def as_dtype(nbtype):
 if isinstance(nbtype, (types.Complex, types.Integer, types.Float)):
  return np.dtype(str(nbtype))
 if (nbtype is types.bool_):
  return np.dtype('?')
 if isinstance(nbtype, (types.NPDatetime, types.NPTimedelta)):
  letter = _as_dtype_letters[type(nbtype)]
  if nbtype.unit:
   return np.dtype(('%s[%s]' % (letter, nbtype.unit)))
  else:
   return np.dtype(letter)
 if isinstance(nbtype, (types.CharSeq, types.UnicodeCharSeq)):
  letter = _as_dtype_letters[type(nbtype)]
  return np.dtype(('%s%d' % (letter, nbtype.count)))
 if isinstance(nbtype, types.Record):
  return nbtype.dtype
 raise NotImplementedError(('%r cannot be represented as a Numpy dtype' % (nbtype,)))

def as_dtype ( nbtype ) : if isinstance ( nbtype , ( types . Complex , types . Integer , types . Float ) ) : return np . dtype ( str ( nbtype ) ) if ( nbtype is types . bool_ ) : return np . dtype ( '?' ) if isinstance ( nbtype , ( types . NPDatetime , types . NPTimedelta ) ) : letter = _as_dtype_letters [ type ( nbtype ) ] if nbtype . unit : return np . dtype ( ( '%s[%s]' % ( letter , nbtype . unit ) ) ) else : return np . dtype ( letter ) if isinstance ( nbtype , ( types . CharSeq , types . UnicodeCharSeq ) ) : letter = _as_dtype_letters [ type ( nbtype ) ] return np . dtype ( ( '%s%d' % ( letter , nbtype . count ) ) ) if isinstance ( nbtype , types . Record ) : return nbtype . dtype raise NotImplementedError ( ( '%r cannot be represented as a Numpy dtype' % ( nbtype , ) ) )
return a numpy dtype instance corresponding to the given numba type .