code: def _get_valid_geom_types(schema, driver):
      """Returns a set of geometry types the schema will accept"""
      schema_geom_type = schema["geometry"]
      if isinstance(schema_geom_type, str) or schema_geom_type is None:
          schema_geom_type = (schema_geom_type,)
      valid_types = set()
      for geom_type in schema_geom_type:
          geom_type = str(geom_type).lstrip("3D ")
          if geom_type == "Unknown" or geom_type == "Any":
              valid_types.update(ALL_GEOMETRY_TYPES)
          else:
              if geom_type not in ALL_GEOMETRY_TYPES:
                  raise UnsupportedGeometryTypeError(geom_type)
              valid_types.add(geom_type)
  
      # shapefiles don't differentiate between single/multi geometries, except points
      if driver == "ESRI Shapefile" and "Point" not in valid_types:
          for geom_type in list(valid_types):
              if not geom_type.startswith("Multi"):
                  valid_types.add("Multi" + geom_type)
  
      return valid_types
  
imports: from contextlib import ExitStack
  import logging
  import os
  import warnings
  from fiona import compat, vfs
  from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
  from fiona.ogrext import Session, WritingSession
  from fiona.ogrext import buffer_to_virtual_file, remove_virtual_file, GEOMETRY_TYPES
  from fiona.errors import DriverError, DriverSupportError, GDALVersionError, SchemaError, UnsupportedGeometryTypeError, UnsupportedOperation
  from fiona.logutils import FieldSkipLogFilter
  from fiona.crs import CRS
  from fiona._env import get_gdal_release_name, get_gdal_version_tuple
  from fiona.env import env_ctx_if_needed
  from fiona.errors import FionaDeprecationWarning
  from fiona.drvsupport import driver_from_extension, supported_drivers, driver_mode_mingdal, _driver_converts_field_type_silently_to_str, _driver_supports_field
  from fiona.path import Path, vsi_path, parse_path
label_desc: Use image node_id 1 for calling a global function with example usage: _get_valid_geom_types(schema, driver) and returns: valid_types