def make_kind_check(python_types, numpy_kind):
 def check(value):
  if hasattr(value, 'dtype'):
   return (value.dtype.kind == numpy_kind)
  return isinstance(value, python_types)
 return check

def make_kind_check ( python_types , numpy_kind ) : def check ( value ) : if hasattr ( value , 'dtype' ) : return ( value . dtype . kind == numpy_kind ) return isinstance ( value , python_types ) return check
make a function that checks whether a scalar or array is of a given kind .