A decorator to register a service on a container.
    For more information see :meth:`Container.add_service`.

def service(container, name=None):
    """A decorator to register a service on a container.
    For more information see :meth:`Container.add_service`.
    """
    def register(service):
        container.add_service(service, name)
        return service

    return register