code: def test_callbacks():
      def func(artist):
          func.counter += 1
  
      func.counter = 0
  
      art = martist.Artist()
      oid = art.add_callback(func)
      assert func.counter == 0
      art.pchanged()  # must call the callback
      assert func.counter == 1
      art.set_zorder(
          10
      )  # setting a property must also call the callback
      assert func.counter == 2
      art.remove_callback(oid)
      art.pchanged()  # must not call the callback anymore
      assert func.counter == 2
  
imports: import io
  from itertools import chain
  import numpy
  import pytest
  import matplotlib.colors
  import matplotlib.pyplot
  import matplotlib.patches
  import matplotlib.lines
  import matplotlib.path
  import matplotlib.transforms
  import matplotlib.collections
  import matplotlib.artist
  import matplotlib.backend_bases
  import matplotlib
  from matplotlib.testing.decorators import check_figures_equal, image_comparison
label_desc: Use image node_id 16 for calling a global function with example usage: test_callbacks() without return types