HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //proc/thread-self/root/usr/local/lib/python3.7/test/__pycache__/test_statistics.cpython-37.pyc
B

��gc)�@sTdZddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlZdd�Z
dd�Zd	d
�Zd`d
d�ZGdd�d�ZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd �d ej�ZGd!d"�d"ej�ZGd#d$�d$ej�ZGd%d&�d&ej�ZGd'd(�d(ej�ZGd)d*�d*ej�ZGd+d,�d,ej�Z Gd-d.�d.ej�Z!Gd/d0�d0ej�Z"Gd1d2�d2ej�Z#Gd3d4�d4ej�Z$Gd5d6�d6�Z%Gd7d8�d8�Z&Gd9d:�d:e%e&�Z'Gd;d<�d<e�Z(Gd=d>�d>e�Z)Gd?d@�d@e�Z*GdAdB�dBe%�Z+GdCdD�dDee+e&�Z,GdEdF�dFee+e&�Z-GdGdH�dHee+�Z.GdIdJ�dJee&�Z/GdKdL�dLe.e&�Z0GdMdN�dNe.e&�Z1GdOdP�dPe.�Z2GdQdR�dRee+e&�Z3GdSdT�dTe%�Z4GdUdV�dVe4ee&�Z5GdWdX�dXe4ee&�Z6GdYdZ�dZe4e�Z7Gd[d\�d\e4e�Z8d]d^�Z9e:d_k�rPe�;�dS)az_Test suite for statistics module, including helper NumericTestCase and
approx_equal function.

�N)�Decimal)�FractioncCst�d|�S)z:Return -1.0 for negatives, including -0.0, otherwise +1.0.�)�math�copysign)�x�r�0/usr/local/lib/python3.7/test/test_statistics.py�signsr
cCsZt|�t|�k	rdSt|t�r2t�|�o0t�|�S|��d}|��d}||koX|dkS)a�Return True if a and b are both the same kind of NAN.

    >>> _nan_equal(Decimal('NAN'), Decimal('NAN'))
    True
    >>> _nan_equal(Decimal('sNAN'), Decimal('sNAN'))
    True
    >>> _nan_equal(Decimal('NAN'), Decimal('sNAN'))
    False
    >>> _nan_equal(Decimal(42), Decimal('NAN'))
    False

    >>> _nan_equal(float('NAN'), float('NAN'))
    True
    >>> _nan_equal(float('NAN'), 0.5)
    False

    >>> _nan_equal(float('NAN'), Decimal('NAN'))
    False

    NAN payloads are not compared.
    F�)�n�N)�type�
isinstance�floatr�isnanZas_tuple)�a�bZaexpZbexprrr	�
_nan_equals
rcCs:tt|�t|��}t||�}|r*||ntd�}||fS)z�Return the absolute and relative errors between two numbers.

    >>> _calc_errors(100, 75)
    (25, 0.25)
    >>> _calc_errors(100, 100)
    (0, 0.0)

    Returns the (absolute error, relative error) between the two arguments.
    �inf)�max�absr)�actual�expected�base�abs_err�rel_errrrr	�_calc_errors<s
r��-���q=�H�����z>cCs�|dks|dkrtd��t�|�s,t�|�r0dS||kr<dSt�|�sPt�|�rTdSt||�}t||tt|�t|���}||kS)a�approx_equal(x, y [, tol [, rel]]) => True|False

    Return True if numbers x and y are approximately equal, to within some
    margin of error, otherwise return False. Numbers which compare equal
    will also compare approximately equal.

    x is approximately equal to y if the difference between them is less than
    an absolute error tol or a relative error rel, whichever is bigger.

    If given, both tol and rel must be finite, non-negative numbers. If not
    given, default values are tol=1e-12 and rel=1e-7.

    >>> approx_equal(1.2589, 1.2587, tol=0.0003, rel=0)
    True
    >>> approx_equal(1.2589, 1.2587, tol=0.0001, rel=0)
    False

    Absolute error is defined as abs(x-y); if that is less than or equal to
    tol, x and y are considered approximately equal.

    Relative error is defined as abs((x-y)/x) or abs((x-y)/y), whichever is
    smaller, provided x or y are not zero. If that figure is less than or
    equal to rel, x and y are considered approximately equal.

    Complex numbers are not directly supported. If you wish to compare to
    complex numbers, extract their real and imaginary parts and compare them
    individually.

    NANs always compare unequal, even with themselves. Infinities compare
    approximately equal if they have the same sign (both positive or both
    negative). Infinities with different signs compare unequal; so do
    comparisons of infinities with finite numbers.
    rz%error tolerances must be non-negativeFT)�
ValueErrorrr�isinfrr)r�y�tol�relZactual_errorZ
allowed_errorrrr	�approx_equalLs"r%c@seZdZdZdS)�
_DoNothinga�
    When doing numeric work, especially with floats, exact equality is often
    not what you want. Due to round-off error, it is often a bad idea to try
    to compare floats with equality. Instead the usual procedure is to test
    them with some (hopefully small!) allowance for error.

    The ``approx_equal`` function allows you to specify either an absolute
    error tolerance, or a relative error, or both.

    Absolute error tolerances are simple, but you need to know the magnitude
    of the quantities being compared:

    >>> approx_equal(12.345, 12.346, tol=1e-3)
    True
    >>> approx_equal(12.345e6, 12.346e6, tol=1e-3)  # tol is too small.
    False

    Relative errors are more suitable when the values you are comparing can
    vary in magnitude:

    >>> approx_equal(12.345, 12.346, rel=1e-4)
    True
    >>> approx_equal(12.345e6, 12.346e6, rel=1e-4)
    True

    but a naive implementation of relative error testing can run into trouble
    around zero.

    If you supply both an absolute tolerance and a relative error, the
    comparison succeeds if either individual test succeeds:

    >>> approx_equal(12.345e6, 12.346e6, tol=1e-3, rel=1e-4)
    True

    N)�__name__�
__module__�__qualname__�__doc__rrrr	r&�s#r&c@s@eZdZdZdZZddd�Zdd�Zd
dd	�Ze	d
d��Z
dS)�NumericTestCasez�Unit test class for numeric work.

    This subclasses TestCase. In addition to the standard method
    ``TestCase.assertAlmostEqual``,  ``assertApproxEqual`` is provided.
    rNcCsZ|dkr|j}|dkr|j}t|tjj�r@t|tjj�r@|j}n|j}||||||�dS)a�Test passes if ``first`` and ``second`` are approximately equal.

        This test passes if ``first`` and ``second`` are equal to
        within ``tol``, an absolute error, or ``rel``, a relative error.

        If either ``tol`` or ``rel`` are None or not given, they default to
        test attributes of the same name (by default, 0).

        The objects may be either numbers, or sequences of numbers. Sequences
        are tested element-by-element.

        >>> class MyTest(NumericTestCase):
        ...     def test_number(self):
        ...         x = 1.0/6
        ...         y = sum([x]*6)
        ...         self.assertApproxEqual(y, 1.0, tol=1e-15)
        ...     def test_sequence(self):
        ...         a = [1.001, 1.001e-10, 1.001e10]
        ...         b = [1.0, 1e-10, 1e10]
        ...         self.assertApproxEqual(a, b, rel=1e-3)
        ...
        >>> import unittest
        >>> from io import StringIO  # Suppress test runner output.
        >>> suite = unittest.TestLoader().loadTestsFromTestCase(MyTest)
        >>> unittest.TextTestRunner(stream=StringIO()).run(suite)
        <unittest.runner.TextTestResult run=2 errors=0 failures=0>

        N)r#r$r�collections�abc�Sequence�_check_approx_seq�_check_approx_num)�self�first�secondr#r$�msg�checkrrr	�assertApproxEqual�sz!NumericTestCase.assertApproxEqualc
	Csrt|�t|�kr:dt|�t|�f}|�||�}|�|��x2tt||��D] \}\}}	|�||	||||�qJWdS)Nz0sequences differ in length: %d items != %d items)�len�_formatMessage�failureException�	enumerate�zipr0)
r1r2r3r#r$r4�standardMsg�ir�errr	r/�s
z!NumericTestCase._check_approx_seqcCs>t||||�rdS|�|||||�}|�||�}|�|��dS)N)r%�_make_std_err_msgr8r9)r1r2r3r#r$r4�idxr<rrr	r0�s
z!NumericTestCase._check_approx_numc	CsJ||kst�d}|dk	r(d|}||}t||�\}}|||||||fS)Nzk  %r != %r
  values differ by more than tol=%r and rel=%r
  -> absolute error = %r
  -> relative error = %rz,numeric sequences first differ at index %d.
)�AssertionErrorr)	r2r3r#r$r@�template�headerrrrrr	r?�sz!NumericTestCase._make_std_err_msg)NNN)N)r'r(r)r*r#r$r6r/r0�staticmethodr?rrrr	r+�s
+
	r+c@seZdZdZdd�ZdS)�TestSignz5Test that the helper function sign() works correctly.cCs$|�td�d�|�td�d�dS)Ngrg����)�assertEqualr
)r1rrr	�
testZeroesszTestSign.testZeroesN)r'r(r)r*rHrrrr	rEsrEc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�ApproxEqualSymmetryTestcCsldddtd�tdd�g}ddd	td
�tdd�g}t|�t|�ksDt�x"t||�D]\}}|�||�qPWdS)Ni�	gfffff�B@gfffff�(�z2.54��6i�	g������B@gR����(�z2.59�)rrr7rAr;�do_relative_symmetry)r1Zargs1Zargs2rrrrr	�test_relative_symmetrys

z.ApproxEqualSymmetryTest.test_relative_symmetrycCs�t||�t||�}}||ks"t�||}t||�t||�}}||d}|�t||d|d��|�t||d|d��dS)Nrr)r#r$)�minrrAr�
assertTruer%)r1rr�deltaZrel_err1Zrel_err2r$rrr	rM-sz,ApproxEqualSymmetryTest.do_relative_symmetrycCsdddddg}d}x�|D]�}x�ttttfD]�}||�d}||}t|t||��}|j||||d�|j|||d	d|d�|j|||d	|dd�|j||||dd�|j|||d	|d�|j|||d	d|d�|j||d
d
d�|j||d
d
d�q*WqWdS)Ni�������ki�mr�d)r#r$rr)�intrrrrr�do_symmetry_test)r1�argsrQr�type_rr"�rrrr	�
test_symmetry9s
z%ApproxEqualSymmetryTest.test_symmetryc
Cs@d}t||||�}t||||�}|�|||�||||f��dS)Nz+approx_equal comparisons don't match for %r)r%rG�format)r1rrr#r$rBZflag1Zflag2rrr	rWQsz(ApproxEqualSymmetryTest.do_symmetry_testN)r'r(r)rNrMr[rWrrrr	rIsrIc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�ApproxEqualExactTestcCsJt||||d�}|�|d|�t||||d�}|�|d|�dS)N)r#r$zequality failure for x=%r)r%rP)r1rr#r$�resultrrr	�do_exactly_equal_test^sz*ApproxEqualExactTest.do_exactly_equal_testcCs xdD]}|�|dd�qWdS)N)�*iMi~:��iiU�
i�r)r_)r1rrrr	�test_exactly_equal_intsds
z,ApproxEqualExactTest.test_exactly_equal_intscCs xdD]}|�|dd�qWdS)N)g�z�G��?g/�$���?g�����e�@g7@gpf@g!�rh��Q@gB`��"KB@r)r_)r1rrrr	�test_exactly_equal_floatsis
z.ApproxEqualExactTest.test_exactly_equal_floatscCsRt}xH|dd�|d�|dd�|dd�|dd	�|dd�gD]}|�|dd�q8WdS)
NrrrrS��	��#�$)rr_)r1�F�frrr	�test_exactly_equal_fractionsns8z1ApproxEqualExactTest.test_exactly_equal_fractionscCs.t}x$t|d���D]}|�|dd�qWdS)Nz8.2 31.274 912.04 16.745 1.2047r)r�map�splitr_)r1�D�drrr	�test_exactly_equal_decimalstsz0ApproxEqualExactTest.test_exactly_equal_decimalscCsJxDdD]<}|�|dd�|�|ddd�t|d�}|�|dd�qWdS)N)�i�i\i�i��g{�G�z�?r�
i�)r_r)r1rrjrrr	�test_exactly_equal_absolutezs


