#NEWLINE# def iter_contiguous_extent( self ) : #NEWLINE# #INDENT# ' Generates extents\n        ' #NEWLINE# if ( self . is_c_contig or self . is_f_contig ) : #NEWLINE# #INDENT# ( yield self . extent ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . dims [ 0 ] . stride < self . dims [ ( - 1 ) ] . stride ) : #NEWLINE# #INDENT# innerdim = self . dims [ 0 ] #NEWLINE# outerdims = self . dims [ 1 : ] #NEWLINE# outershape = self . shape [ 1 : ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# innerdim = self . dims [ ( - 1 ) ] #NEWLINE# outerdims = self . dims [ : ( - 1 ) ] #NEWLINE# outershape = self . shape [ : ( - 1 ) ] #NEWLINE# #UNINDENT# if innerdim . is_contiguous ( self . itemsize ) : #NEWLINE# #INDENT# oslen = [ range ( s ) for s in outershape ] #NEWLINE# for indices in itertools . product ( * oslen ) : #NEWLINE# #INDENT# base = compute_index ( indices , outerdims ) #NEWLINE# ( yield ( ( base + innerdim . start ) , ( base + innerdim . stop ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# oslen = [ range ( s ) for s in self . shape ] #NEWLINE# for indices in itertools . product ( * oslen ) : #NEWLINE# #INDENT# offset = compute_index ( indices , self . dims ) #NEWLINE# ( yield ( offset , ( offset + self . itemsize ) ) )