code: def _energy_to_enthalpy(energy):
      """Converts energy to enthalpy.
  
      This function take the energies stored in the energy array and
      converts them to formation enthalpy.
  
      Parameters
      ---------
      energy : list of lists of floats
  
      Returns
      -------
      enthalpy : list of lists containing the enthalpies.
      """
  
      pureA = [energy[0][0], energy[0][1]]
      pureB = [energy[1][0], energy[1][1]]
      pureC = [energy[2][0], energy[2][1]]
  
      enthalpy = []
      for en in energy:
          c = en[2]
          conc = [float(i) / sum(c) for i in c]
  
          CE = _en_to_enth(en[0], conc, pureA[0], pureB[0], pureC[0])
          VASP = _en_to_enth(en[1], conc, pureA[1], pureB[1], pureC[1])
  
          enthalpy.append([CE, VASP, c])
  
      return enthalpy
  
imports: import ternary
  import matplotlib.pyplot
label_desc: Use image node_id 2 for calling a global function with example usage: _energy_to_enthalpy(energy) and returns: enthalpy