z0ApproxEqualExactTest.test_exactly_equal_absolutecCs2|�td�td�d�|�td�td�d�dS)Nz3.571z0.01rz81.3971)r_r)r1rrr	�$test_exactly_equal_absolute_decimals�sz9ApproxEqualExactTest.test_exactly_equal_absolute_decimalscCsDx(dddtdd�gD]}|�|dd�qW|�td�dtd	��dS)
Ni� g33333SY@g�z�G�rS�rg{�G�z�?z11.68z0.01)rr_r)r1rrrr	�test_exactly_equal_relative�sz0ApproxEqualExactTest.test_exactly_equal_relativecCsLx(dddtdd�gD]}|�|dd�qWt}|�|d�|d	�|d
��dS)Ni9�gˡE��0@g\��(h��rd�g�������?g{�G�z�?z7.2z0.1z0.01)rr_r)r1rrnrrr	�test_exactly_equal_both�sz,ApproxEqualExactTest.test_exactly_equal_bothN)r'r(r)r_rbrcrkrprtrurwryrrrr	r]Xsr]c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�ApproxEqualUnequalTestcCs<x6||fD](}t||dddd�}|�|d|�qWdS)Nrr)r#r$zinequality failure for x=%r)r%�assertFalse)r1rrr^rrr	�do_exactly_unequal_test�sz.ApproxEqualUnequalTest.do_exactly_unequal_testcCsxdD]}|�|�qWdS)N)i�i��i�i�iXC)r|)r1rrrr	�test_exactly_unequal_ints�s
z0ApproxEqualUnequalTest.test_exactly_unequal_intscCsxdD]}|�|�qWdS)N)g��Q�#@g����[�@gfffff�G@gףp=
W"@g=
ףp=1@)r|)r1rrrr	�test_exactly_unequal_floats�s
z2ApproxEqualUnequalTest.test_exactly_unequal_floatscCs@t}x6|dd�|dd�|dd�|dd�gD]}|�|�q*WdS)	NrrSrfre���eiς)rr|)r1rirjrrr	�test_exactly_unequal_fractions�s*z5ApproxEqualUnequalTest.test_exactly_unequal_fractionscCs&x ttd���D]}|�|�qWdS)Nz!3.1415 298.12 3.47 18.996 0.00245)rlrrmr|)r1rorrr	�test_exactly_unequal_decimals�sz4ApproxEqualUnequalTest.test_exactly_unequal_decimalsN)r'r(r)r|r}r~r�r�rrrr	rz�s
rzc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!S)"�ApproxEqualInexactTestc	Csfd}x\||||fD]H}|�||�}|�t||d|dd�|�|�t|||ddd�|�qWdS)NzTest failure for x={!r}, y={!r}rr)r#r$)r\rPr%r{)r1rrQrBr"r4rrr	�do_approx_equal_abs_test�s
z/ApproxEqualInexactTest.do_approx_equal_abs_testcCs*x$dD]}|�|d�|�|d�qWdS)N)i��iI���i����rRrrre�%i�i�&i6�jrsr)r�)r1rrrr	�test_approx_equal_absolute_ints�s
z6ApproxEqualInexactTest.test_approx_equal_absolute_intscCs6x0dD](}|�|d�|�|d�|�|d�qWdS)N)	g�t��q�gfffffFX�g333333�g333333�g�?g�?g333333@g�Q���@g�����ҭ@g�?g{�G�z�?g-C��6?)r�)r1rrrr	�!test_approx_equal_absolute_floats�s
z8ApproxEqualInexactTest.test_approx_equal_absolute_floatscCs\tdd�}dddddddd	d
ddg}x2d
d�|D�D] }|�||�|�|t|��q4WdS)Nr�i����i�rRrFrrSrJ��"�Gcss|]}t|d�VqdS)r�N)r)�.0rrrr	�	<genexpr>�szNApproxEqualInexactTest.test_approx_equal_absolute_fractions.<locals>.<genexpr>)rr�r)r1rQ�
numeratorsrjrrr	�$test_approx_equal_absolute_fractions�s

