code: def patched(attrs, updates):
      
      orig = patch(attrs, updates.items())
      try:
          yield orig
      finally:
          patch(attrs, orig.items())
docs: A context in which some attributes temporarily have a modified value.