Ë
    •KêjÞ­  ã                  óò  — d Z ddlmZ ddlZddlZddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
m
Z
 dd	l
mZ dd
lmZ ddlmZ ddlZddlmZ ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlmZ erddlmZ ne Zd5d„Z!	 	 	 	 	 	 	 	 d6d„Z"	 	 	 	 	 	 	 	 	 	 	 	 	 	 d7d„Z# ed«      Z$ edd¬«      Z% G d„ dejL                  ee%   «      Z'd„ Z( G d„ d e'e   «      Z) G d!„ d"e'eeef      «      Z* G d#„ d$e'ee      «      Z+ G d%„ d&e'e%   «      Z, G d'„ d(e,e   «      Z- G d)„ d*e'e
ez     «      Z.	 	 	 d8	 	 	 	 	 	 	 	 	 d9d+„Z/d:d,„Z0	 	 	 	 	 	 	 	 d;d-„Z1d<d.„Z2d=d/„Z3d>d0„Z4d?d1„Z5d@d2„Z6d@d3„Z7d@d4„Z8y)Az&The implementation of pytest.approx().é    )ÚannotationsN)Ú
Collection)ÚMapping)ÚSequence)ÚSized)Údatetime)Ú	timedelta)ÚDecimal)ÚFloatOperation)ÚComplex)ÚAny)ÚGeneric)ÚSupportsAbs)ÚTYPE_CHECKING)Ú	TypeGuard)ÚTypeVar)Ú#PytestApproxDecimalToleranceWarning)Úndarrayc                ó"   — | €|S t        | |«      S )a°  Track a running maximum without seeding it with a value of another type.

    Seeding with ``-math.inf`` compares a float against whatever is being
    accumulated. For Decimal that comparison is exact, but it signals
    ``decimal.FloatOperation`` when that trap is set, and the sequence variant
    used to swallow the signal (``decimal.FloatOperation`` is a ``TypeError``
    subclass) and report ``-inf`` as the difference.
    )Úmax)ÚcurrentÚ	candidates     úS/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/_pytest/approx.pyÚ	_max_diffr   %   s   € ð  ˜ˆ9ÐD¬S°¸)Ó-DÐDó    c                ó|   — |rt         j                  }| €t         j                   n| |€t         j                   fS |fS )zÕTurn the accumulators into the values shown in the failure message.

    ``-math.inf`` means "no difference could be computed at all", which happens
    when every mismatched element is a non-number (#13012).
    )ÚmathÚinf)Úmax_abs_diffÚmax_rel_diffÚrel_diff_is_infinites      r   Ú_vetted_diffsr"   1   sE   € ñ Ü—x‘xˆà!Ð)Œ�‰‰	¨|Ø!Ð)Œ�‰ˆ	ðð à/;ðð r   c                ó¶  — t        |«      }|j                  dd«       g d¢}|D ]W  \  }}	}
t        |d   t        |«      «      |d<   t        |d   t        |	«      «      |d<   t        |d   t        |
«      «      |d<   ŒY dt        |«      › d|› d�d	|› �d
|› �g|D ��	�
cg c](  \  }}	}
|d|d   › d�›d|	d|d   › d�›d|
d|d   › d�›�‘Œ* c}
}	}z   }|S c c}
}	}w )Nr   )ÚIndexÚObtainedÚExpected)r   r   r   é   é   z(comparison failed. Mismatched elements: z / ú:zMax absolute difference: zMax relative difference: ú<Ú z | )ÚlistÚinsertr   Úlen)Úfull_objectÚmessage_dataÚnumber_of_elementsÚdifferent_idsr   r    Úmessage_listÚ	max_sizesÚindexÚobtainedÚexpectedÚindexesÚexplanations                r   Ú_compare_approxr:   A   s2  € ô ˜Ó%€LØ×Ñ˜Ð<Ô=Ú€IØ%1ò 8Ñ!ˆˆx˜Ü˜9 Q™<¬¨U«Ó4ˆ	�!‰Ü˜9 Q™<¬¨X«Ó7ˆ	�!‰Ü˜9 Q™<¬¨X«Ó7ˆ	�!Šð8ð
 3´3°}Ó3EÐ2FÀcÐJ\ÐI]Ð]^Ð_Ø
# L >Ð2Ø
# L >Ð2ðð ,8÷	ð 	á'ˆG�X˜xð �1�Y˜q‘\�N  Ð"Ð
# 3 x°°)¸A±,°¸pÐ/?Ð&@ÀÀHÈQÈyÐYZÉ|ÈnÐ\\ÐL\ÐC]Ò^ô	ñ	€Kð Ðùô		s   Â-C
ÚTÚ	ExpectedTT)Ú	covariantc                  óˆ   — e Zd ZdZdZdZdZ	 	 	 	 	 	 	 	 	 	 dd„Zej                  dd„«       Z	dd„Z
dd„Zd	„ ZdZdd
„Zdd„Zy)ÚApproxzÜThe return type of :func:`pytest.approx`.

    ``Approx`` objects support (approximate) equality comparisons and ``repr``,
    and can also be used with ``isinstance(..., pytest.Approx)``.

    .. versionadded:: 9.2
    ÚpytestNéd   c                ó<   — || _         || _        || _        || _        y ©N)r7   ÚrelÚabsÚnan_ok)Úselfr7   rD   rE   rF   s        r   Ú__init__zApprox.__init__n   s    € ð !ˆŒàˆŒàˆŒàˆ�r   c                ó   — t         ‚rC   ©ÚNotImplementedError©rG   s    r   Ú__repr__zApprox.__repr__~   s   € ä!Ð!r   c                ó   — dd|› �d| › �gS )Núcomparison failedú
Obtained: ú
Expected: © )rG   Ú
other_sides     r   Ú_repr_comparezApprox._repr_compare‚   s#   € àØ˜˜Ð%Ø˜˜Ðð
ð 	
r   c                óJ   ‡ — t        ˆ fd„‰ j                  |«      D «       «      S )Nc              3  óL   •K  — | ]  \  }}|‰j                  |«      k(  –— Œ y ­wrC   ©Ú_approx_scalar)Ú.0ÚaÚxrG   s      €r   ú	<genexpr>z Approx.__eq__.<locals>.<genexpr>Š   s*   øè ø€ ò 
Ù,0¨A¨qˆA�×$Ñ$ QÓ'Õ'ñ
ùs   ƒ!$)ÚallÚ_yield_comparisons©rG   Úactuals   ` r   Ú__eq__zApprox.__eq__‰   s(   ø€ Üó 
Ø48×4KÑ4KÈFÓ4Sô
ó 
ð 	
r   c                ó   — d}t        d«      ‚)NTzVapprox() is not supported in a boolean context.
Did you mean: `assert a == approx(b)`?)ÚAssertionError)rG   Ú__tracebackhide__s     r   Ú__bool__zApprox.__bool__Ž   s   € Ø ÐÜØeó
ð 	
r   c                ó\  — t        |t        «      r-t        || j                  | j                  | j
                  ¬«      S t        |t        t        f«      r-t        || j                  | j                  | j
                  ¬«      S t        || j                  | j                  | j
                  ¬«      S )N©rD   rE   rF   )
Ú
isinstancer
   ÚApproxDecimalrD   rE   rF   r   r	   ÚApproxTimedeltaÚApproxScalar)rG   r[   s     r   rX   zApprox._approx_scalar—   sr   € Ü�aœÔ!Ü  ¨¯©°d·h±hÀtÇ{Á{ÔSÐSÜ�aœ(¤IÐ.Ô/Ü" 1¨$¯(©(¸¿¹ÈÏÉÔUÐUÜ˜A 4§8¡8°·±À$Ç+Á+ÔNÐNr   c                ó   — t         ‚)zoYield all the pairs of numbers to be compared.

        This is used to implement the `__eq__` method.
        rJ   r_   s     r   r^   zApprox._yield_comparisonsž   s
   € ô
 "Ð!r   ©
r7   r<   rD   ú"float | Decimal | timedelta | NonerE   rn   rF   ÚboolÚreturnÚNone©rp   Ústr)rp   ú	list[str]©rp   ro   )rp   z#ApproxScalar[Any] | ApproxTimedelta©r`   Úobject)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__array_ufunc__Ú__array_priority__rH   ÚabcÚabstractmethodrM   rT   ra   re   Ú__hash__rX   r^   rR   r   r   r?   r?   _   s‹   „ ñð €Jð €OØÐðàðð 0ðð 0ð	ð
 ðð 
