def register_function(self, patterns, instances=None, **reg_kwargs):
        """Decorator for register."""

        def wrapper(function):
            self.register(patterns, function, instances=instances, **reg_kwargs)
            return function

        return wrapper