def METHOD_NAME(
    p_array,
    masker,
    sig_idx,
    nonsig_idx,
    alpha,
    ground_truth_foci_ijks,
    n_iters=None,
    good_sensitivity=True,
    good_specificity=True,
):
    """Check if p-values are within the correct range."""
    ################################################
    # CHECK IF P-VALUES ARE WITHIN THE CORRECT RANGE
    ################################################
    if n_iters:
        assert p_array.min() >= (1.0 / n_iters)
        assert p_array.max() <= 1.0 - (1.0 / n_iters)
    else:
        assert (p_array >= 0).all() and (p_array <= 1).all()
    p_map = masker.inverse_transform(p_array).get_fdata()
    # reformat coordinate indices to index p_map
    gtf_idx = [
        [ground_truth_foci_ijks[i][j] for i in range(len(ground_truth_foci_ijks))]
        for j in range(3)
    ]
    best_chance_p_values = p_map[tuple(gtf_idx)]
    assert all(best_chance_p_values < ALPHA) == good_sensitivity
    p_array_sig = p_array[sig_idx]
    p_array_nonsig = p_array[nonsig_idx]
    # assert that at least 50% of voxels surrounding the foci
    # are significant at alpha = .05
    observed_sig = p_array_sig < alpha
    observed_sig_perc = observed_sig.sum() / len(observed_sig)
    assert (observed_sig_perc >= 0.5) == good_sensitivity
    # assert that more than 95% of voxels farther away
    # from foci are nonsignificant at alpha = 0.05
    observed_nonsig = p_array_nonsig > alpha
    observed_nonsig_perc = observed_nonsig.sum() / len(observed_nonsig)
    assert np.isclose(observed_nonsig_perc, (1 - alpha), atol=0.05) == good_specificity