def isscalarlike(x):
 return (np.isscalar(x) or (isdense(x) and (x.ndim == 0)))

def isscalarlike ( x ) : return ( np . isscalar ( x ) or ( isdense ( x ) and ( x . ndim == 0 ) ) )
is x either a scalar .