code: def test_patch_for_descriptor(gorilla_setting):
      A, _ = gen_class_A_B()
  
      original_A_f3_raw = object.__getattribute__(A, "f3")
  
      def patched_A_f3(self):  # pylint: disable=unused-argument
          pass
  
      patch_A_f3 = gorilla.Patch(A, "f3", patched_A_f3, gorilla_setting)
  
      assert gorilla.get_original_attribute(A, "f3") is A.delegated_f3
      assert (
          gorilla.get_original_attribute(
              A, "f3", bypass_descriptor_protocol=True
          )
          is original_A_f3_raw
      )
  
      gorilla.apply(patch_A_f3)
      assert A.f3 is patched_A_f3
      assert gorilla.get_original_attribute(A, "f3") is A.delegated_f3
      assert (
          gorilla.get_original_attribute(
              A, "f3", bypass_descriptor_protocol=True
          )
          is original_A_f3_raw
      )
  
      gorilla.revert(patch_A_f3)
      assert A.f3 is A.delegated_f3
      assert gorilla.get_original_attribute(A, "f3") is A.delegated_f3
      assert (
          gorilla.get_original_attribute(
              A, "f3", bypass_descriptor_protocol=True
          )
          is original_A_f3_raw
      )
  
      # test patch a descriptor
      @delegate(patched_A_f3)
      def new_patched_A_f3(self):  # pylint: disable=unused-argument
          pass
  
      new_patch_A_f3 = gorilla.Patch(
          A, "f3", new_patched_A_f3, gorilla_setting
      )
      gorilla.apply(new_patch_A_f3)
      assert A.f3 is patched_A_f3
      assert object.__getattribute__(A, "f3") is new_patched_A_f3
      assert gorilla.get_original_attribute(A, "f3") is A.delegated_f3
      assert (
          gorilla.get_original_attribute(
              A, "f3", bypass_descriptor_protocol=True
          )
          is original_A_f3_raw
      )
  
file_path: mlflow/tests/utils/test_gorilla.py
imports: import pytest
  from mlflow.utils import gorilla
label_desc: Use image node_id 5 for calling a global function with example usage: test_patch_for_descriptor(gorilla_setting) without return types