code: def _worker(args):
      i, outfn, nsteps = args
  
      pid = os.getpid()
      _random = _rngs.get(
          pid, np.random.RandomState(int(int(pid) + time.time()))
      )
      _rngs[pid] = _random
  
      ndim = int(np.ceil(2 ** (7 * _random.rand())))
      nwalkers = 2 * ndim + 2
      # nwalkers += nwalkers % 2
      print(ndim, nwalkers)
  
      cov = random_cov(ndim)
      icov = np.linalg.inv(cov)
  
      ens_samp = emcee.EnsembleSampler(
          nwalkers, ndim, lnprobfn, args=[icov]
      )
      ens_samp.random_state = _random.get_state()
      pos, lnprob, state = ens_samp.run_mcmc(
          np.random.randn(nwalkers * ndim).reshape([nwalkers, ndim]),
          nsteps,
      )
  
      proposal = np.diag(cov.diagonal())
      mh_samp = emcee.MHSampler(proposal, ndim, lnprobfn, args=[icov])
      mh_samp.random_state = state
      mh_samp.run_mcmc(np.random.randn(ndim), nsteps)
  
      f = h5py.File(outfn)
      f["data"][i, :] = np.array(
          [ndim, np.mean(ens_samp.acor), np.mean(mh_samp.acor)]
      )
      f.close()
  
file_path: emcee/document/plots/oned.py
imports: import os
  import sys
  import time
  from multiprocessing import Pool
  import h5py
  import matplotlib.pyplot
  import numpy
  import emcee
label_desc: Use image node_id 3 for calling a global function with example usage: _worker(args) without return types