#NEWLINE# def _o2s( dtype , shape , order ) : #NEWLINE# #INDENT# if ( ( dtype is None ) or ( shape is None ) or ( order is None ) ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if ( order == 'F' ) : #NEWLINE# #INDENT# shape = list ( shape ) #NEWLINE# shape . reverse ( ) #NEWLINE# #UNINDENT# strides = [ ] #NEWLINE# itemsize = dtype . itemsize #NEWLINE# for i in range ( len ( shape ) , 0 , ( - 1 ) ) : #NEWLINE# #INDENT# strides . append ( itemsize ) #NEWLINE# itemsize *= shape [ ( i - 1 ) ] #NEWLINE# #UNINDENT# if ( order in ( 'C' , None ) ) : #NEWLINE# #INDENT# strides . reverse ( ) #NEWLINE# #UNINDENT# return tuple ( strides )