code: def _check_engine(engine, func):
      # if not specified through keyword or option, then default to "fiona" if
      # installed, otherwise try pyogrio
      if engine is None:
          import geopandas
  
          engine = geopandas.options.io_engine
  
      if engine is None:
          _import_fiona()
          if fiona:
              engine = "fiona"
          else:
              _import_pyogrio()
              if pyogrio:
                  engine = "pyogrio"
  
      if engine == "fiona":
          _import_fiona()
          _check_fiona(func)
      elif engine == "pyogrio":
          _import_pyogrio()
          _check_pyogrio(func)
      elif engine is None:
          raise ImportError(
              f"The {func} requires the 'pyogrio' or 'fiona' package, "
              "but neither is installed or imports correctly."
              f"\nImporting fiona resulted in: {fiona_import_error}"
              f"\nImporting pyogrio resulted in: {pyogrio_import_error}"
          )
  
      return engine
  
imports: import os
  from packaging.version import Version
  from pathlib import Path
  import warnings
  import numpy
  import pandas
  from pandas.api.types import is_integer_dtype
  import pyproj
  from shapely.geometry import mapping
  from shapely.geometry.base import BaseGeometry
  from geopandas import GeoDataFrame, GeoSeries
  from urllib.parse import urlparse
  from urllib.parse import uses_netloc, uses_params, uses_relative
  import urllib.request
  from geopandas._compat import PANDAS_GE_20
label_desc: Use image node_id 5 for calling a global function with example usage: _check_engine(engine, func) and returns: engine