code: def add(self, *args: Any, **kwargs: Any) -> Optional[Callable]:
          
          self.items = {
              **self.items,
              # Methods passed as positional args need a __name__ attribute, raises
              # AttributeError otherwise.
              **{m.__name__: validate(m) for m in args},
              **{k: validate(v) for k, v in kwargs.items()},
          }
          if len(args):
              return args[0]  # for the decorator to work
          return None
docs: Register a function to the list.
  
          Args:
              *args: Set/Sequence of positional arguments.
              **kwargs: Mapping of named arguments.
  
          Raises:
              AttributeError: Raised if the method being added has no name. (i.e. it has
                  no `__name__` property, and no `name` argument was given.)
  
          Examples:
              methods = Methods()
              @methods.add
              def subtract(minuend, subtrahend):
                  return minuend - subtrahend