code: def unpack_hyperopt_vals(vals):
      """
      Unpack values from a hyperopt return dictionary where values are wrapped in a list.
      :param vals: dict
      :return: dict
          copy of the dictionary with unpacked values
      """
      assert isinstance(vals, dict), "Parameter must be given as dict."
      ret = {}
      for k, v in list(vals.items()):
          try:
              ret[k] = v[0]
          except (TypeError, IndexError):
              ret[k] = v
      return ret
  
imports: import ast
  import re
  import warnings
  from operator import attrgetter
  from hyperopt import space_eval
label_desc: Use image node_id 8 for calling a global function with example usage: unpack_hyperopt_vals(vals) and returns: ret