code: def get_nn_gp_kernel(
      kernel_type,
      nn_type,
      gp_cts_hps,
      gp_dscr_hps,
      tp_comp,
      kernel_options,
  ):
      """Constructs and returns the kernel hyperparams."""
      # pylint: disable=unused-argument
      kernel_hyperparams = {}
      gp_cts_hps = gp_cts_hps[:]  # create a copy of the list
      # Extract GP hyper-parameters
      # 1. Scale and alphas
      if kernel_type in ["lp", "emd", "lpemd_prod"]:
          kernel_hyperparams["scale"] = np.exp(gp_cts_hps[0])
          gp_cts_hps = gp_cts_hps[1:]
      elif kernel_type == "lpemd_sum":
          kernel_hyperparams["alphas"] = np.exp(gp_cts_hps[:2])
          gp_cts_hps = gp_cts_hps[2:]
      # 2. betas
      if kernel_options["dist_type"] in ["lp", "emd"]:
          kernel_hyperparams["betas"] = np.exp(
              gp_cts_hps[: kernel_options["num_mislabel_struct_coeffs"]]
          )
          gp_cts_hps = gp_cts_hps[
              kernel_options["num_mislabel_struct_coeffs"] :
          ]
      elif kernel_options["dist_type"] == "lp-emd":
          kernel_hyperparams["betas"] = np.exp(
              gp_cts_hps[
                  : 2 * kernel_options["num_mislabel_struct_coeffs"]
              ]
          )
          gp_cts_hps = gp_cts_hps[
              2 * kernel_options["num_mislabel_struct_coeffs"] :
          ]
      # 3 & 4. mislabel and structural coefficents
      if kernel_options["to_tune_mislabel_struct_coeffs"]:
          kernel_hyperparams["mislabel_coeffs"] = gp_cts_hps[0]
          kernel_hyperparams["struct_coeffs"] = gp_cts_hps[1]
          gp_cts_hps = gp_cts_hps[2:]
      else:
          kernel_hyperparams["mislabel_coeffs"] = kernel_options[
              "mislabel_coeffs"
          ]
          kernel_hyperparams["struct_coeffs"] = kernel_options[
              "struct_coeffs"
          ]
      # Some checks
      assert len(gp_cts_hps) == 0
      # Build the remainder of the kernel ---------------------------------
      # - powers
      lp_powers = [kernel_options["lp_power"]] * kernel_options[
          "num_mislabel_struct_coeffs"
      ]
      emd_powers = [kernel_options["emd_power"]] * kernel_options[
          "num_mislabel_struct_coeffs"
      ]
      if kernel_options["dist_type"] == "lp":
          kernel_hyperparams["powers"] = lp_powers
      elif kernel_options["dist_type"] == "emd":
          kernel_hyperparams["powers"] = emd_powers
      elif kernel_options["dist_type"] == "lp-emd":
          kernel_hyperparams["powers"] = [
              j for i in zip(lp_powers, emd_powers) for j in i
          ]
      # - non_assignment_penalty
      kernel_hyperparams["non_assignment_penalty"] = kernel_options[
          "non_assignment_penalty"
      ]
      ret = get_nn_kernel_from_args(
          kernel_type,
          nn_type,
          kernel_hyperparams,
          tp_comp,
          kernel_options["dist_type"],
      )
      return ret, gp_cts_hps, gp_dscr_hps
  
imports: import numpy
  from .None import otmann
  from ..gp import gp_core
  from ..utils.ancillary_utils import get_list_of_floats_as_str
  from ..utils.reporters import get_reporter
  from ..utils.option_handler import get_option_specs, load_options
label_desc: Use image node_id 2 for calling a global function with example usage: get_nn_gp_kernel(kernel_type, nn_type, gp_cts_hps, gp_dscr_hps, tp_comp, kernel_options) and returns: ret,  gp_cts_hps,  gp_dscr_hps