=begin rdoc
If event is an Array, the output is adapted.

This outputter is only for internal use via Todonotes.
=end
971529
def format(event)
      #@@basicformat      "%*s %s"
      #~ buff = sprintf("%-*s %-5s", Log4r::MaxLevelLength, Log4r::LNAMES[event.level],
             #~ event.data.is_a?(Array) ? event.data.first : event.name)
      buff = "%5s" % (event.data.is_a?(Array) ? event.data.first : event.name)
      #~ buff += (event.tracer.nil? ? "" : "(#{event.tracer[2]})") + ": "
      buff << ": "
      buff << format_object(event.data.is_a?(Array) ? event.data.last : event.data) 
      buff << (event.tracer.nil? ? "" : " (#{event.tracer.join('/')})")
      buff << "\n"
      buff
    end
1065161
function processOutputs(outputs) {
  var removeSourceMaps = require('./sourcemaps').removeSourceMaps;

  var offset = 0;

  var outputObj = {};

  var sources = outputObj.sources = [];
  var sourceMapsWithOffsets = outputObj.sourceMapsWithOffsets = [];

  outputs.forEach(function(output) {
    var source;
    if (typeof output == 'object') {
      source = output.source || '';
      var offset_ = output.sourceMapOffset || 0;
      var map = output.sourceMap;
      if (map) {
        sourceMapsWithOffsets.push([offset + offset_, map]);
      }
    }
    // NB perhaps we should enforce output is always an object down the chain?
    else if (typeof output == 'string') {
      source = output;
    }
    else {
      var format = output ? output.toString() : typeof output;
      throw new Error("Unexpected output format: " + format);
    }
    source = removeSourceMaps(source || '');
    offset += countLines(source);
    sources.push(source);
  });

  return outputObj;
}
90891
function _loop(i) {
				var eventName = eventNames[i];
				var actionGroup = instructions[eventName];

				ws.addEventListener(eventName, function (res) {

					processActionGroup({ res: res, actionGroup: actionGroup });

					// TODO handle sending messages
				});
			}
588975
function ensureArray(object, key) {
  if (!object[key]) {
    object[key] = [];
  }
  if (!Array.isArray(object[key])) {
    throw new Error("Can't perform array operation on non-array field");
  }
}
425827
function(newMode) {
    if (newMode == 'SPLIT') {
      this.outputConnection.setCheck('Array');
      this.getInput('INPUT').setCheck('String');
    } else {
      this.outputConnection.setCheck('String');
      this.getInput('INPUT').setCheck('Array');
    }
  }
