code: def test_write_multilayer_geopackage(tmp_path, data_dir, tiffs):
      """Validate if you can create multilayer."""
      gpkg = tmp_path.joinpath("test.gpkg")
      tables = [
          "{}({})".format(tiff, idx)
          for idx, tiff in enumerate(tiffs, 1)
      ]
  
      for tiff, table in zip(tiffs, tables):
          with rasterio.open(os.path.join(data_dir, tiff)) as src:
              profile = src.meta
              profile["driver"] = "GPKG"
              profile["RASTER_TABLE"] = table
              profile["APPEND_SUBDATASET"] = True
              profile["TILE_FORMAT"] = "TIFF"
  
              with rasterio.open(gpkg, "w", **profile) as dst:
                  dst.write(src.read())
  
      with rasterio.open(gpkg) as dst:
          assert len(dst.subdatasets) == 2
  
file_path: rasterio/tests/test_dataset_rw.py
imports: import numpy
  import pytest
  import rasterio
  from rasterio.errors import UnsupportedOperation
  from rasterio.profiles import DefaultGTiffProfile
  import os
label_desc: Use image node_id 3 for calling a global function with example usage: test_write_multilayer_geopackage(tmp_path, data_dir, tiffs) without return types