Create an empty array with appropriate shape.
544936
def _create_empty_array(self, frames, always_2d, dtype):
        """"""
        import numpy as np
        if always_2d or self.channels > 1:
            shape = frames, self.channels
        else:
            shape = frames,
        return np.empty(shape, dtype, order='C')
330397
function() {
      var i        = 0,
          length   = arr.length,
          newArray = [];
      for (; i<length; i++) {
        newArray.push(arr[i]);
      }
      return newArray;
    }
1025720
public static Slice wrappedShortArray(short[] array, int offset, int length)
    {
        if (length == 0) {
            return EMPTY_SLICE;
        }
        return new Slice(array, offset, length);
    }
693735
def to_0d_object_array(value: Any) -> np.ndarray:
    
    result = np.empty((), dtype=object)
    result[()] = value
    return result
758415
public static int[] squeeze(int[] shape) {
        if (isColumnVectorShape(shape))
            return shape;

        List<Integer> ret = new ArrayList<>();

        //strip all but last dimension
        for (int i = 0; i < shape.length; i++)
            if (shape[i] != 1)
                ret.add(shape[i]);
        return ArrayUtil.toArray(ret);
    }
411495
def drop_empty(arr):
    
    return [x for x in arr if not isinstance(x, list) or len(x) > 0]
1140324
public static Slice wrappedDoubleArray(double[] array, int offset, int length)
    {
        if (length == 0) {
            return EMPTY_SLICE;
        }
        return new Slice(array, offset, length);
    }
820765
def emptyArray(key, add_label=None):
    """"""

    result = {
        'key': key,
        'startEmpty': True
    }
    if add_label is not None:
        result['add'] = add_label
        result['style'] = {'add': 'btn-success'}
    return result
1053198
public static Slice wrappedIntArray(int[] array, int offset, int length)
    {
        if (length == 0) {
            return EMPTY_SLICE;
        }
        return new Slice(array, offset, length);
    }
1249427
public static <T> Set<T> arrayToSet(final T[] array) {
        if (null == array) {
            return Collections.emptySet();
        }

        final Set<T> ret = new HashSet<T>();

        for (int i = 0; i < array.length; i++) {
            final T object = array[i];

            ret.add(object);
        }

        return ret;
    }
1083184
public static int[] shape(INDArrayIndex... indices) {
        int[] ret = new int[indices.length];
        for (int i = 0; i < ret.length; i++) {
            // FIXME: LONG
            ret[i] = (int) indices[i].length();
        }

        List<Integer> nonZeros = new ArrayList<>();
        for (int i = 0; i < ret.length; i++) {
            if (ret[i] > 0)
                nonZeros.add(ret[i]);
        }

        return ArrayUtil.toArray(nonZeros);
    }
977928
def empty(self, shape, complex=False):
        
        if complex:
            return np.empty(shape, dtype=self.complex, order=self.order)
        return np.empty(shape, dtype=self.float, order=self.order)
1181687
def newarray(self, length, value=0):
        """"""
        if self.bitdepth > 8:
            return array('H', [value] * length)
        else:
            return bytearray([value] * length)
1302073
def sparse_arrays(self, value):
        """"""
        if not isinstance(value, bool):
            raise TypeError('sparse_arrays attribute must be a logical type.')
        self._sparse_arrays = value
792243
def ensure_ndarray_or_None(A, shape=None, uniform=None, ndim=None, size=None, dtype=None, kind=None):
     """
    if A is not None:
        return ensure_ndarray(A, shape=shape, uniform=uniform, ndim=ndim, size=size, dtype=dtype, kind=kind)
    else:
        return None
1039576
function filledarray(value, size){
  var a = new Array(size);
  for(var i=0; i<size; i++){a[i] = value;}
  return a;
}
105396
def p_block_empty(self, p):
        ''
        p[0] = Block((), lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))