def datashape_type_to_numpy(type_):
 if isinstance(type_, Option):
  type_ = type_.ty
 if isinstance(type_, DateTime):
  return np.dtype('datetime64[ns]')
 else:
  return type_.to_numpy_dtype()

def datashape_type_to_numpy ( type_ ) : if isinstance ( type_ , Option ) : type_ = type_ . ty if isinstance ( type_ , DateTime ) : return np . dtype ( 'datetime64[ns]' ) else : return type_ . to_numpy_dtype ( )
given a datashape type .