src/pybel/tokens.py
def _variant_po_to_dict(tokens) -> CentralDogma:
    """Convert a PyParsing data dictionary to a central dogma abundance (i.e., Protein, RNA, miRNA, Gene).

    :type tokens: ParseResult
    """
    dsl = FUNC_TO_DSL.get(tokens[FUNCTION])
    if dsl is None:
        raise ValueError('invalid tokens: {}'.format(tokens))

    concept = tokens[CONCEPT]
    return dsl(
        namespace=concept[NAMESPACE],
        name=concept[NAME],
        identifier=concept.get(IDENTIFIER),
        xrefs=tokens.get(XREFS),
        variants=[
            _variant_to_dsl_helper(variant_tokens)
            for variant_tokens in tokens[VARIANTS]
        ],
    )
Convert a PyParsing data dictionary to a central dogma abundance (i.e., Protein, RNA, miRNA, Gene).

    :type tokens: ParseResult
    
Convert a PyParsing data dictionary to a central dogma abundance .
Convert a PyParsing data dictionary to a central dogma abundance .
def _variant_po_to_dict(tokens) -> CentralDogma:
    dsl = FUNC_TO_DSL.get(tokens[FUNCTION])
    if dsl is None:
        raise ValueError('invalid tokens: {}'.format(tokens))
    concept = tokens[CONCEPT]
    return dsl(
        namespace=concept[NAMESPACE],
        name=concept[NAME],
        identifier=concept.get(IDENTIFIER),
        xrefs=tokens.get(XREFS),
        variants=[
            _variant_to_dsl_helper(variant_tokens)
            for variant_tokens in tokens[VARIANTS]
        ],
    )
def _variant_po_to_dict ( tokens ) -> CentralDogma : dsl = FUNC_TO_DSL . get ( tokens [ FUNCTION ] ) if dsl is None : raise ValueError ( 'invalid tokens: {}' . format ( tokens ) ) concept = tokens [ CONCEPT ] return dsl ( namespace = concept [ NAMESPACE ] , name = concept [ NAME ] , identifier = concept . get ( IDENTIFIER ) , xrefs = tokens . get ( XREFS ) , variants = [ _variant_to_dsl_helper ( variant_tokens ) for variant_tokens in tokens [ VARIANTS ] ] , )
Convert a PyParsing data dictionary to a central dogma abundance (i.e., Protein, RNA, miRNA, Gene).
Convert a PyParsing data dictionary to a central dogma abundance ( i . e . Protein RNA miRNA Gene ) .
"""Convert a PyParsing data dictionary to a central dogma abundance (i.e., Protein, RNA, miRNA, Gene).

    :type tokens: ParseResult
    """
tokens