code: def test_stock_legend_titles(arr_plot_blues):
      """Test that the correct number of default titles plot."""
  
      im_ax, im_arr_bin = arr_plot_blues
  
      # Default legend title values
      def_titles = [
          "Category {}".format(i) for i in np.unique(im_arr_bin)
      ]
  
      the_legend = ep.draw_legend(im_ax=im_ax)
      # Legend handle titles should equal unique values in ax array
      assert len(the_legend.get_texts()) == len(
          np.unique(im_ax.get_array().data)
      )
      assert def_titles == [
          text.get_text() for text in the_legend.get_texts()
      ]
      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 9 for calling a global function with example usage: test_stock_legend_titles(arr_plot_blues) without return types