ó
    Á›‘hP%  ã                  óB  • S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKrS SKrS SK	r	S SK
rS SKrS SKJr  \R                  S:  a  S SKJr  OS SKr\R$                  SS j5       r\R$                   S   SS jj5       r    SS jrS	 r\" \\5      r\R$                  S
 5       rS r\R$                  \R4                  4S j5       r\R$                  SS\4S j5       rS r " S S5      r " S S\R>                  \R@                  5      r " S S\R@                  5      r!g)é    )ÚannotationsN)ÚIterator)é   é   )Útarfilec              #  óÎ   #   • [         R                  " 5       n[         R                  " U 5         U v •  [         R                  " U5        g! [         R                  " U5        f = f7f)z¡
>>> tmp_path = getfixture('tmp_path')
>>> with pushd(tmp_path):
...     assert os.getcwd() == os.fspath(tmp_path)
>>> assert os.getcwd() != os.fspath(tmp_path)
N)ÚosÚgetcwdÚchdir)ÚdirÚorigs     ÚeC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\setuptools/_vendor/jaraco/context.pyÚpushdr      s=   é € ô �9Š9‹;€DÜ‡H‚HˆS„MðØŠ	ä
�Š��øŒ�Š��üs   ‚,A%¯A
 ³A%Á
A"Á"A%c              #  óì  #   • Uc?  [         R                  R                  U 5      R                  SS5      R                  SS5      n[         R                  " U5         [
        R                  R                  U 5      n[        R                  " USS9 nUR                  U[        S9  SSS5        Uv •  [        R                  " U5        g! , (       d  f       N)= f! [        R                  " U5        f = f7f)av  
Get a tarball, extract it, yield, then clean up.

>>> import urllib.request
>>> url = getfixture('tarfile_served')
>>> target = getfixture('tmp_path') / 'out'
>>> tb = tarball(url, target_dir=target)
>>> import pathlib
>>> with tb as extracted:
...     contents = pathlib.Path(extracted, 'contents.txt').read_text(encoding='utf-8')
>>> assert not os.path.exists(extracted)
Nz.tar.gzÚ z.tgzzr|*)ÚfileobjÚmode)ÚpathÚfilter)r	   r   ÚbasenameÚreplaceÚmkdirÚurllibÚrequestÚurlopenr   ÚopenÚ
extractallÚstrip_first_componentÚshutilÚrmtree)ÚurlÚ
target_dirÚreqÚtfs       r   Útarballr%   '   s²   é € ð  ÑÜ—W‘W×%Ñ% cÓ*×2Ñ2°9¸bÓA×IÑIÈ&ÐRTÓUˆ
ô
 ‡H‚HˆZÔð"Ü�n‰n×$Ñ$ SÓ)ˆÜ�\Š\ #¨EÒ2°bØ�M‰M˜zÔ2GˆMÑH÷ 3àÒä�Š�jÕ!÷	 3Õ2ûô 	�Š�jÕ!üs6   ‚AC4Á4C ÂCÂ%C Â1C4Ã
CÃC ÃC1Ã1C4c                óL   • U R                   R                  SS5      u  o l         U $ )NÚ/é   )ÚnameÚsplit)Úmemberr   Ú_s      r   r   r   G   s#   € ð —[‘[×&Ñ& s¨AÓ.�N€A„{Ø€Mó    c                 óH   • S n[         R                  " U[        U 5      5      $ )aQ  
Compose any number of dependent context managers into a single one.

The last, innermost context manager may take arbitrary arguments, but
each successive context manager should accept the result from the
previous as a single parameter.

Like :func:`jaraco.functools.compose`, behavior works from right to
left, so the context manager should be indicated from outermost to
innermost.

Example, to create a context manager to change to a temporary
directory:

