def service(self, name: str = None):
        """
        Decorator to mark something as a service.
        """
        if self._services_initialized:
            from warnings import warn
            warn('Services have already been initialized. Please register '
                 f'{name} sooner.')
            return lambda x: x

        def wrapper(service):
            self.register_service(name, service)
            return service
        return wrapper
Decorator to mark something as a service.