class_docstr: Ensure that mpld3renderer filters out empty line collections. 
docstr: Create an empty line collection by requesting invalid contours, and
  check that a collection with length(paths) === 0 is not passed to the
  JavaScript.
docstr_tok: ["Create","an","empty","line","collection","by","requesting","invalid","contours",",","and","check","that","a","collection","with","length","(","paths",")","===","0","is","not","passed","to","the","JavaScript","."]
code: def test_extra_contour(self):
      """Create an empty line collection by requesting invalid contours, and
      check that a collection with length(paths) === 0 is not passed to the
      JavaScript.
      """
      fig, ax = plt.subplots()
      X, Y = np.mgrid[0:5, 0:5]
      Z = X**2 - Y**2
      ax.contour(X, Y, Z, range(-15, 18, 2))  # last contour level is 17
      # but Z.max() is 16
      jsondict = mpld3.fig_to_dict(fig)
  
      for collection in jsondict["axes"][0]["collections"]:
          self.assertTrue(len(collection["paths"]) != 0)
      return
  
imports: import unittest
  import numpy
  import matplotlib.pyplot
  import mpld3
label_desc: Use image node_id 1 for calling the empty_collection_tests obj's underlying member method code with example usage: obj.test_extra_contour() without return types