óð  	×Ñò"ó ð"ó
ó
ò

ð €HóOô"r   r?   c                óÎ   ‡ — t        |t        t        z  «      rt        |«      } |ˆ fd„|D «       «      S t	        |«      r|D �cg c]  }t        ‰ |«      ‘Œ c}S  ‰ |«      S c c}w )z=Recursively map a function over a sequence of arbitrary depthc              3  ó6   •K  — | ]  }t        ‰|«      –— Œ y ­wrC   )Ú_recursive_sequence_map)rY   ÚxiÚfs     €r   r\   z*_recursive_sequence_map.<locals>.<genexpr>ª   s   øè ø€ ÒC¸2Ô/°°2×6ÑCùs   ƒ)rh   r,   ÚtupleÚtypeÚ_is_sequence_likerƒ   )r…   r[   Úseq_typer„   s   `   r   rƒ   rƒ   ¦   sZ   ø€ ä�!”TœE‘\Ô"Ü˜“7ˆÙÓCÀÔCÓCÐCÜ	˜1Ô	Ø9:Ö;°2Ô'¨¨2Õ.Ò;Ð;á�‹tˆùò <s   ÁA"c                  ó:   ‡ — e Zd ZdZdd„Zdd„Zdˆ fd„Zd„ Zˆ xZS )	ÚApproxNumpyzHPerform approximate comparisons where the expected value is numpy array.c                ój   — t        | j                  | j                  j                  «       «      }d|›d�S ©Núapprox(ú))rƒ   rX   r7   Útolist)rG   Úlist_scalarss     r   rM   zApproxNumpy.__repr__´   s6   € Ü.Ø×Ñ §¡×!5Ñ!5Ó!7ó
ˆð ˜Ð(¨Ð*Ð*r   c                ó*  — dd l }	 	 	 	 	 	 d	d„}| j                  j                  }t        | j                  | j                  j                  «       «      }t        |«      }|€J ‚||j                  k7  rdd|› d|j                  › �gS | j                  j                  }d }d }	d}
g } |j                  d„ |D «       Ž D ]o  } |||«      } |||«      }||k7  sŒt        |j                  |z
  «      }t        ||«      }|dk(  rd}
nt        |	|t        |«      z  «      }	|j                  |«       Œq t        ||	|
«      \  }}	|D �cg c]0  }t        |«      t         |||«      «      t         |||«      «      f‘Œ2 }}t        | j                  |||||	«      S c c}w )
Nr   c                ó"   — | }|D ]  }||   }Œ	 |S )z¹
            Helper function to get the value out of a nested list, given an n-dimensional index.
            This mimics numpy's indexing, but for raw nested python lists.
            rR   )Únested_listÚnd_indexÚvalueÚis       r   Úget_value_from_nested_listz=ApproxNumpy._repr_compare.<locals>.get_value_from_nested_list½   s&   € ð %ˆEØò !�Ø˜a™‘ð!àˆLr   z3Impossible to compare arrays with different shapes.zShapes: ú and Fc              3  ó2   K  — | ]  }t        |«      –— Œ y ­wrC   )Úrange)rY   r—   s     r   r\   z,ApproxNumpy._repr_compare.<locals>.<genexpr>Ý   s   è ø€ Ò(J°a¬¨q¯Ñ(Jùs   ‚T)r”   z	list[Any]r•   ztuple[Any, ...]rp   r   )Ú	itertoolsr7   Úshaperƒ   rX   r�   Ú_as_numpy_arrayÚsizeÚproductrE   r   Úappendr"   rs   r:   )rG   rS   rœ   r˜   Únp_array_shapeÚapprox_side_as_seqÚother_side_as_arrayr1   r   r    r!   r2   r5   Úapprox_valueÚother_valueÚabs_diffr0   s                    r   rT   zApproxNumpy._repr_compareº   sñ  € Ûð
	Ø"ð
	Ø.=ð
	àó
	ð Ÿ™×,Ñ,ˆÜ4Ø×Ñ §¡×!5Ñ!5Ó!7ó
Ðô
 .¨jÓ9ÐØ"Ð.Ð.Ð.àÐ0×6Ñ6Ò6àEØ˜>Ð*¨%Ð0C×0IÑ0IÐ/JÐKðð ð
 "Ÿ]™]×/Ñ/ÐØ ˆØ ˆØ$ÐØˆØ&�Y×&Ñ&Ñ(J¸>Ô(JÐKò 
	,ˆEÙ5Ð6HÈ%ÓPˆLÙ4Ð5HÈ%ÓPˆKØ˜{Ó*Ü˜|×4Ñ4°{ÑBÓC�Ü(¨°xÓ@�Ø !Ò#Ø+/Ñ(ä#,¨\¸8ÄcÈ+ÓFVÑ;VÓ#W�LØ×$Ñ$ UÕ+ð
	,ô &3Ø˜,Ð(<ó&
Ñ"ˆ�lð 'ö
ð ô	 �E“
ÜÑ.Ð/BÀEÓJÓKÜÑ.Ð/AÀ5ÓIÓJòð
ˆð 
ô Ø�M‰MØØØØØó
ð 	
ùò
s   Ä?5Fc                ó  •— dd l }|j                  |«      s	 |j                  |«      }|j                  |«      s$|j
                  | j                  j
                  k7  ryt        ‰| �!  |«      S # t        $ r}t	        d|› d�«      |‚d }~ww xY w)Nr   zcannot compare 'z' to numpy.ndarrayF)	ÚnumpyÚisscalarÚasarrayÚ	ExceptionÚ	TypeErrorr�   r7   Úsuperra   )rG   r`   ÚnpÚeÚ	__class__s       €r   ra   zApproxNumpy.__eq__þ   sŠ   ø€ Ûð �{‰{˜6Ô"ðVØŸ™ FÓ+�ð �{‰{˜6Ô" v§|¡|°t·}±}×7JÑ7JÒ'JØä‰w‰~˜fÓ%Ð%øô ò VÜÐ"2°6°(Ð:LÐ MÓNÐTUÐUûðVús   ˜A- Á-	BÁ6BÂBc              #  óh  K  — dd l }|j                  |«      rG|j                  | j                  j                  «      D ]  }|t        | j                  |   «      f–— Œ  y |j                  | j                  j                  «      D ]*  }t        ||   «      t        | j                  |   «      f–— Œ, y ­w)Nr   )r©   rª   Úndindexr7   r�   Ú_unbox_numpy_scalar)rG   r`   r¯   r—   s       r   r^   zApproxNumpy._yield_comparisons  s    è ø€ Ûð �;‰;�vÔØ—Z‘Z §¡× 3Ñ 3Ó4ò D�ØÔ1°$·-±-ÀÑ2BÓCÐCÓCñDð —Z‘Z §¡× 3Ñ 3Ó4ò �ä'¨¨q©	Ó2Ü'¨¯©°aÑ(8Ó9ðó ñùs   ‚B0B2rr   )rS   zndarray | list[Any]rp   rt   ru   )	rx   ry   rz   r{   rM   rT   ra   r^   Ú__classcell__©r±   s   @r   r‹   r‹   ±   s   ø„ ÙRó+óB
õH&ö r   r‹   c                  óZ   ‡ — e Zd ZdZ	 	 	 	 	 	 	 	 	 	 dˆ fd„Zdd„Zd	d„Zd
ˆ fd„Zd„ Zˆ xZ	S )ÚApproxMappingzyPerform approximate comparisons where the expected value is a mapping
    with numeric values (the keys can be anything).c           
     óØ   •— d}|j                  «       D ]A  \  }}t        |«      sŒd}t        |j                  ||t	        j
                  |«      «      «      ‚ t        ‰	| �  ||||¬«       y )NTz[pytest.approx() does not support nested dictionaries: key={!r} value={!r}
  full mapping={}rg   )ÚitemsÚ_is_nested_containerr­   ÚformatÚpprintÚpformatr®   rH   )
