code: def mutating_method(func):
      
      def wrapper(self, *__args, **__kwargs):
          old_mutable = self._mutable
          self._mutable = True
          try:
              # Call the wrapped function
              return func(self, *__args, **__kwargs)
          finally:
              self._mutable = old_mutable
      return wrapper
docs: Decorator for methods that are allowed to modify immutable objects