code: def _inlined_categorical_uniform_crossover(
      parent_params: np.ndarray,
      rng: np.random.RandomState,
      swapping_prob: float,
      search_space: Dict[str, BaseDistribution],
  ) -> np.ndarray:
      # We can't use uniform crossover implementation of `BaseCrossover` for
      # parameters from `CategoricalDistribution`, since categorical params are
      # passed to crossover untransformed, which is not what `BaseCrossover`
      # implementations expect.
      n_categorical_params = len(search_space)
      masks = (rng.rand(n_categorical_params) >= swapping_prob).astype(
          int
      )
      return parent_params[masks, range(n_categorical_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 6 for calling a global function with example usage: _inlined_categorical_uniform_crossover(parent_params, rng, swapping_prob, search_space) and returns: parent_params