rG   r7   rD   rE   rF   rd   Úkeyr–   Úmsgr±   s
            €r   rH   zApproxMapping.__init__$  sm   ø€ ð !Ðà"Ÿ.™.Ó*ò 	R‰JˆC�Ü# EÕ*Øt�Ü §
¡
¨3°´v·~±~ÀhÓ7OÓ PÓQÐQð	Rô
 	‰Ñ˜ s°¸FÐÕCr   c           	     ó�   — d| j                   j                  «       D ��ci c]  \  }}|| j                  |«      “Œ c}}›d�S c c}}w r�   )r7   rº   rX   )rG   ÚkÚvs      r   rM   zApproxMapping.__repr__4  sB   € ØÀ$Ç-Á-×BUÑBUÓBW×X¹$¸!¸Q˜A˜t×2Ñ2°1Ó5Ñ5ÓXÐ\Ð\]Ð^Ð^ùÓXs   ŸAc           	     ó  — t        | j                  «      t        |«      k7  r&ddt        | j                  «      › dt        |«      › �gS | j                  j                  «       |j                  «       k7  r0dd| j                  j                  «       › d|j                  «       › �gS | j                  j                  «       D ��ci c]  \  }}|| j	                  |«      “Œ }}}t        |«      }d }d }d}g }	|j                  «       D ]“  \  }
}||
   }||k7  sŒ|j                  �f|�d	 t        |t        |j                  |z
  «      «      }|j                  dk(  rd	}n/t        |t        |j                  |z
  |j                  z  «      «      }|	j                  |
«       Œ• t        |||«      \  }}|	D �cg c](  }t        |«      t        ||   «      t        ||   «      f‘Œ* }}t        | j                  |||	||«      S c c}}w # t        $ r Y Œ�w xY wc c}w )
Nz4Impossible to compare mappings with different sizes.ú	Lengths: r™   zcomparison failed.z&Mappings has different keys: expected z	 but got Fr   T)r.   r7   Úkeysrº   rX   r   rE   ÚZeroDivisionErrorr¡   r"   rs   r:   )rG   rS   rÂ   rÃ   Úapprox_side_as_mapr1   r   r    r!   r2   Ú
approx_keyr¥   r¦   r¿   r0   s                  r   rT   zApproxMapping._repr_compare7  sN  € äˆt�}‰}Ó¤ Z£Ò0àFØœC §¡Ó.Ð/¨u´S¸³_Ð4EÐFðð ð
 �=‰=×ÑÓ :§?¡?Ó#4Ò4à$Ø8¸¿¹×9KÑ9KÓ9MÐ8NÈiÐXb×XgÑXgÓXiÐWjÐkðð ð 37·-±-×2EÑ2EÓ2G÷
Ù*.¨!¨QˆAˆt×"Ñ" 1Ó%Ñ%ð
Ðñ 
ô !Ð!3Ó4ÐØ ˆØ ˆØ$ÐØˆØ(:×(@Ñ(@Ó(Bò 	1Ñ$ˆJ˜Ø$ ZÑ0ˆKØ˜{Ó*Ø×(Ñ(Ð4¸Ð9PðÜ'0Ø(ä × 5Ñ 5¸Ñ CÓDó(˜ð
 (×0Ñ0°AÒ5Ø37Ñ0ä+4Ø ,Ü #à%1×%:Ñ%:¸[Ñ%HØ&2×&;Ñ&;ñ%<ó!"ó,˜Lð ×$Ñ$ ZÕ0ð/	1ô2 &3Ø˜,Ð(<ó&
Ñ"ˆ�lð %ö
àô �‹X”s˜: c™?Ó+¬SÐ1CÀCÑ1HÓ-IÒJð
ˆð 
ô
 Ø�M‰MØØØØØó
ð 	
ùóW
øô< -ò Ùðüò
s   Ã G5Ä"A#G;Æ,-H
Ç;	HÈHc                óÀ   •— 	 t        |j                  «       «      t        | j                  j                  «       «      k7  ry	 t        ‰| �  |«      S # t        $ r Y yw xY w©NF)ÚsetrÆ   r7   ÚAttributeErrorr®   ra   ©rG   r`   r±   s     €r   ra   zApproxMapping.__eq__y  sZ   ø€ ð	Ü�6—;‘;“=Ó!¤S¨¯©×);Ñ);Ó)=Ó%>Ò>Øð ?ô
 ‰w‰~˜fÓ%Ð%øô ò 	Ùð	ús   ƒ=A Á	AÁAc              #  óZ   K  — | j                   D ]  }||   | j                   |   f–— Œ y ­wrC   ©r7   )rG   r`   rÂ   s      r   r^   z ApproxMapping._yield_comparisons‚  s1   è ø€ Ø—‘ò 	.ˆAØ˜‘)˜TŸ]™]¨1Ñ-Ð-Ó-ñ	.ùs   ‚)+)
r7   zMapping[Any, Any]rD   rn   rE   rn   rF   ro   rp   rq   rr   )rS   zMapping[object, float]rp   rt   ru   ©
rx   ry   rz   r{   rH   rM   rT   ra   r^   rµ   r¶   s   @r   r¸   r¸      sZ   ø„ ñ7ðDà#ðDð 0ðDð 0ð	Dð
 ðDð 
õDó _ó@
õD&ö.r   r¸   c                  óZ   ‡ — e Zd ZdZ	 	 	 	 	 	 	 	 	 	 dˆ fd„Zdd„Zd	d„Zd
ˆ fd„Zd„ Zˆ xZ	S )ÚApproxSequenceLikezRPerform approximate comparisons where the expected value is a sequence of numbers.c           
     óÎ   •— d}t        |«      D ]A  \  }}t        |«      sŒd}t        |j                  ||t	        j
                  |«      «      «      ‚ t        ‰	| �  ||||¬«       y )NTz]pytest.approx() does not support nested data structures: {!r} at index {}
  full sequence: {}rg   )Ú	enumerater»   r­   r¼   r½   r¾   r®   rH   )