z;ApproxEqualInexactTest.test_approx_equal_absolute_fractionscCs>td�}x0ttd���D]}|�||�|�||�qWdS)Nz0.01z1.0 3.5 36.08 61.79 7912.3648)rrlrmr�)r1rQrorrr	�#test_approx_equal_absolute_decimals�sz:ApproxEqualInexactTest.test_approx_equal_absolute_decimalscCs|�tddddd��dS)Ng�h㈵��>g�h㈵��g-C��6?r)r#r$)rPr%)r1rrr	�test_cross_zero�sz&ApproxEqualInexactTest.test_cross_zeroc	Csnd}xd|d||d|fD]H}|�||�}|�t||dd|d�|�|�t||d|dd�|�qWdS)NzTest failure for x={!r}, y={!r}rrr)r#r$)r\rPr%r{)r1rrQrBr"r4rrr	�do_approx_equal_rel_test�s
z/ApproxEqualInexactTest.do_approx_equal_rel_testcCsr|�tddddd��|�tddddd��|�tdddd	d��|�td
ddd	d��|�tdddd	d��dS)N�@�/rg
ףp=
�?)r#r$g�G�z��?i�ig�?i�i�)rPr%r{)r1rrr	�test_approx_equal_relative_ints�s
z6ApproxEqualInexactTest.test_approx_equal_relative_intscCs*x$dD]}|�|d�|�|d�qWdS)N)g{�G�Jf�g��������g�������?g�?g\��(|B@g��ʡE>�@g��x��@g{�G�z�?g-C��6?)r�)r1rrrr	�!test_approx_equal_relative_floats�s
z8ApproxEqualInexactTest.test_approx_equal_relative_floatscCspt}tdd�}x\|dd�|dd�|dd�|dd	�gD]4}x.|t|�fD]}|�||�|�||�qFWq4WdS)
Nrdrx�TrJ��1�2�\�U)rrr�)r1rirQrjrorrr	�$test_approx_equal_relative_fractions�s
*z;ApproxEqualInexactTest.test_approx_equal_relative_fractionscCs>x8ttd���D]&}|�|td��|�|td��qWdS)Nz$0.02 1.0 5.7 13.67 94.138 91027.9321z0.001z0.05)rlrrmr�)r1rorrr	�#test_approx_equal_relative_decimalssz:ApproxEqualInexactTest.test_approx_equal_relative_decimalscCst|r
|jn|j}|t|||dd��|r.|jn|j}|t||d|d��|sP|rV|jn|j}|t||||d��dS)Nr)r#r$)rPr{r%)r1rrr#r$Ztol_flagZrel_flagr5rrr	�
do_check_bothsz$ApproxEqualInexactTest.do_check_bothcCs,|�dddddd�|�dddd	dd�dS)
NgR����@g+���@g����Mbp?g���W�8?Tg?5^�I��g%��C��g����Mb`?g-C��6*?)r�)r1rrr	�test_approx_equal_both1sz.ApproxEqualInexactTest.test_approx_equal_both1cCs|�dddddd�dS)NgR����@g+���@g����Mbp?gV�F�?8?TF)r�)r1rrr	�test_approx_equal_both2 sz.ApproxEqualInexactTest.test_approx_equal_both2cCs|�dddddd�dS)NgR����@g+���@g����MbP?g���W�8?FT)r�)r1rrr	�test_approx_equal_both3$sz.ApproxEqualInexactTest.test_approx_equal_both3cCs,|�dddddd�|�dddd	dd�dS)
Ng=
ףp=@g@g{�G�z�?g����MbP?Fg�Q��[�@g�(\��[�@g{�G�z�?giUMu�>)r�)r1rrr	�test_approx_equal_both4(sz.ApproxEqualInexactTest.test_approx_equal_both4N)r'r(r)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr	r��s 		r�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�ApproxEqualSpecialsTestcCs�x�ttfD]z}|d�}|�t||��|�t||dd��|�t||dd��|�t||��|�t||��|�t|d��q
WdS)Nrrrg{�G�z�?i�)rrrPr%r{)r1rYrrrr	�test_inf1sz ApproxEqualSpecialsTest.test_infcCsFx@ttfD]4}|d�}x&||d�dfD]}|�t||��q&Wq
WdS)N�nanri�)rrr{r%)r1rYr��otherrrr	�test_nan;sz ApproxEqualSpecialsTest.test_nancCs&t�dd�}|�t|dddd��dS)NgrFg�������?)r#r$)rrrPr%)r1�nzerorrr	�test_float_zeroesAsz)ApproxEqualSpecialsTest.test_float_zeroescCs&td�}|�t|td�ddd��dS)Nz-0.0rg�������?)r#r$)rrPr%)r1r�rrr	�test_decimal_zeroesEsz+ApproxEqualSpecialsTest.test_decimal_zeroesN)r'r(r)r�r�r�r�rrrr	r�.s
r�c@seZdZdd�Zdd�ZdS)�TestApproxEqualErrorscCs|�ttdddd�dS)NrUrFg�������?)�assertRaisesr r%)r1rrr	�test_bad_tolMsz"TestApproxEqualErrors.test_bad_tolcCs|�ttdddd�dS)NrUrg��������)r�r r%)r1rrr	�test_bad_relQsz"TestApproxEqualErrors.test_bad_relN)r'r(r)r�r�rrrr	r�Jsr�c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�TestNumericTestCasecCs2tj|�}|j|�}x|D]}|�||�qWdS)N)r+r?�generate_substringsZassertIn)r1rXZ
actual_msgrZ	substringrrr	�do_testas


zTestNumericTestCase.do_testcCs|�tttj��dS)N)rP�
issubclassr+�unittest�TestCase)r1rrr	� test_numerictestcase_is_testcasegsz4TestNumericTestCase.test_numerictestcase_is_testcasecCsd}|�|�dS)N)g@g@g�?g�?N)r�)r1rXrrr	�test_error_msg_numericksz*TestNumericTestCase.test_error_msg_numericcCsd}|�|�dS)N)g@g� @g�?g�?rf)r�)r1rXrrr	�test_error_msg_sequencepsz+TestNumericTestCase.test_error_msg_sequencec	CsDt||�\}}d|d|d|d|g}|dk	r@|�d|�|S)z5Return substrings we expect to see in error messages.ztol=%rzrel=%rzabsolute error = %rzrelative error = %rNzdiffer at index %d)r�append)	r1r2r3r#r$r@rrZ
substringsrrr	r�us
z'TestNumericTestCase.generate_substringsN)r'r(r)r�r�r�r�r�rrrr	r�[s
r�c@s(eZdZeZddgZdd�Zdd�ZdS)�GlobalsTestr*�__all__cCs,x&|jD]}|�t|j|�d|�qWdS)Nz%s not present)�expected_metadatarP�hasattr�module)r1�metarrr	�	test_meta�szGlobalsTest.test_metacCsF|j}x:|jD]0}|�|�d�d|�|�t||�d|�qWdS)N�_zprivate name "%s" in __all__zmissing name "%s" in __all__)r�r�r{�
startswithrPr�)r1r��namerrr	�test_check_all�s
zGlobalsTest.test_check_allN)r'r(r)�
statisticsr�r�r�r�rrrr	r��sr�c@s(eZdZe�ejjdkd�dd��ZdS)�DocTestsrz)Docstrings are omitted with -OO and abovecCs0tjttjd�\}}|�|d�|�|d�dS)N)Zoptionflagsr)�doctestZtestmodr��ELLIPSIS�
assertGreaterrG)r1ZfailedZtriedrrr	�test_doc_tests�szDocTests.test_doc_testsN)	r'r(r)r�ZskipIf�sys�flags�optimizer�rrrr	r��sr�c@seZdZdd�ZdS)�StatisticsErrorTestcCs4d}|�ttd��|�ttjt�|tjj�dS)NzNExpected StatisticsError to be a ValueError, but got a subclass of %r instead.�StatisticsError)rPr�r�r�r�r �__base__)r1�errmsgrrr	�test_has_exception�s

z&StatisticsErrorTest.test_has_exceptionN)r'r(r)r�rrrr	r��sr�c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�ExactRatioTestcCs(x"dD]}|�t�|�|df�qWdS)N)i�����rrS�cl F�x:^Vr)rGr��_exact_ratio)r1r=rrr	�test_int�s
zExactRatioTest.test_intcCs6d}x,|D]$}t|d�}|�t�|�|df�q
WdS)N)���rr�&r�)rrGr�r�)r1r�rrjrrr	�
test_fraction�s

zExactRatioTest.test_fractioncCsf|�t�d�d�|�t�d�d�dd�td�D�}x*|D]"}t�|�\}}|�|||�q<WdS)Ng�?)rrxg�?)rerxcSsg|]}t�dd��qS)i����rU)�random�uniform)r�r�rrr	�
<listcomp>�sz-ExactRatioTest.test_float.<locals>.<listcomp>rU)rGr�r��range)r1�datar�num�denrrr	�
test_float�s
zExactRatioTest.test_floatcCsJt}tj}|�||d��d�|�||d��d�|�||d��d�dS)Nz0.125)rrxz12.345)i�	��z-1.98)i����r�)rr�r�rG)r1rnr�rrr	�test_decimal�s
zExactRatioTest.test_decimalcCs�td�}Gdd�dt�}Gdd�dt�}xr||fD]d}x^t|t|fD]N}||�}t�|�}|�||df�|�t|d�|�|�t�|d��qFWq4WdS)N�INFc@seZdZdS)z(ExactRatioTest.test_inf.<locals>.MyFloatN)r'r(r)rrrr	�MyFloat�sr�c@seZdZdS)z*ExactRatioTest.test_inf.<locals>.MyDecimalN)r'r(r)rrrr	�	MyDecimal�sr�r)	rrr�r�rGrrPrr!)r1r�r�r�rrYr�ratiorrr	r��s
zExactRatioTest.test_infcCsxtd�}Gdd�dt�}xZ|||�fD]J}t�|�}|�t�|d��|�|dd�|�t|d�t|��q&WdS)N�NANc@seZdZdS)z.ExactRatioTest.test_float_nan.<locals>.MyFloatN)r'r(r)rrrr	r��sr�rr)	rr�r�rPrr�assertIsrGr)r1r�r�r�r�rrr	�test_float_nan�s
zExactRatioTest.test_float_nancCs�td�}td�}Gdd�dt�}xb|||�|||�fD]J}t�|�}|�t|d|��|�|dd�|�t|d�t|��q6WdS)Nr��sNANc@seZdZdS)z2ExactRatioTest.test_decimal_nan.<locals>.MyDecimalN)r'r(r)rrrr	r��sr�rr)rr�r�rPrr�rGr)r1r�r�r�r�r�rrr	�test_decimal_nan�s
zExactRatioTest.test_decimal_nanN)
r'r(r)r�r�r�r�r�r�r�rrrr	r��s
r�c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�DecimalToRatioTestcCs<td�}|�t�|�|df�|�t�|�|df�dS)Nr�)rrGr�r�)r1rrrr	�
test_infinity�sz DecimalToRatioTest.test_infinitycCsHxBtd�td�fD].}t�|�\}}|�t||��|�|d�qWdS)Nr�r�)rr�r�rPrr�)r1r�r�r�rrr	r��szDecimalToRatioTest.test_nancCs|td�td�g}xf|D]^}|dks&t�t�|�\}}|�|d�|�|d�t�|�\}}|�|d�|�|d�qWdS)Nz	9.8765e12z
9.8765e-12r)rrAr�r��assertGreaterEqualr�ZassertLessEqual)r1Znumbersror�r�rrr	�	test_signs
zDecimalToRatioTest.test_signcCst�td��}|�|d�dS)Nz0.1234)iii�)r�r�rrG)r1�trrr	�test_negative_exponentsz)DecimalToRatioTest.test_negative_exponentcCst�td��}|�|d�dS)Nz1.234e7)i K�r)r�r�rrG)r1r�rrr	�test_positive_exponentsz)DecimalToRatioTest.test_positive_exponentcCs8t�td��}|�|d�t�td��}|�|d�dS)NZ1e2)rUrz1.47e5)i8>r)r�r�rrG)r1r�rrr	�test_regression_20536 sz(DecimalToRatioTest.test_regression_20536N)	r'r(r)r�r�r�r�r�r�rrrr	r��s
r�c@s$eZdZdd�Zdd�Zdd�ZdS)�IsFiniteTestcCs4x.dtdd�dtd�fD]}|�t�|��qWdS)NrSrrdg@z5.5)rrrPr��	_isfinite)r1rrrr	�test_finite,szIsFiniteTest.test_finitecCs.x(td�td�fD]}|�t�|��qWdS)Nr)rrr{r�r�)r1rrrr	r�1szIsFiniteTest.test_infinitycCs4x.td�td�td�fD]}|�t�|��qWdS)Nr�r�r�)rrr{r�r�)r1rrrr	r�6szIsFiniteTest.test_nanN)r'r(r)r�r�r�rrrr	r�)sr�c@sdeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�
CoerceTestcCsRxLttttfD]<}|�t�|t�|�Gdd�d|�}|�t�|t�|�qWdS)Nc@seZdZdS)z%CoerceTest.test_bool.<locals>.MyClassN)r'r(r)rrrr	�MyClassWsr�)rVrrrr�r��_coerce�bool)r1�Tr�rrr	�	test_boolQszCoerceTest.test_boolcCs,|�t�||�|�|�t�||�|�dS)z Assert that type A coerces to B.N)r�r�r�)r1�A�Brrr	�assertCoerceToZszCoerceTest.assertCoerceTocCsT|�||�Gdd�d|�}|�||�Gdd�d|�}|�||�|�||�dS)z6Checks that type A coerces to B, including subclasses.c@seZdZdS)z/CoerceTest.check_coerce_to.<locals>.SubclassOfAN)r'r(r)rrrr	�SubclassOfAdsrc@seZdZdS)z/CoerceTest.check_coerce_to.<locals>.SubclassOfBN)r'r(r)rrrr	�SubclassOfBgsrN)r)r1rrrrrrr	�check_coerce_to_szCoerceTest.check_coerce_tocCs,|�ttj||f�|�ttj||f�dS)z=Assert that coercing A to B, or vice versa, raises TypeError.N)r��	TypeErrorr�r�)r1rrrrr	�assertCoerceRaiseskszCoerceTest.assertCoerceRaisescCs�|tk	st�|�t�||�|�Gdd�d|�}Gdd�d|�}Gdd�d|�}x|||fD]}|�||�q\W|�||�|�||�|�||�dS)z>Check that type T coerces correctly with subclasses of itself.c@seZdZdS)z*CoerceTest.check_type_coercions.<locals>.UN)r'r(r)rrrr	�Uvsrc@seZdZdS)z*CoerceTest.check_type_coercions.<locals>.VN)r'r(r)rrrr	�Vwsr	c@seZdZdS)z*CoerceTest.check_type_coercions.<locals>.WN)r'r(r)rrrr	�Wxsr
N)r�rAr�r�r�rr)r1r�rr	r
�typrrr	�check_type_coercionspszCoerceTest.check_type_coercionscCs.|�t�xtttfD]}|�t|�qWdS)N)rrVrrrr)r1rrrr	r��s
zCoerceTest.test_intcCs|�t�|�tt�dS)N)rrrr)r1rrr	r��s
zCoerceTest.test_fractioncCs|�t�dS)N)rr)r1rrr	r��szCoerceTest.test_decimalcCs|�t�dS)N)rr)r1rrr	r��szCoerceTest.test_floatcCsBx<tttd�ttfD]&}x ttttfD]}|�	||�q&WqWdS)N)
�str�listr�tuple�dictrVrrrr)r1Zbad_typeZ	good_typerrr	�test_non_numeric_types�sz!CoerceTest.test_non_numeric_typescCs>x8ttfD],}Gdd�d|�}|�|t�|�|t�q
WdS)Nc@seZdZdS)z6CoerceTest.test_incompatible_types.<locals>.MySubclassN)r'r(r)rrrr	�
MySubclass�sr)rrrr)r1r�rrrr	�test_incompatible_types�sz"CoerceTest.test_incompatible_typesN)r'r(r)r�rrrrr�r�r�r�rrrrrr	r�<s	r�c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�ConvertTestcCs$|�||�|�t|�t|��dS)z5Check that x equals y, and has the same type as well.N)rGr�r)r1rr"rrr	�check_exact_equal�szConvertTest.check_exact_equalcCsPt�td�t�}|�|d�Gdd�dt�}t�td�|�}|�||d��dS)Nr�c@seZdZdS)z#ConvertTest.test_int.<locals>.MyIntN)r'r(r)rrrr	�MyInt�srrJ)r��_convertrrVr)r1rrrrr	r��s
zConvertTest.test_intcCs\t�tdd�t�}|�|tdd��Gdd�dt�}t�tdd�|�}|�||dd��dS)N�_r�cseZdZ�fdd�Z�ZS)z-ConvertTest.test_fraction.<locals>.MyFractioncs|�t��|��S)N)�	__class__�super�__truediv__)r1r�)rrr	r�sz9ConvertTest.test_fraction.<locals>.MyFraction.__truediv__)r'r(r)r�
__classcell__rr)rr	�
MyFraction�srr��
)r�rrr)r1rrrrr	r��s
zConvertTest.test_fractioncCsTt�tdd�t�}|�|d�Gdd�dt�}t�tdd�|�}|�||d��dS)	NrFrg�cseZdZ�fdd�Z�ZS)z'ConvertTest.test_float.<locals>.MyFloatcs|�t��|��S)N)rrr)r1r�)rrr	r�sz3ConvertTest.test_float.<locals>.MyFloat.__truediv__)r'r(r)rrrr)rr	r��sr�rerxg�?)r�rrrr)r1rr�rrr	r��s
zConvertTest.test_floatcCsXt�tdd�t�}|�|td��Gdd�dt�}t�tdd�|�}|�||d��dS)	Nr�(z0.025cseZdZ�fdd�Z�ZS)z+ConvertTest.test_decimal.<locals>.MyDecimalcs|�t��|��S)N)rrr)r1r�)rrr	r�sz7ConvertTest.test_decimal.<locals>.MyDecimal.__truediv__)r'r(r)rrrr)rr	r��sr�i�rqz-0.9375)r�rrrr)r1rr�rrr	r��s
zConvertTest.test_decimalcCsNxHtd�td�fD]4}x.||fD] }t�|t|��}|�||�q"WqWdS)Nr)rrr�rrr)r1r�rrrrr	r��szConvertTest.test_infcCsDx>td�td�td�fD]$}t�|t|��}|�t||��qWdS)Nr�r�r�)rrr�rrrPr)r1r�rrrr	r��szConvertTest.test_nanN)
r'r(r)rr�r�r�r�r�r�rrrr	r�s


rc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�FailNegTestz Test _fail_neg private function.cCs2ddtd�td�g}tt�|��}|�||�dS)Nrg@rdrr)rrrr��	_fail_negrG)r1�values�newrrr	�test_pass_through�szFailNegTest.test_pass_throughcCsDx>ddtd�td�gD]&}|g}t�|�}|�tjt|�qWdS)Nrg@rdrr)rrr�r!r�r��next)r1r�seq�itrrr	�test_negatives_raise�s
z FailNegTest.test_negatives_raisec
Cspdt�dd�}ytt�dg|��Wn.tjk
rT}z|jd}Wdd}~XYnX|�d�|�||�dS)Nzbadness #%di'i��rFrz(expected exception, but it didn't happen)	r�Zrandintr%r�r!r�rXZfailrG)r1r4r>r�rrr	�test_error_msg�s
zFailNegTest.test_error_msgN)r'r(r)r*r$r(r)rrrr	r �sr c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�UnivariateCommonMixincCs|�t|j�dS)N)r�r�func)r1rrr	�test_no_args�sz"UnivariateCommonMixin.test_no_argscCs.x(gdtg�fD]}|�tj|j|�qWdS)Nr)�iterr�r�r�r+)r1�emptyrrr	�test_empty_data�sz%UnivariateCommonMixin.test_empty_datacCs,ttd��}x|t|�kr&t�|�qW|S)z"Return int data for various tests.rs)rr��sortedr��shuffle)r1r�rrr	�prepare_datasz"UnivariateCommonMixin.prepare_datacCs\|��}t|�dkst�|t|�ks(t�|dd�}||k	s@t�|�|�}|�||d�dS)Nrzdata has been modified)r2r7rAr0r+ZassertListEqual)r1r�Zsavedr�rrr	�test_no_inplace_modificationss
z3UnivariateCommonMixin.test_no_inplace_modificationscCsFddddddddgd}|�|�}t�|�|�|�}|�||�dS)NrrrdrrrS�rU)r+r�r1rG)r1r�rrrrr	�test_order_doesnt_matters



z.UnivariateCommonMixin.test_order_doesnt_mattercCsrGdd�dt�}Gdd�dt�}dd�}|��}|�|�}x2ttt|||fD]}|�||��}|�||�qLWdS)Nc@seZdZdS)zBUnivariateCommonMixin.test_type_of_data_collection.<locals>.MyListN)r'r(r)rrrr	�MyList$sr6c@seZdZdS)zCUnivariateCommonMixin.test_type_of_data_collection.<locals>.MyTupleN)r'r(r)rrrr	�MyTuple&sr7cSsdd�|D�S)Ncss|]
}|VqdS)Nr)r��objrrr	r�)szXUnivariateCommonMixin.test_type_of_data_collection.<locals>.generator.<locals>.<genexpr>r)r�rrr	�	generator(szEUnivariateCommonMixin.test_type_of_data_collection.<locals>.generator)rrr2r+r-rG)r1r6r7r9r�r�kindr^rrr	�test_type_of_data_collection"s
z2UnivariateCommonMixin.test_type_of_data_collectioncCs0tddd�}|�t|��}|�|�|�|�dS)N�r�rd)r�r+rrG)r1r�rrrr	�test_range_data0sz%UnivariateCommonMixin.test_range_datacCs.|�d�|�d�|�d�|�t��dS)Nr�gE@)�check_for_type_error�object)r1rrr	�test_bad_arg_types6s



z(UnivariateCommonMixin.test_bad_arg_typescGs|jt|jf|��dS)N)r�rr+)r1rXrrr	r>Esz*UnivariateCommonMixin.check_for_type_errorcslGdd�dt�}|��}|�|�}xDt|ttfD]4��fdd�|D�}t|�|�|��}|�||�q0WdS)Ncs,eZdZ�fdd�Z�fdd�ZeZ�ZS)z@UnivariateCommonMixin.test_type_of_data_element.<locals>.MyFloatcst|�t��|��S)N)rrr)r1r�)rrr	rMszLUnivariateCommonMixin.test_type_of_data_element.<locals>.MyFloat.__truediv__cst|�t��|��S)N)rr�__add__)r1r�)rrr	rAOszHUnivariateCommonMixin.test_type_of_data_element.<locals>.MyFloat.__add__)r'r(r)rrA�__radd__rrr)rr	r�Lsr�csg|]}�|��qSrr)r�r)r:rr	r�VszCUnivariateCommonMixin.test_type_of_data_element.<locals>.<listcomp>)rr2r+rrrrG)r1r��rawrr�r^r)r:r	�test_type_of_data_elementHs
z/UnivariateCommonMixin.test_type_of_data_elementN)
r'r(r)r,r/r2r3r5r;r=r@r>rDrrrr	r*�s

r*c@s eZdZdZdd�Zdd�ZdS)�UnivariateTypeMixinamMixin class for type-conserving functions.

    This mixin class holds test(s) for functions which conserve the type of
    individual data points. E.g. the mean of a list of Fractions should itself
    be a Fraction.

    Not all tests to do with types need go in this class. Only those that
    rely on the function returning the same type as its input data.
    cCsGdd�dt�}ttt|fS)z4Return the types which are expected to be conserved.cs\eZdZ�fdd�Z�fdd�Z�fdd�Z�fdd�Z�fd	d
�Z�fdd�ZeZ	�Z
S)
zHUnivariateTypeMixin.prepare_types_for_conservation_test.<locals>.MyFloatcst|�t��|��S)N)rrr)r1r�)rrr	rhszTUnivariateTypeMixin.prepare_types_for_conservation_test.<locals>.MyFloat.__truediv__cst|�t��|��S)N)rr�__rtruediv__)r1r�)rrr	rFjszUUnivariateTypeMixin.prepare_types_for_conservation_test.<locals>.MyFloat.__rtruediv__cst|�t��|��S)N)rr�__sub__)r1r�)rrr	rGlszPUnivariateTypeMixin.prepare_types_for_conservation_test.<locals>.MyFloat.__sub__cst|�t��|��S)N)rr�__rsub__)r1r�)rrr	rHnszQUnivariateTypeMixin.prepare_types_for_conservation_test.<locals>.MyFloat.__rsub__cst|�t��|��S)N)rr�__pow__)r1r�)rrr	rIpszPUnivariateTypeMixin.prepare_types_for_conservation_test.<locals>.MyFloat.__pow__cst|�t��|��S)N)rrrA)r1r�)rrr	rArszPUnivariateTypeMixin.prepare_types_for_conservation_test.<locals>.MyFloat.__add__)r'r(r)rrFrGrHrIrArBrrr)rr	r�gsr�)rrr)r1r�rrr	�#prepare_types_for_conservation_testesz7UnivariateTypeMixin.prepare_types_for_conservation_testcsJ|��}x<|��D]0��fdd�|D�}|�|�}|�t|���qWdS)Ncsg|]}�|��qSrr)r�r)r:rr	r�}sz<UnivariateTypeMixin.test_types_conserved.<locals>.<listcomp>)r2rJr+r�r)r1r�ror^r)r:r	�test_types_conservedws

z(UnivariateTypeMixin.test_types_conservedN)r'r(r)r*rJrKrrrr	rE[s	rEc@seZdZdd�ZdS)�
TestSumCommoncCsdd�}||_dS)NcWstj|�\}}}t�||�S)N)r��_sumr�)rXr��valuerrrr	�simplified_sum�sz+TestSumCommon.setUp.<locals>.simplified_sum)r+)r1rOrrr	�setUp�szTestSumCommon.setUpN)r'r(r)rPrrrr	rL�srLc@sdeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�TestSumcCstj|_dS)N)r�rMr+)r1rrr	rP�sz
TestSum.setUpcCstxngdtg�fD]\}|�|�|�ttd�df�|�|�|d�ttd�df�|�|�|d�ttd�df�qWdS)Nrrr�gffffff@)r-rGr+rVrr)r1r�rrr	r/�szTestSum.test_empty_datacCsX|�|�ddddddddg�ttd�d	f�|�|�d
ddddgd
�ttd�df�dS)NrrSrd���i����r<r`�<rxrrrrfi�i�)rGr+rVr)r1rrr	�	test_ints�szTestSum.test_intscCsL|�|�dgd�ttd�df�|�|�ddddgd�ttd�d	f�dS)
Ng�?r<g@g�?g�?g�?g�?g	@rr)rGr+rr)r1rrr	�test_floats�szTestSum.test_floatscCs.|�|�tdd�gd�ttdd�df�dS)Nri�i�r)rGr+r)r1rrr	�test_fractions�szTestSum.test_fractionsc	CsXt}|d�|d�|d�|d�|d�|d�|d�|d�g}|�|�|�ttd	�d
f�dS)Nz0.001z5.246z1.702z-0.025z3.974z2.328z4.617z2.843z20.686rx)rrGr+)r1rnr�rrr	�
test_decimals�s
zTestSum.test_decimalscCs:dd�td�D�}|jt|�|�d�t�|�dd�dS)NcSsg|]}t�dd��qS)i����i�)r�r�)r�r�rrr	r��sz7TestSum.test_compare_with_math_fsum.<locals>.<listcomp>i�rg��ؗ�Ҭ<)r$)r�r6rr+rZfsum)r1r�rrr	�test_compare_with_math_fsum�sz#TestSum.test_compare_with_math_fsumcCs|dd�td�D�}|�|�d}|�|d|�|d�d�|�|d|�|d�d�|�|td�|�|d�d�dS)	NcSsg|]}t�dd��qS)ri�)r�r�)r�r�rrr	r��sz/TestSum.test_start_argument.<locals>.<listcomp>rUrr`r�i��g@��x�D)r�r+rGr)r1r�r�rrr	�test_start_argument�s
zTestSum.test_start_argumentcCs4|�t|jdddgd�|�t|jddddg�dS)NrrrdZ999)r�rr+)r1rrr	�test_strings_fail�szTestSum.test_strings_failcCs4|�t|jdddgd�|�t|jddddg�dS)Nrrrds999)r�rr+)r1rrr	�test_bytes_fail�szTestSum.test_bytes_failcCs8|�t|jddtd�g�|�t|jddgtd��dS)Nrg@)r�rr+r)r1rrr	�test_mixed_sum�szTestSum.test_mixed_sumN)r'r(r)rPr/rTrUrVrWrXrYrZr[r\rrrr	rQ�srQc@seZdZdd�ZdS)�SumTortureTestcCs�|�t�ddddgd�ttd�df�|�t�ddddgd�ttd�df�t�ddddgd�\}}}|�|t�|�|d�|jt|�d	d
d�dS)Nrg}Ô%�I�Tg}Ô%�I��i'g��@i@�g0��.�++rFg���^�,gV瞯�<)r$)rGr�rMrrr�r6)r1r�r��countrrr	�test_torture�szSumTortureTest.test_tortureN)r'r(r)r_rrrr	r]�sr]c@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�SumSpecialValuescCsRxLttfD]@}|d�}t�d|dg�d}|�t|�|�|�t�|��q
WdS)Nr�rr)	rrr�rMr�rrPrr)r1rYr�r^rrr	r��s
zSumSpecialValues.test_nancCsH|�t�|��|�t|�t|��|�|dk|dk�||ksDt�dS)z8Check x is an infinity of the same type and sign as inf.rN)rPrr!r�rrGrA)r1rrrrr	�check_infinity�szSumSpecialValues.check_infinitycCsLt�dd|dg�d}|�||�t�dd|d|dg�d}|�||�dS)Nrrrdrr)r�rMra)r1rr^rrr	�do_test_inf�szSumSpecialValues.do_test_infcCs(td�}xdD]}|�||�qWdS)Nr)rrF)rrb)r1rr
rrr	�test_float_inf�s
zSumSpecialValues.test_float_infcCs(td�}xdD]}|�||�qWdS)Nr)rrF)rrb)r1rr
rrr	�test_decimal_infs
z!SumSpecialValues.test_decimal_infcCs8td�}t�dd|d|dg�d}|�t�|��dS)Nrrrrdrr)rr�rMrPrr)r1rr^rrr	�test_float_mismatched_infssz+SumSpecialValues.test_float_mismatched_infsc	CsPtd�}dd|d|dg}t�tj�� |�t�t�|�d��WdQRXdS)Nrrrrdrr)	r�decimal�localcontextZExtendedContextrPrrr�rM)r1rr�rrr	�3test_decimal_extendedcontext_mismatched_infs_to_nanszDSumSpecialValues.test_decimal_extendedcontext_mismatched_infs_to_nanc	CsHtd�}dd|d|dg}t�tj��|�tjtj|�WdQRXdS)Nrrrrdrr)rrfrgZBasicContextr��InvalidOperationr�rM)r1rr�rrr	�0test_decimal_basiccontext_mismatched_infs_to_nanszASumSpecialValues.test_decimal_basiccontext_mismatched_infs_to_nancCs(td�}d|dg}|�tjtj|�dS)Nr�rr)rr�rfrir�rM)r1r�r�rrr	�test_decimal_snan_raisess
z)SumSpecialValues.test_decimal_snan_raisesN)r'r(r)r�rarbrcrdrerhrjrkrrrr	r`�sr`c@s$eZdZdd�Zdd�Zdd�ZdS)�AverageMixincCs:x4dddtdd�td�fD]}|�|�|g�|�qWdS)Nr�g@E@g�X_yCrL�z0.28)rrrGr+)r1rrrr	�test_single_value&szAverageMixin.test_single_valuecCsdddtdd�td�fS)Ng@rJg��7y�!C�=�Cz4.9712)rr)r1rrr	�'prepare_values_for_repeated_single_test+sz4AverageMixin.prepare_values_for_repeated_single_testcCsZxT|��D]H}xBdD]:}|j||d��"|g|}|�|�|�|�WdQRXqWq
WdS)N)rrSrsr<)rr^)rq�subTestrGr+)r1rr^r�rrr	�test_repeated_single_value.s


