code: def test_rotate_boxes():
      boxes = np.array([[0.1, 0.1, 0.8, 0.3, 0.5]])
      rboxes = np.array(
          [[0.1, 0.1], [0.8, 0.1], [0.8, 0.3], [0.1, 0.3]]
      )
      # Angle = 0
      rotated = geometry.rotate_boxes(
          boxes, angle=0.0, orig_shape=(1, 1)
      )
      assert np.all(rotated == rboxes)
      # Angle < 1:
      rotated = geometry.rotate_boxes(
          boxes, angle=0.5, orig_shape=(1, 1)
      )
      assert np.all(rotated == rboxes)
      # Angle = 30
      rotated = geometry.rotate_boxes(
          boxes, angle=30, orig_shape=(1, 1)
      )
      assert rotated.shape == (1, 4, 2)
  
      boxes = np.array([[0.0, 0.0, 0.6, 0.2, 0.5]])
      # Angle = -90:
      rotated = geometry.rotate_boxes(
          boxes, angle=-90, orig_shape=(1, 1), min_angle=0
      )
      assert np.allclose(
          rotated,
          np.array([[[1, 0.0], [1, 0.6], [0.8, 0.6], [0.8, 0.0]]]),
      )
      # Angle = 90
      rotated = geometry.rotate_boxes(
          boxes, angle=+90, orig_shape=(1, 1), min_angle=0
      )
      assert np.allclose(
          rotated,
          np.array([[[0, 1.0], [0, 0.4], [0.2, 0.4], [0.2, 1.0]]]),
      )
  
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 6 for calling a global function with example usage: test_rotate_boxes() without return types