docs: def register_for_json(*args, **kwargs) -> Any:
      """
      Class decorator to register classes with our JSON system.
  
      - If method is ``'provides_init_args_kwargs'``, the class provides a
        function
  
        .. code-block:: python
  
          def init_args_kwargs(self) -> Tuple[List[Any], Dict[str, Any]]
  
        that returns an ``(args, kwargs)`` tuple, suitable for passing to its
        ``__init__()`` function as ``__init__(*args, **kwargs)``.
  
      - If method is ``'provides_init_kwargs'``, the class provides a function
  
        .. code-block:: python
  
          def init_kwargs(self) -> Dict
  
        that returns a dictionary ``kwargs`` suitable for passing to its
        ``__init__()`` function as ``__init__(**kwargs)``.
  
      - Otherwise, the method argument is as for ``register_class_for_json()``.
  
      Usage looks like:
  
      .. code-block:: python
  
          @register_for_json(method=METHOD_STRIP_UNDERSCORE)
          class TableId(object):
              def __init__(self, db: str = '', schema: str = '',
                           table: str = '') -> None:
                  self._db = db
                  self._schema = schema
                  self._table = table
  
      """
      if DEBUG:
          print("register_for_json: args = {}".format(repr(args)))
          print("register_for_json: kwargs = {}".format(repr(kwargs)))
  
      # http://stackoverflow.com/questions/653368/how-to-create-a-python-decorator-that-can-be-used-either-with-or-without-paramet  # noqa
      # In brief,
      #   @decorator
      #   x
      #
      # means
      #   x = decorator(x)
      #
      # so
      #   @decorator(args)
      #   x
      #
      # means
      #   x = decorator(args)(x)
  
      if len(args) == 1 and len(kwargs) == 0 and callable(args[0]):
          if DEBUG:
              print("... called as @register_for_json")
          # called as @decorator
          # ... the single argument is the class itself, e.g. Thing in:
          #   @decorator
          #   class Thing(object):
          #       # ...
          # ... e.g.:
          #   args = (<class '__main__.unit_tests.<locals>.SimpleThing'>,)
          #   kwargs = {}
          cls = args[0]  # type: ClassType
          register_class_for_json(cls, method=METHOD_SIMPLE)
          return cls
  
      # Otherwise:
      if DEBUG:
          print("... called as @register_for_json(*args, **kwargs)")
      # called as @decorator(*args, **kwargs)
      # ... e.g.:
      #   args = ()
      #   kwargs = {'method': 'provides_to_init_args_kwargs_dict'}
      method = kwargs.pop('method', METHOD_SIMPLE)  # type: str
      obj_to_dict_fn = kwargs.pop('obj_to_dict_fn', None)  # type: InstanceToDictFnType  # noqa
      dict_to_obj_fn = kwargs.pop('dict_to_obj_fn', initdict_to_instance)  # type: DictToInstanceFnType  # noqa
      default_factory = kwargs.pop('default_factory', None)  # type: DefaultFactoryFnType  # noqa
      check_result = kwargs.pop('check_results', True)  # type: bool
  
      def register_json_class(cls_: ClassType) -> ClassType:
          odf = obj_to_dict_fn
          dof = dict_to_obj_fn
          if method == METHOD_PROVIDES_INIT_ARGS_KWARGS:
              if hasattr(cls_, INIT_ARGS_KWARGS_FN_NAME):
                  odf = wrap_args_kwargs_to_initdict(
                      getattr(cls_, INIT_ARGS_KWARGS_FN_NAME),
                      typename=cls_.__qualname__,
                      check_result=check_result
                  )
              else:
                  raise ValueError(
                      "Class type {} does not provide function {}".format(
                          cls_, INIT_ARGS_KWARGS_FN_NAME))
          elif method == METHOD_PROVIDES_INIT_KWARGS:
              if hasattr(cls_, INIT_KWARGS_FN_NAME):
                  odf = wrap_kwargs_to_initdict(
                      getattr(cls_, INIT_KWARGS_FN_NAME),
                      typename=cls_.__qualname__,
                      check_result=check_result
                  )
              else:
                  raise ValueError(
                      "Class type {} does not provide function {}".format(
                          cls_, INIT_KWARGS_FN_NAME))
          elif method == METHOD_NO_ARGS:
              odf = obj_with_no_args_to_init_dict
          register_class_for_json(cls_,
                                  method=method,
                                  obj_to_dict_fn=odf,
                                  dict_to_obj_fn=dof,
                                  default_factory=default_factory)
          return cls_
  
      return register_json_class