z'AverageMixin.test_repeated_single_valueN)r'r(r)rnrqrsrrrr	rl#srlc@steZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�TestMeancCstj|_dS)N)r��meanr+)r1rrr	rP8szTestMean.setUpcCs|�|�ddddg�d�dS)Ng}Ô%�I�Trrdg}Ô%�I��)rGr+)r1rrr	�test_torture_pep;szTestMean.test_torture_pepcCsDddddddddddddddd	d
g}t�|�|�|�|�d�dS)NrrrrdrrrSr4rfrxreg@@)r�r1rGr+)r1r�rrr	rT?s$
zTestMean.test_intscCs4ddddddddg}t�|�|�|�|�d	�dS)
Ng@1@g�3@g4@g�5@g�5@g@7@g 9@g�;@g6@)r�r1rGr+)r1r�rrr	rUEs
zTestMean.test_floatscCsJt}|d�|d�|d�|d�|d�g}t�|�|�|�|�|d��dS)Nz1.634z2.517z3.912z4.072z5.813z3.5896)rr�r1rGr+)r1rnr�rrr	rWKs"
zTestMean.test_decimalsc	Csft}|dd�|dd�|dd�|dd�|dd�|dd�|dd�g}t�|�|�|�|�|d	d
��dS)NrrrdrrrSr4rfrxi�i�)rr�r1rGr+)r1rir�rrr	rVRs<
zTestMean.test_fractionscCsndddddg}xZttfD]N}xHdD]@}|d�|}||g}|�|�}|�t�|��|�||�q"WqWdS)NrrdrSrfre)rrFr)rrr+rPrr!rG)r1rCr:r
rr�r^rrr	r�Ys


