code: def test_listed_cmap_3_classes(vals_missing_plot_list_cmap):
      """Test legend for a listed cmap where
      the user wants all classes to be drawn in the legend. IE the classified
      image has classes 2,3,4 and the user wants classes 1-5 to appear.
      """
  
      im_ax, arr = vals_missing_plot_list_cmap
  
      class_list = list(range(5))
      leg = ep.draw_legend(im_ax, classes=class_list)
      legend_cols = [i.get_facecolor() for i in leg.get_patches()]
  
      assert len(legend_cols) == len(class_list)
      plt.close()
  
imports: import numpy
  import pytest
  import matplotlib
  import matplotlib.pyplot
  from matplotlib.colors import ListedColormap
  import earthpy.plot
label_desc: Use image node_id 17 for calling a global function with example usage: test_listed_cmap_3_classes(vals_missing_plot_list_cmap) without return types