code: def json2vals(in_x, vals, out_y, name=NodeType.ROOT):
      if isinstance(in_x, dict):
          if NodeType.TYPE in in_x.keys():
              _type = in_x[NodeType.TYPE]
              name = name + "-" + _type
  
              try:
                  out_y[name] = vals[NodeType.INDEX]
              # TODO - catch exact Exception
              except Exception:
                  out_y[name] = vals
  
              if _type == "choice":
                  _index = vals[NodeType.INDEX]
                  json2vals(
                      in_x[NodeType.VALUE][_index],
                      vals[NodeType.VALUE],
                      out_y,
                      name=name + "[%d]" % _index,
                  )
              if _type == "randint":
                  out_y[name] -= in_x[NodeType.VALUE][0]
          else:
              for key in in_x.keys():
                  json2vals(
                      in_x[key],
                      vals[key],
                      out_y,
                      name + "[%s]" % str(key),
                  )
      elif isinstance(in_x, list):
          for i, temp in enumerate(in_x):
              # nested json
              if isinstance(temp, dict):
                  if NodeType.NAME not in temp.keys():
                      raise RuntimeError(
                          "'_name' key is not found in this nested search space."
                      )
                  else:
                      json2vals(temp, vals[i], out_y, name + "[%d]" % i)
              else:
                  json2vals(temp, vals[i], out_y, name + "[%d]" % i)
  
imports: import copy
  import logging
  import hyperopt
  import numpy
  from schema import Optional, Schema
  from nni import ClassArgsValidator
  from nni.common.hpo_utils import validate_search_space
  from nni.tuner import Tuner
  from nni.utils import NodeType, OptimizeMode, extract_scalar_reward, split_index
label_desc: Use image node_id 3 for calling a global function with example usage: json2vals(in_x, vals, out_y, name) without return types