    def decorator(function):
        """Add ``function`` to the ``DESCRIPTORS``."""
        if descriptor_name is None:
            name = function.__name__.replace('_', '-')
        else:
            name = descriptor_name
        assert name not in DESCRIPTORS[rule], name

        function.wants_base_url = wants_base_url
        DESCRIPTORS[rule][name] = function
        return function
Add ``function`` to the ``DESCRIPTORS``.
weasyprint/css/validation/descriptors.py