GWT safe version of Arrays.copyOf.
344124
static <T> T[] arraysCopyOf(T[] original, int newLength) {
    T[] copy = newArray(original, newLength);
    System.arraycopy(original, 0, copy, 0, Math.min(original.length, newLength));
    return copy;
  }
165091
void copyValue(int[] val) {
        int len = val.length;
        if (value.length < len)
            value = new int[len];
        System.arraycopy(val, 0, value, 0, len);
        intLen = len;
        offset = 0;
    }
848104
function dup(x) {
    var i, buff;
    buff=new Array(x.length);
    copy_(buff,x);
    return buff;
  }
594178
public static long[] copyOf(long[] longArray) {

    	long[] copy = new long[longArray.length];
        System.arraycopy(longArray, 0, copy, 0, longArray.length);
        return copy;
    }
473336
private static int[][] deepClone(int[][] array) {
        int[][] result = new int[array.length][];
        for (int i = 0; i < result.length; i++) {
            result[i] = array[i].clone();
        }
        return result;
    }
115084
@SuppressWarnings("unchecked")
    public static <T> T[] cloneArray(T[] original) {
        if (original == null) {
            return null;
        }

        try {
            Class<?> clazz = original.getClass().getComponentType();
            T[] copy = (T[]) Array.newInstance(clazz, original.length);
            if (copy.length != 0) {
                Constructor<T> copyConstructor = (Constructor<T>) clazz.getConstructor(clazz);
                int i = 0;
                for (T t : original) {
                    copy[i++] = copyConstructor.newInstance(t);
                }
            }
            return copy;
        } catch (Exception e) {
            throw new RuntimeException("Cannot copy array. Does its type have a copy-constructor? " + original, e);
        }
    }
358872
public static boolean[] copyOf(boolean[] booleanArray) {

    	boolean[] copy = new boolean[booleanArray.length];
        System.arraycopy(booleanArray, 0, copy, 0, booleanArray.length);
        return copy;
    }
841534
private void copyArrays() {
        String[] oldSyms = mSymbols;
        int size = oldSyms.length;
        mSymbols = new String[size];
        System.arraycopy(oldSyms, 0, mSymbols, 0, size);
        Bucket[] oldBuckets = mBuckets;
        size = oldBuckets.length;
        mBuckets = new Bucket[size];
        System.arraycopy(oldBuckets, 0, mBuckets, 0, size);
    }
725152
function cloneArrayBuffer(arrayBuffer) {
  var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  new _Uint8Array(result).set(new _Uint8Array(arrayBuffer));
  return result;
}
104642
function(o) {
        var type = _.util.type(o);

        switch (type) {
          case 'Object':
            var clone = {};

            for (var key in o) {
              if (o.hasOwnProperty(key)) {
                clone[key] = _.util.clone(o[key]);
              }
            }

            return clone;

          case 'Array':
            return o.slice();
        }

        return o;
      }
900298
void copyTo(byte[] dest, int destOffset) {
        System.arraycopy(array,offset,dest,destOffset,length());
    }
697858
def safe_cast(values, dtype, copy):
    

    try:
        return values.astype(dtype, casting='safe', copy=copy)
    except TypeError:

        casted = values.astype(dtype, copy=copy)
        if (casted == values).all():
            return casted

        raise TypeError("cannot safely cast non-equivalent {} to {}".format(
            values.dtype, np.dtype(dtype)))
737238
function cloneTypedArray(typedArray, isDeep) {
  var buffer = isDeep ? _cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
307293
public Object[] copyOf(Object[] a) {
        Object[] b = new Object[a.length];
        System.arraycopy(a, 0, b, 0, a.length);
        return b;
    }
203789
public static double[][] array_clone(double[][] a) {
        if(a == null) {
            return a;
        }
        double[][] copy = new double[a.length][];
        for(int i=0;i<a.length;i++) {
            copy[i] = Arrays.copyOf(a[i], a[i].length);
        }
        return copy;
    }
157546
function() {
    var options, name, src, copy, copyIsArray, clone,
      target = arguments[0] || {},
      i = 1,
      length = arguments.length,
      deep = true;

    // Handle case when target is a string or something (possible in deep copy)
    if (typeof target !== "object" && typeof target !== 'function') {
      target = {};
    }

    for (; i < length; i++) {
      // Only deal with non-null/undefined values
      if ((options = arguments[i]) !== null) {
        // Extend the base object
        for (name in options) {
          src = target[name];
          copy = options[name];

          // Prevent never-ending loop
          if (target === copy) {
            continue;
          }

          // Recurse if we're merging plain objects or arrays
          if (deep && copy && (copy.constructor == Object || (copyIsArray = (copy.constructor == Array)))) {
            if (copyIsArray) {
              copyIsArray = false;
              // Overwrite the source with a copy of the array to merge in
              clone = [];
            } else {
              clone = src && src.constructor == Object ? src : {};
            }

            // Never move original objects, clone them
            target[name] = Util.merge(clone, copy);

          // Don't bring in undefined values
          } else if (copy !== undefined) {
            target[name] = copy;
          }
        }
      }
    }

    // Return the modified object
    return target;
  }
661248
private <R> Collection<R> copy(Iterable<R> src) {
        return Lists.newArrayList(src);
    }