# 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 heights[-1] == len(x)

    def test_bivariate_histogram(self, x, y):

        h = Histogram()
        heights, edges = h(x, y)
        bins_mpl = (
            np.histogram_bin_edges(x, "auto"),
            np.histogram_bin_edges(y, "auto"),
        )
        heights_mpl, *edges_mpl = np.histogram2d(x, y, bins_mpl)
        assert_array_equal(heights, heights_mpl)
        assert_array_equal(edges[0], edges_mpl[0])
        assert_array_equal(edges[1], edges_mpl[1])

    def test_bivariate_count_stat(self, x, y):

        h = Histogram(stat="count")
        heights, _ = h(x, y)
        assert heights.sum() == len(x)

    def test_bivariate_density_stat(self, x, y):

        h = Histogram(stat="density")
        heights, (edges_x, edges_y) = h(x, y)
        areas = np.outer(np.diff(edges_x), np.diff(edges_y))
        assert (heights * areas).sum() == pytest.approx(1)

    def test_bivariate_probability_stat(self, x, y):


# 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 heights[-1] == len(x)

    def test_bivariate_histogram(self, x, y):

        h = Histogram()
        heights, edges = h(x, y)
        bins_mpl = (
            np.histogram_bin_edges(x, "auto"),
            np.histogram_bin_edges(y, "auto"),
        )
        heights_mpl, *edges_mpl = np.histogram2d(x, y, bins_mpl)
        assert_array_equal(heights, heights_mpl)
        assert_array_equal(edges[0], edges_mpl[0])
        assert_array_equal(edges[1], edges_mpl[1])

    def test_bivariate_count_stat(self, x, y):

        h = Histogram(stat="count")
        heights, _ = h(x, y)
        assert heights.sum() == len(x)

    def test_bivariate_density_stat(self, x, y):

        h = Histogram(stat="density")
        heights, (edges_x, edges_y) = h(x, y)
        areas = np.outer(np.diff(edges_x), np.diff(edges_y))
        assert (heights * areas).sum() == pytest.approx(1)

    def test_bivariate_probability_stat(self, x, y):


        h = Histogram(stat="probability")