code: def test_image():
      fig, ax = plt.subplots()
      ax.imshow(
          np.random.random((20, 20)),
          cmap=plt.cm.binary,
          alpha=0.2,
          zorder=4,
          extent=(2, 4, 3, 5),
      )
      rep = fig_to_dict(fig)
      axrep = rep["axes"][0]
      image = axrep["images"][0]
  
      # TODO: how to test data?
      assert_equal(
          list(sorted(image.keys())),
          ["alpha", "coordinates", "data", "extent", "id", "zorder"],
      )
      assert_equal(image["alpha"], 0.2)
      assert_equal(image["extent"], (2, 4, 3, 5))
      assert_equal(image["zorder"], 4)
      assert_equal(image["coordinates"], "data")
  
file_path: mpld3/mpld3/tests/test_elements.py
imports: import numpy
  import matplotlib.pyplot
  from ..None import fig_to_dict, fig_to_html
  from numpy.testing import assert_equal
label_desc: Use image node_id 6 for calling a global function with example usage: test_image() without return types