def _isscalar(x):
    '\n    Check whether x is if a scalar type, or 0-dim.\n\n    Parameters\n    ----------\n    x : anything\n        An input to be checked for scalar-ness.\n\n    Returns\n    -------\n    is_scalar : boolean\n        True if the input is a scalar, False otherwise.\n    '
    return (np.isscalar(x) or (hasattr(x, 'shape') and (x.shape == ())))
Check whether x is if a scalar type, or 0-dim.

Parameters
----------
x : anything
    An input to be checked for scalar-ness.

Returns
-------
is_scalar : boolean
    True if the input is a scalar, False otherwise.
def _isscalar(x):
    '\n    Check whether x is if a scalar type, or 0-dim.\n\n    Parameters\n    ----------\n    x : anything\n        An input to be checked for scalar-ness.\n\n    Returns\n    -------\n    is_scalar : boolean\n        True if the input is a scalar, False otherwise.\n    '
    return (np.isscalar(x) or (hasattr(x, 'shape') and (x.shape == ())))