def from_dtype(dtype):
  if not isinstance(dtype, np.dtype):
    assert hasattr(dtype, 'dtype'), "Expected a dtype but %s" % dtype 
    value = dtype(0)
    dtype = value.dtype 
  parakeet_type = _dtype_to_parakeet_type.get(dtype)
  if parakeet_type is None:
    assert False, "Don't know how to make Parakeet scalar type from dtype %s" % dtype
  return parakeet_type
dataset/ETHPy150Open iskandr/parakeet/parakeet/ndtypes/scalar_types.py/from_dtype/original