code: def _convert(param_config):
      d = {}
      for param in param_config:
          if param["type"] == "int":
              d[param["name"]] = hp.randint(
                  param["name"], param["range"][1] - param["range"][0]
              )
              # hyperopt doesn't support [low, high] for int
          elif param["type"] == "float":
              if len(param["range"]) != 2:
                  raise ValueError(
                      "HyperOpt: range for float only has two numbers, you have %d"
                      % len(param["range"])
                  )
              param["range"] = sorted(param["range"])
              d[param["name"]] = hp.uniform(
                  param["name"], param["range"][0], param["range"][1]
              )
          elif param["type"] == "choice":
              d[param["name"]] = hp.choice(
                  param["name"], param["range"]
              )
          else:
              msg = (
                  "%s is not supported type, choose int, float, choice"
                  % param["type"]
              )
              logger.fatal(msg)
              raise KeyError(msg)
      return d
  
file_path: auptimizer/src/aup/Proposer/HyperoptProposer.py
imports: import importlib
  import logging
  import numpy
  from six.moves import input
  from .AbstractProposer import AbstractProposer
  from .hyperopt import hp, base
  from .hyperopt.utils import coarse_utcnow
  from ..utils import set_default_keyvalue, check_missing_key, get_from_options
label_desc: Use image node_id 2 for calling a global function with example usage: _convert(param_config) and returns: d