rG   r7   rD   rE   rF   rd   r5   r[   rÀ   r±   s
            €r   rH   zApproxSequenceLike.__init__Š  sk   ø€ ð !Ðä! (Ó+ò 	P‰HˆE�1Ü# AÕ&Øv�Ü §
¡
¨1¨e´V·^±^ÀHÓ5MÓ NÓOÐOð	Pô
 	‰Ñ˜ s°¸FÐÕCr   c                ó”   ‡ — t        ‰ j                  «      }|t        t        fvrt        }d |ˆ fd„‰ j                  D «       «      ›d�S )NrŽ   c              3  ó@   •K  — | ]  }‰j                  |«      –— Œ y ­wrC   rW   )rY   r[   rG   s     €r   r\   z.ApproxSequenceLike.__repr__.<locals>.<genexpr>ž  s   øè ø€ Ò!P¸Q $×"5Ñ"5°a×"8Ñ!Pùó   ƒr�   )r‡   r7   r†   r,   )rG   r‰   s   ` r   rM   zApproxSequenceLike.__repr__š  sB   ø€ Ü˜Ÿ™Ó&ˆØœE¤4˜=Ñ(ÜˆHØ™Ó!PÀ$Ç-Á-Ô!PÓPÐSÐSTÐUÐUr   c           	     óè  — t        | j                  «      t        |«      k7  r&ddt        | j                  «      › dt        |«      › �gS t        | j                  | j                  «      }t        |«      }d }d }d}g }t	        t        ||d¬«      «      D ]e  \  }\  }	}
|	|
k7  sŒ	 t        |	j                  |
z
  «      }t        ||«      }|
dk(  rd}nt        ||t        |
«      z  «      }	 |j                  |«       Œg t        |||«      \  }}|D �cg c](  }t        |«      t        ||   «      t        ||   «      f‘Œ* }}t        | j                  |||||«      S # t        $ r ‚ t        $ r Y Œ„w xY wc c}w )Nz1Impossible to compare lists with different sizes.rÅ   r™   FT©Ústrictr   )r.   r7   rƒ   rX   rÕ   ÚziprE   r   r   r­   r¡   r"   rs   r:   )rG   rS   rÈ   r1   r   r    r!   r2   r—   r¥   r¦   r§   r0   s                r   rT   z ApproxSequenceLike._repr_compare   s°  € äˆt�}‰}Ó¤ Z£Ò0àCØœC §¡Ó.Ð/¨u´S¸³_Ð4EÐFðð ô
 5°T×5HÑ5HÈ$Ï-É-ÓXÐä Ð!3Ó4ÐØ ˆØ ˆØ$ÐØˆÜ.7ÜÐ" J°tÔ<ó/
ò 	(Ñ*ˆAÑ*�˜kð ˜{Ó*ðÜ" <×#8Ñ#8¸;Ñ#FÓG�HÜ#,¨\¸8Ó#D�Lð # aÒ'Ø/3Ñ,ä'0Ø(¨(´S¸Ó5EÑ*Eó(™ð ×$Ñ$ QÕ'ð+	(ô. &3Ø˜,Ð(<ó&
Ñ"ˆ�lð
 #ö
àô �‹V”S˜ A™Ó'¬Ð-?ÀÑ-BÓ)CÒDð
ˆð 
ô
 Ø�M‰MØØØØØó
ð 	
øô- &ò Øä ò Ùðüò
s   Â"$EÄ-E/ÅE,Å+E,c                óˆ   •— 	 t        |«      t        | j                  «      k7  ry	 t        ‰| �  |«      S # t        $ r Y yw xY wrË   )r.   r7   r­   r®   ra   rÎ   s     €r   ra   zApproxSequenceLike.__eq__×  sJ   ø€ ð	Ü�6‹{œc $§-¡-Ó0Ò0Øð 1ô ‰w‰~˜fÓ%Ð%øô ò 	Ùð	ús   ƒ!5 µ	AÁ Ac                ó2   — t        || j                  d¬«      S )NTrÚ   )rÜ   r7   r_   s     r   r^   z%ApproxSequenceLike._yield_comparisonsß  s   € Ü�6˜4Ÿ=™=°Ô6Ð6r   )
r7   zSequence[Any]rD   rn   rE   rn   rF   ro   rp   rq   rr   )rS   zSequence[float]rp   rt   ru   rÑ   r¶   s   @r   rÓ   rÓ   ‡  sW   ø„ Ù\ðDàðDð 0ðDð 0ð	Dð
 ðDð 
õDó Vó5
õn&ö7r   rÓ   c                  óŽ   ‡ — e Zd ZU dZdZded<   dZded<   ded<   ded	<   	 	 	 	 	 	 	 	 	 	 dˆ fd
„Zdd„Zdd„Z	dZ
ed„ «       Zˆ xZS )rk   zLPerform approximate comparisons where the expected value is a single number.gê-�™—q=zfloat | DecimalÚDEFAULT_ABSOLUTE_TOLERANCEg�íµ ÷Æ°>ÚDEFAULT_RELATIVE_TOLERANCEzfloat | Decimal | NonerD   rE   c                óŠ  •— d}|�mt        |t        t        t        f«      s!t	        dt        |«      j                  › �«      ‚t        |t        «      s!t	        dt        |«      j                  › �«      ‚|�<t        |t        t        t        f«      s!t	        dt        |«      j                  › �«      ‚t        ‰| �%  ||||¬«       y )NTzLrelative tolerance for a scalar value must be an int, float or Decimal, got zJexpected value must support abs(...) when relative tolerance is used, got zLabsolute tolerance for a scalar value must be an int, float or Decimal, got rg   )
rh   ÚintÚfloatr
   r­   r‡   rx   r   r®   rH   )rG   r7   rD   rE   rF   rd   r±   s         €r   rH   zApproxScalar.__init__í  sÑ   ø€ ð !ÐØˆ?Ü˜c¤C¬´Ð#8Ô9ÜðÜ ›9×-Ñ-Ð.ð0óð ô ˜h¬Ô4ÜðÜ ›>×2Ñ2Ð3ð5óð ð ˆ?¤:¨c´C¼ÄÐ3HÔ#IÜðÜ˜C“y×)Ñ)Ð*ð,óð ô 	‰Ñ˜ s°¸FÐÕCr   c                ój  — t        | j                  «      s?t        | j                  t        t        z  «      rt        t        | j                  «      «      rt        | j                  «      S 	 t        | j                  t        «      r| j                  d›}n5d| j                  cxk  rdk  rn n| j                  d›}n| j                  d›}t        | j                  t        «      r0| j                  j                  rt        | j                  «      s|dz  }| j                  › d|› �S # t        $ r d}Y Œw xY w)u¾   Return a string communicating both the expected value and the
        tolerance for the comparison being made.

        For example, ``1.0 Â± 1e-6``, ``(3+4j) Â± 5e-6 âˆ  Â±180Â°``.
        z.1egü©ñÒMbP?g     @�@Únu    âˆ  Â±180Â°z???õ    Â± )Ú_is_boolr7   rh   r   r
   Ú_is_infrE   rs   Ú	toleranceÚimagÚ
