def precompute_idfs(wglobal, dfs, total_docs):
 return dict(((termid, wglobal(df, total_docs)) for (termid, df) in iteritems(dfs)))

def precompute_idfs ( wglobal , dfs , total_docs ) : return dict ( ( ( termid , wglobal ( df , total_docs ) ) for ( termid , df ) in iteritems ( dfs ) ) )
precompute the inverse document frequency mapping for all terms .