897929
function _Array(conf) {
  var arr = [];
  var arrDb = [];
  var type = '';
  var id = '';
  var classId = '';
  var propertyName = '';
  var isReadOnly = false;
  var isClassName = false;

  conf = conf || {};
  type = conf.type || '';
  id = conf.id || '';
  propertyName = conf.propertyName || '';
  arrDb = conf.arr || [];
  classId = conf.classId || '';

  if (typeof conf.readOnly !== 'undefined') {
    isReadOnly = conf.readOnly;
  }

  isClassName = $metamodel.isClassName(type);

  // init
  arrDb.forEach(function(val) {
    if (isClassName) {
      arr.push($helper.getRuntime().require(val));
    } else {
      arr.push(val);
    }
  });

  /**
   * @method _copy
   * @private
   * @description copy the array
   */
  function _copy() {
    var i = 0;
    var j = 0;
    var length = arr.length;

    arrDb.forEach(function(val) {
      if (isClassName) {
        arr[i] = $helper.getRuntime().require(val);
      } else {
        arr[i] = val;
      }
      i = i + 1;
    });

    for (j = i; j < length; j++) {
      delete arr[j];
    }
    arr.length = arrDb.length;
  }

  /**
   * @method _add
   * @param {String} val value to add
   * @param {String} action type of action
   * @param {Number} start
   * @param {String} deleteCount
   * @private
   * @description add an item in the array
   */
  function _add(val, action, start, deleteCount) {
    var i = 0;
    var length = 0;
    var del = [];

    if (!isReadOnly) {
      if (isClassName) {
        if (val && $metamodel.inheritFrom(val.constructor.name, type)) {
          switch (true) {
            case action === 'push':
              arrDb.push(val.id());
              break;
            case action === 'unshift':
              arrDb.unshift(val.id());
              break;
            case action === 'splice':
              del = arrDb.splice(start, deleteCount, val);

              length = del.length;
              for (i = 0; i < length; i++) {
                $workflow.process({
                  component: id,
                  state: propertyName,
                  data: [store[del[i]], 'remove']
                });
              }
              break;
            default:
              break;
          }

          if ($helper.isRuntime()) {
            $helper
              .getRuntime()
              .require('db')
              .update({
                collection: classId,
                id: id,
                field: propertyName,
                value: arrDb
              });
          }

          $workflow.process({
            component: id,
            state: propertyName,
            data: [val, 'add']
          });
        } else {
          $log.invalidPropertyName(id, classId, propertyName, val, type);
        }
      } else {
        if (val && $metamodel.isValidType(val, type)) {
          switch (true) {
            case action === 'push':
              arrDb.push(val);
              break;
            case action === 'unshift':
              arrDb.unshift(val);
              break;
            case action === 'splice':
              arrDb.splice(start, deleteCount, val);
              break;
            default:
              break;
          }

          if ($helper.isRuntime()) {
            $helper
              .getRuntime()
              .require('db')
              .update({
                collection: classId,
                id: id,
                field: propertyName,
                value: arrDb
              });
          }

          $workflow.process({
            component: id,
            state: propertyName,
            data: [val, 'add']
          });
        } else {
          $log.invalidPropertyName(id, classId, propertyName, val, type);
        }
      }
    } else {
      $log.readOnlyProperty(id, classId, propertyName);
    }
    return arrDb.length;
  }

  /**
   * @method _remove
   * @param {String} action
   * @private
   * @description remove an item from the array
   */
  function _remove(action) {
    var result;
    var val = null;

    if (!isReadOnly) {
      if (arrDb.length !== 0) {
        switch (true) {
          case action === 'pop':
            val = arrDb.pop();
            break;
          case action === 'shift':
            val = arrDb.shift();
            break;
          default:
            break;
        }

        if ($helper.isRuntime()) {
          $helper
            .getRuntime()
            .require('db')
            .update({
              collection: classId,
              id: id,
              field: propertyName,
              value: arrDb
            });
        }

        if (isClassName) {
          result = store[val];
        } else {
          result = val;
        }

        $workflow.process({
          component: id,
          state: propertyName,
          data: [result, 'remove']
        });
      }
    } else {
      $log.readOnlyProperty(id, classId, propertyName);
    }
    return result;
  }

  /**
   * @method push
   * @param {_Component|Object} val
   * @description Override push method
   */
  arr.push = function push(val) {
    var result = _add(val, 'push');

    arr[arr.length] = val;

    return result;
  };

  /**
   * @method pop
   * @returns {_Component|Object} value
   * @description Override pop method
   */
  arr.pop = function pop() {
    var result = _remove('pop');
    var length = arr.length;

    if (length !== 0) {
      delete arr[length];
      arr.length = length - 1;
    }

    return result;
  };

  /**
   * @method shift
   * @returns {_Component|Object} value
   * @description Override shift method
   */
  arr.shift = function shift() {
    var result = _remove('shift');
    _copy();

    return result;
  };

  /**
   * @method unshift
   * @param {_Component|Object} val
   * @description Override unshift method
   */
  arr.unshift = function unshift(val) {
    var result = _add(val, 'unshift');
    _copy();

    return result;
  };

  /**
   * @method push
   * @param {_Component|Object} arr
   * @description Override concat method
   */
  arr.concat = function concat(arr) {
    var i = 0;
    var length = 0;
    var result = null;

    if (Array.isArray(arr)) {
      length = arr.length;
      for (i = 0; i < length; i++) {
        _add(arr[i], 'push');
      }
    }

    conf.arr = arrDb;

    result = new _Array(conf);
    _copy();

    return result;
  };

  /**
   * @method sort
   * @param {Function} funct the sort function
   * @returns {_Array} the current _Array
   * @description Override sort method
   */
  arr.sort = function sort(funct) {
    arrDb.sort(funct);

    if ($helper.isRuntime()) {
      $helper
        .getRuntime()
        .require('db')
        .update({
          collection: classId,
          id: id,
          field: propertyName,
          value: arrDb
        });
    }

    _copy();

    return arr;
  };

  /**
   * @method reverse
   * @returns {_Array} the reversed _Array
   * @description Override reverse method
   */
  arr.reverse = function reverse() {
    arrDb.reverse();

    if ($helper.isRuntime()) {
      $helper
        .getRuntime()
        .require('db')
        .update({
          collection: classId,
          id: id,
          field: propertyName,
          value: arrDb
        });
    }

    _copy();

    return arr;
  };

  /**
   * @method splice
   * @returns {_Array} the spliced _Array
   * @description Override splice method
   */
  arr.splice = function splice(start, deleteCount, val) {
    var result = [];
    var i = 0;
    var length = 0;
    var data = null;

    if (typeof val !== 'undefined') {
      _add(val, 'splice', start, deleteCount);
    } else {
      result = arrDb.splice(start, deleteCount);

      if ($helper.isRuntime()) {
        $helper
          .getRuntime()
          .require('db')
          .update({
            collection: classId,
            id: id,
            field: propertyName,
            value: arrDb
          });
      }

      length = result.length;
      for (i = 0; i < length; i++) {
        if (isClassName) {
          data = store[result[i]];
        } else {
          data = result[i];
        }

        $workflow.process({
          component: id,
          state: propertyName,
          data: [data, 'remove']
        });
      }
    }

    _copy();

    return result;
  };

  /**
   * @method slice
   * @returns {_Array} the sliced _Array
   * @description Override slice method
   */
  arr.slice = function slice(begin, end) {
    var result = arrDb.slice(begin, end);
    _copy();

    return result;
  };

  return arr;
}
1216972
protected void _writeStartObject(boolean array) throws IOException {
		_writeArrayFieldNameIfNeeded();
		if (_currentDocument != null) {
			//embedded document/array
			_buffer.putByte(_typeMarker, array ? BsonConstants.TYPE_ARRAY :
				BsonConstants.TYPE_DOCUMENT);
		}
		_currentDocument = new DocumentInfo(_currentDocument, _buffer.size(), array);
		reserveHeader();
	}
