code: def is_charge_balanced(reaction):
      
      charge = 0
      for metabolite, coefficient in iteritems(reaction.metabolites):
          if metabolite.charge is None:
              return False
          charge += coefficient * metabolite.charge
      return charge == 0
docs: Confirm that a reaction is charge balanced.