class_docstr: Run the optimization process given the current executor
class_docstr_tok: ["Run","the","optimization","process","given","the","current","executor"]
docstr: Sample new trials for all free workers
docstr_tok: ["Sample","new","trials","for","all","free","workers"]
code: def sample(self):
      """Sample new trials for all free workers"""
      n_trial = self.should_sample()
  
      if n_trial > 0:
          # the producer does the job of limiting the number of new trials
          # already no need to worry about it
          # NB: suggest reserve the trial already
          new_trials = self._suggest_trials(n_trial)
          log.debug(f"Sampled {len(new_trials)} new configs")
          return new_trials
  
      return []
  
imports: from __future__ import annotations
  import logging
  import os
  import shutil
  import signal
  import time
  import typing
  import warnings
  from contextlib import contextmanager
  from dataclasses import dataclass
  from typing import Callable
  import orion.core
  from orion.core.utils import backward
  from orion.core.utils.exceptions import BrokenExperiment, CompletedExperiment, InvalidResult, LazyWorkers, ReservationRaceCondition, WaitingForTrials
  from orion.core.utils.flatten import flatten, unflatten
  from orion.core.worker.consumer import ExecutionError
  from orion.core.worker.trial import AlreadyReleased
  from orion.executor.base import AsyncException, AsyncResult
  from orion.storage.base import LockAcquisitionTimeout
label_desc: Use image node_id 10 for calling the Runner obj's underlying member method code with example usage: obj.sample() and returns: list, new_trials