def _safely_castable_to_int(dt):
 int_size = np.dtype(int).itemsize
 safe = ((np.issubdtype(dt, int) and (dt.itemsize <= int_size)) or (np.issubdtype(dt, np.unsignedinteger) and (dt.itemsize < int_size)))
 return safe

def _safely_castable_to_int ( dt ) : int_size = np . dtype ( int ) . itemsize safe = ( ( np . issubdtype ( dt , int ) and ( dt . itemsize <= int_size ) ) or ( np . issubdtype ( dt , np . unsignedinteger ) and ( dt . itemsize < int_size ) ) ) return safe
test whether the numpy data type dt can be safely cast to an int .