code: def patch_pyarrow():
      # starting from pyarrow 14.0.1, it has its own mechanism
      if Version(pyarrow.__version__) >= Version("14.0.1"):
          return
  
      # if the user has pyarrow_hotfix (https://github.com/pitrou/pyarrow-hotfix)
      # installed, use this instead (which also ensures it works if they had
      # called `pyarrow_hotfix.uninstall()`)
      try:
          import pyarrow_hotfix  # noqa: F401
      except ImportError:
          pass
      else:
          return
  
      # if the hotfix is already installed and enabled
      if getattr(pyarrow, "_hotfix_installed", False):
          return
  
      class ForbiddenExtensionType(pyarrow.ExtensionType):
          def __arrow_ext_serialize__(self):
              return b""
  
          @classmethod
          def __arrow_ext_deserialize__(cls, storage_type, serialized):
              import io
              import pickletools
  
              out = io.StringIO()
              pickletools.dis(serialized, out)
              raise RuntimeError(
                  _ERROR_MSG.format(
                      storage_type=storage_type,
                      serialized=serialized,
                      pickle_disassembly=out.getvalue(),
                  )
              )
  
      pyarrow.unregister_extension_type("arrow.py_extension_type")
      pyarrow.register_extension_type(
          ForbiddenExtensionType(
              pyarrow.null(), "arrow.py_extension_type"
          )
      )
  
      pyarrow._hotfix_installed = True
  
label_desc: Use image node_id 1 for calling a global function with example usage: patch_pyarrow() and returns: bytes