code: def require_gdal_version(
      version, param=None, values=None, is_max_version=False, reason=""
  ):
      """A decorator that ensures the called function or parameters are supported
      by the runtime version of GDAL.  Raises GDALVersionError if conditions
      are not met.
  
      Examples:
      \b
          @require_gdal_version('2.2')
          def some_func():
  
      calling `some_func` with a runtime version of GDAL that is < 2.2 raises a
      GDALVersionErorr.
  
      \b
          @require_gdal_version('2.2', param='foo')
          def some_func(foo='bar'):
  
      calling `some_func` with parameter `foo` of any value on GDAL < 2.2 raises
      a GDALVersionError.
  
      \b
          @require_gdal_version('2.2', param='foo', values=('bar',))
          def some_func(foo=None):
  
      calling `some_func` with parameter `foo` and value `bar` on GDAL < 2.2
      raises a GDALVersionError.
  
  
      Parameters
      ------------
      version: tuple, string, or GDALVersion
      param: string (optional, default: None)
          If `values` are absent, then all use of this parameter with a value
          other than default value requires at least GDAL `version`.
      values: tuple, list, or set (optional, default: None)
          contains values that require at least GDAL `version`.  `param`
          is required for `values`.
      is_max_version: bool (optional, default: False)
          if `True` indicates that the version provided is the maximum version
          allowed, instead of requiring at least that version.
      reason: string (optional: default: '')
          custom error message presented to user in addition to message about
          GDAL version.  Use this to provide an explanation of what changed
          if necessary context to the user.
  
      Returns
      ---------
      wrapped function
  
      """
      if values is not None:
          if param is None:
              raise ValueError(
                  "require_gdal_version: param must be provided with values"
              )
  
          if not isinstance(values, (tuple, list, set)):
              raise ValueError(
                  "require_gdal_version: values must be a tuple, list, or set"
              )
  
      version = GDALVersion.parse(version)
      runtime = GDALVersion.runtime()
      inequality = ">=" if runtime < version else "<="
      reason = f"\n{reason}" if reason else reason
  
      def decorator(f):
          @wraps(f)
          def wrapper(*args, **kwds):
              if (runtime < version and not is_max_version) or (
                  is_max_version and runtime > version
              ):
                  if param is None:
                      raise GDALVersionError(
                          f"GDAL version must be {inequality} {version}{reason}"
                      )
  
                  # normalize args and kwds to dict
                  argspec = getfullargspec(f)
                  full_kwds = kwds.copy()
  
                  if argspec.args:
                      full_kwds.update(
                          dict(zip(argspec.args[: len(args)], args))
                      )
  
                  if argspec.defaults:
                      defaults = dict(
                          zip(
                              reversed(argspec.args),
                              reversed(argspec.defaults),
                          )
                      )
                  else:
                      defaults = {}
  
                  if param in full_kwds:
                      if values is None:
                          if param not in defaults or (
                              full_kwds[param] != defaults[param]
                          ):
                              raise GDALVersionError(
                                  f'usage of parameter "{param}" requires '
                                  f"GDAL {inequality} {version}{reason}"
                              )
  
                      elif full_kwds[param] in values:
                          raise GDALVersionError(
                              f'parameter "{param}={full_kwds[param]}" requires '
                              f"GDAL {inequality} {version}{reason}"
                          )
  
              return f(*args, **kwds)
  
          return wrapper
  
      return decorator
  
imports: from functools import wraps, total_ordering
  from inspect import getfullargspec
  import logging
  import os
  import re
  import threading
  import warnings
  import attr
  from fiona._env import GDALDataFinder, GDALEnv, PROJDataFinder, calc_gdal_version_num, get_gdal_config, get_gdal_release_name, get_gdal_version_num, set_gdal_config, set_proj_data_search_path
  from fiona.errors import EnvError, FionaDeprecationWarning, GDALVersionError
  from fiona.session import Session, DummySession
label_desc: Use image node_id 10 for calling a global function with example usage: require_gdal_version(version, param, values, is_max_version, reason) and returns: decorator, wrapper, f