<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_class(self, className):
 """ Adds a class to the top level element of the widget. Doesn't add the class if it already exists. """

        if className not in self._dom_classes:
            self._dom_classes = list(self._dom_classes) + [className]
        return self