code: def test_create_internal_mask(data):
      """Write an internal mask to the fixture's RGB.byte.tif."""
      with rasterio.Env(GDAL_TIFF_INTERNAL_MASK=True):
          with rasterio.open(
              str(data.join("RGB.byte.tif")), "r+"
          ) as dst:
              blue = dst.read(1, masked=False)
              mask = 255 * (blue == 0).astype("uint8")
              dst.write_mask(mask)
  
      # There should be no .msk file
      assert data.join("RGB.byte.tif").exists()
      assert not data.join("RGB.byte.tif.msk").exists()
  
      # Check that the mask was saved correctly.
      with rasterio.open(str(data.join("RGB.byte.tif"))) as src:
          assert (mask == src.read_masks()).all()
          for flags in src.mask_flag_enums:
              assert MaskFlags.per_dataset in flags
              assert MaskFlags.alpha not in flags
              assert MaskFlags.nodata not in flags
  
file_path: rasterio/tests/test_mask_creation.py
imports: import numpy
  import pytest
  import rasterio
  from rasterio.enums import MaskFlags
  from rasterio.errors import RasterioIOError
  from rasterio.windows import Window
label_desc: Use image node_id 1 for calling a global function with example usage: test_create_internal_mask(data) without return types