Extends array parameters recursively.

@param  array ... list of array to extend.
@return array     The extended array.
774600
public static function extend()
    {
        if (func_num_args() < 2) {
            throw new BadFunctionCallException("Not enough parameters");
        }
        $args = func_get_args();
        $merged = array_shift($args);

        foreach ($args as $source) {
            foreach ($source as $key => $value) {
                if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) {
                    $merged[$key] = static::merge($merged[$key], $value);
                } else {
                    $merged[$key] = $value;
                }
            }
        }
        return $merged;
    }
893948
public ToStringBuilder append(final Object[] array) {
        style.append(buffer, null, array, null);
        return this;
    }
1096584
public function overWriteParameterSet ($array) {
		if (!Arrays::IsTraversable($array)) {
			return false;
		}
		foreach ($array as $name => $data) {
			Request::OverWriteParameters($name, $data);
			$this->request->parameter[$name] = $data;
		}
		if (is_array($this->request->parameter)) {
			$this->request->parameter = LazyArrayObject::Create($this->request->parameter);
		}
		return true;
	}
368007
@SafeVarargs
	public static <T> T[] addAll(T[]... arrays) {
		if (arrays.length == 1) {
			return arrays[0];
		}

		int length = 0;
		for (T[] array : arrays) {
			if (array == null) {
				continue;
			}
			length += array.length;
		}
		T[] result = newArray(arrays.getClass().getComponentType().getComponentType(), length);

		length = 0;
		for (T[] array : arrays) {
			if (array == null) {
				continue;
			}
			System.arraycopy(array, 0, result, length, array.length);
			length += array.length;
		}
		return result;
	}
1286328
public final static Object toPrimitiveArray(final Object array) {
        if (!array.getClass().isArray()) {
            return array;
        }
        final Class<?> clazz = OBJ_TO_PRIMITIVE.get(array.getClass().getComponentType());
        return setArray(clazz, array);
    }
1137041
public static function cloneArray(array $array): array
    {
        $newArray = [];
        foreach($array as $key => $value) {
            if(\is_object($value)) {
                $newArray[$key] = clone $value;
            } elseif(\is_array($value)) {
                $newArray[$key] = self::cloneArray($value);
            } else {
                $newArray[$key] = $value;
            }
        }
        return $newArray;
    }
271955
def expand_array(self, array_name):
        """"""
        ret = self.master._array[array_name] if array_name in self.master._array else []
        try:
            ret = self.do_expand_array(array_name)
        except Exception as e:
            self.warn("Error expanding array '%s': %s" % (array_name, str(e)))
        return ret
224191
public static <T extends Comparable<? super T>> T[] desc(final T[] comparableArray) {

        if (comparableArray == null) {
            return null;
        }
        T[] clone = comparableArray.clone();
        descByReflex(clone);
        return clone;
    }
1120039
public static function extend($method, $callback = null)
    {
        if (is_array($method)) {
            foreach ($method as $key => $val) {
                self::$extend[strtolower($key)] = $val;
            }
        } else {
            self::$extend[strtolower($method)] = $callback;
        }
    }
1291850
protected Object[] _transform(final Object[] array) {
        Object[] result = new Object[array.length];
        for (Object object : array) {
            ArrayUtils.add(result, transform(object));
        }
        return result;
    }
1236440
def extend(self, values):
        """"""
        self.database.run_script(
            'array_extend',
            keys=[self.key],
            args=values)
20806
private static List<Object> arrayToList(final Object array) {
    if (array instanceof Object[])
      return Arrays.asList((Object[]) array);

    List<Object> result = new ArrayList<Object>();
    // Arrays of the primitive types can't be cast to array of Object, so this:
    if (array instanceof int[])
      for (int value : (int[]) array) result.add(value);
    else if (array instanceof boolean[])
      for (boolean value : (boolean[]) array) result.add(value);
    else if (array instanceof long[])
      for (long value : (long[]) array) result.add(value);
    else if (array instanceof float[])
      for (float value : (float[]) array) result.add(value);
    else if (array instanceof double[])
      for (double value : (double[]) array) result.add(value);
    else if (array instanceof short[])
      for (short value : (short[]) array) result.add(value);
    else if (array instanceof byte[])
      for (byte value : (byte[]) array) result.add(value);
    else if (array instanceof char[])
      for (char value : (char[]) array) result.add(value);
    return result;
  }
968816
public static <T> ArrayList<T> mergeLists(final T... array) {
        final ArrayList<T> retValue = new ArrayList<T>();
        Collections.addAll(retValue, array);
        return retValue;
    }
649727
public static List<Integer> asList(int[] array) {
    List<Integer> l = new ArrayList<Integer>();
    for (int i : array) {
      l.add(i);
    }
    return l;
  }
436070
public static List<Writable> toRecord(INDArray array) {
        List<Writable> writables = new ArrayList<>();
        writables.add(new NDArrayWritable(array));
        return writables;
    }
1206325
public static <T> List<T> toList(final T[] array) {

    if (array != null) {
      List<T> list = new ArrayList<T>(array.length);
      for (T element : array) {
        list.add(element);
      }
      return list;
    } else {
      return new ArrayList<T>(0);
    }
  }
367296
@SuppressWarnings("unchecked")
    public static <T extends Example> T[] asArray( T example )
    {
        List<Example> examples = asList( example );
        T[] array = (T[]) Array.newInstance( example.getClass(), examples.size() );
        return examples.toArray( array );
    }