code: def test_write_nodata(tmpdir):
      name = str(tmpdir.join("test_write_nodata.tif"))
      a = np.ones((100, 100), dtype=rasterio.ubyte) * 127
      with rasterio.open(
          name,
          "w",
          driver="GTiff",
          width=100,
          height=100,
          count=2,
          dtype=a.dtype,
          nodata=0,
      ) as s:
          s.write(a, indexes=1)
          s.write(a, indexes=2)
      info = subprocess.check_output(
          ["gdalinfo", "-stats", name]
      ).decode("utf-8")
      assert "NoData Value=0" in info
  
imports: import logging
  import re
  from pathlib import Path
  import subprocess
  import affine
  import numpy
  import pytest
  from .conftest import requires_gdal35, gdal_version
  import rasterio
  from rasterio.drivers import blacklist
  from rasterio.enums import MaskFlags, Resampling
  from rasterio.env import Env, GDALVersion
  from rasterio.errors import RasterioIOError
label_desc: Use image node_id 18 for calling a global function with example usage: test_write_nodata(tmpdir) without return types