ValueError)rG   Úvetted_tolerances     r   rM   zApproxScalar.__repr__  sú   € ô �T—]‘]Ô#Ü˜tŸ}™}¬g¼Ñ.?Ô@Ü”s˜4Ÿ=™=Ó)Ô*ä�t—}‘}Ó%Ð%ð	%Ü˜$Ÿ.™.¬'Ô2ð '+§n¡n°SÐ%9Ñ Ø˜Ÿ™Ô-¨#Õ-Ø&*§n¡n°QÐ%7Ñ à&*§n¡n°SÐ%9Ð ô ˜4Ÿ=™=¬'Ô2Ø—M‘M×&Ò&Ü §¡Ô/à  NÑ2Ð ð —-‘-� Ð%5Ð$6Ð7Ð7øô ò 	%Ø$Òð	%ús   Á+B(D$ Ä$D2Ä1D2c                ód  ‡ — t        |«      }|�t        ˆ fd„|j                  D «       «      S t        ‰ j                  «      rt        |«      sy|‰ j                  k(  ryt        ‰ j                  «      s8t        ‰ j                  t        t        z  «      rt        |t        t        z  «      syt        t        ‰ j                  «      «      r"‰ j                  xr t        t        |«      «      S t        t        ‰ j                  «      «      ryt        ‰ j                  |z
  «      ‰ j                  k  }|S )ziReturn whether the given value is equal to the expected value
        within the pre-specified tolerance.c              3  ó@   •K  — | ]  }‰j                  |«      –— Œ y ­wrC   )ra   )rY   rZ   rG   s     €r   r\   z&ApproxScalar.__eq__.<locals>.<genexpr>8  s   øè ø€ Ò<¨!�t—{‘{ 1—~Ñ<ùrØ   FT)rž   r]   Úflatrè   r7   rh   r   r
   Ú_is_nanrE   rF   ré   rê   )rG   r`   r«   Úresults   `   r   ra   zApproxScalar.__eq__1  sê   ø€ ô " &Ó)ˆØÐô Ó<¨w¯|©|Ô<Ó<Ð<ô �D—M‘MÔ"¬8°FÔ+;ØØ�t—}‘}Ò$Øô �D—M‘MÔ"Ü�t—}‘}¤g´Ñ&7Ô8Ü˜6¤7¬WÑ#4Ô5àô
 ”3�t—}‘}Ó%Ô&Ø—;‘;Ò7¤7¬3¨v«;Ó#7Ð7ô ”3�t—}‘}Ó%Ô&Øô ˜4Ÿ=™=¨6Ñ1Ó2°d·n±nÑDˆØˆr   Nc                ó¶  — | j                   �| j                   n| j                  }t        |«      rt        d«      ‚|dk  rt        d|› �«      ‚| j                  €| j                   �|S | j                  �| j                  n| j
                  }t        | j                  «      }||z  }t        |«      rt        d«      ‚|dk  rt        d|› �«      ‚t        ||«      S )zÅReturn the tolerance for the comparison.

        This could be either an absolute tolerance or a relative tolerance,
        depending on what the user specified or which would be larger.
        z absolute tolerance can't be NaN.r   ú&absolute tolerance can't be negative: ú relative tolerance can't be NaN.ú&relative tolerance can't be negative: )rE   rà   rñ   rì   rD   rá   r7   r   )rG   Úabsolute_tolerancerD   Úabs_expectedÚrelative_tolerances        r   rê   zApproxScalar.tolerance_  só   € ð Ÿ™Ð,ˆD�HŠH°$×2QÑ2Qð 	ô Ð%Ô&ÜÐ?Ó@Ð@Ø Ò!ÜØ8Ð9KÐ8LÐMóð ð �8‰8ÐØ�x‰xÐ#Ø)Ð)ð Ÿ(™(Ð.ˆd�hŠh°D×4SÑ4Sˆô #& d§m¡mÓ"4ˆØ.1°LÑ.@ÐäÐ%Ô&ÜÐ?Ó@Ð@Ø Ò!ÜØ8Ð9KÐ8LÐMóð ô
 Ð%Ð'9Ó:Ð:r   rm   rr   ru   )rx   ry   rz   r{   rà   Ú__annotations__rá   rH   rM   ra   r€   Úpropertyrê   rµ   r¶   s   @r   rk   rk   ã  sŠ   ø… ÙVð 38Ð Ó7Ø26Ð Ó6Ø	ÓØ	ÓðDàðDð 0ðDð 0ð	Dð
 ðDð 
õDó4(8óT*ðX €Hàñ,;ó ô,;r   rk   c                  ón   ‡ — e Zd ZU dZ ed«      Z ed«      Zded<   ded<   	 	 	 	 	 	 	 	 	 	 dˆ fd„Zˆ xZ	S )	ri   zFPerform approximate comparisons where the expected value is a Decimal.z1e-12z1e-6zDecimal | NonerD   rE   c                óâ   •— t        |t        t        f«      rt        j                  |«      }n|}t        |t        t        f«      rt        j                  |«      }n|}t
        ‰| �  ||||«       y rC   )rh   rä   rã   r
   Ú
from_floatr®   rH   )rG   r7   rD   rE   rF   Úrel_Úabs_r±   s          €r   rH   zApproxDecimal.__init__—  s^   ø€ ô �cœE¤3˜<Ô(Ü/6×/AÑ/AÀ#Ó/F‰DàˆDÜ�cœE¤3˜<Ô(Ü/6×/AÑ/AÀ#Ó/F‰DàˆDÜ‰Ñ˜ 4¨¨vÕ6r   )
r7   r
   rD   rn   rE   rn   rF   ro   rp   rq   )
