def as_dtype(nbtype):
    if isinstance(nbtype, (types.Complex, types.Integer, types.Float)):
        return numpy.dtype(str(nbtype))
    if nbtype is types.bool_:
        return numpy.dtype('?')
    if isinstance(nbtype, (types.NPDatetime, types.NPTimedelta)):
        letter = _as_dtype_letters[type(nbtype)]
        if nbtype.unit:
            return numpy.dtype('%s[%s]' % (letter, nbtype.unit))
        else:
            return numpy.dtype(letter)
    if isinstance(nbtype, (types.CharSeq, types.UnicodeCharSeq)):
        letter = _as_dtype_letters[type(nbtype)]
        return numpy.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.
dataset/ETHPy150Open numba/numba/numba/numpy_support.py/as_dtype