code: def get_energy(self, composition, strict=True):
          
          if strict and set(composition.keys()) > set(self.keys()):
              s = set(composition.keys()) - set(self.keys())
              raise ValueError("Potentials not specified for {}".format(s))
          return sum(self.get(k, 0) * v for k, v in composition.items())
docs: Calculates the energy of a composition.
          
          Args:
              composition (Composition): input composition
              strict (bool): Whether all potentials must be specified