code: def tiffs(tmpdir):
      _profile = {
          "transform": Affine(5.0, 0.0, 0.0, 0.0, -5.0, 0.0),
          "crs": CRS({"init": "epsg:4326"}),
          "driver": "GTiff",
          "dtype": "uint8",
          "height": 3,
          "width": 3,
      }
  
      # 1. RGB without nodata value
      prof = _profile.copy()
      prof["count"] = 3
      prof["nodata"] = None
      with rasterio.open(
          str(tmpdir.join("rgb_no_ndv.tif")), "w", **prof
      ) as dst:
          dst.write(red, 1)
          dst.write(grn, 2)
          dst.write(blu, 3)
  
      # 2. RGB with nodata value
      prof = _profile.copy()
      prof["count"] = 3
      prof["nodata"] = 0
      with rasterio.open(
          str(tmpdir.join("rgb_ndv.tif")), "w", **prof
      ) as dst:
          dst.write(red, 1)
          dst.write(grn, 2)
          dst.write(blu, 3)
  
      # 3. RGBA without nodata value
      prof = _profile.copy()
      prof["count"] = 4
      prof["nodata"] = None
      with rasterio.open(
          str(tmpdir.join("rgba_no_ndv.tif")), "w", **prof
      ) as dst:
          dst.write(red, 1)
          dst.write(grn, 2)
          dst.write(blu, 3)
          dst.write(alp, 4)
  
      # 4. RGBA with nodata value
      prof = _profile.copy()
      prof["count"] = 4
      prof["nodata"] = 0
      with rasterio.open(
          str(tmpdir.join("rgba_ndv.tif")), "w", **prof
      ) as dst:
          dst.write(red, 1)
          dst.write(grn, 2)
          dst.write(blu, 3)
          dst.write(alp, 4)
  
      # 5. RGB with msk
      prof = _profile.copy()
      prof["count"] = 3
      with rasterio.open(
          str(tmpdir.join("rgb_msk.tif")), "w", **prof
      ) as dst:
          dst.write(red, 1)
          dst.write(grn, 2)
          dst.write(blu, 3)
          dst.write_mask(msk)
  
      # 6. RGB with msk (internal)
      prof = _profile.copy()
      prof["count"] = 3
      with rasterio.Env(GDAL_TIFF_INTERNAL_MASK=True):
          with rasterio.open(
              str(tmpdir.join("rgb_msk_internal.tif")), "w", **prof
          ) as dst:
              dst.write(red, 1)
              dst.write(grn, 2)
              dst.write(blu, 3)
              dst.write_mask(msk)
  
      # 7. RGBA with msk
      prof = _profile.copy()
      prof["count"] = 4
      with rasterio.open(
          str(tmpdir.join("rgba_msk.tif")), "w", **prof
      ) as dst:
          dst.write(red, 1)
          dst.write(grn, 2)
          dst.write(blu, 3)
          dst.write(alp, 4)
          dst.write_mask(msk)
  
      return tmpdir
  
file_path: rasterio/tests/test_dataset_mask.py
imports: from affine import Affine
  import numpy
  import pytest
  from affine import Affine
  import rasterio
  from rasterio.enums import Resampling
  from rasterio.errors import NodataShadowWarning
  from rasterio.crs import CRS
label_desc: Use image node_id 1 for calling a global function with example usage: tiffs(tmpdir) and returns: tmpdir