code: def test_multiple_layer_memoryfile(testdata_generator):
      """Test ability to create multiple layers in memoryfile"""
      driver = "GPKG"
      range1 = list(range(0, 5))
      range2 = list(range(5, 10))
      schema, crs, records1, records2, _ = testdata_generator(
          driver, range1, range2
      )
  
      with MemoryFile() as memfile:
          with memfile.open(
              mode="w", driver=driver, schema=schema, layer="layer1"
          ) as c:
              c.writerecords(records1)
          with memfile.open(
              mode="w", driver=driver, schema=schema, layer="layer2"
          ) as c:
              c.writerecords(records2)
  
          with memfile.open(driver=driver, layer="layer1") as c:
              assert driver == c.driver
              items = list(c)
              assert len(items) == len(range1)
  
          with memfile.open(driver=driver, layer="layer2") as c:
              assert driver == c.driver
              items = list(c)
              assert len(items) == len(range1)
  
imports: import os
  from io import BytesIO
  import pytest
  import fiona
  from fiona import supported_drivers
  from fiona.drvsupport import _driver_supports_mode
  from fiona.errors import DriverError
  from fiona.io import MemoryFile, ZipMemoryFile
  from fiona.meta import supports_vsi
  from .conftest import requires_gdal2, requires_gpkg
label_desc: Use image node_id 23 for calling a global function with example usage: test_multiple_layer_memoryfile(testdata_generator) without return types