def prune_unused_metabolites(cobra_model):
output_model = cobra_model.copy()<EOL>inactive_metabolites = [m for m in output_model.metabolites<EOL>if len(m.reactions) == <NUM_LIT:0>]<EOL>output_model.remove_metabolites(inactive_metabolites)<EOL>return output_model, inactive_metabolites<EOL>
Remove metabolites that are not involved in any reactions and
    returns pruned model

    Parameters
    ----------
    cobra_model: class:`~cobra.core.Model.Model` object
        the model to remove unused metabolites from

    Returns
    -------
    output_model: class:`~cobra.core.Model.Model` object
        input model with unused metabolites removed
    inactive_metabolites: list of class:`~cobra.core.reaction.Reaction`
        list of metabolites that were removed