code: def _set_up_nn_domain_otmann(
      dom_idx,
      dom,
      dom_identifier,
      curr_dom_Xs,
      options,
      cts_hp_bounds,
      param_order,
      kernel_params_for_each_domain,
      dist_computers,
      lists_of_dists,
  ):
      """Set up for NN Domain."""
      _process_otmann_kernel_params(
          dom_idx,
          options,
          kernel_params_for_each_domain,
          dist_computers,
      )
      # Check if we need to pre-compute distances -----------------------------------------
      if (
          options.otmann_choose_mislabel_struct_coeffs == "use_given"
          and kernel_params_for_each_domain[dom_idx].list_of_dists
          is None
      ):
          # Then compute the distances
          if dist_computers[dom_idx] is None:
              from ..nn.otmann import (
                  get_otmann_distance_computer_from_args,
              )
  
              curr_dist_computer = (
                  get_otmann_distance_computer_from_args(
                      dom.nn_type,
                      options.otmann_non_assignment_penalty,
                      kernel_params_for_each_domain[
                          dom_idx
                      ].otmann_mislabel_coeffs,
                      kernel_params_for_each_domain[
                          dom_idx
                      ].otmann_struct_coeffs,
                      kernel_params_for_each_domain[
                          dom_idx
                      ].otmann_dist_type,
                  )
              )
          else:
              curr_dist_computer = dist_computers[dom_idx]
          # Add the current distance computer to dist_computers
          kernel_params_for_each_domain[
              dom_idx
          ].otmann_distance_computer = curr_dist_computer
          dist_computers[dom_idx] = curr_dist_computer
          # Now compute lists of dists
          curr_list_of_dists = curr_dist_computer(
              curr_dom_Xs, curr_dom_Xs
          )
          kernel_params_for_each_domain[
              dom_idx
          ].list_of_dists = curr_list_of_dists
          lists_of_dists[dom_idx] = curr_list_of_dists
      # Create bounds here ----------------------------------------------------------------
      # 1. Relative weights for LP/EMD terms
      if (
          kernel_params_for_each_domain[dom_idx].otmann_kernel_type
          == "lpemd_sum"
      ):
          cts_hp_bounds.append(
              [0, 1]
          )  # controls relative weighting of each term
          param_order.append(
              [dom_identifier + "-lp_emd_tradeoff", "cts"]
          )
      # 2. Betas
      lp_beta_log_bounds = [
          [np.log(1e-9), np.log(1e-3)]
      ] * kernel_params_for_each_domain[
          dom_idx
      ].otmann_num_mislabel_struct_coeffs
      emd_beta_log_bounds = [
          [np.log(1e-1), np.log(1e2)]
      ] * kernel_params_for_each_domain[
          dom_idx
      ].otmann_num_mislabel_struct_coeffs
      if (
          kernel_params_for_each_domain[dom_idx].otmann_dist_type
          == "lp"
      ):
          all_beta_bounds = lp_beta_log_bounds
      elif (
          kernel_params_for_each_domain[dom_idx].otmann_dist_type
          == "emd"
      ):
          all_beta_bounds = emd_beta_log_bounds
      elif (
          kernel_params_for_each_domain[dom_idx].otmann_dist_type
          == "lp-emd"
      ):
          all_beta_bounds = [
              j
              for i in zip(lp_beta_log_bounds, emd_beta_log_bounds)
              for j in i
          ]
      cts_hp_bounds.extend(all_beta_bounds)
      param_order.extend(
          [
              [dom_identifier + "-beta-%d" % (idx), "cts"]
              for idx in range(len(all_beta_bounds))
          ]
      )
      # 3 & 4. mislabel/struct coeffs
      if kernel_params_for_each_domain[
          dom_idx
      ].otmann_to_tune_mislabel_struct_coeffs:
          cts_hp_bounds.append(
              [0.001, 2.0]
          )  # mislabel coefficient (not in log space)
          param_order.append(
              [dom_identifier + "-mislabel_coeff", "cts"]
          )
          cts_hp_bounds.append(
              [0.001, 2.0]
          )  # structural coefficient (not in log space)
          param_order.append([dom_identifier + "-struct_coeff", "cts"])
      return cts_hp_bounds, param_order
  
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 8 for calling a global function with example usage: _set_up_nn_domain_otmann(dom_idx, dom, dom_identifier, curr_dom_Xs, options, cts_hp_bounds, param_order, kernel_params_for_each_domain, dist_computers, lists_of_dists) and returns: cts_hp_bounds,  param_order