code: def test_emcee_custom_pool(self):
      # tests use of a custom pool
  
      if not HAS_EMCEE:
          return True
  
      global emcee_counter
      emcee_counter = 0
  
      class my_pool:
          def map(self, f, arg):
              global emcee_counter
              emcee_counter += 1
              return map(f, arg)
  
      def cost_fun(params, **kwargs):
          return rosen_der([params["a"], params["b"]])
  
      params = Parameters()
      params.add("a", 1, min=-5, max=5, vary=True)
      params.add("b", 1, min=-5, max=5, vary=True)
  
      fitter = Minimizer(cost_fun, params)
      fitter.emcee(workers=my_pool(), steps=1000, nwalkers=100)
      assert emcee_counter > 500
  
imports: import sys
  import unittest
  import numpy
  from numpy import pi
  from numpy.testing import assert_allclose, assert_almost_equal, assert_equal
  import pytest
  from scipy.optimize import rosen_der
  from uncertainties import ufloat
  from lmfit import Minimizer, Parameters, minimize
  from lmfit.lineshapes import gaussian
  from lmfit.minimizer import HAS_EMCEE, SCALAR_METHODS, MinimizerResult, coerce_float64
  from lmfit.models import SineModel
label_desc: Use image node_id 20 for calling the CommonMinimizerTest obj's underlying member method code with example usage: obj.test_emcee_custom_pool() and returns: True, rosen_der, map