text:
/**
 *     This code was auto-generated by a Codezu.
 *
 *     Changes to this file may cause incorrect behavior and will be lost if
 *     the code is regenerated.
 */
package com.mozu.api.contracts.commerceruntime.discounts;

import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.joda.time.DateTime;
import java.io.IOException;
import java.lang.ClassNotFoundException;
import com.mozu.api.contracts.commerceruntime.discounts.Discount;

/**
 *	The discount currently applied to the cart or order, represented as a negative currency amount to be subtracted from the final price. If multiple discounts are applied to the same order, the Applied Discount displays the most valuable discount for the shopper.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class AppliedDiscount implements Serializable
{
	// Default Serial Version UID
	private static final long serialVersionUID = 1L;

	protected  String couponCode;

	public String getCouponCode() {
		return this.couponCode;
	}

	public void setCouponCode(String couponCode) {
		this.couponCode = couponCode;
	}

	protected  Boolean excluded;

	public Boolean getExcluded() {
		return this.excluded;
	}

	public void setExcluded(Boolean excluded) {
		this.excluded = excluded;
	}

	protected  Double impact;

	public Double getImpact() {
		return this.impact;
	}

	public void setImpact(Double impact) {
		this.impact = impact;
	}

	protected  Discount discount;

	public Discount getDiscount() {
		return this.discount;
	}

	public void setDiscount(Discount discount) {
		this.discount = discount;
	}

}

redpajama_set_name: RedPajamaGithub


text:
package org.osgi.service.component.propertytypes;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.osgi.framework.Constants;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.ComponentPropertyType;

/**
 * Component Property Type for the remote service properties for an exported
 * service.
 *

 * This annotation can be used on a {@link Component} to declare the values of
 * the remote service properties for an exported service.
 *
 * @see "Component Property Types"
 * @see "Remote Services Specification"
 * @author $Id$
 * @since 1.4
 */
@ComponentPropertyType
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.TYPE)
public @interface ExportedService {
	/**
	 * Service property marking the service for export. It defines the
	 * interfaces under which the service can be exported.
	 *

	 * If an empty array is specified, the property is not added to the
	 * component description.
	 *
	 * @return The exported service interfaces.
	 * @see Constants#SERVICE_EXPORTED_INTERFACES
	 */
	Class< ? >[] service_exported_interfaces();

	/**
	 * Service property identifying the configuration types that should be used
	 * to export the service.
	 *

	 * If an empty array is specified, the default value, the property is not
	 * added to the component description.
	 *
	 * @return The configuration types.
	 * @see Constants#SERVICE_EXPORTED_CONFIGS
	 */
	String[] service_exported_configs() default {};

	/**
	 * Service property identifying the intents that the distribution provider
	 * must implement to distribute the service.
	 *

	 * If an empty array is specified, the default value, the property is not
	 * added to the component description.
	 *
	 * @return The intents that the distribution provider must implement to
	 *         distribute the service.
	 * @see Constants#SERVICE_EXPORTED_INTENTS
	 */
	String[] service_exported_intents() default {};

	/**
	 * Service property identifying the extra intents that the distribution
	 * provider must implement to distribute the service.
	 *

	 * If an empty array is specified, the default value, the property is not
	 * added to the component description.
	 *
	 * @return The extra intents that the distribution provider must implement
	 *         to distribute the service.
	 * @see Constants#SERVICE_EXPORTED_INTENTS_EXTRA
	 */
	String[] service_exported_intents_extra() default {};

	/**
	 * Service property identifying the intents that this service implements.
	 *

	 * If an empty array is specified, the default value, the property is not
	 * added to the component description.
	 *
	 * @return The intents that the service implements.
	 * @see Constants#SERVICE_INTENTS
	 */
	String[] service_intents() default {};
}


text:
var registerComponent = require('../core/component').registerComponent;
var bind = require('../utils/bind');
var checkControllerPresentAndSetup = require('../utils/tracked-controls').checkControllerPresentAndSetup;
var emitIfAxesChanged = require('../utils/tracked-controls').emitIfAxesChanged;

