Wrap the ary to return an Array type
335434
def _return(self, ary):
        
        if isinstance(ary, Array):
            return ary
        return Array(ary, copy=False)
1156964
function toArray(value) {
      var length = value ? getLength(value) : 0;
      if (!isLength(length)) {
        return values(value);
      }
      if (!length) {
        return [];
      }
      return (lodash.support.unindexedChars && isString(value))
        ? value.split('')
        : arrayCopy(value);
    }
171498
function asArray() {
  var argLen = arguments.length;
  switch(argLen) {
  // No arguments returns an empty array
  case 0:
    return [];
  // Single array argument returns that array
  case 1:
    var arg = arguments[0];
    if (Array.isArray(arg)) {
      return arg;
    }
    // Single object argument returns an array with object as only element
    return [arg];
  // List of arguments returns an array with arguments as elements
  default:
    var args = new Array(argLen);
    for(var i=0; i < argLen; ++i) {
      args[i] = arguments[i];
    }
    return args;
  }
}
213588
def dtype_contract(input_dtype=None, output_dtype=None):
    """"""
    def wrap(function):
        @wraps(function)
        def wrapped_function(*args, **kwargs):
            if input_dtype is not None:
                check_dtype(args[0], input_dtype)
            array = function(*args, **kwargs)
            if output_dtype is not None:
                check_dtype(array, output_dtype)
            return array
        return wrapped_function
    return wrap
1278073
def array(description, **kwargs) -> typing.Type:
    
    kwargs['description'] = description
    return type('Array', (Array,), kwargs)
1304990
function toArray(obj) {
	if (Array.isArray(obj)) return obj;
	var a = [];
	a.push(obj);
	return a;
}
226423
function mapArray(type) {
		return Array.map(type, function(thing) {
			return isType(thing) ? parse(thing) : thing;
		});
	}
792138
def daArray(arry, dtype=numpy.float):
    
    a = numpy.array(arry, dtype)
    res = DistArray(a.shape, a.dtype)
    res[:] = a
    return res
711336
function unwrapArray(arg, defaultValue) {
  arg = Array.isArray(arg) ? /* istanbul ignore next (preact) */ arg[0] : arg
  if (!arg && defaultValue) {
    return defaultValue
  } else {
    return arg
  }
}
471855
def literal_array(cls, elems):
        
        tys = [el.type for el in elems]
        if len(tys) == 0:
            raise ValueError("need at least one element")
        ty = tys[0]
        for other in tys:
            if ty != other:
                raise TypeError("all elements must have the same type")
        return cls(types.ArrayType(ty, len(elems)), elems)
1020006
def be_array_to_bytes(arr):
    
    data = fix_byteorder(arr)
    if hasattr(arr, 'tobytes'):
        return data.tobytes()
    else:
        return data.tostring()
1110331
function slice (ar, start, end) {
    return Array.prototype.slice.call(ar, start, end)
  }
665766
def array_dim(arr):
    
    dim = []
    while True:
        try:
            dim.append(len(arr))
            arr = arr[0]
        except TypeError:
            return dim
893777
function makeArray(obj) {
        var isArray;
        if ((isArray = Array.isArray)) {
            return isArray(obj) ? obj : [obj];
        }
        return ArrayPrototype.concat(obj);
    }
815204
def arrays_to_string(file_prefix=None):
    """"""
    return Registry(
        types={
            numpy.ndarray: SerNumpyArray(),
            numpy.floating: SerNumpyScalar()
        },
        hooks={
            '<ufunc>': SerUFunc()
        },
        hook_fn=_numpy_hook
    )
279401
function(arr, i) {
			var ret = arr.slice(0);
			for (var j = 0; j < i; j++) {
				ret = [ret[ret.length - 1]].concat(ret.slice(0, ret.length - 1));
			}
			return ret;
		}
242301
function ArrayType (data, length) {
    if (!(this instanceof ArrayType)) {
      return new ArrayType(data, length)
    }
    debug('creating new array instance')
    ArrayIndex.call(this)
    var item_size = ArrayType.BYTES_PER_ELEMENT
    if (0 === arguments.length) {
      // new IntArray()
      // use the "fixedLength" if provided, otherwise throw an Error
      if (fixedLength > 0) {
        this.length = fixedLength
        this.buffer = new Buffer(this.length * item_size)
      } else {
        throw new Error('A "length", "array" or "buffer" must be passed as the first argument')
      }
    } else if ('number' == typeof data) {
      // new IntArray(69)
      this.length = data
      this.buffer = new Buffer(this.length * item_size)
    } else if (isArray(data)) {
      // new IntArray([ 1, 2, 3, 4, 5 ], {len})
      // use optional "length" if provided, otherwise use "fixedLength, otherwise
      // use the Array's .length
      var len = 0
      if (null != length) {
        len = length
      } else if (fixedLength > 0) {
        len = fixedLength
      } else {
        len = data.length
      }
      if (data.length < len) {
        throw new Error('array length must be at least ' + len + ', got ' + data.length)
      }
      this.length = len
      this.buffer = new Buffer(len * item_size)
      for (var i = 0; i < len; i++) {
        this[i] = data[i]
      }
    } else if (Buffer.isBuffer(data)) {
      // new IntArray(Buffer(8))
      var len = 0
      if (null != length) {
        len = length
      } else if (fixedLength > 0) {
        len = fixedLength
      } else {
        len = data.length / item_size | 0
      }
      var expectedLength = item_size * len
      this.length = len
      if (data.length != expectedLength) {
        if (data.length < expectedLength) {
          throw new Error('buffer length must be at least ' + expectedLength + ', got ' + data.length)
        } else {
          debug('resizing buffer from %d to %d', data.length, expectedLength)
          data = data.slice(0, expectedLength)
        }
      }
      this.buffer = data
    }
  }