code: def _process_otmann_kernel_params(
      dom_idx, options, kernel_params_for_each_domain, dist_computers
  ):
      """Preprocesses the structural and mislabel coefficients for domain in dom_idx."""
      # First check if dist_type and kernel_type are consistent ----------------------------
      otmann_dist_type = options.otmann_dist_type
      otmann_kernel_type = options.otmann_kernel_type
      otmann_choose_mislabel_struct_coeffs = (
          options.otmann_choose_mislabel_struct_coeffs
      )
      otmann_mislabel_coeffs = options.otmann_mislabel_coeffs
      otmann_struct_coeffs = options.otmann_struct_coeffs
      if (
          otmann_dist_type in ["lp", "emd"]
          and otmann_kernel_type != otmann_dist_type
      ):
          raise ValueError(
              "If dist_type is %s, then kernel_type should be %s."
              % (otmann_dist_type, otmann_dist_type)
          )
      elif otmann_dist_type == "lp-emd" and otmann_kernel_type not in [
          "lpemd_prod",
          "lpemd_sum",
      ]:
          raise ValueError(
              "If otmann_dist_type is lp-emd, then otmann_kernel_type should "
              + "be lpemd_sum or lpemd_prod."
          )
      # Check if the mislabel/struct coeffs are give as appropriate
      if otmann_choose_mislabel_struct_coeffs == "use_given" and (
          otmann_mislabel_coeffs == "" or otmann_struct_coeffs == ""
      ):
          raise ValueError(
              (
                  "If choose_mislabel_struct_coeffs is use_given, then "
                  + "mislabel_coeffs and struct_coeffs cannot be empty. Given mislabel_coeffs=%s,"
                  + " struct_coeffs=%s"
              )
              % (otmann_mislabel_coeffs, otmann_struct_coeffs)
          )
      # Now process the mislabel and struct coeffs -----------------------------------------
      if otmann_choose_mislabel_struct_coeffs == "tune_coeffs":
          # If they are integers or floats
          otmann_num_mislabel_struct_coeffs = 1
          otmann_to_tune_mislabel_struct_coeffs = True
      elif (
          isinstance(otmann_mislabel_coeffs, list)
          and isinstance(otmann_struct_coeffs, list)
      ) or (
          isinstance(otmann_mislabel_coeffs, str)
          and isinstance(otmann_struct_coeffs, str)
      ):
          # If they are lists or strings
          if isinstance(otmann_mislabel_coeffs, str):
              # If they are strings, obtain the lists
              otmann_mislabel_coeffs = [
                  float(x) for x in otmann_mislabel_coeffs.split("-")
              ]
              otmann_struct_coeffs = [
                  float(x) for x in otmann_struct_coeffs.split("-")
              ]
          else:
              otmann_mislabel_coeffs = otmann_mislabel_coeffs
              otmann_struct_coeffs = otmann_struct_coeffs
          # Other parameters
          otmann_num_mislabel_struct_coeffs = len(
              otmann_mislabel_coeffs
          )
          otmann_to_tune_mislabel_struct_coeffs = False
          # Check if the lengths are the same
          if len(otmann_mislabel_coeffs) != len(otmann_struct_coeffs):
              raise ValueError(
                  "Length of mislabel and structural coefficients must be same."
                  + "Given: mislabel: %s (%d), struct:%s (%d)."
                  % (
                      str(otmann_mislabel_coeffs),
                      len(otmann_mislabel_coeffs),
                      str(otmann_struct_coeffs),
                      len(otmann_struct_coeffs),
                  )
              )
      else:
          raise ValueError(
              "Bad format for mislabel and structural coefficients."
              + "Given: mislabel: %s, struct:%s."
              % (str(otmann_mislabel_coeffs), str(otmann_struct_coeffs))
          )
      # Now store them in kernel_params_for_each_domain ------------------------------------
      kernel_params_for_each_domain[
          dom_idx
      ].otmann_mislabel_coeffs = otmann_mislabel_coeffs
      kernel_params_for_each_domain[
          dom_idx
      ].otmann_struct_coeffs = otmann_struct_coeffs
      kernel_params_for_each_domain[
          dom_idx
      ].otmann_num_mislabel_struct_coeffs = (
          otmann_num_mislabel_struct_coeffs
      )
      kernel_params_for_each_domain[
          dom_idx
      ].otmann_to_tune_mislabel_struct_coeffs = (
          otmann_to_tune_mislabel_struct_coeffs
      )
      kernel_params_for_each_domain[
          dom_idx
      ].otmann_choose_mislabel_struct_coeffs = (
          otmann_choose_mislabel_struct_coeffs
      )
      kernel_params_for_each_domain[
          dom_idx
      ].otmann_dist_type = otmann_dist_type
      kernel_params_for_each_domain[
          dom_idx
      ].otmann_kernel_type = otmann_kernel_type
      # store other parameters from options
      kernel_params_for_each_domain[
          dom_idx
      ].otmann_lp_power = options.otmann_lp_power
      kernel_params_for_each_domain[
          dom_idx
      ].otmann_emd_power = options.otmann_emd_power
      kernel_params_for_each_domain[
          dom_idx
      ].otmann_non_assignment_penalty = (
          options.otmann_non_assignment_penalty
      )
      # Add the distance computer
      kernel_params_for_each_domain[
          dom_idx
      ].otmann_distance_computer = dist_computers[dom_idx]
  
imports: from __future__ import print_function
  from argparse import Namespace
  import numpy
  from ..exd import domains
  from ..exd.cp_domain_utils import load_cp_domain_from_config_file
  from .None import gp_core, mf_gp
  from .euclidean_gp import get_euclidean_integral_gp_kernel_with_scale, prep_euclidean_integral_kernel_hyperparams
  from .kernel import CartesianProductKernel, HammingKernel
  from ..utils.general_utils import get_idxs_from_list_of_lists
  from ..utils.option_handler import get_option_specs, load_options
  from ..utils.reporters import get_reporter
label_desc: Use image node_id 9 for calling a global function with example usage: _process_otmann_kernel_params(dom_idx, options, kernel_params_for_each_domain, dist_computers) without return types