original_docstring: A function called by the HPO application to report final or intermediate
      results.
  
      Example:
  
      .. code-block:: python
  
          import time
          from flaml import tune
  
          def compute_with_config(config):
              current_time = time.time()
              metric2minimize = (round(config['x'])-95000)**2
              time2eval = time.time() - current_time
              tune.report(metric2minimize=metric2minimize, time2eval=time2eval)
  
          analysis = tune.run(
              compute_with_config,
              init_config={},
              config={
                  'x': tune.qloguniform(lower=1, upper=1000000, q=1),
                  'y': tune.randint(lower=1, upper=1000000)
              },
              metric='metric2minimize', mode='min',
              num_samples=1000000, time_budget_s=60, use_ray=False)
              
          print(analysis.trials[-1].last_result)
  
      Args:
          _metric: Optional default anonymous metric for ``tune.report(value)``.
              (For compatibility with ray.tune.report)
          **kwargs: Any key value pair to be reported.
      
docstring: A function called by the HPO application to report final or intermediate
  results.
docstring_tokens: A function called by the HPO application to report final or intermediate results .
code: def report(_metric=None, **kwargs):
      '''A function called by the HPO application to report final or intermediate
      results.
  
      Example:
  
      .. code-block:: python
  
          import time
          from flaml import tune
  
          def compute_with_config(config):
              current_time = time.time()
              metric2minimize = (round(config['x'])-95000)**2
              time2eval = time.time() - current_time
              tune.report(metric2minimize=metric2minimize, time2eval=time2eval)
  
          analysis = tune.run(
              compute_with_config,
              init_config={},
              config={
                  'x': tune.qloguniform(lower=1, upper=1000000, q=1),
                  'y': tune.randint(lower=1, upper=1000000)
              },
              metric='metric2minimize', mode='min',
              num_samples=1000000, time_budget_s=60, use_ray=False)
              
          print(analysis.trials[-1].last_result)
  
      Args:
          _metric: Optional default anonymous metric for ``tune.report(value)``.
              (For compatibility with ray.tune.report)
          **kwargs: Any key value pair to be reported.
      '''
      global _use_ray
      global _verbose
      if _use_ray:
          from ray import tune
          return tune.report(_metric, **kwargs)
      else:
          result = kwargs
          if _verbose == 2:
              logger.info(f"result: {kwargs}")
          if _metric: result['_default_anonymous_metric'] = _metric
          trial = _runner.running_trial
          result['config'] = trial.config
          for key, value in trial.config.items():
              result['config/'+key] = value
          _runner.process_trial_result(_runner.running_trial, result)
          result['time_total_s'] = trial.last_update_time - trial.start_time
          if _verbose > 2:
              logger.info(f"result: {result}")
          if _runner.running_trial.is_finished():
              return None
          else: return True
code_tokens: def report ( _metric = None , ** kwargs ) : global _use_ray global _verbose if _use_ray : from ray import tune return tune . report ( _metric , ** kwargs ) else : result = kwargs if _verbose == 2 : logger . info ( f"result: {kwargs}" ) if _metric : result [ '_default_anonymous_metric' ] = _metric trial = _runner . running_trial result [ 'config' ] = trial . config for key , value in trial . config . items ( ) : result [ 'config/' + key ] = value _runner . process_trial_result ( _runner . running_trial , result ) result [ 'time_total_s' ] = trial . last_update_time - trial . start_time if _verbose > 2 : logger . info ( f"result: {result}" ) if _runner . running_trial . is_finished ( ) : return None else : return True
short_docstring: A function called by the HPO application to report final or intermediate
  results.
short_docstring_tokens: A function called by the HPO application to report final or intermediate results .
comment: '''A function called by the HPO application to report final or intermediate
      results.
  
      Example:
  
      .. code-block:: python
  
          import time
          from flaml import tune
  
          def compute_with_config(config):
              current_time = time.time()
              metric2minimize = (round(config['x'])-95000)**2
              time2eval = time.time() - current_time
              tune.report(metric2minimize=metric2minimize, time2eval=time2eval)
  
          analysis = tune.run(
              compute_with_config,
              init_config={},
              config={
                  'x': tune.qloguniform(lower=1, upper=1000000, q=1),
                  'y': tune.randint(lower=1, upper=1000000)
              },
              metric='metric2minimize', mode='min',
              num_samples=1000000, time_budget_s=60, use_ray=False)
              
          print(analysis.trials[-1].last_result)
  
      Args:
          _metric: Optional default anonymous metric for ``tune.report(value)``.
              (For compatibility with ray.tune.report)
          **kwargs: Any key value pair to be reported.
      '''