code: def test_anchoredtext_horizontal_alignment():
      fig, ax = plt.subplots()
  
      text0 = AnchoredText(
          "test\ntest long text",
          loc="center left",
          pad=0.2,
          prop={"ha": "left"},
      )
      ax.add_artist(text0)
      text1 = AnchoredText(
          "test\ntest long text",
          loc="center",
          pad=0.2,
          prop={"ha": "center"},
      )
      ax.add_artist(text1)
      text2 = AnchoredText(
          "test\ntest long text",
          loc="center right",
          pad=0.2,
          prop={"ha": "right"},
      )
      ax.add_artist(text2)
  
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 11 for calling a global function with example usage: test_anchoredtext_horizontal_alignment() without return types