human
Complete the below
def chunks_from_arrays(arrays):

    ''''Chunks tuple from nested list of arrays
    >>> x = np.array([1, 2])
    >>> chunks_from_arrays([x, x])
    ((2, 2),)
    >>> x = np.array([[1, 2]])
    >>> chunks_from_arrays([[x], [x]])
    ((1, 1), (2,))
    >>> x = np.array([[1, 2]])
    >>> chunks_from_arrays([[x, x]])
    ((1,), (2, 2))
    >>> chunks_from_arrays([1, 1])
    ((1, 1),)'
    '''
 ... Write me a the Python program you requested?
assistant
#Here is the Python program you requested.
    if (not arrays):
        return ()
    result = []
    dim = 0
    def shape(x):
        try:
            return x.shape
        except AttributeError:
            return (1,)
    while isinstance(arrays, (list, tuple)):
        result.append(tuple([shape(deepfirst(a))[dim] for a in arrays]))
        arrays = arrays[0]
        dim += 1
    return tuple(result)