code: def test_shapes_band1_as_mask(
      runner, pixelated_image, pixelated_image_file
  ):
      """
      When using --as-mask option, pixel value should not matter, only depends
      on pixels being contiguous.
      """
      shapely = pytest.importorskip(
          "shapely", reason="Test requires shapely."
      )
      from shapely.geometry import shape
  
      pixelated_image[2:3, 2:3] = 4
  
      with rasterio.open(pixelated_image_file, "r+") as out:
          out.write(pixelated_image, indexes=1)
  
      with pytest.warns(None):
          result = runner.invoke(
              main_group,
              [
                  "shapes",
                  "--collection",
                  pixelated_image_file,
                  "--band",
                  "--bidx",
                  "1",
                  "--as-mask",
              ],
          )
  
          assert result.exit_code == 0
          assert result.output.count('"FeatureCollection"') == 1
          assert result.output.count('"Feature"') == 3
          assert (
              shape(
                  json.loads(result.output)["features"][0]["geometry"]
              ).area
              == 1.0
          )
  
file_path: rasterio/tests/test_rio_shapes.py
imports: import json
  import re
  import numpy
  import pytest
  import rasterio
  from rasterio.rio.main import main_group
label_desc: Use image node_id 13 for calling a global function with example usage: test_shapes_band1_as_mask(runner, pixelated_image, pixelated_image_file) without return types