code: def test_non_ax_obj():
      """Draw_legend fun should raise AttributeError if provided with a
      non mpl axis object"""
  
      with pytest.raises(
          AttributeError,
          match="The legend function requires a matplotlib axis object",
      ):
          ep.draw_legend(im_ax=list())
  
imports: import numpy
  import pytest
  import matplotlib
  import matplotlib.pyplot
  from matplotlib.colors import ListedColormap
  import earthpy.plot
label_desc: Use image node_id 11 for calling a global function with example usage: test_non_ax_obj() without return types