code: def test_line():
      fig, ax = plt.subplots()
      ax.plot(
          np.arange(10),
          np.random.random(10),
          "--k",
          alpha=0.3,
          zorder=10,
          lw=2,
      )
      rep = fig_to_dict(fig)
      axrep = rep["axes"][0]
      line = axrep["lines"][0]
  
      assert_equal(
          list(sorted(line.keys())),
          [
              "alpha",
              "color",
              "coordinates",
              "dasharray",
              "data",
              "drawstyle",
              "id",
              "linewidth",
              "xindex",
              "yindex",
              "zorder",
          ],
      )
      assert_equal(line["alpha"], 0.3)
      assert_equal(line["color"], "#000000")
      assert_equal(line["coordinates"], "data")
      assert line["dasharray"] in ["7.4,3.2", "6,6"]
      assert_equal(line["zorder"], 10)
      assert_equal(line["linewidth"], 2)
  
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 1 for calling a global function with example usage: test_line() without return types