code: def test_num_titles(image_array_2bands):
      """Test the number of titles.
  
      If a user provides two titles for a single band array, the function
      should raise an error OR if the title list is a different length than
      the array it should also raise an errors.
      """
      single_band = image_array_2bands[0]
  
      with pytest.raises(
          ValueError,
          match="plot_bands expects one title for a single band array",
      ):
          ep.plot_bands(arr=single_band, title=["Title1", "Title2"])
      with pytest.raises(
          ValueError, match="plot_bands() expects the number"
      ):
          ep.plot_bands(
              arr=image_array_2bands,
              title=["Title1", "Title2", "Title3"],
          )
      plt.close()
  
imports: import pytest
  import matplotlib.pyplot
  import matplotlib.colors
  import earthpy.plot
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: test_num_titles(image_array_2bands) without return types