docstr: Test to check global optimiser returns the correct position corresponding to the best cost 
docstr_tok: ["Test","to","check","global","optimiser","returns","the","correct","position","corresponding","to","the","best","cost"]
code: def test_global_correct_pos(self, options):
      """Test to check global optimiser returns the correct position corresponding to the best cost"""
      opt = GlobalBestPSO(n_particles=10, dimensions=2, options=options)
      cost, pos = opt.optimize(sphere, iters=5)
      # find best pos from history
      min_cost_idx = np.argmin(opt.cost_history)
      min_pos_idx = np.argmin(sphere(opt.pos_history[min_cost_idx]))
      assert np.array_equal(
          opt.pos_history[min_cost_idx][min_pos_idx], pos
      )
  
file_path: pyswarms/tests/optimizers/test_global_best.py
imports: import pytest
  import numpy
  from pyswarms.single import GlobalBestPSO
  from pyswarms.utils.functions.single_obj import sphere
  from .abc_test_optimizer import ABCTestOptimizer
label_desc: Use image node_id 4 for calling the TestGlobalBestOptimizer obj's underlying member method code with example usage: obj.test_global_correct_pos(options) without return types