1112709
def _array_handler(self, _cursor_type):
        
        # The element type has been previously declared
        # we need to get the canonical typedef, in some cases
        _type = _cursor_type.get_canonical()
        size = _type.get_array_size()
        if size == -1 and _type.kind == TypeKind.INCOMPLETEARRAY:
            size = 0
            # FIXME: Incomplete Array handling at end of record.
            # https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
            # FIXME VARIABLEARRAY DEPENDENTSIZEDARRAY
        _array_type = _type.get_array_element_type()  # .get_canonical()
        if self.is_fundamental_type(_array_type):
            _subtype = self.parse_cursor_type(_array_type)
        elif self.is_pointer_type(_array_type):
            # code.interact(local=locals())
            # pointers to POD have no declaration ??
            # FIXME test_struct_with_pointer x_n_t g[1]
            _subtype = self.parse_cursor_type(_array_type)
        elif self.is_array_type(_array_type):
            _subtype = self.parse_cursor_type(_array_type)
        else:
            _subtype_decl = _array_type.get_declaration()
            _subtype = self.parse_cursor(_subtype_decl)
            # if _subtype_decl.kind == CursorKind.NO_DECL_FOUND:
            #    pass
            #_subtype_name = self.get_unique_name(_subtype_decl)
            #_subtype = self.get_registered(_subtype_name)
        obj = typedesc.ArrayType(_subtype, size)
        obj.location = _subtype.location
        return obj
