code: def driver_from_extension(path):
      """
      Attempt to auto-detect driver based on the extension.
  
      Parameters
      ----------
      path: str or pathlike object
          The path to the dataset to write with.
  
      Returns
      -------
      str:
          The name of the driver for the extension.
      """
      try:
          # in case the path is a file handle
          # or a partsed path
          path = path.name
      except AttributeError:
          pass
  
      driver_extensions = vector_driver_extensions()
  
      try:
          return driver_extensions[
              os.path.splitext(path)[-1].lstrip(".").lower()
          ]
      except KeyError:
          raise ValueError(
              "Unable to detect driver. Please specify driver."
          )
  
file_path: Fiona/fiona/drvsupport.py
imports: import os
  from fiona.env import Env
  from fiona._env import get_gdal_version_tuple
label_desc: Use image node_id 4 for calling a global function with example usage: driver_from_extension(path) and returns: driver_extensions