#NEWLINE# def _from_str_dtype( dtype ) : #NEWLINE# #INDENT# m = re_typestr . match ( dtype . str ) #NEWLINE# if ( not m ) : #NEWLINE# #INDENT# raise NotImplementedError ( dtype ) #NEWLINE# #UNINDENT# groups = m . groups ( ) #NEWLINE# typecode = groups [ 0 ] #NEWLINE# if ( typecode == 'U' ) : #NEWLINE# #INDENT# if ( dtype . byteorder not in '=|' ) : #NEWLINE# #INDENT# raise NotImplementedError ( 'Does not support non-native byteorder' ) #NEWLINE# #UNINDENT# count = ( typecode . itemsize // sizeof_unicode_char ) #NEWLINE# assert ( count == int ( groups [ 1 ] ) ) , 'Unicode char size mismatch' #NEWLINE# return types . UnicodeCharSeq ( count ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( typecode == 'S' ) : #NEWLINE# #INDENT# count = dtype . itemsize #NEWLINE# assert ( count == int ( groups [ 1 ] ) ) , 'Char size mismatch' #NEWLINE# return types . CharSeq ( count ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise NotImplementedError ( dtype )