def toggle_feature ( cls, event ):
        """ Toggles the feature on or off.
        """
        if cls.state == 0:
            cls.state = 1
            add_feature( cls )
            for control in event.window.control.GetChildren():
                window = getattr( control, 'owner', None )
                if isinstance( window, DockWindow ):
                    do_later( window.update_layout )
        else:
            method    = 'disable'
            cls.state = cls.state - 3
            if cls.state == 1:
                method = 'enable'
            cls.instances = [ aref for aref in cls.instances
                                   if aref() is not None ]
            for aref in cls.instances:
                feature = aref()
                if feature is not None:
                    getattr( feature, method )()
dataset/ETHPy150Open enthought/pyface/pyface/dock/dock_window_feature.py/DockWindowFeature.toggle_feature/swapped operands of `-`