code: def _to_file_fiona(df, filename, driver, schema, crs, mode, **kwargs):
      if schema is None:
          schema = infer_schema(df)
  
      if crs:
          crs = pyproj.CRS.from_user_input(crs)
      else:
          crs = df.crs
  
      with fiona_env():
          crs_wkt = None
          try:
              gdal_version = fiona.env.get_gdal_release_name()
          except AttributeError:
              gdal_version = "2.0.0"  # just assume it is not the latest
          if Version(gdal_version) >= Version("3.0.0") and crs:
              crs_wkt = crs.to_wkt()
          elif crs:
              crs_wkt = crs.to_wkt("WKT1_GDAL")
          with fiona.open(
              filename,
              mode=mode,
              driver=driver,
              crs_wkt=crs_wkt,
              schema=schema,
              **kwargs,
          ) as colxn:
              colxn.writerecords(df.iterfeatures())
  
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 16 for calling a global function with example usage: _to_file_fiona(df, filename, driver, schema, crs, mode) without return types