def _get_number_of_warmup_and_kept_draws_from_fit(fit):
    """Get number of warmup draws and kept draws."""

    if 'warmup2' not in fit:
        n_warmup = 0
        n_draws = fit['n_save'][0]
    else:
        n_warmup = fit['warmup2'][0]
        n_draws = fit['n_save'][0] - fit['warmup2'][0]

    return n_warmup, n_draws