code: def test_rotate_rect():
      loc = np.asarray([1.0, 2.0])
      width = 2
      height = 3
      angle = 30.0
  
      # A rotated rectangle
      rect1 = Rectangle(loc, width, height, angle=angle)
  
      # A non-rotated rectangle
      rect2 = Rectangle(loc, width, height)
  
      # Set up an explicit rotation matrix (in radians)
      angle_rad = np.pi * angle / 180.0
      rotation_matrix = np.array(
          [
              [np.cos(angle_rad), -np.sin(angle_rad)],
              [np.sin(angle_rad), np.cos(angle_rad)],
          ]
      )
  
      # Translate to origin, rotate each vertex, and then translate back
      new_verts = (
          np.inner(rotation_matrix, rect2.get_verts() - loc).T + loc
      )
  
      # They should be the same
      assert_almost_equal(rect1.get_verts(), new_verts)
  
imports: import numpy
  from numpy.testing import assert_almost_equal, assert_array_equal
  import pytest
  import matplotlib
  from matplotlib.patches import Annulus, Ellipse, Patch, Polygon, Rectangle, FancyArrowPatch, FancyArrow, BoxStyle, Arc
  from matplotlib.testing.decorators import image_comparison, check_figures_equal
  from matplotlib.transforms import Bbox
  import matplotlib.pyplot
  from matplotlib import collections, colors, patches, path, transforms, rcParams
  import sys
label_desc: Use image node_id 4 for calling a global function with example usage: test_rotate_rect() without return types