<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def toggle_class(self, csscl):
 """Same as jQuery's toggleClass function. It toggles the css class on this element."""

        self._stable = False
        action = ("add", "remove")[self.has_class(csscl)]
        return getattr(self.attrs["klass"], action)(csscl)