def get_tile_set(chunks):
 tile_set = defaultdict(int)
 for ((chunkx, chunkz), chunkmtime) in chunks.iteritems():
  (col, row) = tileset.convert_coords(chunkx, chunkz)
  for (tilec, tiler) in tileset.get_tiles_by_chunk(col, row):
   tile = tileset.RenderTile.compute_path(tilec, tiler, 5)
   tile_set[tile.path] = max(tile_set[tile.path], chunkmtime)
 for (tile, tile_mtime) in tile_set.copy().iteritems():
  for i in reversed(xrange(5)):
   tile_set[tile[:i]] = max(tile_set[tile[:i]], tile_mtime)
 return dict(tile_set)

def get_tile_set ( chunks ) : tile_set = defaultdict ( int ) for ( ( chunkx , chunkz ) , chunkmtime ) in chunks . iteritems ( ) : ( col , row ) = tileset . convert_coords ( chunkx , chunkz ) for ( tilec , tiler ) in tileset . get_tiles_by_chunk ( col , row ) : tile = tileset . RenderTile . compute_path ( tilec , tiler , 5 ) tile_set [ tile . path ] = max ( tile_set [ tile . path ] , chunkmtime ) for ( tile , tile_mtime ) in tile_set . copy ( ) . iteritems ( ) : for i in reversed ( xrange ( 5 ) ) : tile_set [ tile [ : i ] ] = max ( tile_set [ tile [ : i ] ] , tile_mtime ) return dict ( tile_set )
given the dictionary mapping chunk coordinates their mtimes .