code: def test_clip_to_datawindow(runner, tmpdir):
      output = str(
          tmpdir.join(
              "test.tif",
          )
      )
      result = runner.invoke(
          main_group,
          [
              "clip",
              "tests/data/float_raster_with_extra_nodata.tif",
              output,
              "--to-data-window",
          ],
      )
      assert result.exit_code == 0
      assert os.path.exists(
          output,
      )
  
      # could also check that it is equal to tests/data/float_raster_with_nodata.tif
      with rasterio.open(output) as out:
          assert out.shape == (12, 13)
  
file_path: rasterio/tests/test_rio_clip.py
imports: import os
  import numpy
  import pytest
  import rasterio
  from rasterio.rio.main import main_group
label_desc: Use image node_id 5 for calling a global function with example usage: test_clip_to_datawindow(runner, tmpdir) without return types