# Path: seaborn/_statistics.py
# class KDE:
# class Histogram:
# class ECDF:
# class EstimateAggregator:
#     def __init__(
#         self, *,
#         bw_method=None,
#         bw_adjust=1,
#         gridsize=200,
#         cut=3,
#         clip=None,
#         cumulative=False,
#     ):
#     def _define_support_grid(self, x, bw, cut, clip, gridsize):
#     def _define_support_univariate(self, x, weights):
#     def _define_support_bivariate(self, x1, x2, weights):
#     def define_support(self, x1, x2=None, weights=None, cache=True):
#     def _fit(self, fit_data, weights=None):
#     def _eval_univariate(self, x, weights=None):
#     def _eval_bivariate(self, x1, x2, weights=None):
#     def __call__(self, x1, x2=None, weights=None):
#     def __init__(
#         self,
#         stat="count",
#         bins="auto",
#         binwidth=None,
#         binrange=None,
#         discrete=False,
#         cumulative=False,
#     ):
#     def _define_bin_edges(self, x, weights, bins, binwidth, binrange, discrete):
#     def define_bin_params(self, x1, x2=None, weights=None, cache=True):
#     def _eval_bivariate(self, x1, x2, weights):
#     def _eval_univariate(self, x, weights):
#     def __call__(self, x1, x2=None, weights=None):
#     def __init__(self, stat="proportion", complementary=False):
#     def _eval_bivariate(self, x1, x2, weights):
#     def _eval_univariate(self, x, weights):
#     def __call__(self, x1, x2=None, weights=None):
#     def __init__(self, estimator, errorbar=None, **boot_kws):
#     def __call__(self, data, var):
# def _percentile_interval(data, width):
# def _validate_errorbar_arg(arg):
#     DEFAULT_LEVELS = {
#         "ci": 95,
#         "pi": 95,
#         "se": 1,
#         "sd": 1,
#     }


import numpy as np
import pandas as pd
    import statsmodels.distributions as smdist
import pytest
from numpy.testing import assert_array_equal, assert_array_almost_equal
from .._statistics import (
    KDE,
    Histogram,
    ECDF,
    EstimateAggregator,
    _validate_errorbar_arg,
    _no_scipy,
)
        assert out["xmax"] == (long_df["x"].mean() + 2 * long_df["x"].sem())

    def test_sd_errorbars(self, long_df):

        agg = EstimateAggregator("mean", "sd")
        out = agg(long_df, "x")
        assert out["x"] == long_df["x"].mean()
        assert out["xmin"] == (long_df["x"].mean() - long_df["x"].std())
        assert out["xmax"] == (long_df["x"].mean() + long_df["x"].std())

        agg = EstimateAggregator("mean", ("sd", 2))
        out = agg(long_df, "x")
        assert out["x"] == long_df["x"].mean()
        assert out["xmin"] == (long_df["x"].mean() - 2 * long_df["x"].std())
        assert out["xmax"] == (long_df["x"].mean() + 2 * long_df["x"].std())

    def test_pi_errorbars(self, long_df):

        agg = EstimateAggregator("mean", "pi")
        out = agg(long_df, "y")
        assert out["ymin"] == np.percentile(long_df["y"], 2.5)
        assert out["ymax"] == np.percentile(long_df["y"], 97.5)

        agg = EstimateAggregator("mean", ("pi", 50))
        out = agg(long_df, "y")
        assert out["ymin"] == np.percentile(long_df["y"], 25)
        assert out["ymax"] == np.percentile(long_df["y"], 75)

    def test_ci_errorbars(self, long_df):


# Path: seaborn/_statistics.py
# class KDE:
# class Histogram:
# class ECDF:
# class EstimateAggregator:
#     def __init__(
#         self, *,
#         bw_method=None,
#         bw_adjust=1,
#         gridsize=200,
#         cut=3,
#         clip=None,
#         cumulative=False,
#     ):
#     def _define_support_grid(self, x, bw, cut, clip, gridsize):
#     def _define_support_univariate(self, x, weights):
#     def _define_support_bivariate(self, x1, x2, weights):
#     def define_support(self, x1, x2=None, weights=None, cache=True):
#     def _fit(self, fit_data, weights=None):
#     def _eval_univariate(self, x, weights=None):
#     def _eval_bivariate(self, x1, x2, weights=None):
#     def __call__(self, x1, x2=None, weights=None):
#     def __init__(
#         self,
#         stat="count",
#         bins="auto",
#         binwidth=None,
#         binrange=None,
#         discrete=False,
#         cumulative=False,
#     ):
#     def _define_bin_edges(self, x, weights, bins, binwidth, binrange, discrete):
#     def define_bin_params(self, x1, x2=None, weights=None, cache=True):
#     def _eval_bivariate(self, x1, x2, weights):
#     def _eval_univariate(self, x, weights):
#     def __call__(self, x1, x2=None, weights=None):
#     def __init__(self, stat="proportion", complementary=False):
#     def _eval_bivariate(self, x1, x2, weights):
#     def _eval_univariate(self, x, weights):
#     def __call__(self, x1, x2=None, weights=None):
#     def __init__(self, estimator, errorbar=None, **boot_kws):
#     def __call__(self, data, var):
# def _percentile_interval(data, width):
# def _validate_errorbar_arg(arg):
#     DEFAULT_LEVELS = {
#         "ci": 95,
#         "pi": 95,
#         "se": 1,
#         "sd": 1,
#     }


# Path: seaborn/tests/test_statistics.py
import numpy as np
import pandas as pd
    import statsmodels.distributions as smdist
import pytest
from numpy.testing import assert_array_equal, assert_array_almost_equal
from .._statistics import (
    KDE,
    Histogram,
    ECDF,
    EstimateAggregator,
    _validate_errorbar_arg,
    _no_scipy,
)

        assert out["xmax"] == (long_df["x"].mean() + 2 * long_df["x"].sem())

    def test_sd_errorbars(self, long_df):

        agg = EstimateAggregator("mean", "sd")
        out = agg(long_df, "x")
        assert out["x"] == long_df["x"].mean()
        assert out["xmin"] == (long_df["x"].mean() - long_df["x"].std())
        assert out["xmax"] == (long_df["x"].mean() + long_df["x"].std())

        agg = EstimateAggregator("mean", ("sd", 2))
        out = agg(long_df, "x")
        assert out["x"] == long_df["x"].mean()
        assert out["xmin"] == (long_df["x"].mean() - 2 * long_df["x"].std())
        assert out["xmax"] == (long_df["x"].mean() + 2 * long_df["x"].std())

    def test_pi_errorbars(self, long_df):

        agg = EstimateAggregator("mean", "pi")
        out = agg(long_df, "y")
        assert out["ymin"] == np.percentile(long_df["y"], 2.5)
        assert out["ymax"] == np.percentile(long_df["y"], 97.5)

        agg = EstimateAggregator("mean", ("pi", 50))
        out = agg(long_df, "y")
        assert out["ymin"] == np.percentile(long_df["y"], 25)
        assert out["ymax"] == np.percentile(long_df["y"], 75)

    def test_ci_errorbars(self, long_df):


        agg = EstimateAggregator("mean", "ci", n_boot=100000, seed=0)