def numpy_scalar(data):
 if ((data.ndim > 0) and ((len(data.shape) == 0) or (builtins.max(data.shape) == 0))):
  assert numpy.all((numpy.array([]) == data))
  raise EmptyConstantError()
 try:
  numpy.complex(data)
  return data
 except Exception:
  raise NotScalarConstantError('v.data is non-numeric, non-scalar, or has more than one unique value', data)

def numpy_scalar ( data ) : if ( ( data . ndim > 0 ) and ( ( len ( data . shape ) == 0 ) or ( builtins . max ( data . shape ) == 0 ) ) ) : assert numpy . all ( ( numpy . array ( [ ] ) == data ) ) raise EmptyConstantError ( ) try : numpy . complex ( data ) return data except Exception : raise NotScalarConstantError ( 'v.data is non-numeric, non-scalar, or has more than one unique value' , data )
return a scalar stored in a numpy ndarray .