def add(self, value):
        """
        Add a class.

        This has no effect if the class is already present.
        """
        if not value or re.search(r'\s', value):
            raise ValueError("Invalid class name: %r" % value)
        classes = self._get_class_value().split()
        if value in classes:
            return
        classes.append(value)
        self._attributes['class'] = ' '.join(classes)

        Add a class.

        This has no effect if the class is already present.
        
stackoverflow/venv/lib/python3.6/site-packages/lxml/html/__init__.py