code: def _try_crossover(
      parents: List[FrozenTrial],
      crossover: BaseCrossover,
      study: Study,
      rng: np.random.RandomState,
      swapping_prob: float,
      categorical_search_space: Dict[str, BaseDistribution],
      numerical_search_space: Dict[str, BaseDistribution],
      numerical_transform: Optional[_SearchSpaceTransform],
  ) -> Dict[str, Any]:
      child_params: Dict[str, Any] = {}
  
      if len(categorical_search_space) > 0:
          parents_categorical_params = np.array(
              [
                  [parent.params[p] for p in categorical_search_space]
                  for parent in [parents[0], parents[-1]]
              ],
              dtype=object,
          )
  
          child_categorical_array = (
              _inlined_categorical_uniform_crossover(
                  parents_categorical_params,
                  rng,
                  swapping_prob,
                  categorical_search_space,
              )
          )
          child_categorical_params = {
              param: value
              for param, value in zip(
                  categorical_search_space, child_categorical_array
              )
          }
          child_params.update(child_categorical_params)
  
      if numerical_transform is None:
          return child_params
  
      # The following is applied only for numerical parameters.
      parents_numerical_params = np.stack(
          [
              numerical_transform.transform(
                  {
                      param_key: parent.params[param_key]
                      for param_key in numerical_search_space.keys()
                  }
              )
              for parent in parents
          ]
      )  # Parent individual with NUMERICAL_DISTRIBUTIONS parameter.
  
      child_numerical_array = crossover.crossover(
          parents_numerical_params,
          rng,
          study,
          numerical_transform.bounds,
      )
      child_numerical_params = numerical_transform.untransform(
          child_numerical_array
      )
      child_params.update(child_numerical_params)
  
      return child_params
  
imports: from typing import Any
  from typing import Callable
  from typing import Dict
  from typing import List
  from typing import Optional
  from typing import Sequence
  import numpy
  from optuna._transform import _SearchSpaceTransform
  from optuna.distributions import BaseDistribution
  from optuna.distributions import FloatDistribution
  from optuna.distributions import IntDistribution
  from optuna.samplers.nsgaii._crossovers._base import BaseCrossover
  from optuna.study import Study
  from optuna.study import StudyDirection
  from optuna.trial import FrozenTrial
label_desc: Use image node_id 1 for calling a global function with example usage: _try_crossover(parents, crossover, study, rng, swapping_prob, categorical_search_space, numerical_search_space, numerical_transform) and returns: child_params, child_params