zTestMean.test_infc	Cs:dddtd�dddtd�g}|�|�}|�t�|��dS)	Nrrrr4rrrdrSz-inf)rr+rPrr)r1r�r^rrr	�test_mismatched_infsds
zTestMean.test_mismatched_infscCsPdddddg}x<ttfD]0}|d�}||g}|�|�}|�t�|��qWdS)NrrdrSrfrer�)rrr+rPrr)r1rCr:rr�r^rrr	r�js

zTestMean.test_nanc	s\d�dddddddd	d
g	}|�|��}|�ks4t�|��fdd�|D��}|�||�dS)
Nge��Ag333333@g@g������@g������@g333333@g������@g @g333333 @g������"@csg|]}|��qSrr)r�r)�crr	r�ysz*TestMean.test_big_data.<locals>.<listcomp>)r+rArG)r1r�rr^r)rxr	�
test_big_datasszTestMean.test_big_datacCs:dd�td�D�}|�|�}|�|d�}|�||�dS)NcSsg|]}t�dd��qS)r�rS)r�r�)r�r�rrr	r�~sz.TestMean.test_doubled_data.<locals>.<listcomp>i�r)r�r+r6)r1r�rrrrr	�test_doubled_data|s
zTestMean.test_doubled_datacCs td�}|�t�|g�|�dS)NZ1e4)rrGr�ru)r1rorrr	�test_regression_20561�szTestMean.test_regression_20561cCs`|�t�ddg�d�d}d}x<dD]4}|�t�|g|�|�|�t�|g|�|�q$WdS)Ng�������g�g)rrdrSr�)rGr�ru)r1ZbigZtinyrrrr	�test_regression_25177�s
zTestMean.test_regression_25177N)r'r(r)rPrvrTrUrWrVr�rwr�ryrzr{r|rrrr	rt7s		rtcs�eZdZdd�Z�fdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Z�ZS)�TestHarmonicMeancCstj|_dS)N)r�Z
harmonic_meanr+)r1rrr	rP�szTestHarmonicMean.setUpcst���}|�d�|S)Nr)rr2�remove)r1r")rrr	r2�s

zTestHarmonicMean.prepare_datacCsdddtdd�td�fS)Ng@rJg��7y�!Crorpz4.125)rr)r1rrr	rq�sz8TestHarmonicMean.prepare_values_for_repeated_single_testcCs dddg}|�|�|�d�dS)Nrrr)rGr+)r1r"rrr	�	test_zero�s
zTestHarmonicMean.test_zeroc
CsLtj}x@dgdddgfD],}|j|d��|�||j|�WdQRXqWdS)NrFrrRrd)r")r�r�rrr�r+)r1�excr"rrr	�test_negative_error�sz$TestHarmonicMean.test_negative_errorcCs0ddddddg}t�|�|�|�|�d�dS)Nrrrrxrqg333333@)r�r1rGr+)r1r�rrr	rT�s
zTestHarmonicMean.test_intscCsHdddddg}t�|�|�|�|�d�|�|�ddddg�d�dS)Ng�?g�?g�?g�?)r�r1rGr+)r1r�rrr	�test_floats_exact�s
z"TestHarmonicMean.test_floats_exactcCs,x&tdd�D]}|�|�|g�|�qWdS)Nrr�)r�rGr+)r1rrrr	�test_singleton_lists�sz%TestHarmonicMean.test_singleton_listsc	Cs�t}|�|�|d�|d�|d�|d�g�|d��|d�|d�|d�|d�g}t�|�|�|�|�|d��|d�|d�|d	�|d
�g}t�|�|�|�|�|d�d�dS)
NrLr�rSz0.05z0.10z0.20z1.68z0.32z5.94z2.75i�iC)rrGr+r�r1)r1rnr�rrr	�test_decimals_exact�s.

z$TestHarmonicMean.test_decimals_exactc	Csft}|dd�|dd�|dd�|dd�|dd�|dd�|dd�g}t�|�|�|�|�|d	d
��dS)NrrrdrrrSr4rfrxi|i�)rr�r1rGr+)r1rir�rrr	rV�s<
zTestHarmonicMean.test_fractionscCs$dtd�dg}|�|�|�d�dS)Ng@rg�?)rrGr+)r1r"rrr	r��szTestHarmonicMean.test_infcCs(dtd�dg}|�t�|�|���dS)Ng@r�g�?)rrPrrr+)r1r"rrr	r��szTestHarmonicMean.test_nanc	sPd�dddddddd	d
g	}|�|��}|��fdd�|D��}|�||�dS)
N�og333333@g@g������@g������@g333333@g������@g @g333333 @g������"@csg|]}|��qSrr)r�r)rxrr	r��sz>TestHarmonicMean.test_multiply_data_points.<locals>.<listcomp>)r+rG)r1r�rr^r)rxr	�test_multiply_data_points�s
z*TestHarmonicMean.test_multiply_data_pointscCs:dd�td�D�}|�|�}|�|d�}|�||�dS)NcSsg|]}t�dd��qS)rrS)r�r�)r�r�rrr	r��sz6TestHarmonicMean.test_doubled_data.<locals>.<listcomp>i�r)r�r+r6)r1r�rrrrr	rz�s
z"TestHarmonicMean.test_doubled_data)r'r(r)rPr2rqrr�rTr�r�r�rVr�r�r�rzrrr)rr	r}�sr}csTeZdZdd�Z�fdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
�ZS)�
TestMediancCstj|_dS)N)r��medianr+)r1rrr	rP�szTestMedian.setUpcs(t���}t|�ddkr$|�d�|S)z+Overload method from UnivariateCommonMixin.rr)rr2r7r�)r1r�)rrr	r2�s

zTestMedian.prepare_datacCs:ddddddg}t|�ddks$t�|�|�|�d�dS)	NrrrdrrrSr4rg@)r7rArGr+)r1r�rrr	�test_even_ints�szTestMedian.test_even_intscCs<dddddddg}t|�ddks&t�|�|�|�d�dS)NrrrdrrrSr4re)r7rArGr+)r1r�rrr	�
test_odd_intsszTestMedian.test_odd_intscCsjt}|dd�|dd�|dd�|dd�|dd�g}t|�ddksDt�t�|�|�|�|�|dd��dS)NrrfrrdrrrS)rr7rAr�r1rGr+)r1rir�rrr	�test_odd_fractionss
,
zTestMedian.test_odd_fractionscCsrt}|dd�|dd�|dd�|dd�|dd�|dd�g}t|�ddksLt�t�|�|�|�|�|dd��dS)	NrrfrrdrrrSr4r)rr7rAr�r1rGr+)r1rir�rrr	�test_even_fractionss
4
zTestMedian.test_even_fractionscCs^t}|d�|d�|d�|d�|d�g}t|�ddks:t�t�|�|�|�|�|d��dS)Nz2.5z3.1z4.2z5.7z5.8rr)rr7rAr�r1rGr+)r1rnr�rrr	�test_odd_decimalss
"
zTestMedian.test_odd_decimalscCsdt}|d�|d�|d�|d�|d�|d�g}t|�ddks@t�t�|�|�|�|�|d	��dS)
Nz1.2z2.5z3.1z4.2z5.7z5.8rrz3.65)rr7rAr�r1rGr+)r1rnr�rrr	�test_even_decimalss
(
zTestMedian.test_even_decimals)r'r(r)rPr2r�r�r�r�r�r�rrr)rr	r��sr�c@seZdZdd�Zdd�ZdS)�TestMedianDataTypecCstj|_dS)N)r�r�r+)r1rrr	rP*szTestMedianDataType.setUpcCs@ttd��}t|�ddks t�x|t|�kr:t�|�q"W|S)NrLrr)rr�r7rAr0r�r1)r1r�rrr	r2-s
zTestMedianDataType.prepare_dataN)r'r(r)rPr2rrrr	r�(sr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
TestMedianLowcCstj|_dS)N)r�Z
median_lowr+)r1rrr	rP6szTestMedianLow.setUpcCs:ddddddg}t|�ddks$t�|�|�|�d�dS)NrrrdrrrSr4r)r7rArGr+)r1r�rrr	r�9szTestMedianLow.test_even_intscCsrt}|dd�|dd�|dd�|dd�|dd�|dd�g}t|�ddksLt�t�|�|�|�|�|dd��dS)	NrrfrrdrrrSr4r)rr7rAr�r1rGr+)r1rir�rrr	r�?s
4
z!TestMedianLow.test_even_fractionscCsdt}|d�|d�|d�|d�|d�|d�g}t|�ddks@t�t�|�|�|�|�|d��dS)	Nz1.1z2.2z3.3z4.4z5.5z6.6rr)rr7rAr�r1rGr+)r1rnr�rrr	r�Gs
(
z TestMedianLow.test_even_decimalsN)r'r(r)rPr�r�r�rrrr	r�5sr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TestMedianHighcCstj|_dS)N)r�Zmedian_highr+)r1rrr	rPQszTestMedianHigh.setUpcCs:ddddddg}t|�ddks$t�|�|�|�d�dS)NrrrdrrrSr4r)r7rArGr+)r1r�rrr	r�TszTestMedianHigh.test_even_intscCsrt}|dd�|dd�|dd�|dd�|dd�|dd�g}t|�ddksLt�t�|�|�|�|�|dd��dS)	NrrfrrdrrrSr4r)rr7rAr�r1rGr+)r1rir�rrr	r�Zs
4
z"TestMedianHigh.test_even_fractionscCsdt}|d�|d�|d�|d�|d�|d�g}t|�ddks@t�t�|�|�|�|�|d��dS)	Nz1.1z2.2z3.3z4.4z5.5z6.6rr)rr7rAr�r1rGr+)r1rnr�rrr	r�bs
(
z!TestMedianHigh.test_even_decimalsN)r'r(r)rPr�r�r�rrrr	r�Psr�c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�TestMedianGroupedcCstj|_dS)N)r�Zmedian_groupedr+)r1rrr	rPnszTestMedianGrouped.setUpcCsdddddddg}t|�ddks&t�|�|�|�d�dddddddg}t|�ddks^t�|�|�|�d�dd	d	dd
d
d
d
dddg}t|�ddks�t�|�|�|d�d
�dddddd
d
d
dddddddg}t|�ddks�t�|j|�|d�ddd�dS)Nrr�rLrrg�+@rSrsr<�r�g`3@rq�����g������4@g:�0�yE>)r#)r7rArGr+r6)r1r�rrr	�test_odd_number_repeatedqs"z*TestMedianGrouped.test_odd_number_repeatedcCsddddddddddg
}t|�ddks,t�|j|�|d�d	d
d�ddd
d
d
dg}t|�ddksht�|j|�|�dd
d�dddd
d
d
ddddddg}t|�ddks�t�|�|�|�d�dd
d
d
ddddddg
}t|�ddks�t�|�|�|�d�dS)NrSrsrLr<r�r�rrg�����*3@g:�0�yE>)r#rdrrg["8���@r4g@g@)r7rAr6r+rG)r1r�rrr	�test_even_number_repeated�sz+TestMedianGrouped.test_even_number_repeatedcCsTxNdddtdd�td�fD]2}x,dD]$}|g|}|�|�|�t|��q$WqWdS)Ng333333@�Dg��ޗCr�r�z32.9714)rrSrsr<)rrrGr+r)r1rr^r�rrr	rs�s

