code: def require_minimum_pyarrow_version() -> None:
      """Raise ImportError if minimum version of pyarrow is not installed"""
      # TODO(HyukjinKwon): Relocate and deduplicate the version specification.
      minimum_pyarrow_version = "4.0.0"
  
      import os
  
      try:
          import pyarrow
  
          have_arrow = True
      except ImportError as error:
          have_arrow = False
          raised_error = error
      if not have_arrow:
          raise PySparkImportError(
              error_class="PACKAGE_NOT_INSTALLED",
              message_parameters={
                  "package_name": "PyArrow",
                  "minimum_version": str(minimum_pyarrow_version),
              },
          ) from raised_error
      if LooseVersion(pyarrow.__version__) < LooseVersion(
          minimum_pyarrow_version
      ):
          raise PySparkImportError(
              error_class="UNSUPPORTED_PACKAGE_VERSION",
              message_parameters={
                  "package_name": "PyArrow",
                  "minimum_version": str(minimum_pyarrow_version),
                  "current_version": str(pyarrow.__version__),
              },
          )
      if os.environ.get("ARROW_PRE_0_15_IPC_FORMAT", "0") == "1":
          raise PySparkRuntimeError(
              error_class="ARROW_LEGACY_IPC_FORMAT",
              message_parameters={},
          )
  
imports: from pyspark.loose_version import LooseVersion
  from pyspark.errors import PySparkImportError, PySparkRuntimeError
label_desc: Use image node_id 2 for calling a global function with example usage: require_minimum_pyarrow_version() without return types