rx   ry   rz   r{   r
   rà   rá   rú   rH   rµ   r¶   s   @r   ri   ri   �  sa   ø… ÙPá!(¨Ó!1ÐÙ!(¨£ÐØ	ÓØ	Óð7àð7ð 0ð7ð 0ð	7ð
 ð7ð 
÷7ñ 7r   ri   c                  óX   ‡ — e Zd ZdZ	 	 	 	 	 	 	 	 	 	 dˆ fd„Zdd„Zd	d„Zd
d„Zdd„Zˆ xZ	S )rj   zïPerform approximate comparisons where the expected value is a
    datetime or timedelta.

    Requires an explicit tolerance as a timedelta for abs, or a float for rel.
    Relative tolerance is not supported for datetime comparisons.
    c                óì  •— d}t        |t        «      r|�t        d«      ‚|rt        d«      ‚|€|€t        d«      ‚|�1t        |t        «      s!t        dt	        |«      j
                  › �«      ‚|�|t        d«      k  rt        d|› �«      ‚|�Št        |t        t        f«      s!t        dt	        |«      j
                  › �«      ‚|dk  rt        d	|› �«      ‚t        j                  |«      rt        d
«      ‚t        j                  |«      rt        d«      ‚|}|€d }n*t        |t        «      rJ ‚|t        j                  |«      z  }|�|�t        ||«      }n|�|n|}t        ‰	| �A  |||d¬«       y )NTzmpytest.approx() does not support relative tolerance for datetime comparisons. Use abs=timedelta(...) instead.zKpytest.approx() does not support nan_ok for datetime/timedelta comparisons.z pytest.approx() requires an explicit tolerance for datetime/timedelta comparisons: e.g. approx(expected, abs=timedelta(seconds=1)) or approx(expected, rel=0.01)zCabsolute tolerance for datetime/timedelta must be a timedelta, got r   rô   z7relative tolerance for timedelta must be a number, got rö   rõ   z%relative tolerance can't be infinite.Frg   )rh   r   r­   r	   r‡   rx   rì   rã   rä   r   ÚisnanÚisinfÚbuiltinsrE   r   r®   rH   )
rG   r7   rD   rE   rF   rd   Úabs_toleranceÚrel_tolerancerê   r±   s
            €r   rH   zApproxTimedelta.__init__±  s¯  ø€ ð !ÐÜ�h¤Ô)¨c¨oÜðHóð ñ Üð2óð ð ˆ;˜3˜;Üð0óð ð ˆ?¤:¨c´9Ô#=Üð"Ü"& s£)×"4Ñ"4Ð!5ð7óð ð ˆ?˜s¤Y¨q£\Ò1ÜÐEÀcÀUÐKÓLÐLØˆ?Ü˜c¤C¬ <Ô0Üð#Ü#'¨£9×#5Ñ#5Ð"6ð8óð ð �QŠwÜ Ð#IÈ#ÈÐ!OÓPÐPÜ�z‰z˜#ŒÜ Ð!CÓDÐDÜ�z‰z˜#ŒÜ Ð!HÓIÐIð ˆØˆ;Ø ‰Mô " (¬HÔ5Ð5Ð5Ø¤(§,¡,¨xÓ"8Ñ8ˆMØÐ$¨Ð)BÜ*-¨m¸]Ó*K‰Ià)6Ð)B™ÈˆIÜ‰Ñ˜ s°	À%ÐÕHr   c                ó8   — | j                   › d| j                  › �S )Nrç   )r7   rE   rL   s    r   rM   zApproxTimedelta.__repr__ì  s   € Ø—-‘-�  T§X¡X JÐ/Ð/r   c                óž   — 	 t        t        j                  | j                  |z
  «      | j                  k  «      S # t        t
        f$ r Y yw xY wrË   )ro   r  rE   r7   r­   ÚOverflowErrorr_   s     r   ra   zApproxTimedelta.__eq__ï  sD   € ð	ÜœŸ™ T§]¡]°VÑ%;Ó<ÀÇÁÑHÓIÐIøÜœ=Ð)ò 	Ùð	ús   ‚7: ºAÁAc              #  ó,   K  — || j                   f–— y ­wrC   rÐ   r_   s     r   r^   z"ApproxTimedelta._yield_comparisonsõ  s   è ø€ Ø�d—m‘mÐ#Ó#ùs   ‚c                óÞ   — 	 t        j                  | j                  |z
  «      }dd|› �d| j                  › d| j                  › �d|› �d| j                  › �gS # t        t        f$ r d}Y ŒGw xY w)NzN/ArO   rP   rQ   rç   zAbsolute difference: zTolerance: )r  rE   r7   r­   r
  )rG   rS   r§   s      r   rT   zApproxTimedelta._repr_compareø  s‚   € ð	Ü—|‘| D§M¡M°JÑ$>Ó?ˆHð  Ø˜˜Ð%Ø˜Ÿ™˜ t¨D¯H©H¨:Ð6Ø# H :Ð.Ø˜$Ÿ(™(˜Ð$ð
