code: def test_crop_image_swapped_args(basic_image_tif, basic_geometry):
      """If users provide a polygon instead of raster raise an error."""
      with pytest.raises(AttributeError):
          es.crop_image(basic_geometry, basic_image_tif)
      with pytest.raises(AttributeError):
          es.crop_image(basic_geometry, basic_geometry)
  
file_path: earthpy/earthpy/tests/test_crop_image.py
imports: import numpy
  import pytest
  import rasterio
  from shapely.geometry import Polygon, Point, LineString
  import earthpy.spatial
label_desc: Use image node_id 9 for calling a global function with example usage: test_crop_image_swapped_args(basic_image_tif, basic_geometry) without return types