code: def sum_biomass_weight(reaction):
      
      return sum(-coef * met.formula_weight
                 for (met, coef) in iteritems(reaction.metabolites)) / 1000.0
docs: Compute the sum of all reaction compounds.
  
      This function expects all metabolites of the biomass reaction to have
      formula information assigned.
  
      Parameters
      ----------
      reaction : cobra.core.reaction.Reaction
          The biomass reaction of the model under investigation.
  
      Returns
      -------
      float
          The molecular weight of the biomass reaction in units of g/mmol.