z,TestMedianGrouped.test_repeated_single_valuecCsdt}|dd�|dd�|dd�|dd�|dd�g}t|�ddksDt�t�|�|�|�|�d�dS)	NrSrrrerrJrrg@)rr7rAr�r1rGr+)r1rir�rrr	r��s
,
z$TestMedianGrouped.test_odd_fractionscCslt}|dd�|dd�|dd�|dd�|dd�|dd�g}t|�ddksLt�t�|�|�|�|�d�dS)	NrSrrrerrJrrg
@)rr7rAr�r1rGr+)r1rir�rrr	r��s
4
z%TestMedianGrouped.test_even_fractionscCsZt}|d�|d�|d�|d�|d�g}t|�ddks:t�t�|�|�|�|�d�dS)Nz5.5z6.5z7.5z8.5rrg@)rr7rAr�r1rGr+)r1rnr�rrr	r��s
"
z#TestMedianGrouped.test_odd_decimalscCs�t}|d�|d�|d�|d�|d�|d�g}t|�ddks@t�t�|�|�|�|�d�|d�|d�|d�|d�|d�|d�g}t|�ddks�t�t�|�|�|�|�d�dS)	Nz5.5z6.5z7.5z8.5rrg@g@)rr7rAr�r1rGr+)r1rnr�rrr	r��s(
(
z$TestMedianGrouped.test_even_decimalscCs�ddddddddddg
}|�|�|d�d	�dddddddddddg}|j|�|d�d
dd�d
d
ddddddddddg}|�|�|d�d�dS)Ng@g@g@g@g
@g@g@g�?g@g["8���@g:�0�yE>)r#����iii,i@iTr<g�p@)rGr+r6)r1r�rrr	�
test_interval�szTestMedianGrouped.test_intervalcCsxdddg}|�t|j|�dddg}|�t|j|�dddg}d}|�t|j||�dddg}d}|�t|j||�dS)N��rrrd)r�rr+)r1r��intervalrrr	�test_data_type_error�s



