def METHOD_NAME(arrays, depth=0):
    if depth < max_depth:
        if len(arrays) == 0:
            raise ValueError('Lists cannot be empty')
        arrs = [METHOD_NAME(arr, depth+1) for arr in arrays]
        return _nx.concatenate(arrs, axis=-(max_depth-depth))
    else:
        # We've 'bottomed out' - arrays is either a scalar or an array
        # type(arrays) is not list
        return atleast_nd(arrays, result_ndim)