def from_dtype(dtype):
 if (dtype.fields is None):
  try:
   return FROM_DTYPE[dtype]
  except KeyError:
   if (dtype.char in 'SU'):
    return _from_str_dtype(dtype)
   if (dtype.char in 'mM'):
    return _from_datetime_dtype(dtype)
   if (dtype.char in 'V'):
    subtype = from_dtype(dtype.subdtype[0])
    return types.NestedArray(subtype, dtype.shape)
   raise NotImplementedError(dtype)
 else:
  return from_struct_dtype(dtype)

def from_dtype ( dtype ) : if ( dtype . fields is None ) : try : return FROM_DTYPE [ dtype ] except KeyError : if ( dtype . char in 'SU' ) : return _from_str_dtype ( dtype ) if ( dtype . char in 'mM' ) : return _from_datetime_dtype ( dtype ) if ( dtype . char in 'V' ) : subtype = from_dtype ( dtype . subdtype [ 0 ] ) return types . NestedArray ( subtype , dtype . shape ) raise NotImplementedError ( dtype ) else : return from_struct_dtype ( dtype )
return a numba type instance corresponding to the given numpy *dtype* .