var DAYDREAM_CONTROLLER_MODEL_BASE_URL = 'https://cdn.aframe.io/controllers/google/';
var DAYDREAM_CONTROLLER_MODEL_OBJ_URL = DAYDREAM_CONTROLLER_MODEL_BASE_URL + 'vr_controller_daydream.obj';
var DAYDREAM_CONTROLLER_MODEL_OBJ_MTL = DAYDREAM_CONTROLLER_MODEL_BASE_URL + 'vr_controller_daydream.mtl';

var GAMEPAD_ID_PREFIX = 'Daydream Controller';

/**
 * Daydream controls.
 */
module.exports.Component = registerComponent('daydream-controls', {
  schema: {
    hand: {default: ''},  // Informs the degenerate arm model.
    buttonColor: {type: 'color', default: '#000000'},
    buttonTouchedColor: {type: 'color', default: '#777777'},
    buttonHighlightColor: {type: 'color', default: '#FFFFFF'},
    model: {default: true},
    // Use -999 as sentinel value to auto-determine based on hand.
    rotationOffset: {default: 0},
    armModel: {default: true}
  },

  // buttonId
  // 0 - trackpad
  // 1 - menu (never dispatched on this layer)
  // 2 - system (never dispatched on this layer)
  mapping: {
    axes: {trackpad: [0, 1]},
    buttons: ['trackpad', 'menu', 'system']
  },

  bindMethods: function () {
    this.onModelLoaded = bind(this.onModelLoaded, this);
    this.onControllersUpdate = bind(this.onControllersUpdate, this);
    this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);
    this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);
    this.onAxisMoved = bind(this.onAxisMoved, this);
    this.onGamepadConnectionEvent = bind(this.onGamepadConnectionEvent, this);
  },

  init: function () {
    var self = this;
    this.animationActive = 'pointing';
    this.onButtonChanged = bind(this.onButtonChanged, this);
    this.onButtonDown = function (evt) { self.onButtonEvent(evt.detail.id, 'down'); };
    this.onButtonUp = function (evt) { self.onButtonEvent(evt.detail.id, 'up'); };
    this.onButtonTouchStart = function (evt) { self.onButtonEvent(evt.detail.id, 'touchstart'); };
    this.onButtonTouchEnd = function (evt) { self.onButtonEvent(evt.detail.id, 'touchend'); };
    this.onAxisMoved = bind(this.onAxisMoved, this);
    this.controllerPresent = false;
    this.everGotGamepadEvent = false;
    this.lastControllerCheck = 0;
    this.bindMethods();
    this.checkControllerPresentAndSetup = checkControllerPresentAndSetup;  // To allow mock.
    this.emitIfAxesChanged = emitIfAxesChanged;  // To allow mock.
  },

  addEventListeners: function () {
    var el = this.el;
    el.addEventListener('buttonchanged', this.onButtonChanged);
    el.addEventListener('buttondown', this.onButtonDown);
    el.addEventListener('buttonup', this.onButtonUp);
    el.addEventListener('touchstart', this.onButtonTouchStart);
    el.addEventListener('touchend', this.onButtonTouchEnd);
    el.addEventListener('model-loaded', this.onModelLoaded);
    el.addEventListener('axismove', this.onAxisMoved);
    this.controllerEventsActive = true;
  },

  removeEventListeners: function () {
    var el = this.el;
    el.removeEventListener('buttonchanged', this.onButtonChanged);
    el.removeEventListener('buttondown', this.onButtonDown);
    el.removeEventListener('buttonup', this.onButtonUp);
    el.removeEventListener('touchstart', this.onButtonTouchStart);
    el.removeEventListener('touchend', this.onButtonTouchEnd);
    el.removeEventListener('model-loaded', this.onModelLoaded);
    el.removeEventListener('axismove', this.onAxisMoved);
    this.controllerEventsActive = false;
  },

  checkIfControllerPresent: function () {
    this.checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX, {hand: this.data.hand});
  },

  onGamepadConnectionEvent: function (evt) {
    this.everGotGamepadEvent = true;
    // Due to an apparent bug in FF Nightly
    // where only one gamepadconnected / disconnected event is fired,
    // which makes it difficult to handle in individual controller entities,
    // we no longer remove the controllersupdate listener as a result.
    this.checkIfControllerPresent();
  },

  play: function () {
    this.checkIfControllerPresent();
    this.addControllersUpdateListener();
    window.addEventListener('gamepadconnected', this.onGamepadConnectionEvent, false);
    window.addEventListener('gamepaddisconnected', this.onGamepadConnectionEvent, false);
  },

  pause: function () {
    this.removeEventListeners();
    this.removeControllersUpdateListener();
    window.removeEventListener('gamepadconnected', this.onGamepadConnectionEvent, false);
    window.removeEventListener('gamepaddisconnected', this.onGamepadConnectionEvent, false);
  },

  injectTrackedControls: function () {
    var el = this.el;
    var data = this.data;
    el.setAttribute('tracked-controls', {
      armModel: data.armModel,
      hand: data.hand,
      idPrefix: GAMEPAD_ID_PREFIX,
      rotationOffset: data.rotationOffset
    });
    if (!this.data.model) { return; }
    this.el.setAttribute('obj-model', {
      obj: DAYDREAM_CONTROLLER_MODEL_OBJ_URL,
      mtl: DAYDREAM_CONTROLLER_MODEL_OBJ_MTL
    });
  },

  addControllersUpdateListener: function () {
    this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);
  },

  removeControllersUpdateListener: function () {
    this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);
  },

  onControllersUpdate: function () {
    if (!this.everGotGamepadEvent) { this.checkIfControllerPresent(); }
  },

  onModelLoaded: function (evt) {
    var controllerObject3D = evt.detail.model;
    var buttonMeshes;
    if (!this.data.model) { return; }
    buttonMeshes = this.buttonMeshes = {};
    buttonMeshes.menu = controllerObject3D.getObjectByName('AppButton_AppButton_Cylinder.004');
    buttonMeshes.system = controllerObject3D.getObjectByName('HomeButton_HomeButton_Cylinder.005');
    buttonMeshes.trackpad = controllerObject3D.getObjectByName('TouchPad_TouchPad_Cylinder.003');
    // Offset pivot point.
    controllerObject3D.position.set(0, 0, -0.04);
  },

  onAxisMoved: function (evt) {
    this.emitIfAxesChanged(this, this.mapping.axes, evt);
  },

  onButtonChanged: function (evt) {
    var button = this.mapping.buttons[evt.detail.id];
    if (!button) return;
    // Pass along changed event with button state, using button mapping for convenience.
    this.el.emit(button + 'changed', evt.detail.state);
  },

  onButtonEvent: function (id, evtName) {
    var buttonName = this.mapping.buttons[id];
    var i;
    if (Array.isArray(buttonName)) {
      for (i = 0; i < buttonName.length; i++) {
        this.el.emit(buttonName[i] + evtName);
      }
    } else {
      this.el.emit(buttonName + evtName);
    }
    this.updateModel(buttonName, evtName);
  },

  updateModel: function (buttonName, evtName) {
    var i;
    if (!this.data.model) { return; }
    if (Array.isArray(buttonName)) {
      for (i = 0; i < buttonName.length; i++) {
        this.updateButtonModel(buttonName[i], evtName);
      }
    } else {
      this.updateButtonModel(buttonName, evtName);
    }
  },

  updateButtonModel: function (buttonName, state) {
    var buttonMeshes = this.buttonMeshes;
    if (!buttonMeshes || !buttonMeshes[buttonName]) { return; }
    var color;
    switch (state) {
      case 'down':
        color = this.data.buttonHighlightColor;
        break;
      case 'touchstart':
        color = this.data.buttonTouchedColor;
        break;
      default:
        color = this.data.buttonColor;
    }
    buttonMeshes[buttonName].material.color.set(color);
  }
});


