src/pybel/canonicalize.py
def postpend_location(bel_string: str, location_model) -> str:
    """Rip off the closing parentheses and adds canonicalized modification.

    I did this because writing a whole new parsing model for the data would be sad and difficult

    :param bel_string: BEL string representing node
    :param dict location_model: A dictionary containing keys :code:`pybel.constants.TO_LOC` and
                                :code:`pybel.constants.FROM_LOC`
    :return: A part of a BEL string representing the location
    """
    if not all(k in location_model for k in {NAMESPACE, NAME}):
        raise ValueError('Location model missing namespace and/or name keys: {}'.format(location_model))

    return "{}, loc({}:{}))".format(
        bel_string[:-1],
        location_model[NAMESPACE],
        ensure_quotes(location_model[NAME]),
    )
Rip off the closing parentheses and adds canonicalized modification.

    I did this because writing a whole new parsing model for the data would be sad and difficult

    :param bel_string: BEL string representing node
    :param dict location_model: A dictionary containing keys :code:`pybel.constants.TO_LOC` and
                                :code:`pybel.constants.FROM_LOC`
    :return: A part of a BEL string representing the location
    
Rip off the closing parentheses and adds canonicalized modification.
I did this because writing a whole new parsing model for the data would be sad and difficult
Rip off the closing parentheses and adds canonicalized modification . I did this because writing a whole new parsing model for the data would be sad and difficult
def postpend_location(bel_string: str, location_model) -> str:
    if not all(k in location_model for k in {NAMESPACE, NAME}):
        raise ValueError('Location model missing namespace and/or name keys: {}'.format(location_model))
    return "{}, loc({}:{}))".format(
        bel_string[:-1],
        location_model[NAMESPACE],
        ensure_quotes(location_model[NAME]),
    )
def postpend_location ( bel_string : str , location_model ) -> str : if not all ( k in location_model for k in { NAMESPACE , NAME } ) : raise ValueError ( 'Location model missing namespace and/or name keys: {}' . format ( location_model ) ) return "{}, loc({}:{}))" . format ( bel_string [ : - 1 ] , location_model [ NAMESPACE ] , ensure_quotes ( location_model [ NAME ] ) , )
Rip off the closing parentheses and adds canonicalized modification.
Rip off the closing parentheses and adds canonicalized modification .
"""Rip off the closing parentheses and adds canonicalized modification.

    I did this because writing a whole new parsing model for the data would be sad and difficult

    :param bel_string: BEL string representing node
    :param dict location_model: A dictionary containing keys :code:`pybel.constants.TO_LOC` and
                                :code:`pybel.constants.FROM_LOC`
    :return: A part of a BEL string representing the location
    """
A part of a BEL string representing the location
A part of a BEL string representing the location
bel_string
str
BEL string representing node
BEL string representing node
location_model
A dictionary containing keys :code:`pybel.constants.TO_LOC` and
:code:`pybel.constants.FROM_LOC`
A dictionary containing keys : code : ` pybel . constants . TO_LOC ` and : code : ` pybel . constants . FROM_LOC `