class_docstr: This is the base class for all optimization algorithms. These are the core algorithms which produce
  recommendations on what to try next.
code: def convertResultsToTrials(self, hyperparameterSpace, results):
      trials = hyperopt.Trials()
  
      for resultIndex, result in enumerate(results):
          data = {
              "book_time": datetime.datetime.now(),
              "exp_key": None,
              "misc": {
                  "cmd": ("domain_attachment", "FMinIter_Domain"),
                  "idxs": {},
                  "tid": resultIndex,
                  "vals": {},
                  "workdir": None,
              },
              "owner": None,
              "refresh_time": datetime.datetime.now(),
              "result": {
                  "loss": result["loss"],
                  "status": result["status"],
              },
              "spec": None,
              "state": 2,
              "tid": resultIndex,
              "version": 0,
          }
  
          for param in Hyperparameter(
              hyperparameterSpace
          ).getFlatParameters():
              value = result[param.name]
              if value is not "" and value is not None:
                  if "enum" in param.config:
                      value = param.config["enum"].index(value)
  
                  data["misc"]["idxs"][param.hyperoptVariableName] = [
                      resultIndex
                  ]
                  data["misc"]["vals"][param.hyperoptVariableName] = [
                      value
                  ]
              else:
                  data["misc"]["idxs"][param.hyperoptVariableName] = []
                  data["misc"]["vals"][param.hyperoptVariableName] = []
  
          trials.insert_trial_doc(data)
      return trials
  
file_path: hypermax/hypermax/algorithms/optimization_algorithm_base.py
imports: import hyperopt
  import datetime
  from hypermax.hyperparameter import Hyperparameter
  import json
  import copy
  from pprint import pprint
label_desc: Use image node_id 2 for calling the OptimizationAlgorithmBase obj's underlying member method code with example usage: obj.convertResultsToTrials(hyperparameterSpace, results) and returns: trials