code: def test_raster_geometrymask_crop_invert(
      basic_image_2x2, basic_image_file, basic_geometry
  ):
      """Test cropping and inverting"""
  
      geometries = [basic_geometry]
  
      with rasterio.open(basic_image_file) as src:
          geometrymask, transform, window = raster_geometry_mask(
              src, geometries, crop=True, invert=True
          )
  
      image = basic_image_2x2[2:5, 2:5] == 1
  
      assert geometrymask.shape == (3, 3)
      assert np.array_equal(geometrymask, image)
      assert transform == Affine(1, 0, 2, 0, 1, 2)
      assert window is not None and window.flatten() == (2, 2, 3, 3)
  
imports: import numpy
  import pytest
  from affine import Affine
  import rasterio
  from rasterio.mask import raster_geometry_mask, mask
  from .conftest import MockGeoInterface
label_desc: Use image node_id 6 for calling a global function with example usage: test_raster_geometrymask_crop_invert(basic_image_2x2, basic_image_file, basic_geometry) without return types