text:
class AimAction :
    public GeneralAction
{
public:
    /// The target aimed by the character.
    Character * target;

    /// @brief Constructor.
    AimAction(Character * _actor, Character * _target);

    /// @brief Destructor.
    virtual ~AimAction();

    bool check(std::string & error) const override;

    ActionType getType() const override;

    std::string getDescription() const override;

    std::string stop() override;

    ActionStatus perform() override;

    unsigned int getCooldown() override;
};


text:
package org.opensmartgridplatform.adapter.protocol.oslp.elster.infra.messaging;

import java.io.Serializable;

import javax.annotation.PostConstruct;

import org.apache.commons.lang3.StringUtils;
import org.opensmartgridplatform.adapter.protocol.oslp.elster.device.DeviceResponse;
import org.opensmartgridplatform.adapter.protocol.oslp.elster.device.responses.EmptyDeviceResponse;
import org.opensmartgridplatform.adapter.protocol.oslp.elster.infra.networking.DeviceService;
import org.opensmartgridplatform.adapter.protocol.oslp.elster.services.DeviceResponseService;
import org.opensmartgridplatform.shared.exceptionhandling.ComponentType;
import org.opensmartgridplatform.shared.exceptionhandling.FunctionalException;
import org.opensmartgridplatform.shared.exceptionhandling.FunctionalExceptionType;
import org.opensmartgridplatform.shared.exceptionhandling.OsgpException;
import org.opensmartgridplatform.shared.exceptionhandling.TechnicalException;
import org.opensmartgridplatform.shared.infra.jms.DeviceMessageMetadata;
import org.opensmartgridplatform.shared.infra.jms.MessageMetadata;
import org.opensmartgridplatform.shared.infra.jms.MessageProcessor;
import org.opensmartgridplatform.shared.infra.jms.MessageProcessorMap;
import org.opensmartgridplatform.shared.infra.jms.MessageType;
import org.opensmartgridplatform.shared.infra.jms.ProtocolResponseMessage;
import org.opensmartgridplatform.shared.infra.jms.ResponseMessageResultType;
import org.opensmartgridplatform.shared.infra.jms.ResponseMessageSender;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

