def shape2tuple(shape):
    '\n    Return shape as a tuple.\n\n    Parameters\n    ----------\n    shape : int or tuple\n        The given shape.\n\n    Returns\n    -------\n    tuple\n        The shape as a tuple.\n    '
    if isinstance(shape, Number):
        return (shape,)
    elif (shape is None):
        return shape
    return tuple(shape)
Return shape as a tuple.

Parameters
----------
shape : int or tuple
    The given shape.

Returns
-------
tuple
    The shape as a tuple.
def shape2tuple(shape):
    '\n    Return shape as a tuple.\n\n    Parameters\n    ----------\n    shape : int or tuple\n        The given shape.\n\n    Returns\n    -------\n    tuple\n        The shape as a tuple.\n    '
    if isinstance(shape, Number):
        return (shape,)
    elif (shape is None):
        return shape
    return tuple(shape)