code: def test_offsetbox_loc_codes():
      # Check that valid string location codes all work with an AnchoredOffsetbox
      codes = {
          "upper right": 1,
          "upper left": 2,
          "lower left": 3,
          "lower right": 4,
          "right": 5,
          "center left": 6,
          "center right": 7,
          "lower center": 8,
          "upper center": 9,
          "center": 10,
      }
      fig, ax = plt.subplots()
      da = DrawingArea(100, 100)
      for code in codes:
          anchored_box = AnchoredOffsetbox(loc=code, child=da)
          ax.add_artist(anchored_box)
      fig.canvas.draw()
  
imports: from collections import namedtuple
  import io
  import numpy
  from numpy.testing import assert_allclose
  import pytest
  from matplotlib.testing.decorators import check_figures_equal, image_comparison
  import matplotlib.pyplot
  import matplotlib.patches
  import matplotlib.lines
  from matplotlib.backend_bases import MouseButton, MouseEvent
  from matplotlib.offsetbox import AnchoredOffsetbox, AnnotationBbox, AnchoredText, DrawingArea, HPacker, OffsetBox, OffsetImage, PaddedBox, TextArea, VPacker, _get_packed_offsets
label_desc: Use image node_id 3 for calling a global function with example usage: test_offsetbox_loc_codes() without return types