ð 	
øô œ=Ð)ò 	ØŠHð	ús   ‚"A ÁA,Á+A,)
r7   zdatetime | timedeltarD   rn   rE   rn   rF   ro   rp   rq   rr   ru   rv   )rS   r   rp   rt   )
rx   ry   rz   r{   rH   rM   ra   r^   rT   rµ   r¶   s   @r   rj   rj   ©  sX   ø„ ñð9Ià&ð9Ið 0ð9Ið 0ð	9Ið
 ð9Ið 
õ9Ióv0óó$÷
r   rj   c                óÞ  — d}t        | ||«       t        | t        «      rt        | |||¬«      S t        | t        «      rt        | |||¬«      S t        | «      x}�t        ||||¬«      S t        | «      rt        | |||¬«      S t        | t        «      r't        | t        t        z  «      sd| ›�}t        |«      ‚t        | t        t        f«      rt!        | |||¬«      S t#        | |||¬«      S )a©$  Assert that two numbers (or two ordered sequences of numbers) are equal to each other
    within some tolerance.

    Due to the :doc:`python:tutorial/floatingpoint`, numbers that we
    would intuitively expect to be equal are not always so::

        >>> 0.1 + 0.2 == 0.3
        False

    This problem is commonly encountered when writing tests, e.g. when making
    sure that floating-point values are what you expect them to be.  One way to
    deal with this problem is to assert that two floating-point numbers are
    equal to within some appropriate tolerance::

        >>> abs((0.1 + 0.2) - 0.3) < 1e-6
        True

    However, comparisons like this are tedious to write and difficult to
    understand.  Furthermore, absolute comparisons like the one above are
    usually discouraged because there's no tolerance that works well for all
    situations.  ``1e-6`` is good for numbers around ``1``, but too small for
    very big numbers and too big for very small ones.  It's better to express
    the tolerance as a fraction of the expected value, but relative comparisons
    like that are even more difficult to write correctly and concisely.

    The ``approx`` class performs floating-point comparisons using a syntax
    that's as intuitive as possible::

        >>> from pytest import approx
        >>> 0.1 + 0.2 == approx(0.3)
        True

    The same syntax also works for ordered sequences of numbers::

        >>> (0.1 + 0.2, 0.2 + 0.4) == approx((0.3, 0.6))
        True

    ``numpy`` arrays::

        >>> import numpy as np                                                          # doctest: +SKIP
        >>> np.array([0.1, 0.2]) + np.array([0.2, 0.4]) == approx(np.array([0.3, 0.6])) # doctest: +SKIP
        True

    And for a ``numpy`` array against a scalar::

        >>> import numpy as np                                         # doctest: +SKIP
        >>> np.array([0.1, 0.2]) + np.array([0.2, 0.1]) == approx(0.3) # doctest: +SKIP
        True

    Only ordered sequences are supported, because ``approx`` needs
    to infer the relative position of the sequences without ambiguity. This means
    ``sets`` and other unordered sequences are not supported.

    Finally, dictionary *values* can also be compared::

        >>> {'a': 0.1 + 0.2, 'b': 0.2 + 0.4} == approx({'a': 0.3, 'b': 0.6})
        True

    The comparison will be true if both mappings have the same keys and their
    respective values match the expected tolerances.

    **Tolerances**

    By default, ``approx`` considers numbers within a relative tolerance of
    ``1e-6`` (i.e. one part in a million) of its expected value to be equal.
    This treatment would lead to surprising results if the expected value was
    ``0.0``, because nothing but ``0.0`` itself is relatively close to ``0.0``.
    To handle this case less surprisingly, ``approx`` also considers numbers
    within an absolute tolerance of ``1e-12`` of its expected value to be
    equal.  Infinity and NaN are special cases.  Infinity is only considered
    equal to itself, regardless of the relative tolerance.  NaN is not
    considered equal to anything by default, but you can make it be equal to
    itself by setting the ``nan_ok`` argument to True.  (This is meant to
    facilitate comparing arrays that use NaN to mean "no data".)

    Both the relative and absolute tolerances can be changed by passing
    arguments to the ``approx`` constructor::

        >>> 1.0001 == approx(1)
        False
        >>> 1.0001 == approx(1, rel=1e-3)
        True
        >>> 1.0001 == approx(1, abs=1e-3)
        True

    If you specify ``abs`` but not ``rel``, the comparison will not consider
    the relative tolerance at all.  In other words, two numbers that are within
    the default relative tolerance of ``1e-6`` will still be considered unequal
    if they exceed the specified absolute tolerance.  If you specify both
    ``abs`` and ``rel``, the numbers will be considered equal if either
    tolerance is met::

        >>> 1 + 1e-8 == approx(1)
        True
        >>> 1 + 1e-8 == approx(1, abs=1e-12)
        False
        >>> 1 + 1e-8 == approx(1, rel=1e-6, abs=1e-12)
        True

    **Non-numeric types**

    You can also use ``approx`` to compare non-numeric types, or dicts and
    sequences containing non-numeric types, in which case it falls back to
    strict equality. This can be useful for comparing dicts and sequences that
    can contain optional values::

        >>> {"required": 1.0000005, "optional": None} == approx({"required": 1, "optional": None})
        True
        >>> [None, 1.0000005] == approx([None,1])
        True
        >>> ["foo", 1.0000005] == approx([None,1])
        False

    **datetime and timedelta**

    You can also use ``approx`` to compare :class:`~datetime.datetime` and
    :class:`~datetime.timedelta` objects by specifying an absolute tolerance
    as a :class:`~datetime.timedelta`::

        >>> from datetime import datetime, timedelta
        >>> dt1 = datetime(2024, 1, 1, 12, 0, 0)
        >>> dt2 = datetime(2024, 1, 1, 12, 0, 0, 500000)
        >>> dt1 == approx(dt2, abs=timedelta(seconds=1))
        True

    Note that ``rel`` is not supported for datetime comparisons.
    For timedelta comparisons, ``rel`` is a number (not a timedelta) that
    represents a relative tolerance -- a fraction of the expected value.
    ``abs`` must be a ``timedelta`` object in both cases.

    .. versionadded:: 8.4

    If you're thinking about using ``approx``, then you might want to know how
    it compares to other good ways of comparing floating-point numbers.  All of
    these algorithms are based on relative and absolute tolerances and should
    agree for the most part, but they do have meaningful differences:

    - ``math.isclose(a, b, rel_tol=1e-9, abs_tol=0.0)``:  True if the relative
      tolerance is met w.r.t. either ``a`` or ``b`` or if the absolute
      tolerance is met.  Because the relative tolerance is calculated w.r.t.
      both ``a`` and ``b``, this test is symmetric (i.e.  neither ``a`` nor
      ``b`` is a "reference value").  You have to specify an absolute tolerance
      if you want to compare to ``0.0`` because there is no tolerance by
      default.  More information: :py:func:`math.isclose`.

    - ``numpy.isclose(a, b, rtol=1e-5, atol=1e-8)``: True if the difference
      between ``a`` and ``b`` is less that the sum of the relative tolerance
      w.r.t. ``b`` and the absolute tolerance.  Because the relative tolerance
      is only calculated w.r.t. ``b``, this test is asymmetric and you can
      think of ``b`` as the reference value.  Support for comparing sequences
      is provided by :py:func:`numpy.allclose`.  More information:
      :std:doc:`numpy:reference/generated/numpy.isclose`.

    - ``unittest.TestCase.assertAlmostEqual(a, b)``: True if ``a`` and ``b``
      are within an absolute tolerance of ``1e-7``.  No relative tolerance is
      considered , so this function is not appropriate for very large or very
      small numbers.  Also, it's only available in subclasses of ``unittest.TestCase``
      and it's ugly because it doesn't follow PEP8.  More information:
      :py:meth:`unittest.TestCase.assertAlmostEqual`.

    - ``a == pytest.approx(b, rel=1e-6, abs=1e-12)``: True if the relative
      tolerance is met w.r.t. ``b`` or if the absolute tolerance is met.
      Because the relative tolerance is only calculated w.r.t. ``b``, this test
      is asymmetric and you can think of ``b`` as the reference value.  In the
      special case that you explicitly specify an absolute tolerance but not a
      relative tolerance, only the absolute tolerance is considered.

    .. note::

        ``approx`` can handle numpy arrays, but we recommend the
        specialised test helpers in :std:doc:`numpy:reference/routines.testing`
        if you need support for comparisons, NaNs, or ULP-based tolerances.

        To match strings using regex, you can use
        `Matches <https://github.com/asottile/re-assert#re_assertmatchespattern-str-args-kwargs>`_
        from the
        `re_assert package <https://github.com/asottile/re-assert>`_.


    .. note::

        Unlike built-in equality, this function considers
        booleans unequal to numeric zero or one. For example::

           >>> 1 == approx(True)
           False

    .. warning::

       .. versionchanged:: 3.2

       In order to avoid inconsistent behavior, :py:exc:`TypeError` is
       raised for ``>``, ``>=``, ``<`` and ``<=`` comparisons.
       The example below illustrates the problem::

           assert approx(0.1) > 0.1 + 1e-10  # calls approx(0.1).__gt__(0.1 + 1e-10)
           assert 0.1 + 1e-10 > approx(0.1)  # calls approx(0.1).__lt__(0.1 + 1e-10)

       In the second example one expects ``approx(0.1).__le__(0.1 + 1e-10)``
       to be called. But instead, ``approx(0.1).__lt__(0.1 + 1e-10)`` is used to
       comparison. This is because the call hierarchy of rich comparisons
       follows a fixed behavior. More information: :py:meth:`object.__ge__`

    .. versionchanged:: 3.7.1
       ``approx`` raises ``TypeError`` when it encounters a dict value or
       sequence element of non-numeric type.

    .. versionchanged:: 6.1.0
       ``approx`` falls back to strict equality for non-numeric types instead
       of raising ``TypeError``.
    Trg   z:pytest.approx() only supports ordered sequences, but got: )Ú"_warn_on_inexact_decimal_tolerancerh   r
   ri   r   r¸   rž   r‹   rˆ   rÓ   r   rs   Úbytesr­   r   r	   rj   rk   )r7   rD   rE   rF   rd   Únp_arrayrÀ   s          r   Úapproxr    så   € ðP Ðä& x°°cÔ:ä�(œGÔ$Ü˜X¨3°CÀÔGÐGÜ	�HœgÔ	&Ü˜X¨3°CÀÔGÐGÜ% hÓ/Ð
/ˆ(Ð	<Ü˜8¨°#¸fÔEÐEÜ	˜8Ô	$Ü! (°¸ÀVÔLÐLÜ	�HœjÔ	)´*¸XÄsÌUÁ{Ô2SØJÈ8È,ÐWˆÜ˜‹nÐÜ	�Hœx¬Ð3Ô	4Ü˜x¨S°cÀ&ÔIÐIä˜H¨#°3¸vÔFÐFr   c                óÚ   — t        | t        «      ryt        | t        «      r t        d„ | j	                  «       D «       «      S t        | «      rt        | d| «      }t        d„ |D «       «      S y)zFWhether a comparison against ``expected`` will use Decimal arithmetic.Tc              3  ó<   K  — | ]  }t        |t        «      –— Œ y ­wrC   ©rh   r
   ©rY   r–   s     r   r\   z$_contains_decimal.<locals>.<genexpr>  s   è ø€ ÒM°%”:˜e¤W×-ÑMùó   ‚rð   c              3  ó<   K  — | ]  }t        |t        «      –— Œ y ­wrC   r  r  s     r   r\   z$_contains_decimal.<locals>.<genexpr>  s   è ø€ ÒB°%”:˜e¤W×-ÑBùr  F)rh   r
   r   ÚanyÚvaluesrˆ   Úgetattr)r7   r  s     r   Ú_contains_decimalr    s]   € ä�(œGÔ$ØÜ�(œGÔ$ÜÑM¸8¿?¹?Ó;LÔMÓMÐMÜ˜Ô"ô ˜ 6¨8Ó4ˆÜÑB¸6ÔBÓBÐBØr   c                ó„  — d|fd|ffD ��cg c]D  \  }}t        |«      t        u r.t        j                  |«      t        t	        |«      «      k7  r||f‘ŒF }}}|rt        | «      sy|D ]P  \  }}t        j                  t        |› d|›dt        j                  |«      › d|› dt        |«      ›d�
«      d	¬
«       ŒR yc c}}w )a+  Warn when a float tolerance is used for a Decimal comparison.

    A float tolerance is converted with ``Decimal.from_float()``, which is
    exact and therefore keeps the float's full binary expansion: ``rel=0.01``
    really means a tolerance of ``0.010000000000000000208...``. That is wider
    than the ``0.01`` that was written, which defeats the point of comparing
    Decimals in the first place.

    Only floats that cannot be represented exactly are worth warning about;
    ``0.5`` and friends survive the conversion unchanged, as do ints.
    rD   rE   Nú=z? cannot be represented exactly as a Decimal and was widened to z.
