class_docstr: Consume a trial by using it to initialize a black-box box to evaluate it.
  
  It uses an `Experiment` object to push an evaluated trial, if results are
  delivered to the worker process successfully.
  
  It forks another process which executes user's script with the suggested
  options. It expects results to be written in a **JSON** file, whose path
  has been defined in a special orion environmental variable which is set
  into the child process' environment.
  
  Parameters
  ----------
  experiment: `orion.core.worker.experiment.Experiment`
      Manager of this experiment, provides convenient interface for interacting with
      the database.
  
  heartbeat: int, optional
      Frequency (seconds) at which the heartbeat of the trial is updated.
      If the heartbeat of a `reserved` trial is larger than twice the configured
      heartbeat, Oríon will reset the status of the trial to `interrupted`.
      This allows restoring lost trials (ex: due to killed worker).
      Defaults to ``orion.core.config.worker.heartbeat``.
  
  user_script_config: str, optional
      Config argument name of user's script (--config).
      Defaults to ``orion.core.config.worker.user_script_config``.
  
  interrupt_signal_code: int, optional
      Signal returned by user script to signal to Oríon that it was interrupted.
      Defaults to ``orion.core.config.worker.interrupt_signal_code``.
docstr: Execute user's script as a block box using the options contained
  within ``trial``.
  
  Parameters
  ----------
  trial: `orion.core.worker.trial.Trial`
      Orion trial to execute.
  
  Returns
  -------
  bool
      True if the trial was successfully executed. False if the trial is broken.
docstr_tok: ["Execute","user","'s","script","as","a","block","box","using","the","options","contained","within","``","trial","``",".","Parameters","--","--","--","--","--","trial",":","`","orion.core.worker.trial.Trial","`","Orion","trial","to","execute",".","Returns","--","--","--","-","bool","True","if","the","trial","was","successfully","executed",".","False","if","the","trial","is","broken","."]
code: def __call__(self, trial, **kwargs):
      """Execute user's script as a block box using the options contained
      within ``trial``.
  
      Parameters
      ----------
      trial: `orion.core.worker.trial.Trial`
          Orion trial to execute.
  
      Returns
      -------
      bool
          True if the trial was successfully executed. False if the trial is broken.
  
      """
      log.debug("Consumer context: %s", trial.working_dir)
      results_file = self._consume(trial, trial.working_dir)
  
      log.debug(
          "Parsing results from file and fill corresponding Trial object."
      )
      results = self.retrieve_results(results_file)
  
      return results
  
imports: import copy
  import json
  import logging
  import os
  import subprocess
  import tempfile
  import orion.core
  from orion.core.io.convert import JSONConverter
  from orion.core.io.orion_cmdline_parser import OrionCmdlineParser
  from orion.core.io.resolve_config import infer_versioning_metadata
  from orion.core.utils.exceptions import BranchingEvent, InexecutableUserScript, MissingResultFile
label_desc: Use image node_id 2 for calling the Consumer obj's underlying member method code with example usage: obj.__call__(trial) and returns: results