1047623
@Override
    public INDArray[] exec(CustomOp op) {

        Nd4j.getExecutioner().commit();

        //
        if (op.numOutputArguments() == 0 && !op.isInplaceCall()) {
            try {
                val list = this.calculateOutputShape(op);
                if (list.isEmpty())
                    throw new ND4JIllegalStateException("Op name " + op.opName() + " failed to execute. You can't execute non-inplace CustomOp without outputs being specified");

                for (val shape: list)
                    op.addOutputArgument(Nd4j.create(shape));

            } catch (Exception e) {
                throw new ND4JIllegalStateException("Op name " + op.opName() + " failed to execute. You can't execute non-inplace CustomOp without outputs being specified");
            }
        }

        if (op.opName().equalsIgnoreCase("im2col")) {
            val xArr = op.inputArguments()[0];
            val zArr = op.outputArguments()[0];

            CudaContext context = AtomicAllocator.getInstance().getFlowController().prepareAction(zArr, xArr);

            if (extraz.get() == null)
                extraz.set(new PointerPointer(32));

            PointerPointer xShapeHost =
                    extraz.get().put(AddressRetriever.retrieveHostPointer(xArr.shapeInfoDataBuffer()), // 0
                            context.getOldStream(), // 1
                            AtomicAllocator.getInstance().getDeviceIdPointer(), // 2
                            context.getBufferAllocation(), // 3
                            context.getBufferReduction(), // 4
                            context.getBufferScalar(), // 5
                            context.getBufferSpecial(),
                            null,
                            AddressRetriever.retrieveHostPointer(zArr.shapeInfoDataBuffer())
                    );


            val x = AtomicAllocator.getInstance().getPointer(xArr, context);
            val z = AtomicAllocator.getInstance().getPointer(zArr, context);

            val xShape = AtomicAllocator.getInstance().getPointer(xArr.shapeInfoDataBuffer(), context);
            val zShape = AtomicAllocator.getInstance().getPointer(zArr.shapeInfoDataBuffer(), context);

            val hxShape = AtomicAllocator.getInstance().getHostPointer(xArr.shapeInfoDataBuffer());
            val hzShape = AtomicAllocator.getInstance().getHostPointer(zArr.shapeInfoDataBuffer());

            double zeroPad = 0.0;
            if(op.tArgs() != null && op.tArgs().length > 0){
                zeroPad = op.tArgs()[0];
            }
            val extrass = new double[]{op.iArgs()[0], op.iArgs()[1], op.iArgs()[2], op.iArgs()[3], op.iArgs()[4], op.iArgs()[5], op.iArgs()[6], op.iArgs()[7], op.iArgs()[8], zeroPad};
            val extraArgsBuff = Nd4j.getConstantHandler().getConstantBuffer(extrass, xArr.dataType());
            val extraArgs = AtomicAllocator.getInstance().getPointer(extraArgsBuff, context);

            nativeOps.execTransformSame(xShapeHost, 9,
                    null, (LongPointer) hxShape, x, (LongPointer) xShape,
                    null, (LongPointer) hzShape, z, (LongPointer) zShape, extraArgs);

            //AtomicAllocator.getInstance().getAllocationPoint(zArr).tickDeviceWrite();
            AtomicAllocator.getInstance().getFlowController().registerAction(context, zArr, xArr);

            Nd4j.getExecutioner().commit();

            return op.outputArguments();
        } else if (op.opName().equalsIgnoreCase("col2im")) {
            val dtype = Nd4j.dataType();

            val xArr = op.inputArguments()[0];
            val zArr = op.outputArguments()[0];

            CudaContext context = AtomicAllocator.getInstance().getFlowController().prepareAction(zArr, xArr);

            if (extraz.get() == null)
                extraz.set(new PointerPointer(32));

            PointerPointer xShapeHost =
                    extraz.get().put(AddressRetriever.retrieveHostPointer(xArr.shapeInfoDataBuffer()), // 0
                            context.getOldStream(), // 1
                            AtomicAllocator.getInstance().getDeviceIdPointer(), // 2
                            context.getBufferAllocation(), // 3
                            context.getBufferReduction(), // 4
                            context.getBufferScalar(), // 5
                            context.getBufferSpecial(),
                            null,
                            AddressRetriever.retrieveHostPointer(zArr.shapeInfoDataBuffer())
                    );


            val x = AtomicAllocator.getInstance().getPointer(xArr, context);
            val z = AtomicAllocator.getInstance().getPointer(zArr, context);

            val xShape = AtomicAllocator.getInstance().getPointer(xArr.shapeInfoDataBuffer(), context);
            val zShape = AtomicAllocator.getInstance().getPointer(zArr.shapeInfoDataBuffer(), context);

            val hxShape = AtomicAllocator.getInstance().getHostPointer(xArr.shapeInfoDataBuffer());
            val hzShape = AtomicAllocator.getInstance().getHostPointer(zArr.shapeInfoDataBuffer());

            val extrass = new double[]{op.iArgs()[0], op.iArgs()[1], op.iArgs()[2], op.iArgs()[3], op.iArgs()[4], op.iArgs()[5], op.iArgs()[6], op.iArgs()[7]};
            val extraArgsBuff = Nd4j.getConstantHandler().getConstantBuffer(extrass, xArr.dataType());
            val extraArgs = AtomicAllocator.getInstance().getPointer(extraArgsBuff, context);


            nativeOps.execTransformSame(xShapeHost, 8,
                    null, (LongPointer) hxShape, x, (LongPointer) xShape,
                    null, (LongPointer) hzShape, z, (LongPointer) zShape, extraArgs);

            //AtomicAllocator.getInstance().getAllocationPoint(zArr).tickDeviceWrite();
            AtomicAllocator.getInstance().getFlowController().registerAction(context, zArr, xArr);

            //Nd4j.getExecutioner().commit();
            return op.outputArguments();
        } else if (op.opName().equalsIgnoreCase("pooling2d")) {
            val dtype = Nd4j.dataType();

            val xArr = op.inputArguments()[0];
            val zArr = op.outputArguments()[0];

            CudaContext context = AtomicAllocator.getInstance().getFlowController().prepareAction(zArr, xArr);

            if (extraz.get() == null)
                extraz.set(new PointerPointer(32));

            PointerPointer xShapeHost =
                    extraz.get().put(AddressRetriever.retrieveHostPointer(xArr.shapeInfoDataBuffer()), // 0
                            context.getOldStream(), // 1
                            AtomicAllocator.getInstance().getDeviceIdPointer(), // 2
                            context.getBufferAllocation(), // 3
                            context.getBufferReduction(), // 4
                            context.getBufferScalar(), // 5
                            context.getBufferSpecial(),
                            null,
                            AddressRetriever.retrieveHostPointer(zArr.shapeInfoDataBuffer())
                    );


            val x = AtomicAllocator.getInstance().getPointer(xArr, context);
            val z = AtomicAllocator.getInstance().getPointer(zArr, context);

            val xShape = AtomicAllocator.getInstance().getPointer(xArr.shapeInfoDataBuffer(), context);
            val zShape = AtomicAllocator.getInstance().getPointer(zArr.shapeInfoDataBuffer(), context);

            val hxShape = AtomicAllocator.getInstance().getHostPointer(xArr.shapeInfoDataBuffer());
            val hzShape = AtomicAllocator.getInstance().getHostPointer(zArr.shapeInfoDataBuffer());

            val extrass = new double[]{op.iArgs()[0], op.iArgs()[1], op.iArgs()[2], op.iArgs()[3], op.iArgs()[4], op.iArgs()[5], op.iArgs()[6], op.iArgs()[7], op.iArgs()[8]};
            val extraArgsBuff = Nd4j.getConstantHandler().getConstantBuffer(extrass, zArr.dataType());
            val extraArgs = AtomicAllocator.getInstance().getPointer(extraArgsBuff, context);


            nativeOps.execTransformFloat(xShapeHost, 23,
                    null, (LongPointer) hxShape, x, (LongPointer) xShape,
                    zArr.data().addressPointer(), (LongPointer) hzShape, z, (LongPointer) zShape,
                    extraArgs);

            // AtomicAllocator.getInstance().getAllocationPoint(zArr).tickDeviceWrite();
            AtomicAllocator.getInstance().getFlowController().registerAction(context, zArr, xArr);

            return op.outputArguments();
        }

        Nd4j.getExecutioner().commit();

        val context = buildContext();

        context.markInplace(op.isInplaceCall());

        // transferring rng state
        context.setRngStates(Nd4j.getRandom().rootState(), Nd4j.getRandom().nodeState());

        //transferring input/output arrays
        context.setInputArrays(op.inputArguments());
        context.setOutputArrays(op.outputArguments());

        // transferring static args
        context.setBArguments(op.bArgs());
        context.setIArguments(op.iArgs());
        context.setTArguments(op.tArgs());

        val result = exec(op, context);
        val states = context.getRngStates();

        // pulling states back
        Nd4j.getRandom().setStates(states.getFirst(), states.getSecond());

        return result;

        /*
        long st = profilingConfigurableHookIn(op);

        CudaContext context =(CudaContext) AtomicAllocator.getInstance().getDeviceContext().getContext();
        //AtomicAllocator.getInstance().getFlowController().prepareActionAllWrite(op.outputArguments());

        if (extraz.get() == null)
            extraz.set(new PointerPointer(32));


        PointerPointer extras = extraz.get().put(
                new CudaPointer(1),
                context.getOldStream(),
                context.getBufferScalar(),
                context.getBufferReduction());

        val outputArgs = op.outputArguments();
        val inputArgs = op.inputArguments();

        if (outputArgs.length == 0 && !op.isInplaceCall())
            throw new ND4JIllegalStateException("You can't execute non-inplace CustomOp without outputs being specified");

        val lc = op.opName().toLowerCase();
        val hash = op.opHash();


        val inputShapes = new PointerPointer<>(inputArgs.length * 2);
        val inputBuffers = new PointerPointer<>(inputArgs.length * 2);

        int cnt= 0;
        for (val in: inputArgs) {
            val hp = AtomicAllocator.getInstance().getHostPointer(in.shapeInfoDataBuffer());
            inputBuffers.put(cnt,  AtomicAllocator.getInstance().getHostPointer(in));
            inputShapes.put(cnt, hp);


            val dp = AtomicAllocator.getInstance().getPointer(in.shapeInfoDataBuffer(), context);

            inputBuffers.put(cnt + inputArgs.length, AtomicAllocator.getInstance().getPointer(in, context));
            inputShapes.put(cnt+ inputArgs.length, dp);

            if (op.isInplaceCall()) {
                val ap = AtomicAllocator.getInstance().getAllocationPoint(in);
                if (ap != null)
                    ap.tickHostWrite();
            }

            cnt++;
        }


        val outputShapes = new PointerPointer<>(outputArgs.length * 2);
        val outputBuffers = new PointerPointer<>(outputArgs.length * 2);

        cnt= 0;
        for (val out: outputArgs) {
            outputBuffers.put(cnt,  AtomicAllocator.getInstance().getHostPointer(out));
            outputShapes.put(cnt,  AtomicAllocator.getInstance().getHostPointer(out.shapeInfoDataBuffer()));

            outputBuffers.put(cnt + outputArgs.length,  AtomicAllocator.getInstance().getPointer(out, context));
            outputShapes.put(cnt + outputArgs.length,  AtomicAllocator.getInstance().getPointer(out.shapeInfoDataBuffer(), context));

            val ap = AtomicAllocator.getInstance().getAllocationPoint(out);

            if (ap != null)
                ap.tickHostWrite();

            cnt++;
        }

        val iArgs = op.iArgs().length > 0 ? new LongPointer(op.iArgs().length) : null;

        cnt = 0;
        for (val i: op.iArgs())
            iArgs.put(cnt++, i);


        val tArgs = op.tArgs().length > 0 ? new DoublePointer(op.tArgs().length) : null;

        val bArgs = op.bArgs().length > 0 ? new BooleanPointer(op.numBArguments()) : null;

        cnt = 0;
        for (val t: op.tArgs())
            tArgs.put(cnt++, t);

        cnt = 0;
        for (val b: op.bArgs())
            bArgs.put(cnt++, b);

        try {
            val status = OpStatus.byNumber(nativeOps.execCustomOp(extras, hash, inputBuffers, inputShapes, inputArgs.length, outputBuffers, outputShapes, outputArgs.length, tArgs, op.tArgs().length, iArgs, op.iArgs().length, bArgs, op.numBArguments(), op.isInplaceCall()));
            if (status != OpStatus.ND4J_STATUS_OK)
                throw new ND4JIllegalStateException("Op execution failed: " + status);
        } catch (Exception e) {
            throw new RuntimeException("Op [" + op.opName() + "] execution failed");
        }

        //AtomicAllocator.getInstance().getFlowController().prepareActionAllWrite(op.outputArguments());

        profilingConfigurableHookOut(op, st);
        return op.outputArguments();
         */
    }
