def create_convert_sbml_id_function(<EOL>compartment_prefix='<STR_LIT>', reaction_prefix='<STR_LIT>',<EOL>compound_prefix='<STR_LIT>', decode_id=entry_id_from_cobra_encoding):
def convert_sbml_id(entry):<EOL><INDENT>if isinstance(entry, BaseCompartmentEntry):<EOL><INDENT>prefix = compartment_prefix<EOL><DEDENT>elif isinstance(entry, BaseReactionEntry):<EOL><INDENT>prefix = reaction_prefix<EOL><DEDENT>elif isinstance(entry, BaseCompoundEntry):<EOL><INDENT>prefix = compound_prefix<EOL><DEDENT>new_id = entry.id<EOL>if decode_id is not None:<EOL><INDENT>new_id = decode_id(new_id)<EOL><DEDENT>if prefix is not None and new_id.startswith(prefix):<EOL><INDENT>new_id = new_id[len(prefix):]<EOL><DEDENT>return new_id<EOL><DEDENT>return convert_sbml_id<EOL>
Create function for converting SBML IDs.

    The returned function will strip prefixes, decode the ID using the provided
    function. These prefixes are common on IDs in SBML models because the IDs
    live in a global namespace.