code: def with_current_context(self, func):
          
  
          caller_context = self.snapshot()
  
          def call_with_current_context(*args, **kwargs):
              try:
                  backup_context = self.snapshot()
                  self.apply(caller_context)
                  return func(*args, **kwargs)
              finally:
                  self.apply(backup_context)
  
          return call_with_current_context
docs: Capture the current context and apply it to the provided func