>>> temp_dir_as_cwd = _compose(pushd, temp_dir)
>>> with temp_dir_as_cwd() as dir:
...     assert os.path.samefile(os.getcwd(), dir)
c                ó@   ^ ^• U U4S jn[         R                  " U5      $ )Nc               ?  óž   >#   • T" U 0 UD6 nT" U5       nUv •  S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f7f©N© )ÚargsÚkwargsÚsavedÚresÚinnerÚouters       €€r   ÚcomposedÚ/_compose.<locals>.compose_two.<locals>.composedd   s8   øé € Ù˜Ð' Ò'¨5±%¸´,À#Ø’	÷ 3?×'Ð'·,µ,ú×'Õ'üs)   ƒ	AŒ	<•+š<¢	A«
9	µ<¼
A
ÁA)Ú
contextlibÚcontextmanager)r7   r8   r9   s   `` r   Úcompose_twoÚ_compose.<locals>.compose_twoc   s   ù€ ö	ô ×(Ò(¨Ó2Ð2r-   )Ú	functoolsÚreduceÚreversed)Úcmgrsr=   s     r   Ú_composerC   O   s    € ò(3ô ×Ò˜K¬°%«Ó9Ð9r-   c               /  ó   #   • [         R                  " S[        SS9  UR                  S[        5      n[        U 0 UD6 o2" U5       nUv •  S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f7f)NzBtarball_context is deprecated. Use tarball or tarball_cwd instead.é   ©Ú
stacklevelr   )ÚwarningsÚwarnÚDeprecationWarningÚpopr   r%   )r3   r4   Ú	pushd_ctxÚtballr   s        r   Útarball_contextrN   p   sa   é € ä‡M‚MØLÜØòð
 —
‘
˜7¤EÓ*€IÜ	�$Ð	!˜&Ò	! U¨I°eÔ,<ÀØŠ	÷ -=×	!Ð	!×,<Õ,<ú×	!Õ	!üs4   ‚<A>¾A-ÁAÁA-Á	A>Á
A*	Á&A-Á-
A;Á7A>c                óz   • [         R                  " S[        SS9  U SS n[        SSSS	9nUR	                  US5      $ )
zì
Given a URL or filename, infer the compression code for tar.

>>> infer_compression('http://foo/bar.tar.gz')
'z'
>>> infer_compression('http://foo/bar.tgz')
'z'
>>> infer_compression('file.bz')
'j'
>>> infer_compression('file.xz')
'J'
z3infer_compression is deprecated with no replacementrE   rF   éþÿÿÿNÚzÚjÚJ)ÚgzÚbzÚxz)rH   rI   rJ   ÚdictÚget)r!   Úcompression_indicatorÚmappings      r   Úinfer_compressionr[   |   sG   € ô ‡M‚MØ=ÜØòð    ˜HÐÜ�c˜c cÑ*€Gà�;‰;Ð,¨cÓ2Ð2r-   c              #  ój   #   • [         R                  " 5       n Uv •  U " U5        g! U " U5        f = f7f)a@  
Create a temporary directory context. Pass a custom remover
to override the removal behavior.

>>> import pathlib
>>> with temp_dir() as the_dir:
...     assert os.path.isdir(the_dir)
...     _ = pathlib.Path(the_dir).joinpath('somefile').write_text('contents', encoding='utf-8')
>>> assert not os.path.exists(the_dir)
N)ÚtempfileÚmkdtemp)ÚremoverÚtemp_dirs     r   r`   r`   •   s/   é € ô ×ÒÓ!€HðØŠá�Õø‰�Õüs   ‚3™& �	3¦
0°3Tc              #  ó.  #   • SU ;   a  SOSnU" 5        nUSX/nU(       a  UR                  SU/5        [        [        R                  R                  S5      nU(       a  UOSn[
        R                  " XhS9  Uv •  SSS5        g! , (       d  f       g= f7f)z�
Check out the repo indicated by url.

If dest_ctx is supplied, it should be a context manager
to yield the target directory for the check out.
ÚgitÚhgÚclonez--branchÚwN)Ústdout)Úextendr   r	   r   ÚdevnullÚ
subprocessÚ
check_call)	r!   ÚbranchÚquietÚdest_ctxÚexeÚrepo_dirÚcmdrh   rf   s	            r   Úrepo_contextrq   ¨   st   é € ð ˜C“<‰% T€CÙ	Œ�xØ�G˜SÐ+ˆÞØ�J‰J˜
 FÐ+Ô,Ü”r—w‘w—‘¨Ó,ˆÞ!‘ tˆÜ×Ò˜cÒ1ØŠ÷ 
