code: def test_shadow(fig_test, fig_ref):
      xy = np.array([0.2, 0.3])
      dxy = np.array([0.1, 0.2])
      # We need to work around the nonsensical (dpi-dependent) interpretation of
      # offsets by the Shadow class...
      plt.rcParams["savefig.dpi"] = "figure"
      # Test image.
      a1 = fig_test.subplots()
      rect = mpatches.Rectangle(xy=xy, width=0.5, height=0.5)
      shadow = mpatches.Shadow(rect, ox=dxy[0], oy=dxy[1])
      a1.add_patch(rect)
      a1.add_patch(shadow)
      # Reference image.
      a2 = fig_ref.subplots()
      rect = mpatches.Rectangle(xy=xy, width=0.5, height=0.5)
      shadow = mpatches.Rectangle(
          xy=xy + fig_ref.dpi / 72 * dxy,
          width=0.5,
          height=0.5,
          fc=np.asarray(mcolors.to_rgb(rect.get_facecolor())) * 0.3,
          ec=np.asarray(mcolors.to_rgb(rect.get_facecolor())) * 0.3,
          alpha=0.5,
      )
      a2.add_patch(shadow)
      a2.add_patch(rect)
  
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 26 for calling a global function with example usage: test_shadow(fig_test, fig_ref) without return types