z&TestMedianGrouped.test_data_type_errorN)
r'r(r)rPr�r�rsr�r�r�r�r�r�rrrr	r�ks	
	r�c@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�TestModecCstj|_dS)N)r��moder+)r1rrr	rP�szTestMode.setUpcCsdddddddddddgS)	z+Overload method from UnivariateCommonMixin.rrdrrrfrerrxrr)r1rrr	r2�szTestMode.prepare_datacCs"tddd�}|�tj|j|�dS)Nr<r�rd)r�r�r�r�r+)r1r�rrr	r=�szTestMode.test_range_datacCs4d}|�|�|�d�d��}|�|�|�d�dS)NZabcbdbrzfe fi fo fum fi fi�fi)rGr+rm)r1r�rrr	�test_nominal_data�szTestMode.test_nominal_datacCsHttd��}x6td�D]*}||g}t�|�|�|�|�|�qWdS)Nrs)rr�r�r1rGr+)r1r�r=rorrr	�test_discrete_data�s


zTestMode.test_discrete_datacCsbdddddddddddddddd	d	g}|�d�|�d�krFdksLnt�|�tj|j|�dS)
NrrrdrrrSr4rfrxre)r^rAr�r�r�r+)r1r�rrr	�test_bimodal_data�s&&zTestMode.test_bimodal_datacCs"ttd��}|�tj|j|�dS)Nrs)rr�r�r�r�r+)r1r�rrr	�test_unique_data_failuresz!TestMode.test_unique_data_failurecCs|�t|jd�dS)N)r�rr+)r1rrr	�test_none_dataszTestMode.test_none_datacCs(t�ddddg�}|�tj|j|�dS)Nrr)r,�Counterr�r�r�r+)r1r�rrr	�test_counter_dataszTestMode.test_counter_dataN)r'r(r)rPr2r=r�r�r�r�r�r�rrrr	r��sr�c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�VarianceStdevMixing�-���q=cCs:x4dddtdd�td�fD]}|�|�|g�d�qWdS)Nr�g������3@g���%�Brvr�z8.392r)rrrGr+)r1rrrr	rn!sz$VarianceStdevMixin.test_single_valuecCsPxJdddtdd�td�fD].}x(dD] }|g|}|�|�|�d�q$WqWdS)	Ng������@r�g@�6��<Crdrfz62.4802)rrdrSrLr)rrrGr+)r1rr^r�rrr	rs&s

