def exchange_reaction(cobra_model, metabolite):
    """
    Returns the exchange reaction for a metabolite
    in a COBRA model, or None.
    """

    for rxn in metabolite.reactions:
        if not rxn.reactants or not rxn.products:
            return rxn