code: def _select_parent(
      study: Study,
      parent_population: Sequence[FrozenTrial],
      rng: np.random.RandomState,
      dominates: Callable[
          [FrozenTrial, FrozenTrial, Sequence[StudyDirection]], bool
      ],
  ) -> FrozenTrial:
      population_size = len(parent_population)
      candidate0 = parent_population[rng.choice(population_size)]
      candidate1 = parent_population[rng.choice(population_size)]
  
      # TODO(ohta): Consider crowding distance.
      if dominates(candidate0, candidate1, study.directions):
          return candidate0
      else:
          return candidate1
  
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 4 for calling a global function with example usage: _select_parent(study, parent_population, rng, dominates) and returns: candidate0, candidate1