+
    Aif                         ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIt. ROt]P                  ! ]P                  ^R7      t	]R 4       t
]R 4       tR# )    )contextmanagerN)
stacklevelc               #  
  "   ^ RI p V P                  4       pV'       d/   V P                  V4       F  p/ V^ ,          P                  R&   K  	  ?\	        \
        P                  P                  4       4       F   w  r4 VP                  P                  4        K"  	  \        P                  ! RR7      ;_uu_ 4       p\        P                  ! R4       Vx  RRR4       R#   \         d     Kv  i ; i  + '       g   i     R# ; i5i)a  
Context for use in testing to ensure that all warnings are raised.

Examples
--------
>>> import warnings
>>> def foo():
...     warnings.warn(RuntimeWarning("bar"), stacklevel=2)

We raise the warning once, while the warning filter is set to "once".
Hereafter, the warning is invisible, even with custom filters:

>>> with warnings.catch_warnings():
...     warnings.simplefilter('once')
...     foo()                         # doctest: +SKIP

We can now run ``foo()`` without a warning being raised:

>>> from numpy.testing import assert_warns
>>> foo()                             # doctest: +SKIP

To catch the warning, we call in the help of ``all_warnings``:

>>> with all_warnings():
...     assert_warns(RuntimeWarning, foo)
N__warningregistry__T)recordalways)inspectcurrentframegetouterframesf_localslistsysmodulesitemsr   clearAttributeErrorwarningscatch_warningssimplefilter)r	   framefmod_namemodws         W/var/www/html/photoedit/myenv/lib/python3.14/site-packages/skimage/_shared/_warnings.pyall_warningsr      s     <    "E''.A35AaDMM/0 /ckk//12	##))+ 3 
	 	 	-	-h' 
.	-  		 
.	-	-sB   A8D;C#D8C/
DC,(D+C,,D/D 	:	Dc           
   #    "   \        V \        4      '       d   \        R4      hV f   Rx  R# \        P                  P                  RR4      pVP                  4       R8X  d   RpM,VP                  4       R8X  d   RpM\        \        V4      4      p\        4       ;_uu_ 4       pVx  RV 9   d   V P                  R4       K  V  Uu. uF  pR	VP                  R
4      9  g   K  VNK  	  ppV F  pRpV  FL  p\        P                  ! V\        VP                  4      4      f   K1  RpWt9   g   K;  VP                  V4       KN  	  V'       g   Ka  V'       d   Kk  \        R\        VP                  4       24      h	  V'       d4   \        V4      ^ 8  d$   RpRV VP!                  V4       2p	\        V	4      hRRR4       R# u upi   + '       g   i     R# ; i5i)a  Context for use in testing to catch known warnings matching regexes

Parameters
----------
matching : None or a list of strings or compiled regexes
    Regexes for the desired warning to catch
    If matching is None, this behaves as a no-op.

Examples
--------
>>> import numpy as np
>>> rng = np.random.default_rng()
>>> image = rng.integers(0, 2**16, size=(100, 100), dtype=np.uint16)
>>> # rank filters are slow when bit-depth exceeds 10 bits
>>> from skimage import filters
>>> with expected_warnings(['Bad rank filter performance']):
...     median_filtered = filters.rank.median(image)

Notes
-----
Uses `all_warnings` to ensure all warnings are raised.
Upon exiting, it checks the recorded warnings for the desired matching
pattern(s).
Raises a ValueError if any match was not found or an unexpected
warning was raised.
Allows for three types of behaviors: `and`, `or`, and `optional` matches.
This is done to accommodate different build environments or loop conditions
that may produce different warnings.  The behaviors can be combined.
If you pass multiple patterns, you get an orderless `and`, where all of the
warnings must be raised.
If you use the `|` operator in a pattern, you can catch one of several
warnings.
Finally, you can use `|\A\Z` in a pattern to signify it as optional.

zA``matching`` should be a list of strings and not a string itself.NSKIMAGE_TEST_STRICT_WARNINGS1trueTfalseFz\A\Z|zUnexpected warning: 
zNo warning raised matching:)
isinstancestr
ValueErrorosenvirongetlowerboolintr   removesplitresearchmessagelenjoin)
matchingstrict_warningsr   m	remainingwarnfoundmatchnewlinemsgs
   &         r   expected_warningsr=   J   s    J (C  O
 	

 
jjnn%CSIO&(				 G	+s?34	1 hOOD! (H1G1773<,GQQ	HDE!99UC$56B E)!((/	 "
 uu #7DLL8I7J!KLL  I 2G/yi9P8QRCS/!) 
 I 
sT   B"G$#GG$G*7G&G0GG*G3G7
GGG		G)r   r=   r8   )
contextlibr   r   r   r/   	functoolsr'   __all__partialr8   r   r=        r   <module>rD      s_    % 
  	  	
7
 15 6 6r J" J"rC   