def get_tiles_by_chunk(chunkcol, chunkrow):
 tilecol = (chunkcol - (chunkcol % 2))
 tilerow = (chunkrow - (chunkrow % 4))
 if ((chunkcol % 2) == 0):
  colrange = ((tilecol - 2), tilecol)
 else:
  colrange = (tilecol,)
 if ((chunkrow % 4) == 0):
  rowrange = xrange((tilerow - 4), ((tilerow + 32) + 1), 4)
 else:
  rowrange = xrange(tilerow, ((tilerow + 32) + 1), 4)
 return product(colrange, rowrange)

def get_tiles_by_chunk ( chunkcol , chunkrow ) : tilecol = ( chunkcol - ( chunkcol % 2 ) ) tilerow = ( chunkrow - ( chunkrow % 4 ) ) if ( ( chunkcol % 2 ) == 0 ) : colrange = ( ( tilecol - 2 ) , tilecol ) else : colrange = ( tilecol , ) if ( ( chunkrow % 4 ) == 0 ) : rowrange = xrange ( ( tilerow - 4 ) , ( ( tilerow + 32 ) + 1 ) , 4 ) else : rowrange = xrange ( tilerow , ( ( tilerow + 32 ) + 1 ) , 4 ) return product ( colrange , rowrange )
for the given chunk .