code: def test_set_colorinterp(path_rgba_byte_tif, tmpdir, dtype):
      """Test setting color interpretation by creating an image without CI
      and then setting to unusual values.  Also test with a non-uint8 image.
      """
  
      no_ci_path = str(tmpdir.join("no-ci.tif"))
      with rasterio.open(path_rgba_byte_tif) as src:
          meta = src.meta.copy()
          meta.update(
              height=10,
              width=10,
              dtype=dtype,
              photometric="minisblack",
              alpha="unspecified",
          )
      with rasterio.open(no_ci_path, "w", **meta):
          pass
  
      # This is should be the default color interpretation of the copied
      # image.  GDAL defines these defaults, not Rasterio.
      src_ci = (
          ColorInterp.gray,
          ColorInterp.undefined,
          ColorInterp.undefined,
          ColorInterp.undefined,
      )
  
      dst_ci = (
          ColorInterp.alpha,
          ColorInterp.blue,
          ColorInterp.green,
          ColorInterp.red,
      )
  
      with rasterio.open(no_ci_path, "r+") as src:
          assert src.colorinterp == src_ci
          src.colorinterp = dst_ci
  
      # See note in 'test_set_colorinterp_undefined'.  Opening a second
      # time catches situations like that.
      with rasterio.open(no_ci_path) as src:
          assert src.colorinterp == dst_ci
  
imports: import pytest
  import rasterio
  from rasterio.enums import ColorInterp
label_desc: Use image node_id 3 for calling a global function with example usage: test_set_colorinterp(path_rgba_byte_tif, tmpdir, dtype) without return types