code: def discrete_euclidean_mutation(x, list_of_items, uniform_prob=0.2):
      """Makes a change depending on the vector values."""
      # cdist requires 2d input
      dists = cdist([x], list_of_items)[0]
      # Exponentiate and normalise to get the probabilities.
      unnorm_diff_probs = np.exp(-dists)
      sample_diff_probs = unnorm_diff_probs / unnorm_diff_probs.sum()
      # Change the distribution to interplate between it and uniform
      n = sample_diff_probs.shape[0]
      unif = np.full(sample_diff_probs.shape, 1.0 / n)
      p = (1 - uniform_prob) * sample_diff_probs + uniform_prob * unif
      # Now draw the samples
      idxs = np.arange(n)
      idx = np.random.choice(idxs, p=p)
      ret = list_of_items[idx]
      return _return_ndarray_with_type(x, ret)
  
imports: from copy import copy
  import numpy
  from scipy.spatial.distance import cdist
  from ..exd.cp_domain_utils import get_processed_func_from_raw_func_for_cp_domain, load_cp_domain_from_config_file
  from ..exd.experiment_caller import ExperimentCaller, CPFunctionCaller
  from ..exd.worker_manager import SyntheticWorkerManager
  from ..exd.exd_utils import get_cp_domain_initial_qinfos
  from .ga_optimiser import GAOptimiser, ga_opt_args
  from ..utils.general_utils import project_to_bounds
  from ..utils.option_handler import load_options
label_desc: Use image node_id 4 for calling a global function with example usage: discrete_euclidean_mutation(x, list_of_items, uniform_prob) and returns: _return_ndarray_with_type