code: def test_mask_crop_out_of_bounds(
      runner, tmpdir, basic_feature, pixelated_image_file
  ):
      """
      A GeoJSON mask that is outside bounds of raster should fail with
      --crop option.
      """
  
      coords = np.array(basic_feature["geometry"]["coordinates"]) - 10
      basic_feature["geometry"]["coordinates"] = coords.tolist()
  
      output = str(tmpdir.join("test.tif"))
  
      result = runner.invoke(
          main_group,
          [
              "mask",
              pixelated_image_file,
              output,
              "--crop",
              "--geojson-mask",
              "-",
          ],
          input=json.dumps(basic_feature),
      )
      assert result.exit_code == 2
      assert "GeoJSON outside the extent" in result.output
  
file_path: rasterio/tests/test_rio_mask.py
imports: import json
  import os
  import numpy
  import pytest
  import rasterio
  from rasterio.rio.main import main_group
label_desc: Use image node_id 9 for calling a global function with example usage: test_mask_crop_out_of_bounds(runner, tmpdir, basic_feature, pixelated_image_file) without return types