code: def register(self, function):
          
          function = inspect.isclass(function) and function() or function
          name = function.name
          self[name] = function
docs: Register a function in the function registry.
          The function will be automatically instantiated if not already an
          instance.