def METHOD_NAME(df, t, alternative):
    """Common code between all 3 t-test functions."""
    if alternative != "two-sided" and parse_version(sp_version) < parse_version(
        "1.6.0"
    ):  # pragma: no cover
        raise ValueError("alternative must be 'two-sided' with scipy prior to 1.6.0")
    if alternative == "less":
        prob = t.map_chunk(sp_distributions.t.cdf, args=(df,))
    elif alternative == "greater":
        prob = t.map_chunk(sp_distributions.t.sf, args=(df,))
    elif alternative == "two-sided":
        prob = mt_abs(t).map_chunk(sp_distributions.t.sf, args=(df,)) * 2
    else:
        raise ValueError("alternative must be 'less', 'greater' or 'two-sided'")
    if t.ndim == 0:
        t = t[()]
    return t, prob