code: def kwspaces(self):
      kw_spaces = OrderedDict()
      for k, v in self.kwvars.items():
          if isinstance(v, NestedSpace):
              if isinstance(v, Categorical):
                  kw_spaces["{}{}choice".format(k, SPLITTER)] = v
              for sub_k, sub_v in v.kwspaces.items():
                  new_k = "{}{}{}".format(k, SPLITTER, sub_k)
                  kw_spaces[new_k] = sub_v
          elif isinstance(v, Space):
              kw_spaces[k] = v
      return kw_spaces
  
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 6 for calling the _automl_method obj's underlying member method code with example usage: obj.kwspaces() and returns: kw_spaces