code: def public(self, name=None):
          
          if callable(name):
              self.add_method(name)
              return name
  
          def _(f):
              self.add_method(f, name=name)
              return f
  
          return _
docs: Convenient decorator.
  
          Allows easy registering of functions to this dispatcher. Example:
  
          .. code-block:: python
  
              dispatch = RPCDispatcher()
  
              @dispatch.public
              def foo(bar):
                  # ...
  
              class Baz(object):
                  def not_exposed(self):
                      # ...
  
                  @dispatch.public(name='do_something')
                  def visible_method(arg1)
                      # ...
  
          :param str name: Name to register callable with.