�Žüs   ‚B”A'BÁ;	BÂ
BÂBc                 ó`   • [         R                  " S[        SS9  [        R                  " 5       $ )a(  
A null context suitable to stand in for a meaningful context.

>>> with null() as value:
...     assert value is None

This context is most useful when dealing with two or more code
branches but only some need a context. Wrap the others in a null
context to provide symmetry across all options.
z.null is deprecated. Use contextlib.nullcontextrE   rF   )rH   rI   rJ   r;   Únullcontextr2   r-   r   Únullrt   »   s*   € ô ‡M‚MØ8ÜØòô
 ×!Ò!Ó#Ð#r-   c                  ó€   • \ rS rSrSrSr\44S jrS r\	S 5       r
\	S 5       r\	S 5       rS	 rS
 r\S.S jrS rSrg)ÚExceptionTrapéÎ   aA  
A context manager that will catch certain exceptions and provide an
indication they occurred.

>>> with ExceptionTrap() as trap:
...     raise Exception()
>>> bool(trap)
True

>>> with ExceptionTrap() as trap:
...     pass
>>> bool(trap)
False

>>> with ExceptionTrap(ValueError) as trap:
...     raise ValueError("1 + 1 is not 3")
>>> bool(trap)
True
>>> trap.value
ValueError('1 + 1 is not 3')
>>> trap.tb
<traceback object at ...>

>>> with ExceptionTrap(ValueError) as trap:
...     raise Exception()
Traceback (most recent call last):
...
Exception

>>> bool(trap)
False
)NNNc                ó   • Xl         g r1   )Ú
exceptions)Úselfry   s     r   Ú__init__ÚExceptionTrap.__init__ò   s   € Ø$�r-   c                ó   • U $ r1   r2   ©rz   s    r   Ú	__enter__ÚExceptionTrap.__enter__õ   ó   € Øˆr-   c                ó    • U R                   S   $ ©Nr   ©Úexc_infor~   s    r   ÚtypeÚExceptionTrap.typeø   ó   € à�}‰}˜QÑÐr-   c                ó    • U R                   S   $ )Nr(   r„   r~   s    r   ÚvalueÚExceptionTrap.valueü   rˆ   r-   c                ó    • U R                   S   $ )NrE   r„   r~   s    r   ÚtbÚExceptionTrap.tb   rˆ   r-   c                óf   • US   nU=(       a    [        X R                  5      nU(       a  Xl        U$ rƒ   )Ú
issubclassry   r…   )rz   r…   r†   Úmatchess       r   Ú__exit__ÚExceptionTrap.__exit__  s+   € Ø˜‰{ˆØ×<œ: d¯O©OÓ<ˆÞØ$ŒMØˆr-   c                ó,   • [        U R                  5      $ r1   )Úboolr†   r~   s    r   Ú__bool__ÚExceptionTrap.__bool__  s   € Ü�D—I‘I‹Ðr-   ©Ú_testc               óN   ^ ^^• [         R                  " T5      UUU 4S j5       nU$ )aQ  
Wrap func and replace the result with the truth
value of the trap (True if an exception occurred).

First, give the decorator an alias to support Python 3.8
Syntax.

>>> raises = ExceptionTrap(ValueError).raises

Now decorate a function that always fails.

>>> @raises
... def fail():
...     raise ValueError('failed')
>>> fail()
True
c                 ó‚   >• [        TR                  5       nT" U 0 UD6  S S S 5        T" W5      $ ! , (       d  f       N= fr1   )rv   ry   )r3   r4   Útrapr™   Úfuncrz   s      €€€r   ÚwrapperÚ%ExceptionTrap.raises.<locals>.wrapper!  s6   ø€ ä˜tŸ™Ô/°4Ù�dÐ%˜fÒ%÷ 0á˜“;Ð÷ 0Õ/ús   —	0°
>)r?   Úwraps)rz   r�   r™   rž   s   ``` r   ÚraisesÚExceptionTrap.raises  s'   ú€ ô& 
�Š˜Ó	ö	ó 
ð	ð
 ˆr-   c                ó>   • U R                  U[        R                  S9$ )aJ  
