If the elements of the list are arrays, get the max length of each needed
dimension, otherwise return an int[] containing one element, the length
of the list.
493333
private int[] findArrayDimensions(List<?> list, Class<?> arrayType) {
        List<int[]> elementDims = new LinkedList<int[]>();
        int dimCount = 0;
        for (Object o : list) {
            if (o != null && o.getClass().isArray() && 
                isAssignableFromArray(arrayType, o.getClass().getComponentType())) {
                final int[] dimensions = findArrayDimensions(o);
                elementDims.add(dimensions);
                dimCount = Math.max(dimCount, dimensions.length);
            }
        }

        int[] dimsArr = new int[dimCount + 1];
        // First dimension length is always size of given list
        dimsArr[0] = list.size();
        // Find the max length of each additional dimension
        for (int[] childDim : elementDims) {
            for (int i = 0; i < childDim.length; i++) {
                dimsArr[i + 1] = Math.max(dimsArr[i + 1], childDim[i]);
            }
        }
        return dimsArr;
    }
609438
static int[] toIntArray(List<Integer> integers) {
		int[] ints = new int[integers.size()];
		int i = 0;
		for (Integer n : integers) {
			ints[i++] = n;
		}
		return ints;
	}
640777
public static int max(int[] x) {
        int m = x[0];

        for (int n : x) {
            if (n > m) {
                m = n;
            }
        }

        return m;
    }
298716
public static long max( long []array , int offset , int length ) {
		long max = -Long.MAX_VALUE;
		for (int i = 0; i < length; i++) {
			long tmp = array[offset+i];
			if( tmp > max ) {
				max = tmp;
			}
		}
		return max;
	}
665766
def array_dim(arr):
    
    dim = []
    while True:
        try:
            dim.append(len(arr))
            arr = arr[0]
        except TypeError:
            return dim
864280
public Object getArrayElement(Object o, int index) throws IndexOutOfBoundsException {
        if (o instanceof List)
            return ((List)o).get(index);
        return Array.get(o,index);
    }
934426
int getLongestChainLength() {
		int maxLen = 0;

		for (Entry<?, ?> entry : table) {
			int thisLen = 0;
			while (entry != null) {
				thisLen++;
				entry = entry.next;
			}
			maxLen = Math.max(maxLen, thisLen);
		}

		return maxLen;
	}
222611
static int max(int[] input, int start, int length) {
        assert length >= 1;

        int max = input[start];
        for (int i = length - 2, index = start + 1; i >= 0; i--, index++) {
            final int v = input[index];
            if (v > max) {
                max = v;
            }
        }

        return max;
    }
455487
private int findMaxRowLength(char maze[][]){
        int max = 0;
        for (int row = 0; row < maze.length; row++) {
            if (maze[row].length > max) max = maze[row].length;
        }
        return max;
    }
1233779
private static int[] getStrides(int[] dims) {
        int rightmost = dims.length - 1;
        int[] strides = new int[dims.length];
        if (dims.length > 0) {          
            strides[rightmost] = 1;
            for (int i=rightmost-1; i >= 0; i--) {
                strides[i] = dims[i+1]*strides[i+1];
            }
        }
        return strides;
    }
419886
private static int getMaxLength( String[] values )
    {
        int result = 0;
        
        for ( int i = 0, curr = 0; i < values.length; i++ )
        {
            if ( ( curr = values[i].length() ) > result )
            {
                result = curr;
            }
        }
        return result;
    }
962301
public static double getMaxLength(double[] widths, double[] heights) {
		double maxWidth = getMaxLength(widths);
		double maxHeight = getMaxLength(heights);
		double maxLength = Math.min(maxWidth, maxHeight);
		return maxLength;
	}
1356992
public static long searchMax(long[] longArray) {
        if(longArray.length == 0) {
            throw new IllegalArgumentException("The array you provided does not have any elements");
        }

        long max = longArray[0];

        for(int i = 1; i < longArray.length; i++) {
            if(longArray[i] > max) {
                max = longArray[i];
            }
        }

        return max;
    }
1112220
@Override
  public SparseTensor slice(int[] dimensionNumbers, int[] key) {
    if (dimensionNumbers.length == 0) {
      return this;
    }
    // Check for an efficient case, where the dimensions are the first
    // elements of this.
    if (ArrayUtils.subarrayEquals(getDimensionNumbers(), dimensionNumbers, 0)) {
      long minKeyInt = 0;
      int numDimensions = dimensionNumbers.length;
      for (int i = 0; i < numDimensions; i++) {
        minKeyInt += indexOffsets[i] * key[i];
      }
      long maxKeyInt = minKeyInt + indexOffsets[numDimensions - 1];

      int startIndex = getNearestIndex(minKeyInt);
      int endIndex = getNearestIndex(maxKeyInt);

      long[] newKeyInts = ArrayUtils.copyOfRange(keyNums, startIndex, endIndex);
      int numKeyInts = newKeyInts.length;
      for (int i = 0; i < numKeyInts; i++) {
        newKeyInts[i] -= minKeyInt;
      }

      int[] newDimensionNumbers = ArrayUtils.copyOfRange(getDimensionNumbers(), dimensionNumbers.length, getDimensionNumbers().length);
      int[] newDimensionSizes = ArrayUtils.copyOfRange(getDimensionSizes(), dimensionNumbers.length, getDimensionSizes().length);
      double[] newValues = ArrayUtils.copyOfRange(values, startIndex, endIndex);
      return new SparseTensor(newDimensionNumbers, newDimensionSizes, newKeyInts, newValues);
    }

    // TODO(jayantk): This is an extremely naive implementation of
    // slice.
    // Figure out the appropriate sizes for the subset of dimensions.
    int[] dimensionSizes = new int[dimensionNumbers.length];
    for (int i = 0; i < dimensionNumbers.length; i++) {
      int dimIndex = getDimensionIndex(dimensionNumbers[i]);
      Preconditions.checkArgument(dimIndex >= 0);
      dimensionSizes[i] = getDimensionSizes()[dimIndex];
    }
    SparseTensorBuilder builder = new SparseTensorBuilder(dimensionNumbers, dimensionSizes);
    builder.put(key, 1.0);
    return elementwiseProduct(builder.build()).sumOutDimensions(Ints.asList(dimensionNumbers));
  }
639888
public static long max(LongArrayND array)
    {
        return array.stream().parallel().reduce(
            Long.MIN_VALUE, Math::max);
    }
420918
function length(array)
{
	if (array.height === 0)
	{
		return array.table.length;
	}
	else
	{
		return array.lengths[array.lengths.length - 1];
	}
}
673481
public double getPartialMaxMaxDist(int dimension) {
    double[] data = lookup[dimension];
    double max = data[0];
    for(int i = 1; i < data.length; i++) {
      max = Math.max(max, data[i]);
    }
    return max;
  }