code: def workon(
      experiment,
      n_workers=None,
      pool_size=None,
      max_trials=None,
      max_broken=None,
      max_idle_time=None,
      heartbeat=None,
      user_script_config=None,
      interrupt_signal_code=None,
      ignore_code_changes=None,
      executor=None,
      executor_configuration=None,
      idle_timeout=None,
  ):
      """Try to find solution to the search problem defined in `experiment`."""
  
      # NOTE: Remove in v0.3.0
      if max_idle_time is not None and idle_timeout is None:
          idle_timeout = max_idle_time
  
      consumer = Consumer(
          experiment,
          user_script_config,
          interrupt_signal_code,
          ignore_code_changes,
      )
  
      client = ExperimentClient(experiment, heartbeat=heartbeat)
  
      if executor is None:
          executor = orion.core.config.worker.executor
  
      if executor_configuration is None:
          executor_configuration = (
              orion.core.config.worker.executor_configuration
          )
  
      log.debug("Starting workers")
      with client.tmp_executor(
          executor, n_workers=n_workers, **executor_configuration
      ):
          try:
              client.workon(
                  consumer,
                  n_workers=n_workers,
                  pool_size=pool_size,
                  max_trials_per_worker=max_trials,
                  max_broken=max_broken,
                  trial_arg="trial",
                  on_error=on_error,
                  idle_timeout=idle_timeout,
              )
          except BrokenExperiment as e:
              print(e)
  
      if client.is_done:
          print("Search finished successfully")
  
      print("\n" + format_stats(client))
  
      print("\n" + COMPLETION_MESSAGE.format(experiment=client))
      if not experiment.is_done:
          print(NONCOMPLETED_MESSAGE.format(experiment=client))
  
file_path: orion/src/orion/core/cli/hunt.py
imports: from __future__ import annotations
  import logging
  import orion.core
  from orion.client.experiment import ExperimentClient
  from orion.core.cli import base
  from orion.core.cli import evc
  from orion.core.io import experiment_builder
  from orion.core.utils import sigterm_as_interrupt
  from orion.core.utils.exceptions import BrokenExperiment, InexecutableUserScript, MissingResultFile
  from orion.core.utils.format_terminal import format_stats
  from orion.core.worker.consumer import Consumer
label_desc: Use image node_id 3 for calling a global function with example usage: workon(experiment, n_workers, pool_size, max_trials, max_broken, max_idle_time, heartbeat, user_script_config, interrupt_signal_code, ignore_code_changes, executor, executor_configuration, idle_timeout) without return types