Pass z	=Decimal(z-) to compare against the tolerance you wrote.é   )Ú
stacklevel)
r‡   rä   r
   rþ   Úreprr  ÚwarningsÚwarnr   rs   )r7   rD   rE   Únamer–   Úinexacts         r   r  r    sÞ   € ð$ # C˜L¨5°#¨,Ð7÷áˆD�%Ü�‹;œ%Ñ¤G×$6Ñ$6°uÓ$=ÄÌÈeËÓAUÒ$Uð 
ˆuŠð€Gñ ñ
 Ô+¨HÔ5ØØò 	
‰ˆˆeÜ�‰Ü/Ø�&˜˜%˜ð #&Ü&-×&8Ñ&8¸Ó&?Ð%@ð AØ�v˜Y¤s¨5£z nð 5'ð(óð ö	
ñ	
ùós   ŒA	B<c                ór   — t        | d«      xr* t        | t        «      xr t        | t        t        z  «       S )NÚ__getitem__)Úhasattrrh   r   rs   r  rÐ   s    r   rˆ   rˆ   4  s6   € ä�˜-Ó(ò 	2Ü�x¤Ó'ò	2ä˜8¤S¬5¡[Ó1Ð1ðr   c                ód   — t        | t        «      xr t        | t        t        z  t        z  «       S )zÙWhether ``value`` is a container ``approx`` cannot descend into.

    ``str``, ``bytes`` and ``bytearray`` are collections as well, but they
    compare exactly and are handled as leaves, so they are not nesting.
    )rh   r   rs   r  Ú	bytearray)r–   s    r   r»   r»   <  s2   € ô �eœZÓ(ò ´ØŒs”U‰{œYÑ&ó2ð .ð r   c                óì   — t         j                  j                  d«      }|�S|j                  | «      ryt	        | |j
                  «      r| S t        | d«      st        | d«      r|j                  | «      S y)zˆ
    Return an ndarray if the given object is implicitly convertible to ndarray,
    and numpy is already imported, otherwise None.
    r©   NÚ	__array__Ú__array_interface__)ÚsysÚmodulesÚgetrª   rh   r   r'  r«   )Úobjr¯   s     r   rž   rž   G  sb   € ô
 �k‰k�o‰o˜gÓ&€BØ	€~à�;‰;�sÔØÜ˜˜RŸZ™ZÔ(ØˆJÜ�S˜+Ô&¬'°#Ð7LÔ*MØ—:‘:˜c“?Ð"Ør   c                ó2   — t        | dd«      }|€| S  |«       S )zÐReturn the Python object behind a numpy scalar.

    Indexing an object-dtype array yields the stored Python object, which has
    no ``item()`` of its own -- only numpy's own scalar types need unboxing.
    ÚitemN)r  )r–   r2  s     r   r´   r´   X  s#   € ô �5˜& $Ó'€DØ�Lˆ5Ð,¡d£fÐ,r   c                ó”   — t        | t        «      ryt        j                  j	                  d«      x}rt        | |j
                  «      S y)NTr©   F)rh   ro   r-  r.  r/  Úbool_)Úvalr¯   s     r   rè   rè   b  s;   € ä�#”tÔØÜ�[‰[�_‰_˜WÓ%Ð%€rÐ%Ü˜#˜rŸx™xÓ(Ð(Ør   c                ól   — t        | t        «      r| j                  «       S t        j                  | «      S rC   )rh   r
   Úis_nanr   r  ©r5  s    r   rñ   rñ   k  s(   € ô �#”wÔØ�z‰z‹|ÐÜ�:‰:�c‹?Ðr   c                ól   — t        | t        «      r| j                  «       S t        j                  | «      S rC   )rh   r
   Úis_infiniter   r  r8  s    r   ré   ré   s  s'   € Ü�#”wÔØ�‰Ó Ð Ü�:‰:�c‹?Ðr   )r   r   r   r   rp   r   )r   r   r    r   r!   ro   rp   ztuple[Any, Any])r/   rw   r0   zSequence[tuple[str, str, str]]r1   rã   r2   zSequence[object]r   rä   r    rä   rp   rt   )NNF)
r7   r;   rD   rn   rE   rn   rF   ro   rp   z	Approx[T])r7   rw   rp   ro   )r7   rw   rD   rn   rE   rn   rp   rq   )r7   rw   rp   zTypeGuard[Sequence[Any]])r–   rw   rp   ro   )r0  rw   rp   zndarray | None)r–   r   rp   r   )r5  r   rp   ro   )9r{   Ú
__future__r   r~   r  Úcollections.abcr   r   r   r   r   r	   Údecimalr
   r   r   Únumbersr   r½   r-  Útypingr   r   r   r   r   r   r!  Ú_pytest.warning_typesr   r©   r   rw   r   r"   r:   r;   r<   ÚABCr?   rƒ   r‹   r¸   rÓ   rk   ri   rj   r  r  r  rˆ   r»   rž   r´   rè   rñ   ré   rR   r   r   ú<module>rB     s'  ðÙ ,õ #ã 
Û Ý &Ý #Ý $Ý !Ý Ý Ý Ý "Û Ý Û Û 
Ý Ý Ý Ý  Ý Ý Û å Eñ Þà€Gó	EðØðØ%(ðØ@Dðàóð Øðà0ðð ðð $ð	ð
 ðð ðð óñ4 ˆCƒL€Ù�K¨4Ô0€	ôD"ˆS�W‰W�g˜iÑ(ô D"òNôl�&˜‘/ô lô^d.�F˜7 3¨ 8Ñ,Ñ-ô d.ôNY7˜ ¨¡Ñ.ô Y7ôxi;�6˜)Ñ$ô i;ôX7�L Ñ)ô 7ô4Z
�f˜X¨	Ñ1Ñ2ô Z
ð~ /3Ø.2Øð	zGØðzGà	+ðzGð 
,ðzGð ð	zGð
 ózGózð 
Øð 
à	+ð 
ð 
,ð 
ð 
ó	 
óFóóó"-óóôr   