code: def report_results(data):
      """Facilitate the reporting of results for a user's script acting as a
      black-box computation.
  
      .. warning::
  
         To be called only once in order to report a final evaluation of a particular trial.
  
      .. warning::
  
         Oríon is only minimizing. Make sure to report a metric that you seek to minimize.
  
      .. note::
  
         In case that user's script is not running in a orion's context,
         this function will act as a Python `print` function.
  
      Parameters
      ----------
      data: list of dict
          A list of dictionary representing the results in the form
          dict(name=result_name, type='statistic', value=0). The types supported are
          'objective', 'contraint', 'gradient' and 'statistic'. The list should contain at least
          one 'objective', which is the metric the algorithm will be minimizing.
  
      """
      global _HAS_REPORTED_RESULTS  # pylint:disable=global-statement
      if _HAS_REPORTED_RESULTS:
          raise RuntimeWarning(
              "Has already reported evaluation results once."
          )
      if IS_ORION_ON:
          with open(
              RESULTS_FILENAME, "w", encoding="utf8"
          ) as results_file:
              json.dump(data, results_file)
      else:
          print(data)
      _HAS_REPORTED_RESULTS = True
  
imports: import os
  import sys
  from orion.core import config
label_desc: Use image node_id 4 for calling a global function with example usage: report_results(data) without return types