Convert an array
510673
private Object convertToArray(String pType, String pValue) {
        // It's an array
        String t = pType.substring(1,2);
        Class valueType;
        if (t.equals("L")) {
            // It's an object-type
            String oType = pType.substring(2,pType.length()-1).replace('/','.');
            valueType = ClassUtil.classForName(oType);
            if (valueType == null) {
                throw new IllegalArgumentException("No class of type " + oType + "found");
            }
        } else {
            valueType = TYPE_SIGNATURE_MAP.get(t);
            if (valueType == null) {
                throw new IllegalArgumentException("Cannot convert to unknown array type " + t);
            }
        }
        String[] values = EscapeUtil.splitAsArray(pValue, EscapeUtil.PATH_ESCAPE, ",");
        Object ret = Array.newInstance(valueType,values.length);
        int i = 0;
        for (String value : values) {
            Array.set(ret,i++,value.equals("[null]") ? null : convertFromString(valueType.getCanonicalName(),value));
        }
        return ret;
    }
1027741
function toArray(arrayLike) {
        if (arrayLike === undefined || arrayLike === null) {
            return [];
        }
        if (Array.isArray(arrayLike)) {
            return arrayLike;
        }
        return [arrayLike];
    }
325771
function groupToElements(array, n) {
  var lists = _.groupBy(array, function(element, index){
    return Math.floor(index / n);
  });

  return _.toArray(lists);
}
656607
function setToArray$1(set) {
  var index = -1,
      result = Array(set.size);

  set.forEach(function (value) {
    result[++index] = value;
  });
  return result;
}
831930
function slice(array) {
  const newArray = new Array(array.length);

  let i,
      l;

  for (i = 0, l = array.length; i < l; i++)
    newArray[i] = array[i];

  return newArray;
}
914670
function toArray (span, root) {
  if(!span[root]) return null
  var a = [root]
  while(span[root])
    a.push(root = span[root])
  return a.reverse()
}
1022732
def _array_convert(a):
    
    from numpy import ndarray
    if isinstance(a, ndarray):
        larr = a.tolist()
        if len(larr) == 1:
            return larr[0]
        else:
            return larr
    else:
        return a
983874
function arrayify(thing) {
    if (Array.isArray(thing)) {
      return thing;
    }

    if (thing && typeof thing.length === 'number') {
      return Array.from(thing);
    }

    return [thing];
  }
836864
function toArray(obj) {
  var a, arr = [];
  for (a in obj) {
    arr.push(obj[a]);
  }
  return arr;
}
834658
function array2object(array) {
    var result = {};
    array.forEach(function(e) {
        if (e) {
            var kv = e.trim().split(':');
            if (isNumber(kv[1])) {
                kv[1] = Number(kv[1]);
            } else if (isBoolean(kv[1])) {
                kv[1] = toBoolean(kv[1]);
            } else if (isDateType(kv[1])) {
                kv[1] = convert2Date(kv[1]);
            };
            result[kv[0]] = kv[1];
        };
    });
    return result;
}
1302128
function convert(data, output, frombits, tobits, pad, off) {
  const maxv = (1 << tobits) - 1;
  let acc = 0;
  let bits = 0;
  let j = 0;

  if (pad !== -1)
    output[j++] = pad;

  for (let i = off; i < data.length; i++) {
    const value = data[i];

    if ((value >> frombits) !== 0)
      throw new Error('Invalid bech32 bits.');

    acc = (acc << frombits) | value;
    bits += frombits;

    while (bits >= tobits) {
      bits -= tobits;
      output[j++] = (acc >>> bits) & maxv;
    }
  }

  if (pad !== -1) {
    if (bits > 0)
      output[j++] = (acc << (tobits - bits)) & maxv;
  } else {
    if (bits >= frombits || ((acc << (tobits - bits)) & maxv))
      throw new Error('Invalid bech32 bits.');
  }

  return output.slice(0, j);
}
1346542
def from_array(cls, arr):
        """"""
        return cls().with_columns([(f, arr[f]) for f in arr.dtype.names])
1202270
def decode_array(input_array):
    """"""
    codec, length, param, input_array = parse_header(input_array)
    return codec_dict[codec].decode(input_array, param)
1287292
public static <T, J extends Convertable<T>> T[] convertToArray(J[] array, Class<T> clazz) {
        return toArray(convert(array), clazz);
    }
1353353
function arrayToObject(array) {
  return array.reduce((obj, [prop1, prop2]) => {
    obj[prop1] = prop2
    obj[prop2] = prop1
    return obj
  }, {})
}
891735
public static float[] toFloat(int[] array) {
        float[] n = new float[array.length];
        for (int i = 0; i < array.length; i++) {
            n[i] = (float) array[i];
        }
        return n;
    }
1158095
function toArray(buffer) {
    if(!buffer) buffer = new Buffer(0);
    var view = new Uint8Array(buffer.length);
    for (var i = 0; i < buffer.length; ++i) {
        view[i] = buffer[i];
    }
    return view;
  }