Wrap func and replace the result with the truth
value of the trap (True if no exception).

First, give the decorator an alias to support Python 3.8
Syntax.

>>> passes = ExceptionTrap(ValueError).passes

Now decorate a function that always fails.

>>> @passes
... def fail():
...     raise ValueError('failed')

>>> fail()
False
r˜   )r¡   ÚoperatorÚnot_)rz   r�   s     r   ÚpassesÚExceptionTrap.passes)  s   € ð& �{‰{˜4¤x§}¡}ˆ{Ð5Ð5r-   )r…   ry   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r…   Ú	Exceptionr{   r   Úpropertyr†   rŠ   r�   r’   r–   r•   r¡   r¦   Ú__static_attributes__r2   r-   r   rv   rv   Î   ss   † ñðB  €Hà#, ,ô %òð ñ ó ð ð ñ ó ð ð ñ ó ð òòð %)õ õ66r-   rv   c                  ó   • \ rS rSrSrSrg)Úsuppressi?  z‡
A version of contextlib.suppress with decorator support.

>>> @suppress(KeyError)
... def key_error():
...     {}['']
>>> key_error()
r2   N)r¨   r©   rª   r«   r¬   r¯   r2   r-   r   r±   r±   ?  s   † ôr-   r±   c                  ó.   • \ rS rSrSrSS jrS rS rSrg)	Úon_interruptiJ  aÊ  
Replace a KeyboardInterrupt with SystemExit(1)

>>> def do_interrupt():
...     raise KeyboardInterrupt()
>>> on_interrupt('error')(do_interrupt)()
Traceback (most recent call last):
...
SystemExit: 1
>>> on_interrupt('error', code=255)(do_interrupt)()
Traceback (most recent call last):
...
SystemExit: 255
>>> on_interrupt('suppress')(do_interrupt)()
>>> with __import__('pytest').raises(KeyboardInterrupt):
...     on_interrupt('ignore')(do_interrupt)()
c               ó   • Xl         X l        g r1   ©ÚactionÚcode)rz   r¶   r·   s      r   r{   Úon_interrupt.__init__]  s   € ØŒØ�	r-   c                ó   • U $ r1   r2   r~   s    r   r   Úon_interrupt.__enter__a  r�   r-   c                ó    • U[         Ld  U R                  S:X  a  g U R                  S:X  a  [        U R                  5      UeU R                  S:H  $ )NÚignoreÚerrorr±   )ÚKeyboardInterruptr¶   Ú
SystemExitr·   )rz   ÚexctypeÚexcinstÚexctbs       r   r’   Úon_interrupt.__exit__d  sE   € ØÔ+Ò+¨t¯{©{¸hÓ/FØØ�[‰[˜GÓ#Ü˜TŸY™YÓ'¨WÐ4Ø�{‰{˜jÑ(Ð(r-   rµ   N)r½   r(   )	r¨   r©   rª   r«   r¬   r{   r   r’   r¯   r2   r-   r   r³   r³   J  s   † ñô$òõ)r-   r³   )r   zstr | os.PathLikeÚreturnúIterator[str | os.PathLike]r1   )r"   zstr | os.PathLike | NonerÄ   rÅ   )r+   útarfile.TarInforÄ   rÆ   )"Ú
__future__r   r;   r?   r¤   r	   r   ri   Úsysr]   Úurllib.requestr   rH   Útypingr   Úversion_infoÚ	backportsr   r<   r   r%   r   rC   Útarball_cwdrN   r[   r    r`   rq   rt   rv   r±   ÚContextDecoratorr³   r2   r-   r   Ú<module>rÏ      sO  ðÝ "ã Û Û Û 	Û Û Û 
Û Û Û Ý ð ×Ñ�gÓÞ!ãð ×Ñóó ðð  ×Ñà04ð"Ø-ð"à ô"ó ð"ð>Øðð ôò:ñ< �u˜gÓ&€ð ×Ññó ðò3ð2 ×ÑØ—]‘]ó ó ðð$ ×ÑØ!¨¸ó ó ðò$$÷&n6ñ n6ôbˆz×"Ñ" J×$?Ñ$?ô ô)�:×.Ñ.õ )r-   