code: def convertTrialsToResults(self, hyperparameterSpace, trials):
      results = []
      for trialIndex, trial in enumerate(trials.trials):
          data = {
              "trial": trialIndex,
              "status": trial["result"]["status"],
              "loss": trial["result"]["loss"],
              "log": "",
              "time": abs(
                  (
                      trial["book_time"] - trial["refresh_time"]
                  ).total_seconds()
              ),
          }
  
          params = trial["misc"]["vals"]
          for param in Hyperparameter(
              hyperparameterSpace
          ).getFlatParameters():
              key = param.hyperoptVariableName
  
              if len(params[key]) == 1:
                  value = params[key][0]
                  if "enum" in param.config:
                      value = param.config["enum"][value]
  
                  data[param.name] = value
              else:
                  data[param.name] = ""
  
          results.append(data)
      return results
  
imports: from hyperopt import hp
  from contextlib import contextmanager
  import re
  import functools
  import random
  import numpy
  import numpy.random
  import pkg_resources
  import tempfile
  import scipy.stats
  import os
  import math
  import hyperopt
  import datetime
  import json
  import copy
label_desc: Use image node_id 7 for calling the ATPEOptimizer obj's underlying member method code with example usage: obj.convertTrialsToResults(hyperparameterSpace, trials) and returns: results