def enable (self):
        """
        Enable monitoring.
        Return True if monitoring was already enabled, false otherwise.
        """
        result = self.is_enabled 
        for l, klass in((self.observed_scalar_attributes, scalar_observer),
            (self.observed_list_attributes, list_observer_in_instance),
            (self.observed_dict_attributes, dict_observer_in_instance)):
            self.enable_category(l, klass)
                     
        self.enable_put_in_removed_functions()
        self.is_enabled = True 
        return result

        Enable monitoring.
        Return True if monitoring was already enabled, false otherwise.
        
recipes/Python/306866_A_basic_undo_mechanism/recipe-306866.py