22690
function arrayReduce (array, callback, initialValue) {
  if (array) {
    var len, reduceMethod
    var index = 0
    var context = this
    var previous = initialValue
    var isInitialVal = arguments.length > 2
    var keyList = baseExports.keys(array)
    if (array.length && array.reduce) {
      reduceMethod = function () {
        return callback.apply(context, arguments)
      }
      if (isInitialVal) {
        return array.reduce(reduceMethod, previous)
      }
      return array.reduce(reduceMethod)
    }
    if (isInitialVal) {
      index = 1
      previous = array[keyList[0]]
    }
    for (len = keyList.length; index < len; index++) {
      previous = callback.call(context, previous, array[keyList[index]], index, array)
    }
    return previous
  }
}
173184
function(arr, iterator, callback) {
      callback = _doOnce(callback || noop);
      var amount = arr.length;

      if (!isArray(arr)) return callback();

      var completed = 0;
      doEach(arr, function(item) {
        iterator(item, doOnce(function(err) {
          if (err) {
            callback(err);
            callback = noop;
          } else {
            completed++;
            if (completed >= amount) callback(null);
          }
        }));
      });
    }
538685
function _gpfArrayEnumerator (array) {
    var pos = -1;
    return {
        reset: function () {
            pos = -1;
        },
        moveNext: function (eventsHandler) {
            var result;
            ++pos;
            result = pos < array.length;
            if (!result && eventsHandler) {
                _gpfEventsFire.call(this, _GPF_EVENT_END_OF_DATA, {}, eventsHandler);
            }
            return result;
        },
        current: function () {
            return array[pos];
        }
    };
}
388151
private Object convertArrayToArray(Object array) {
		final Class<?> valueComponentType = ArrayUtil.getComponentType(array);

		if (valueComponentType == targetComponentType) {
			return array;
		}

		final int len = ArrayUtil.length(array);
		final Object result = Array.newInstance(targetComponentType, len);

		final ConverterRegistry converter = ConverterRegistry.getInstance();
		for (int i = 0; i < len; i++) {
			Array.set(result, i, converter.convert(targetComponentType, Array.get(array, i)));
		}
		return result;
	}
