src/pybel/parser/parse_bel.py
def modifier_po_to_dict(tokens):
    """Get the location, activity, and/or transformation information as a dictionary.

    :return: a dictionary describing the modifier
    :rtype: dict
    """
    attrs = {}

    if LOCATION in tokens:
        attrs[LOCATION] = dict(tokens[LOCATION])

    if MODIFIER not in tokens:
        return attrs

    if tokens[MODIFIER] == DEGRADATION:
        attrs[MODIFIER] = tokens[MODIFIER]

    elif tokens[MODIFIER] == ACTIVITY:
        attrs[MODIFIER] = tokens[MODIFIER]

        if EFFECT in tokens:
            attrs[EFFECT] = dict(tokens[EFFECT])

    elif tokens[MODIFIER] == TRANSLOCATION:
        attrs[MODIFIER] = tokens[MODIFIER]

        if EFFECT in tokens:
            try:
                attrs[EFFECT] = tokens[EFFECT].asDict()
            except AttributeError:  # for when it was auto-upgraded
                attrs[EFFECT] = dict(tokens[EFFECT])

    elif tokens[MODIFIER] == CELL_SECRETION:
        attrs[MODIFIER] = TRANSLOCATION
        attrs[EFFECT] = {
            FROM_LOC: language.intracellular,
            TO_LOC: language.extracellular,
        }

    elif tokens[MODIFIER] == CELL_SURFACE_EXPRESSION:
        attrs[MODIFIER] = TRANSLOCATION
        attrs[EFFECT] = {
            FROM_LOC: language.intracellular,
            TO_LOC: language.cell_surface,
        }

    else:
        raise ValueError('Invalid value for tokens[MODIFIER]: {}'.format(tokens[MODIFIER]))

    return attrs
Get the location, activity, and/or transformation information as a dictionary.

    :return: a dictionary describing the modifier
    :rtype: dict
    
Get the location, activity, and/or transformation information as a dictionary.
Get the location activity and / or transformation information as a dictionary .
def modifier_po_to_dict(tokens):
    attrs = {}
    if LOCATION in tokens:
        attrs[LOCATION] = dict(tokens[LOCATION])
    if MODIFIER not in tokens:
        return attrs
    if tokens[MODIFIER] == DEGRADATION:
        attrs[MODIFIER] = tokens[MODIFIER]
    elif tokens[MODIFIER] == ACTIVITY:
        attrs[MODIFIER] = tokens[MODIFIER]
        if EFFECT in tokens:
            attrs[EFFECT] = dict(tokens[EFFECT])
    elif tokens[MODIFIER] == TRANSLOCATION:
        attrs[MODIFIER] = tokens[MODIFIER]
        if EFFECT in tokens:
            try:
                attrs[EFFECT] = tokens[EFFECT].asDict()
            except AttributeError:  
                attrs[EFFECT] = dict(tokens[EFFECT])
    elif tokens[MODIFIER] == CELL_SECRETION:
        attrs[MODIFIER] = TRANSLOCATION
        attrs[EFFECT] = {
            FROM_LOC: language.intracellular,
            TO_LOC: language.extracellular,
        }
    elif tokens[MODIFIER] == CELL_SURFACE_EXPRESSION:
        attrs[MODIFIER] = TRANSLOCATION
        attrs[EFFECT] = {
            FROM_LOC: language.intracellular,
            TO_LOC: language.cell_surface,
        }
    else:
        raise ValueError('Invalid value for tokens[MODIFIER]: {}'.format(tokens[MODIFIER]))
    return attrs
def modifier_po_to_dict ( tokens ) : attrs = { } if LOCATION in tokens : attrs [ LOCATION ] = dict ( tokens [ LOCATION ] ) if MODIFIER not in tokens : return attrs if tokens [ MODIFIER ] == DEGRADATION : attrs [ MODIFIER ] = tokens [ MODIFIER ] elif tokens [ MODIFIER ] == ACTIVITY : attrs [ MODIFIER ] = tokens [ MODIFIER ] if EFFECT in tokens : attrs [ EFFECT ] = dict ( tokens [ EFFECT ] ) elif tokens [ MODIFIER ] == TRANSLOCATION : attrs [ MODIFIER ] = tokens [ MODIFIER ] if EFFECT in tokens : try : attrs [ EFFECT ] = tokens [ EFFECT ] . asDict ( ) except AttributeError : attrs [ EFFECT ] = dict ( tokens [ EFFECT ] ) elif tokens [ MODIFIER ] == CELL_SECRETION : attrs [ MODIFIER ] = TRANSLOCATION attrs [ EFFECT ] = { FROM_LOC : language . intracellular , TO_LOC : language . extracellular , } elif tokens [ MODIFIER ] == CELL_SURFACE_EXPRESSION : attrs [ MODIFIER ] = TRANSLOCATION attrs [ EFFECT ] = { FROM_LOC : language . intracellular , TO_LOC : language . cell_surface , } else : raise ValueError ( 'Invalid value for tokens[MODIFIER]: {}' . format ( tokens [ MODIFIER ] ) ) return attrs
Get the location, activity, and/or transformation information as a dictionary.
Get the location activity and / or transformation information as a dictionary .
"""Get the location, activity, and/or transformation information as a dictionary.

    :return: a dictionary describing the modifier
    :rtype: dict
    """ # for when it was auto-upgraded
a dictionary describing the modifier
a dictionary describing the modifier
dict
tokens