def _isscalar(x):
 return (np.isscalar(x) or (hasattr(x, 'shape') and (x.shape == ())))

def _isscalar ( x ) : return ( np . isscalar ( x ) or ( hasattr ( x , 'shape' ) and ( x . shape == ( ) ) ) )
check whether x is if a scalar type .