code: def spa_tmplt_engine(htilde, kmin, phase_order, delta_f, piM, pfaN,
                       pfa2, pfa3, pfa4, pfa5, pfl5,
                       pfa6, pfl6, pfa7, amp_factor):
      
      err_msg = "This function is a stub that should be overridden using the "
      err_msg += "scheme. You shouldn't be seeing this error!"
      raise ValueError(err_msg)
docs: Calculate the spa tmplt phase