code: def get_writer_for_driver(driver):
      """Return the writer class appropriate for the specified driver."""
      if not driver:
          raise ValueError(
              "'driver' is required to read/write dataset."
          )
      cls = None
      if driver_can_create(driver):
          cls = DatasetWriter
      elif driver_can_create_copy(driver):  # pragma: no branch
          cls = BufferedDatasetWriter
      return cls
  
imports: import logging
  import warnings
  from rasterio._base import get_dataset_driver, driver_can_create, driver_can_create_copy
  from rasterio._io import DatasetReaderBase, DatasetWriterBase, BufferedDatasetWriterBase, MemoryFileBase
  from rasterio.windows import WindowMethodsMixin
  from rasterio.env import ensure_env
  from rasterio.errors import RasterioDeprecationWarning
  from rasterio.transform import TransformMethodsMixin
  from rasterio._path import _UnparsedPath
label_desc: Use image node_id 1 for calling a global function with example usage: get_writer_for_driver(driver) and returns: cls