code: def test_plot_cost_history_return_type(trained_optimizer, history):
      """Tests if plot_cost_history() returns a SubplotBase instance"""
      opt_params = vars(trained_optimizer)
      plot = plot_cost_history(opt_params[history])
      assert isinstance(plot, SubplotBase)
  
file_path: pyswarms/tests/utils/plotters/test_plotters.py
imports: import os
  import pytest
  import matplotlib
  from matplotlib.animation import FuncAnimation
  from matplotlib.axes import SubplotBase
  from pyswarms.utils.plotters import plot_contour, plot_cost_history, plot_surface
  from pyswarms.utils.plotters.plotters import _animate, _mesh
label_desc: Use image node_id 1 for calling a global function with example usage: test_plot_cost_history_return_type(trained_optimizer, history) without return types