code: def obj(**kwvars):
      """
      Decorator for a class that registers its arguments as hyperparameters.
  
      Used for classes like: tf.keras.layers.*
      Each hyperparameter may take a fixed value or be a searchable space
      (e.g. hpo.space.Int, hpo.space.Categorical).
  
  
      :return: an AutoCls object. The instantiation of the class object is delayed
               until AutoCls.sample() is called (usually in each trial).
  
      """
      # def _automl_kwargs_obj(**kwvars):
      #     def registered_func(func):
      #         kwspaces = OrderedDict()
      #         @functools.wraps(func)
      #         def wrapper_call(*args, **kwargs):
      #             kwvars.update(kwargs)
      #             for k, v in kwvars.items():
      #                 if isinstance(v, NestedSpace):
      #                     kwspaces[k] = v
      #                     kwargs[k] = v
      #                 elif isinstance(v, Space):
      #                     kwspaces[k] = v
      #                     hp = v.get_hp(name=k)
      #                     kwargs[k] = hp.default_value
      #                 else:
      #                     kwargs[k] = v
      #             return func(*args, **kwargs)
      #         wrapper_call.kwspaces = kwspaces
      #         wrapper_call.kwvars = kwvars
      #         return wrapper_call
      #     return registered_func
  
      def registered_class(Cls):
          class AutoCls(AutoObject):
              # @_automl_kwargs_obj(**kwvars)
              def __init__(self, *args, **kwargs):
                  self.args = args
                  self.kwargs = kwargs
                  self._inited = False
                  self.kwspaces_ = OrderedDict()
                  self.kwvars = dict()
                  self.sampler_kwargs = dict()
                  self._update_kw()
                  self._callgraph = (
                      None  # keep a reference to the call graph
                  )
  
              def sample(self, **config):
                  kwargs = copy.deepcopy(self.kwargs)
                  # kwspaces = copy.deepcopy(automlobject.kwspaces)
                  kwspaces = copy.deepcopy(self.kwspaces_)
                  for k, v in kwargs.items():
                      if k in kwspaces and isinstance(
                          kwspaces[k], NestedSpace
                      ):
                          sub_config = _strip_config_space(
                              config, prefix=k
                          )
                          kwargs[k] = kwspaces[k].sample(**sub_config)
                      elif k in config:
                          kwargs[k] = config[k]
  
                  args = self.args
                  return Cls(*args, **kwargs)
  
              @property
              def kwspaces(self):
                  return self.kwspaces_
  
              def _update_kw(self):
                  self.kwvars.update(self.kwargs)
                  for k, v in self.kwvars.items():
                      if isinstance(v, NestedSpace):
                          self.kwspaces_[k] = v
                          self.kwargs[k] = v
                          for hp in v.cs.get_hyperparameters():
                              new_parameter = copy.deepcopy(hp)
                              new_parameter.name = "{}{}{}".format(
                                  k, SPLITTER, new_parameter.name
                              )
                              # further add the sub_cs prefix onto the param
                              name = new_parameter.name
                              if hasattr(new_parameter, "choices"):
                                  choices = tuple(new_parameter.choices)
                                  self.sampler_kwargs[name] = choices
                      elif isinstance(v, Space):
                          self.kwspaces_[k] = v
                          hp = v.get_hp(name=k)
                          self.kwargs[k] = hp.default_value
                      else:
                          self.kwargs[k] = v
  
              def __repr__(self):
                  return "AutoCls -- " + Cls.__name__ + str(id(self))
  
              def __call__(self, *args, **kwargs):
                  # super.__call__(*args, **kwargs)
                  # this is to handle functional API of layers
                  self._call_args = args
                  self._call_kwargs = kwargs
                  # get the inputs tensor argument
                  if len(args) == 0:
                      inputs = kwargs["inputs"]
                  else:
                      inputs = args[0]
                  self._callgraph = CallCache.update(inputs, self)
                  return self
  
          # automlobject.kwvars = automlobject.__init__.kwvars
          AutoCls.__doc__ = Cls.__doc__
          AutoCls.__name__ = Cls.__name__
          return AutoCls
  
      return registered_class
  
imports: import copy
  import logging
  import argparse
  import functools
  from collections import OrderedDict
  import numpy
  import multiprocessing
  from .space import *
  from .space import _add_hp, _add_cs, _rm_hp, _strip_config_space, SPLITTER
  from .callgraph import CallCache
  from bigdl.nano.automl.utils import EasyDict
  from bigdl.nano.automl.utils import proxy_methods
  from bigdl.nano.automl.hpo.backend import create_hpo_backend
  from bigdl.nano.deps.automl.hpo_api import create_configuration_space
label_desc: Use image node_id 4 for calling a global function with example usage: obj() and returns: registered_class, AutoCls, Cls, self, unknown, self