<s> from __future__ import absolute_import , division , print_function <EOL> from gensim import models <EOL> from dossier . models . openquery . google import Google <EOL> import dossier . web as web <EOL> class Config ( web . Config ) : <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( Config , self ) . __init__ ( * args , ** kwargs ) <EOL> self . _tfidf = None <EOL> @ property <EOL> def config_name ( self ) : <EOL> return '<STR_LIT>' <EOL> def normalize_config ( self , config ) : <EOL> super ( Config , self ) . normalize_config ( config ) <EOL> try : <EOL> tfidf_path = self . config [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> self . _tfidf = False <EOL> else : <EOL> self . _tfidf = models . TfidfModel . load ( tfidf_path ) <EOL> @ property <EOL> def tfidf ( self ) : <EOL> return self . _tfidf <EOL> @ property <EOL> def google ( self ) : <EOL> api_key = self . config . get ( '<STR_LIT>' ) <EOL> if api_key is None : <EOL> return None <EOL> return Google ( api_key ) </s>
