def __init__(self, mode=None, cache=None):
self.mode = None<EOL>if mode == '<STR_LIT>':<EOL><INDENT>self.mode = LEARN<EOL><DEDENT>elif mode == '<STR_LIT>':<EOL><INDENT>self.mode = RUN<EOL><DEDENT>elif mode == '<STR_LIT>':<EOL><INDENT>self.mode = VERIFY<EOL><DEDENT>self.cache = None<EOL>if self.mode is not None:<EOL><INDENT>if self.mode == LEARN:<EOL><INDENT>self.cache = PersistentDict(cache, flag='<STR_LIT:c>')<EOL><DEDENT>else:<EOL><INDENT>self.cache = PersistentDict(cache, flag='<STR_LIT:r>')<EOL><DEDENT><DEDENT>self.data_version = lru_cache(<EOL>maxsize=hgvs.global_config.lru_cache.maxsize, mode=self.mode,<EOL>cache=self.cache)(self.data_version)<EOL>self.schema_version = lru_cache(<EOL>maxsize=hgvs.global_config.lru_cache.maxsize, mode=self.mode,<EOL>cache=self.cache)(self.schema_version)<EOL>self.get_acs_for_protein_seq = lru_cache(<EOL>maxsize=hgvs.global_config.lru_cache.maxsize, mode=self.mode,<EOL>cache=self.cache)(self.get_acs_for_protein_seq)<EOL>self.get_gene_info = lru_cache(<EOL>maxsize=hgvs.global_config.lru_cache.maxsize, mode=self.mode,<EOL>cache=self.cache)(self.get_gene_info)<EOL>self.get_pro_ac_for_tx_ac = lru_cache(<EOL>maxsize=hgvs.global_config.lru_cache.maxsize, mode=self.mode,<EOL>cache=self.cache)(self.get_pro_ac_for_tx_ac)<EOL>self.get_seq = lru_cache(<EOL>maxsize=hgvs.global_config.lru_cache.maxsize, mode=self.mode,<EOL>cache=self.cache)(self.get_seq)<EOL>self.get_similar_transcripts = lru_cache(<EOL>maxsize=hgvs.global_config.lru_cache.maxsize, mode=self.mode,<EOL>cache=self.cache)(self.get_similar_transcripts)<EOL>self.get_tx_exons = lru_cache(<EOL>maxsize=hgvs.global_config.lru_cache.maxsize, mode=self.mode,<EOL>cache=self.cache)(self.get_tx_exons)<EOL>self.get_tx_for_gene = lru_cache(<EOL>maxsize=hgvs.global_config.lru_cache.maxsize, mode=self.mode,<EOL>cache=self.cache)(self.get_tx_for_gene)<EOL>self.get_tx_for_region = lru_cache(<EOL>maxsize=hgvs.global_config.lru_cache.maxsize, mode=self.mode,<EOL>cache=self.cache)(self.get_tx_for_region)<EOL>self.get_tx_identity_info = lru_cache(<EOL>maxsize=hgvs.global_config.lru_cache.maxsize, mode=self.mode,<EOL>cache=self.cache)(self.get_tx_identity_info)<EOL>self.get_tx_info = lru_cache(<EOL>maxsize=hgvs.global_config.lru_cache.maxsize, mode=self.mode,<EOL>cache=self.cache)(self.get_tx_info)<EOL>self.get_tx_mapping_options = lru_cache(<EOL>maxsize=hgvs.global_config.lru_cache.maxsize, mode=self.mode,<EOL>cache=self.cache)(self.get_tx_mapping_options)<EOL>def _split_version_string(v):<EOL><INDENT>versions = list(map(int, v.split("<STR_LIT:.>")))<EOL>if len(versions) < <NUM_LIT:2>:<EOL><INDENT>versions += [<NUM_LIT:0>]<EOL><DEDENT>assert len(versions) == <NUM_LIT:2><EOL>return versions<EOL><DEDENT>assert self.required_version is not None<EOL>rv = _split_version_string(self.required_version)<EOL>av = _split_version_string(self.schema_version())<EOL>if av[<NUM_LIT:0>] == rv[<NUM_LIT:0>] and av[<NUM_LIT:1>] >= rv[<NUM_LIT:1>]:<EOL><INDENT>return<EOL><DEDENT>raise RuntimeError(<EOL>"<STR_LIT>"<EOL>.format(<EOL>k=type(self).__name__,<EOL>self=self,<EOL>rv=self.required_version,<EOL>av=self.schema_version()))<EOL>
:param mode: cache mode (None[default lru cache], 'learn', 'run', 'verify')
:type mode: str
:param cache: local cache file name
:type cache: str