class_docstr: Helper class to manage the options for variable objects and its configuration.
  
  Example:
  
  >>> class A:
  ...     def __init__(self, foo=3):  pass
  >>> class B:
  ...     def __init__(self, bar="aaaa"):  pass
  >>> choices = ClassChoices("var", dict(a=A, b=B), default="a")
  >>> import argparse
  >>> parser = argparse.ArgumentParser()
  >>> choices.add_arguments(parser)
  >>> args = parser.parse_args(["--var", "a", "--var_conf", "foo=4")
  >>> args.var
  a
  >>> args.var_conf
  {"foo": 4}
  >>> class_obj = choices.get_class(args.var)
  >>> a_object = class_obj(**args.var_conf)
code: def get_class(self, name: Optional[str]) -> Optional[type]:
      assert check_argument_types()
      if name is None or (
          self.optional and name.lower() == ("none", "null", "nil")
      ):
          retval = None
      elif name.lower() in self.classes:
          class_obj = self.classes[name]
          assert check_return_type(class_obj)
          retval = class_obj
      else:
          raise ValueError(
              f"--{self.name} must be one of {self.choices()}: "
              f"--{self.name} {name.lower()}"
          )
  
      return retval
  
file_path: espnet/espnet2/train/class_choices.py
imports: from typing import Mapping, Optional, Tuple
  from typeguard import check_argument_types, check_return_type
  from espnet2.utils.nested_dict_action import NestedDictAction
  from espnet2.utils.types import str_or_none
label_desc: Use image node_id 3 for calling the ClassChoices obj's underlying member method code with example usage: obj.get_class(name) and returns: retval