code: def json2space(x, oldy=None, name=NodeType.ROOT):
      """
      Change search space from json format to hyperopt format
  
      """
      y = list()
      if isinstance(x, dict):
          if NodeType.TYPE in x.keys():
              _type = x[NodeType.TYPE]
              name = name + "-" + _type
              if _type == "choice":
                  if oldy is not None:
                      _index = oldy[NodeType.INDEX]
                      y += json2space(
                          x[NodeType.VALUE][_index],
                          oldy[NodeType.VALUE],
                          name=name + "[%d]" % _index,
                      )
                  else:
                      y += json2space(
                          x[NodeType.VALUE], None, name=name
                      )
              y.append(name)
          else:
              for key in x.keys():
                  y += json2space(
                      x[key],
                      oldy[key] if oldy else None,
                      name + "[%s]" % str(key),
                  )
      elif isinstance(x, list):
          for i, x_i in enumerate(x):
              if isinstance(x_i, dict):
                  if NodeType.NAME not in x_i.keys():
                      raise RuntimeError(
                          "'_name' key is not found in this nested search space."
                      )
              y += json2space(
                  x_i, oldy[i] if oldy else None, name + "[%d]" % i
              )
      return y
  
imports: import copy
  from enum import Enum, unique
  from pathlib import Path
  from schema import And
  from .None import parameter_expressions
label_desc: Use image node_id 5 for calling a global function with example usage: json2space(x, oldy, name) and returns: y