code: def from_dict(cls, d):
          
          charge = d.pop('charge')
          composition = Composition(d)
          return Ion(composition, charge)
docs: Generates an ion object from a dict created by as_dict().
  
          Args:
              d:
                  {symbol: amount} dict.