<s> """<STR_LIT>""" <EOL> class Factory ( object ) : <EOL> def __init__ ( self , client ) : <EOL> self . client = client <EOL> def build_element_proxy ( self , element_class , index_class , index_name = None ) : <EOL> proxy_class = element_class . get_proxy_class ( ) <EOL> element_proxy = proxy_class ( element_class , self . client ) <EOL> primary_index = self . get_index ( element_class , index_class , index_name ) <EOL> element_proxy . index = primary_index <EOL> return element_proxy <EOL> def get_index ( self , element_class , index_class , index_name = None ) : <EOL> if index_name is None : <EOL> index_name = element_class . get_index_name ( self . client . config ) <EOL> index_proxy = self . build_index_proxy ( element_class , index_class ) <EOL> index = index_proxy . get_or_create ( index_name ) <EOL> return index <EOL> def build_index_proxy ( self , element_class , index_class ) : <EOL> base_type = element_class . get_base_type ( ) <EOL> proxy_class = index_class . get_proxy_class ( base_type ) <EOL> index_proxy = proxy_class ( index_class , self . client ) <EOL> return index_proxy </s>
