def precompute(config, soups):
 show_toc = config.get(u'show_toc', {})
 page = {}
 pantsrefs = precompute_pantsrefs(soups)
 for (p, soup) in soups.items():
  title = (get_title(soup) or p)
  page[p] = PrecomputedPageInfo(title=title, show_toc=show_toc.get(p, True))
 return Precomputed(page=page, pantsref=pantsrefs)

def precompute ( config , soups ) : show_toc = config . get ( u'show_toc' , { } ) page = { } pantsrefs = precompute_pantsrefs ( soups ) for ( p , soup ) in soups . items ( ) : title = ( get_title ( soup ) or p ) page [ p ] = PrecomputedPageInfo ( title = title , show_toc = show_toc . get ( p , True ) ) return Precomputed ( page = page , pantsref = pantsrefs )
return info we want to compute before we mutate things .