1143611
public static void oddEvenSort( double arrayToBeSorted[], double[] arrayThatFollowsTheSort ) {
        for( int i = 0; i < arrayToBeSorted.length / 2; i++ ) {
            for( int j = 0; j + 1 < arrayToBeSorted.length; j += 2 )
                if (arrayToBeSorted[j] > arrayToBeSorted[j + 1]) {
                    double tmpa = arrayToBeSorted[j];
                    arrayToBeSorted[j] = arrayToBeSorted[j + 1];
                    arrayToBeSorted[j + 1] = tmpa;
                    if (arrayThatFollowsTheSort != null) {
                        double tmpb = arrayThatFollowsTheSort[j];
                        arrayThatFollowsTheSort[j] = arrayThatFollowsTheSort[j + 1];
                        arrayThatFollowsTheSort[j + 1] = tmpb;
                    }
                }
            for( int j = 1; j + 1 < arrayToBeSorted.length; j += 2 )
                if (arrayToBeSorted[j] > arrayToBeSorted[j + 1]) {
                    double tmpa = arrayToBeSorted[j];
                    arrayToBeSorted[j] = arrayToBeSorted[j + 1];
                    arrayToBeSorted[j + 1] = tmpa;
                    if (arrayThatFollowsTheSort != null) {
                        double tmpb = arrayThatFollowsTheSort[j];
                        arrayThatFollowsTheSort[j] = arrayThatFollowsTheSort[j + 1];
                        arrayThatFollowsTheSort[j + 1] = tmpb;
                    }
                }
        }
    }
383852
function arrayAllocExpression(t, array) {
	return t.newExpression(t.identifier('Array'), [
		t.memberExpression(array, t.identifier('length')),
	]);
}
744983
public function output($array_js) {
		if (!is_array($array_js)) {
			$array_js=array (
					$array_js
			);
		}

		foreach ( $array_js as $js ) {
			$this->jquery_code_for_compile[]="\t$js\n";
		}
	}
1163321
void writeArrayHeader(int size) throws IOException {
        if (size < 16) {
            output.writeByte(MIN_FIX_ARRAY + size);
        } else if (size < 65536) {
            output.writeByte(ARRAY_16);
            output.writeShort(size);
        } else {
            output.writeByte(ARRAY_32);
            output.writeInt(size);
        }
    }