code: def emcee_schools_model(data, draws, chains):
      """Schools model in emcee."""
      import emcee
  
      chains = 10 * chains  # emcee is sad with too few walkers
      y = data["y"]
      sigma = data["sigma"]
      J = data["J"]  # pylint: disable=invalid-name
      ndim = J + 2
  
      pos = np.random.normal(size=(chains, ndim))
      pos[:, 1] = np.absolute(
          pos[:, 1]
      )  #  pylint: disable=unsupported-assignment-operation
  
      if emcee_version() < 3:
          sampler = emcee.EnsembleSampler(
              chains, ndim, _emcee_lnprob, args=(y, sigma)
          )
          # pylint: enable=unexpected-keyword-arg
          sampler.run_mcmc(pos, draws)
      else:
          here = os.path.dirname(os.path.abspath(__file__))
          data_directory = os.path.join(here, "saved_models")
          filepath = os.path.join(data_directory, "reader_testfile.h5")
          backend = emcee.backends.HDFBackend(
              filepath
          )  # pylint: disable=no-member
          backend.reset(chains, ndim)
          # pylint: disable=unexpected-keyword-arg
          sampler = emcee.EnsembleSampler(
              chains,
              ndim,
              _emcee_lnprob,
              args=(y, sigma),
              backend=backend,
          )
          # pylint: enable=unexpected-keyword-arg
          sampler.run_mcmc(pos, draws, store=True)
      return sampler
  
imports: import gzip
  import importlib
  import logging
  import os
  import sys
  from typing import Any, Dict, List, Optional, Tuple, Union
  import cloudpickle
  import numpy
  import pytest
  from _pytest.outcomes import Skipped
  from packaging.version import Version
  from ..data import InferenceData, from_dict
label_desc: Use image node_id 15 for calling a global function with example usage: emcee_schools_model(data, draws, chains) and returns: sampler