

def _shape_repr(shape):
    "Return a platform independent reprensentation of an array shape\n    Under Python 2, the `long` type introduces an 'L' suffix when using the\n    default %r format for tuples of integers (typically used to store the shape\n    of an array).\n    Under Windows 64 bit (and Python 2), the `long` type is used by default\n    in numpy shapes even when the integer dimensions are well below 32 bit.\n    The platform specific type causes string messages or doctests to change\n    from one platform to another which is not desirable.\n    Under Python 3, there is no more `long` type so the `L` suffix is never\n    introduced in string representation.\n    >>> _shape_repr((1, 2))\n    '(1, 2)'\n    >>> one = 2 ** 64 / 2 ** 64  # force an upcast to `long` under Python 2\n    >>> _shape_repr((one, 2 * one))\n    '(1, 2)'\n    >>> _shape_repr((1,))\n    '(1,)'\n    >>> _shape_repr(())\n    '()'\n    "
    if (len(shape) == 0):
        return '()'
    joined = ', '.join((('%d' % shape) for e in shape))
    if (len(shape) == 1):
        joined += ','
    return ('(%s)' % joined)

dataset/ETHPy150Open ibayer/fastFM/fastFM/validation.py _shape_repr/VarMisuse@38/426 `e`->`shape`