code: def _test_uniform(proposal, nwalkers=32, nsteps=2000, seed=1234):
      # Set up the random number generator.
      np.random.seed(seed)
  
      # Initialize the ensemble and proposal.
      coords = np.random.rand(nwalkers, 1)
  
      sampler = emcee.EnsembleSampler(
          nwalkers, 1, normal_log_prob, moves=proposal
      )
      sampler.run_mcmc(coords, nsteps)
  
      # Check the acceptance fraction.
      acc = sampler.acceptance_fraction
      assert np.all(
          (acc < 0.9) * (acc > 0.1)
      ), "Invalid acceptance fraction\n{0}".format(acc)
  
      if stats is not None:
          # Check that the resulting chain "fails" the K-S test.
          samps = sampler.get_chain(flat=True)
          np.random.shuffle(samps)
          ks, _ = stats.kstest(samps[::100, 0], "uniform")
          assert ks > 0.1, "The K-S test failed"
  
file_path: emcee/src/emcee/tests/integration/test_proposal.py
imports: import numpy
  import pytest
  import emcee
label_desc: Use image node_id 5 for calling a global function with example usage: _test_uniform(proposal, nwalkers, nsteps, seed) without return types