class_docstr: Differential evolution.
  
  Default pop size equal to 30
  We return the mean of the individuals with fitness better than median, which might be stupid sometimes.
  CR =.5, F1=.8, F2=.8, curr-to-best.
  Initial population: pure random.
class_docstr_tok: ["Differential","evolution",".","Default","pop","size","equal","to","30","We","return","the","mean","of","the","individuals","with","fitness","better","than","median",",","which","might","be","stupid","sometimes",".","CR","=.5",",","F1=.8",",","F2=.8",",","curr-to-best",".","Initial","population",":","pure","random","."]
code: def _internal_ask_candidate(self) -> p.Parameter:
      if len(self.population) < self.llambda:  # initialization phase
          init = self._config.initialization
          if self.sampler is None and init == "QO":
              self.sampler = oneshot.SamplingSearch(
                  sampler="Hammersley",
                  scrambled=True,
                  opposition_mode="quasi",
              )(self.parametrization, budget=self.llambda)
          if self.sampler is None and init == "SO":
              self.sampler = oneshot.SamplingSearch(
                  sampler="Hammersley",
                  scrambled=True,
                  opposition_mode="special",
              )(self.parametrization, budget=self.llambda)
          if self.sampler is None and init not in [
              "gaussian",
              "parametrization",
          ]:
              assert init in ["LHS", "QR"]
              self.sampler = oneshot.SamplingSearch(
                  sampler=init if init == "LHS" else "Hammersley",
                  scrambled=init == "QR",
                  scale=self.scale,
              )(
                  self.parametrization,
                  budget=self.llambda,
              )
          if init == "parametrization":
              candidate = self.parametrization.sample()
          elif self.sampler is not None:
              candidate = self.sampler.ask()
          elif self._config.crossover == "voronoi":
              new_guy = (
                  self.scale * self._rng.normal(0, 1, self.dimension)
                  if len(self.population) > self.llambda / 6
                  else self.scale
                  * self._rng.normal()
                  * np.ones(self.dimension)
              )
              candidate = self.parametrization.spawn_child().set_standardized_data(
                  new_guy
              )
          else:
              new_guy = self.scale * self._rng.normal(
                  0, 1, self.dimension
              )
              candidate = self.parametrization.spawn_child().set_standardized_data(
                  new_guy
              )
          candidate.heritage["lineage"] = candidate.uid  # new lineage
          self.population[candidate.uid] = candidate
          self._uid_queue.asked.add(candidate.uid)
          return candidate
      # init is done
      lineage = self._uid_queue.ask()
      parent = self.population[lineage]
      candidate = parent.spawn_child()
      candidate.heritage[
          "lineage"
      ] = lineage  # tell-not-asked may have provided a different lineage
      data = candidate.get_standardized_data(
          reference=self.parametrization
      )
      # define all the different parents
      uids = list(self.population)
      a, b = (
          self.population[uids[self._rng.randint(self.llambda)]]
          for _ in range(2)
      )
      best = self.current_bests["pessimistic"].parameter
      # redefine the different parents in case of multiobjective optimization
      if (
          self._config.multiobjective_adaptation
          and self.num_objectives > 1
      ):
          pareto = self.pareto_front()
          # can't use choice directly on pareto, because parametrization can be iterable
          if pareto:
              best = (
                  parent
                  if parent in pareto
                  else pareto[self._rng.choice(len(pareto))]
              )
          if len(pareto) > 2:  # otherwise, not enough diversity
              a, b = (
                  pareto[idx]
                  for idx in self._rng.choice(
                      len(pareto), size=2, replace=False
                  )
              )
      # define donor
      data_a, data_b, data_best = (
          indiv.get_standardized_data(reference=self.parametrization)
          for indiv in (a, b, best)
      )
      donor = (
          data
          + self._config.F1 * (data_a - data_b)
          + self._config.F2 * (data_best - data)
      )
      candidate.parents_uids.extend([i.uid for i in (a, b)])
      # apply crossover
      co = self._config.crossover
      if co == "parametrization":
          candidate.recombine(
              self.parametrization.spawn_child().set_standardized_data(
                  donor
              )
          )
      else:
          crossovers = Crossover(
              self._rng,
              1.0 / self.dimension if co == "dimension" else co,
              self.parametrization,
          )
          crossovers.apply(donor, data)
          candidate.set_standardized_data(
              donor, reference=self.parametrization
          )
      return candidate
  
imports: import warnings
  import numpy
  import nevergrad.common.typing
  from nevergrad.parametrization import parameter
  from .None import metamodel
  from .None import base
  from .None import oneshot
label_desc: Use image node_id 4 for calling the _DE obj's underlying member method code with example usage: obj._internal_ask_candidate() and returns: candidate, candidate