code: def test_rotate_image():
      img = np.ones((32, 64, 3), dtype=np.float32)
      rotated = geometry.rotate_image(img, 30.0)
      assert rotated.shape[:-1] == (32, 64)
      assert rotated[0, 0, 0] == 0
      assert rotated[0, :, 0].sum() > 1
  
      # Expand
      rotated = geometry.rotate_image(img, 30.0, expand=True)
      assert rotated.shape[:-1] == (60, 120)
      assert rotated[0, :, 0].sum() <= 1
  
      # Expand
      rotated = geometry.rotate_image(
          img, 30.0, expand=True, preserve_origin_shape=True
      )
      assert rotated.shape[:-1] == (32, 64)
      assert rotated[0, :, 0].sum() <= 1
  
      # Expand with 90° rotation
      rotated = geometry.rotate_image(img, 90.0, expand=True)
      assert rotated.shape[:-1] == (64, 128)
      assert rotated[0, :, 0].sum() <= 1
  
file_path: doctr/tests/common/test_utils_geometry.py
imports: from copy import deepcopy
  from math import hypot
  import numpy
  import pytest
  from doctr.io import DocumentFile
  from doctr.utils import geometry
label_desc: Use image node_id 7 for calling a global function with example usage: test_rotate_image() without return types