/**
 * Base class for MessageProcessor implementations. Each MessageProcessor
 * implementation should be annotated with @Component. Further the MessageType
 * the MessageProcessor implementation can process should be passed in at
 * construction. The Singleton instance is added to the HashMap of
 * MessageProcessors after dependency injection has completed.
 */
public abstract class DeviceRequestMessageProcessor implements MessageProcessor {

    private static final Logger LOGGER = LoggerFactory.getLogger(DeviceRequestMessageProcessor.class);

    @Autowired
    protected DeviceService deviceService;

    @Autowired
    protected DeviceResponseMessageSender responseMessageSender;

    @Autowired
    protected DeviceResponseService deviceResponseService;

    @Autowired
    @Qualifier("protocolOslpDeviceRequestMessageProcessorMap")
    protected MessageProcessorMap oslpRequestMessageProcessorMap;

    protected final MessageType messageType;

    protected static final String UNEXPECTED_EXCEPTION = "An unknown error occurred";

    /**
     * Each MessageProcessor should register it's MessageType at construction.
     *
     * @param messageType
     *            The MessageType the MessageProcessor implementation can
     *            process.
     */
    protected DeviceRequestMessageProcessor(final MessageType messageType) {
        this.messageType = messageType;
    }

    protected void printDomainInfo(final String messageType, final String domain, final String domainVersion) {
        LOGGER.info("Calling DeviceService function: {} for domain: {} {}", messageType, domain, domainVersion);
    }

    /**
     * Initialization function executed after dependency injection has finished.
     * The MessageProcessor Singleton is added to the HashMap of
     * MessageProcessors.
     */
    @PostConstruct
    public void init() {
        this.oslpRequestMessageProcessorMap.addMessageProcessor(this.messageType, this);
    }

    protected void handleEmptyDeviceResponse(final DeviceResponse deviceResponse,
            final ResponseMessageSender responseMessageSender, final String domain, final String domainVersion,
            final String messageType, final int retryCount) {

        ResponseMessageResultType result = ResponseMessageResultType.OK;
        TechnicalException ex = null;

        try {
            final EmptyDeviceResponse response = (EmptyDeviceResponse) deviceResponse;
            this.deviceResponseService.handleDeviceMessageStatus(response.getStatus());
        } catch (final TechnicalException e) {
            LOGGER.error("Device Response Exception", e);
            result = ResponseMessageResultType.NOT_OK;
            ex = e;
        }

        final DeviceMessageMetadata deviceMessageMetadata = new DeviceMessageMetadata(
                deviceResponse.getDeviceIdentification(), deviceResponse.getOrganisationIdentification(),
                deviceResponse.getCorrelationUid(), messageType, deviceResponse.getMessagePriority());
        final ProtocolResponseMessage responseMessage = ProtocolResponseMessage.newBuilder().domain(domain)
                .domainVersion(domainVersion).deviceMessageMetadata(deviceMessageMetadata).result(result)
                .osgpException(ex).retryCount(retryCount).build();

        responseMessageSender.send(responseMessage);
    }