z-VarianceStdevMixin.test_repeated_single_valuecCs4dgd}|�|�}|j|ddd�|�|d�dS)Ng.�F7ݚ�?i'gg��ؗ�Ҍ<)r#r)r+r6r�)r1r�r^rrr	�test_domain_error_regression-s

z/VarianceStdevMixin.test_domain_error_regressionc
sNddddddddd	d
g
}|�|�}d��fdd
�|D�}|�|�|�|�dS)Ng{�G�z�?gR���Q�?g
ףp=
�?gR���Q@g�p=
ף@g��Q�	@g@g�Q���@g�G�z�@g��Q�@gj�@csg|]}|��qSrr)r�r)�shiftrr	r�Bsz6VarianceStdevMixin.test_shift_data.<locals>.<listcomp>)r+r6)r1rCrr�r)r�r	�test_shift_data7s

z"VarianceStdevMixin.test_shift_datac
sddddddddddd	g
}td
d�|D��s.t�|�|�}d��fd
d�|D�}|�|�|�|�dS)NrrdrrrSrfrersr�rqcss|]}|t|�kVqdS)N)rV)r�rrrr	r�Hsz;VarianceStdevMixin.test_shift_data_exact.<locals>.<genexpr>iʚ;csg|]}|��qSrr)r�r)r�rr	r�Ksz<VarianceStdevMixin.test_shift_data_exact.<locals>.<listcomp>)�allrAr+rG)r1rCrr�r)r�r	�test_shift_data_exactEs
z(VarianceStdevMixin.test_shift_data_exactcCs6dd�td�D�}|�|�}|�|�t|��|�dS)NcSsg|]}t�dd��qS)r�rx)r�r�)r�r�rrr	r�Vsz:VarianceStdevMixin.test_iter_list_same.<locals>.<listcomp>i�)r�r+rGr-)r1r�rrrr	�test_iter_list_sameNs
z&VarianceStdevMixin.test_iter_list_sameN)
r'r(r)r$rnrsr�r�r�r�rrrr	r�s
	r�c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�
TestPVariancecCstj|_dS)N)r��	pvariancer+)r1rrr	rP]szTestPVariance.setUpcCs0ttd��}t�|�d}|�|�|�|�dS)Ni'gP�_A)rr�r�r1rGr+)r1r�rrrr	�test_exact_uniform`s
z TestPVariance.test_exact_uniformcCs&ddddg}d}|�|�|�|�dS)Nrrrfrrqg�6@)rGr+)r1r��exactrrr	rTgszTestPVariance.test_intscCsXt}|dd�|dd�|dd�|dd�g}|dd�}|�|�}|�||�|�|t�dS)Nrrrrdrfrx)rr+rG�assertIsInstance)r1rir�r�r^rrr	rVms$

zTestPVariance.test_fractionscCsNt}|d�|d�|d�|d�g}|d�}|�|�}|�||�|�|t�dS)Nz12.1z12.2z12.5z12.9z0.096875)rr+rGr�)r1rnr�r�r^rrr	rWvs
zTestPVariance.test_decimalsN)r'r(r)rPr�rTrVrWrrrr	r�[s
	r�c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�TestVariancecCstj|_dS)N)r��variancer+)r1rrr	rP�szTestVariance.setUpcCs:x4dddtdd�td�fD]}|�tj|j|g�qWdS)Nrgg33333�8@g�(G�!=Crmr�z4.2084)rrr�r�r�r+)r1rrrr	rn�szTestVariance.test_single_valuecCs&ddddg}d}|�|�|�|�dS)Nrrrfrrqr�)rGr+)r1r�r�rrr	rT�szTestVariance.test_intscCsXt}|dd�|dd�|dd�|dd�g}|dd�}|�|�}|�||�|�|t�dS)Nrrrrdrfr)rr+rGr�)r1rir�r�r^rrr	rV�s$

zTestVariance.test_fractionscCsZt}|d�|d�|d�|d�g}d|d�|d�}|�|�}|�||�|�|t�dS)Nrrfrerrz9.5rd)rr+rGr�)r1rnr�r�r^rrr	rW�s
zTestVariance.test_decimalsN)r'r(r)rPrnrTrVrWrrrr	r��s
	r�c@seZdZdd�Zdd�ZdS)�
TestPStdevcCstj|_dS)N)r�Zpstdevr+)r1rrr	rP�szTestPStdev.setUpcCs8dd�td�D�}t�t�|��}|�|�|�|�dS)NcSsg|]}t�dd��qS)i��r�)r�r�)r�r�rrr	r��sz7TestPStdev.test_compare_to_variance.<locals>.<listcomp>i�)r�r�sqrtr�r�rGr+)r1r�rrrr	�test_compare_to_variance�sz#TestPStdev.test_compare_to_varianceN)r'r(r)rPr�rrrr	r��sr�c@s$eZdZdd�Zdd�Zdd�ZdS)�	TestStdevcCstj|_dS)N)r�Zstdevr+)r1rrr	rP�szTestStdev.setUpcCs:x4dddtdd�td�fD]}|�tj|j|g�qWdS)N�QgH�z�wi@gf7?+�BrSrvz35.719)rrr�r�r�r+)r1rrrr	rn�szTestStdev.test_single_valuecCs8dd�td�D�}t�t�|��}|�|�|�|�dS)NcSsg|]}t�dd��qS)rRre)r�r�)r�r�rrr	r��sz6TestStdev.test_compare_to_variance.<locals>.<listcomp>i�)r�rr�r�r�rGr+)r1r�rrrr	r��sz"TestStdev.test_compare_to_varianceN)r'r(r)rPrnr�rrrr	r��sr�cCs|�t���|S)z&Used for doctest/unittest integration.)ZaddTestsr�ZDocTestSuite)�loaderZtests�ignorerrr	�
load_tests�sr��__main__)rr)<r*r,Zcollections.abcrfr�rr�r�r�rZ	fractionsrr�r
rrr%r&r�r+rErIr]rzr�r�r�r�r�r�r�r�r�r�r�rr r*rErLrQr]r`rlrtr}r�r�r�r�r�r�r�r�r�r�r�r�r'�mainrrrr	�<module>sr
:+_
>@w-@4d:c'H
@`X9
r<B%#