class_docstr: Algorithm for regularized evolution (i.e. aging evolution).
  Follows "Algorithm 1" in Real et al. "Regularized Evolution for Image Classifier Architecture Search",
  with several enhancements.
  
  Sample in this algorithm are called *individuals*.
  Specifically, the first ``population_size`` individuals are randomly sampled from the search space,
  and the rest are generated via a selection and mutation process.
  While new individuals are added to the population, the oldest one is removed to keep the population size constant.
  
  Parameters
  ----------
  population_size
      The number of individuals to keep in the population.
  sample_size
      The number of individuals that should participate in each tournament.
      When mutate, ``sample_size`` individuals can randomly selected from the population,
      and the best one among them will be treated as the parent.
  mutation_prob
      Probability that mutation happens in each dim.
  crossover
      If ``True``, the new individual will be a crossover between winners of two individual tournament.
      That means, two sets of ``sample_size`` individuals will be randomly selected from the population,
      and the best one in each set will be used as parents.
      Every dimension will be randomly selected from one of the parents.
  dedup
      Enforce one sample to never appear twice.
      The population might be smaller than ``population_size`` if this is set to ``True`` and the search space is small.
  seed
      Random seed.
docstr: Get the best individual from a randomly sampled subset of the population.
docstr_tok: ["Get","the","best","individual","from","a","randomly","sampled","subset","of","the","population","."]
code: def best_parent(self) -> Sample:
      """Get the best individual from a randomly sampled subset of the population."""
      samples = list(self._population)
      samples = [
          samples[i]
          for i in self._random_state.permutation(len(samples))[
              : self.sample_size
          ]
      ]
      parent = max(samples, key=lambda sample: sample.y).x
      _logger.debug("Parent picked: %s", parent)
      return parent
  
imports: from __future__ import annotations
  import collections
  import dataclasses
  import logging
  import warnings
  import copy
  from typing import Deque
  from numpy.random import RandomState
  from nni.mutable import Sample, MutableAnnotation
  from nni.nas.execution import ExecutionEngine
  from nni.nas.space import ExecutableModelSpace
  from nni.typehint import TrialMetric
  from nni.nas.execution.event import ModelEvent, ModelEventType
  from .base import Strategy
  from .utils import DeduplicationHelper, RetrySamplingHelper
label_desc: Use image node_id 5 for calling the RegularizedEvolution obj's underlying member method code with example usage: obj.best_parent() and returns: parent