    protected void handleScheduledEmptyDeviceResponse(final DeviceResponse deviceResponse,
            final ResponseMessageSender responseMessageSender, final String domain, final String domainVersion,
            final String messageType, final boolean isScheduled, final int retryCount) {

        ResponseMessageResultType result = ResponseMessageResultType.OK;
        TechnicalException ex = null;

        try {
            final EmptyDeviceResponse response = (EmptyDeviceResponse) deviceResponse;
            this.deviceResponseService.handleDeviceMessageStatus(response.getStatus());
        } catch (final TechnicalException e) {
            LOGGER.error("Device Response Exception", e);
            result = ResponseMessageResultType.NOT_OK;
            ex = e;
        }

        final DeviceMessageMetadata deviceMessageMetadata = new DeviceMessageMetadata(
                deviceResponse.getDeviceIdentification(), deviceResponse.getOrganisationIdentification(),
                deviceResponse.getCorrelationUid(), messageType, deviceResponse.getMessagePriority());
        final ProtocolResponseMessage responseMessage = ProtocolResponseMessage.newBuilder().domain(domain)
                .domainVersion(domainVersion).deviceMessageMetadata(deviceMessageMetadata).result(result)
                .osgpException(ex).scheduled(isScheduled).retryCount(retryCount).build();

        responseMessageSender.send(responseMessage);
    }

    protected void handleError(final Exception e, final String correlationUid, final String organisationIdentification,
            final String deviceIdentification, final String domain, final String domainVersion,
            final String messageType, final int messagePriority, final int retryCount) {
        LOGGER.error("Error while processing message", e);
        final TechnicalException ex = new TechnicalException(ComponentType.PROTOCOL_OSLP, UNEXPECTED_EXCEPTION, e);

        final DeviceMessageMetadata deviceMessageMetadata = new DeviceMessageMetadata(deviceIdentification,
                organisationIdentification, correlationUid, messageType, messagePriority);
        final ProtocolResponseMessage protocolResponseMessage = ProtocolResponseMessage.newBuilder().domain(domain)
                .domainVersion(domainVersion).deviceMessageMetadata(deviceMessageMetadata)
                .result(ResponseMessageResultType.NOT_OK).osgpException(ex).retryCount(retryCount).build();

        this.responseMessageSender.send(protocolResponseMessage);
    }

    protected void handleError(final Exception e, final MessageMetadata messageMetadata) {
        LOGGER.error("Error while processing message, using MessageMetadata to create error response", e);
        final TechnicalException ex = new TechnicalException(ComponentType.PROTOCOL_OSLP, UNEXPECTED_EXCEPTION, e);

        final DeviceMessageMetadata deviceMessageMetadata = new DeviceMessageMetadata(messageMetadata);
        final ProtocolResponseMessage protocolResponseMessage = ProtocolResponseMessage.newBuilder()
                .domain(messageMetadata.getDomain()).domainVersion(messageMetadata.getDomainVersion())
                .deviceMessageMetadata(deviceMessageMetadata).result(ResponseMessageResultType.NOT_OK).osgpException(ex)
                .retryCount(messageMetadata.getRetryCount()).build();

        this.responseMessageSender.send(protocolResponseMessage);
    }

    protected void handleExpectedError(final Exception e, final String correlationUid,
            final String organisationIdentification, final String deviceIdentification, final String domain,
            final String domainVersion, final String messageType, final int messagePriority) {
        LOGGER.error("Expected error while processing message", e);
        final FunctionalException ex = new FunctionalException(FunctionalExceptionType.VALIDATION_ERROR,
                ComponentType.PROTOCOL_OSLP, e);

        final DeviceMessageMetadata deviceMessageMetadata = new DeviceMessageMetadata(deviceIdentification,
                organisationIdentification, correlationUid, messageType, messagePriority);
        final ProtocolResponseMessage protocolResponseMessage = ProtocolResponseMessage.newBuilder().domain(domain)
                .domainVersion(domainVersion).deviceMessageMetadata(deviceMessageMetadata)
                .result(ResponseMessageResultType.NOT_OK).osgpException(ex).build();

        this.responseMessageSender.send(protocolResponseMessage);
    }

