code: def slice_dataset_path(request):
      """Create temporary datasets for test_collection_iterator_items_slice()"""
  
      driver = request.param
      min_id = 0
      max_id = 9
  
      def get_schema(driver):
          special_schemas = {
              "CSV": {
                  "geometry": None,
                  "properties": {"position": "int"},
              }
          }
          return special_schemas.get(
              driver,
              {"geometry": "Point", "properties": {"position": "int"}},
          )
  
      def get_records(driver, range):
          special_records1 = {
              "CSV": [
                  Feature.from_dict(
                      **{
                          "geometry": None,
                          "properties": {"position": i},
                      }
                  )
                  for i in range
              ],
              "PCIDSK": [
                  Feature.from_dict(
                      **{
                          "geometry": {
                              "type": "Point",
                              "coordinates": (0.0, float(i), 0.0),
                          },
                          "properties": {"position": i},
                      }
                  )
                  for i in range
              ],
          }
          return special_records1.get(
              driver,
              [
                  Feature.from_dict(
                      **{
                          "geometry": {
                              "type": "Point",
                              "coordinates": (0.0, float(i)),
                          },
                          "properties": {"position": i},
                      }
                  )
                  for i in range
              ],
          )
  
      schema = get_schema(driver)
      records = get_records(driver, range(min_id, max_id + 1))
  
      create_kwargs = {}
      if driver == "FlatGeobuf":
          create_kwargs["SPATIAL_INDEX"] = False
  
      tmpdir = tempfile.mkdtemp()
      path = os.path.join(tmpdir, get_temp_filename(driver))
  
      with fiona.open(
          path, "w", driver=driver, schema=schema, **create_kwargs
      ) as c:
          c.writerecords(records)
      yield path
      shutil.rmtree(tmpdir)
  
file_path: Fiona/tests/test_slice.py
imports: import tempfile
  import shutil
  import os
  import pytest
  from fiona.env import GDALVersion
  import fiona
  from fiona.drvsupport import supported_drivers, _driver_supports_mode
  from fiona.errors import FionaDeprecationWarning
  from fiona.model import Feature
  from .conftest import get_temp_filename
label_desc: Use image node_id 5 for calling a global function with example usage: slice_dataset_path(request) and returns: special_schemas, special_records1