code: def test_estimate_orientation(
      mock_image, mock_bitmap, mock_tilted_payslip
  ):
      assert estimate_orientation(mock_image * 0) == 0
  
      # test binarized image
      angle = estimate_orientation(mock_bitmap)
      assert abs(angle - 30.0) < 1.0
  
      angle = estimate_orientation(mock_bitmap * 255)
      assert abs(angle - 30.0) < 1.0
  
      angle = estimate_orientation(mock_image)
      assert abs(angle - 30.0) < 1.0
  
      rotated = geometry.rotate_image(mock_image, -angle)
      angle_rotated = estimate_orientation(rotated)
      assert abs(angle_rotated) < 1.0
  
      mock_tilted_payslip = reader.read_img_as_numpy(
          mock_tilted_payslip
      )
      assert (estimate_orientation(mock_tilted_payslip) - 30.0) < 1.0
  
      rotated = geometry.rotate_image(
          mock_tilted_payslip, -30, expand=True
      )
      angle_rotated = estimate_orientation(rotated)
      assert abs(angle_rotated) < 1.0
  
      with pytest.raises(AssertionError):
          estimate_orientation(np.ones((10, 10, 10)))
  
file_path: doctr/tests/common/test_models.py
imports: from io import BytesIO
  import cv2
  import numpy
  import pytest
  import requests
  from doctr.io import reader
  from doctr.models._utils import estimate_orientation, get_language, invert_data_structure
  from doctr.utils import geometry
label_desc: Use image node_id 3 for calling a global function with example usage: test_estimate_orientation(mock_image, mock_bitmap, mock_tilted_payslip) without return types