    public void handleUnableToConnectDeviceResponse(final DeviceResponse deviceResponse, final Throwable t,
            final Serializable messageData, final DeviceResponseMessageSender responseMessageSender,
            final DeviceResponse deviceResponse2, final String domain, final String domainVersion,
            final String messageType, final boolean isScheduled, final int retryCount) {

        final ResponseMessageResultType result = ResponseMessageResultType.NOT_OK;
        final OsgpException ex = new TechnicalException(ComponentType.PROTOCOL_OSLP,
                StringUtils.isBlank(t.getMessage()) ? UNEXPECTED_EXCEPTION : t.getMessage(), t);

        final DeviceMessageMetadata deviceMessageMetadata = new DeviceMessageMetadata(
                deviceResponse.getDeviceIdentification(), deviceResponse.getOrganisationIdentification(),
                deviceResponse.getCorrelationUid(), messageType, deviceResponse.getMessagePriority());
        final ProtocolResponseMessage responseMessage = ProtocolResponseMessage.newBuilder().domain(domain)
                .domainVersion(domainVersion).deviceMessageMetadata(deviceMessageMetadata).result(result)
                .osgpException(ex).dataObject(messageData).scheduled(isScheduled).retryCount(retryCount).build();

        this.responseMessageSender.send(responseMessage);
    }
}


text:
"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var jasmine_util_1 = require("./jasmine_util");
var test_util_1 = require("./test_util");
jasmine_util_1.describeWithFlags('expectArraysEqual', jasmine_util_1.ALL_ENVS, function () {
    it('same arrays', function () {
        test_util_1.expectArraysEqual([1, 2, 3], [1, 2, 3]);
    });
    it('throws on different arrays', function () {
        expect(function () { return test_util_1.expectArraysEqual([1, 2, 3], [3, 2, 1]); })
            .toThrowError(/Arrays differ/);
    });
    it('same nested arrays', function () {
        test_util_1.expectArraysEqual([[1, 2], [3, 4]], [[1, 2], [3, 4]]);
    });
    it('throws on different nested arrays', function () {
        expect(function () { return test_util_1.expectArraysEqual([[1, 2], [3, 4]], [[1, 2], [4, 3]]); })
            .toThrowError(/Arrays differ/);
    });
    it('throws on different nested shapes', function () {
        expect(function () { return test_util_1.expectArraysEqual([[1, 2], [3, 4]], [1, 2, 3, 4]); })
            .toThrowError(/Arrays have different shapes. Actual: \[2,2\]. Expected: \[4\]/);
    });
    it('float32 with regular array', function () {
        test_util_1.expectArraysEqual(new Float32Array([1, 2, 3]), [1, 2, 3]);
    });
    it('throws on different values of float32 with regular array', function () {
        expect(function () { return test_util_1.expectArraysEqual(new Float32Array([1, 2, 3]), [1, 2, 4]); })
            .toThrowError(/Arrays differ/);
    });
    it('int32 with regular array', function () {
        test_util_1.expectArraysEqual(new Int32Array([1, 2, 3]), [1, 2, 3]);
    });
    it('throws on different values of int32 with regular array', function () {
        expect(function () { return test_util_1.expectArraysEqual(new Int32Array([1, 2, 3]), [1, 2, 4]); })
            .toThrowError(/Arrays differ/);
    });
    it('throws on float32 with int32', function () {
        expect(function () { return test_util_1.expectArraysEqual(new Float32Array([1, 2, 3]), new Int32Array([1, 2, 3])); })
            .toThrowError(/Arrays are of different type/);
    });
    it('throws on int32 with uint8', function () {
        expect(function () { return test_util_1.expectArraysEqual(new Int32Array([1, 2, 3]), new Uint8Array([1, 2, 3])); })
            .toThrowError(/Arrays are of different type/);
    });
});
jasmine_util_1.describeWithFlags('expectArraysClose', jasmine_util_1.ALL_ENVS, function () {
    it('same arrays', function () {
        test_util_1.expectArraysClose([1, 2, 3], [1, 2, 3]);
    });
    it('throws on different arrays', function () {
        expect(function () { return test_util_1.expectArraysClose([1, 2, 3], [3, 2, 1]); })
            .toThrowError(/Arrays differ/);
    });
    it('same nested arrays', function () {
        test_util_1.expectArraysClose([[1, 2], [3, 4]], [[1, 2], [3, 4]]);
    });
    it('throws on different nested arrays', function () {
        expect(function () { return test_util_1.expectArraysClose([[1, 2], [3, 4]], [[1, 2], [4, 3]]); })
            .toThrowError(/Arrays differ/);
    });
    it('throws on different nested shapes', function () {
        expect(function () { return test_util_1.expectArraysClose([[1, 2], [3, 4]], [1, 2, 3, 4]); })
            .toThrowError(/Arrays have different shapes. Actual: \[2,2\]. Expected: \[4\]/);
    });
    it('float32 with regular array', function () {
        test_util_1.expectArraysClose(new Float32Array([1, 2, 3]), [1, 2, 3]);
    });
    it('throws on different values of float32 with regular array', function () {
        expect(function () { return test_util_1.expectArraysClose(new Float32Array([1, 2, 3]), [1, 2, 4]); })
            .toThrowError(/Arrays differ/);
    });
    it('int32 with regular array', function () {
        test_util_1.expectArraysClose(new Int32Array([1, 2, 3]), [1, 2, 3]);
    });
    it('throws on different values of int32 with regular array', function () {
        expect(function () { return test_util_1.expectArraysClose(new Int32Array([1, 2, 3]), [1, 2, 4]); })
            .toThrowError(/Arrays differ/);
    });
    it('throws on float32 with int32', function () {
        expect(function () { return test_util_1.expectArraysClose(new Float32Array([1, 2, 3]), new Int32Array([1, 2, 3])); })
            .toThrowError(/Arrays are of different type/);
    });
    it('throws on int32 with uint8', function () {
        expect(function () { return test_util_1.expectArraysClose(new Int32Array([1, 2, 3]), new Uint8Array([1, 2, 3])); })
            .toThrowError(/Arrays are of different type/);
    });
    it('similar arrays with good epsilon', function () {
        var epsilon = 0.1;
        test_util_1.expectArraysClose(new Float32Array([1, 2, 3.08]), [1, 2, 3], epsilon);
    });
    it('similar arrays with bad epsilon', function () {
        var epsilon = 0.01;
        expect(function () { return test_util_1.expectArraysClose(new Float32Array([1, 2, 3.08]), [1, 2, 3], epsilon); })
            .toThrowError(/Arrays differ/);
    });
});
//# sourceMappingURL=test_util_test.js.map


