code: def calculate_performance(all_data):
      """
      Calculates the performance metrics as found in "benchmarks" folder of
      scikit-optimize and prints them in console.
  
      Parameters
      ----------
      * `all_data`: dict
          Traces data collected during run of algorithms. For more details, see
          'evaluate_optimizer' function.
      """
  
      sorted_traces = defaultdict(list)
  
      for model in all_data:
          for dataset in all_data[model]:
              for algorithm in all_data[model][dataset]:
                  data = all_data[model][dataset][algorithm]
  
                  # leave only best objective values at particular iteration
                  best = [[v[-1] for v in d] for d in data]
  
                  supervised_learning_type = (
                      "Regression"
                      if ("Regressor" in model)
                      else "Classification"
                  )
  
                  # for every item in sorted_traces it is 2d array, where first dimension corresponds to
                  # particular repeat of experiment, and second dimension corresponds to index
                  # of optimization step during optimization
                  key = (algorithm, supervised_learning_type)
                  sorted_traces[key].append(best)
  
      # calculate averages
      for key in sorted_traces:
          # the meta objective: average over multiple tasks
          mean_obj_vals = np.mean(sorted_traces[key], axis=0)
  
          minimums = np.min(mean_obj_vals, axis=1)
          f_calls = np.argmin(mean_obj_vals, axis=1)
  
          min_mean = np.mean(minimums)
          min_stdd = np.std(minimums)
          min_best = np.min(minimums)
  
          f_mean = np.mean(f_calls)
          f_stdd = np.std(f_calls)
          f_best = np.min(f_calls)
  
          def fmt(float_value):
              return "%.3f" % float_value
  
          output = (
              str(key[0])
              + " | "
              + " | ".join(
                  [fmt(min_mean) + " +/- " + fmt(min_stdd)]
                  + [fmt(v) for v in [min_best, f_mean, f_stdd, f_best]]
              )
          )
          result = table_template + output
          print("")
          print(key[1])
          print(result)
  
imports: from collections import defaultdict
  from datetime import datetime
  import json
  import sys
  import math
  from joblib import delayed
  from joblib import Parallel
  import numpy
  from sklearn.base import ClassifierMixin
  from sklearn.base import RegressorMixin
  from sklearn.datasets import fetch_california_housing
  from sklearn.datasets import fetch_mldata
  from sklearn.datasets import load_boston
  from sklearn.datasets import load_digits
  from sklearn.model_selection import train_test_split
  from sklearn.preprocessing import StandardScaler
  from sklearn.svm import SVC
  from sklearn.svm import SVR
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.tree import DecisionTreeRegressor
  from sklearn.neural_network import MLPClassifier
  from sklearn.neural_network import MLPRegressor
  from sklearn.metrics import r2_score
  from sklearn.metrics import log_loss
  from skopt import gbrt_minimize
  from skopt import gp_minimize
  from skopt import forest_minimize
  from skopt.space import Categorical
  from skopt.space import Integer
  from skopt.space import Real
label_desc: Use image node_id 6 for calling a global function with example usage: calculate_performance(all_data) and returns: unknown