def METHOD_NAME(samples_a, samples_b, stats_a, stats_b, p_threshold=0.002):
    """Check whether the samples are statistically different.
    If sample data is not provided, or the sample is too small, falls
    back to a pessimistic CI-based check. If it returns True, then the
    difference is statistically significant. If it returns False, it
    might or might not be statistically significant.
    Parameters
    ----------
    samples_a, samples_b
        Input samples
    stats_a, stats_b
        Input stats data
    """
    if samples_a is not None and samples_b is not None:
        # Raw data present: Mann-Whitney U test, but only if there's
        # enough data so that the test can return True
        a = [x for x in samples_a if not math.isnan(x)]
        b = [x for x in samples_b if not math.isnan(x)]
        p_min = 1 / binom(len(a) + len(b), min(len(a), len(b)))
        if p_min < p_threshold:
            _, p = mann_whitney_u(a, b)
            return p < p_threshold
    # If confidence intervals overlap, reject.
    # Corresponds to a test with ill-specified threshold p-value,
    # which generally can be significantly smaller than p <= 0.01
    # depending on the actual data. For normal test (known variance),
    # 0.00027 <= p <= 0.01.
    ci_a = (stats_a['ci_99_a'], stats_a['ci_99_b'])
    ci_b = (stats_b['ci_99_a'], stats_b['ci_99_b'])
    if ci_a[1] >= ci_b[0] and ci_a[0] <= ci_b[1]:
        return False
    return True