text:
        Update your profile

    <form ng-submit="profile.validateAndSave()" class="col s12">

                        {{profile.profileError.message || 'Updated Successfully.'}}

                <input type="text" ng-model="profile.user.username" readonly id="username">
                Username

                <input type="text" ng-model="profile.user.name" class="validate" id="name">
                Name

                <input type="email" ng-model="profile.user.email" class="validate" id="email">
                Email

                <button type="submit" class="btn">Save send</button>

    </form>


text:
#pragma once

#include "SequencePoolLayer.h"
#include "paddle/math/Matrix.h"
#include "paddle/utils/ThreadLocal.h"

namespace paddle {

/**
 * A layer for "internal max" for sequence input.
 * Input: one or more sequences. Each sequence contains some instances.
 * If SequenceLevel = kNonSeq:
 *    Output: output size is the number of input sequences (NOT input instances)
 *    output[i] = max_{for each instance in this sequence}{input[i]}
 *    If stride_ > 0:
 *      Output: a shorten sequence. Stride is the step size by which we slide a
 *              window upon the input sequence, and the max pooling operation is
 *              then applied to each interval independently.
 * If SequenceLevel = kSeq:
 *    Check input sequence must has sub-sequence
 *    Output: output size is the number of input sub-sequences
 *    output[i] = max_{for each instance in this sub-sequence}{input[i]}
 *
 * The config file api is pooling_layer.
 */

class MaxLayer : public SequencePoolLayer {
 protected:
  // maxIndex_[i][j] = k : the value at (i, j) is from input[k].
  IVectorPtr maxIndex_;

 public:
  explicit MaxLayer(const LayerConfig& config) : SequencePoolLayer(config) {}

  bool init(const LayerMap& layerMap,
            const ParameterMap& parameterMap) override {
    return SequencePoolLayer::init(layerMap, parameterMap);
  }

  void forward(PassType passType) override;
  void backward(const UpdateCallback& callback = nullptr) override;
};

}  // namespace paddle