def setup_walkers(cfg_emcee, params, level=0.1):
    """Initialize walkers for emcee.

    Parameters
    ----------
    cfg_emcee: dict
        Configuration parameters for emcee.
    params: asap.Parameter object
        Object for model parameters.
    level: float, optional

    Returns
    -------
    ini_positions: numpy array with (N_walker, N_param) shape
        Initial positions of all walkers.

    """
    # Initialize the walkers
    if cfg_emcee['ini_prior']:
        # Use the prior distributions for initial positions of walkers.
        return params.sample(nsamples=cfg_emcee['burnin_n_walker'])

    return params.perturb(nsamples=cfg_emcee['burnin_n_walker'], level=level)