Ë
    nûàgP%  ã                  ó4  — d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
Zd dlZd dlmZ ej                  dk  rd dlmZ nd dlZej$                  dd„«       Zej$                  	 d	 	 	 dd„«       Z	 	 	 	 dd„Zd	„ Z eee«      Zej$                  d
„ «       Zd„ Zej$                  ej4                  fd„«       Zej$                  ddefd„«       Zd„ Z G d„ d«      Z G d„ dej>                  ej@                  «      Z G d„ dej@                  «      Z!y)é    )ÚannotationsN)ÚIterator)é   é   )Útarfilec              #  óÆ   K  — t        j                  «       }t        j                  | «       	 | –— t        j                  |«       y# t        j                  |«       w xY w­w)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     ú_/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/setuptools/_vendor/jaraco/context.pyÚpushdr      s>   è ø€ ô �9‰9‹;€DÜ‡H�HˆS„MðØŠ	ä
�‰��øŒ�‰��üs   ‚*A!­A ±A!ÁAÁA!c              #  óä  K  — |€?t         j                  j                  | «      j                  dd«      j                  dd«      }t        j                  |«       	 t
        j                  j                  | «      }t        j                  |d¬«      5 }|j                  |t        ¬«       ddd«       |–— t        j                  |«       y# 1 sw Y   Œ#xY w# t        j                  |«       w xY w­w)až  
    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ð 	I°bØ�M‰M˜zÔ2GˆMÔH÷	IàÒä�‰�jÕ!÷		Ið 	Iûô 	�‰�jÕ!üs6   ‚AC0Á6C ÂC
Â(C Â4C0Ã
CÃC ÃC-Ã-C0c                óN   — | j                   j                  dd«      \  }| _         | S )Nú/é   )ÚnameÚsplit)Úmemberr   Ú_s      r   r   r   G   s%   € ð —[‘[×&Ñ& s¨AÓ.�N€A€v„{Ø€Mó    c                 óF   — d„ }t        j                  |t        | «      «      S )a…  
    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                ó<   ‡ ‡— ˆ ˆfd„}t        j                  |«      S )Nc               ?  óŠ   •K  —  ‰| i |¤Ž5 } ‰|«      5 }|–— d d d «       d d d «       y # 1 sw Y   ŒxY w# 1 sw Y   y xY w­w©N© )ÚargsÚkwargsÚsavedÚresÚinnerÚouters       €€r   Úcomposedz/_compose.<locals>.compose_two.<locals>.composedd   sL   øè ø€ Ù˜Ð' Ñ'ð ¨5±%¸³,ð À#Ø’	÷÷ ÷ ñ ú÷ ð üs(   ƒ	AŒ	7•+š7¢	A«4	°7·A ¼A)Ú
contextlibÚcontextmanager)r7   r8   r9   s   `` r   Úcompose_twoz_compose.<locals>.compose_twoc   s   ù€ õ	ô ×(Ñ(¨Ó2Ð2r-   )Ú	functoolsÚreduceÚreversed)Úcmgrsr<   s     r   Ú_composerA   O   s    € ò(3ô ×Ñ˜K¬°%«Ó9Ð9r-   c               /  óò   K  — t        j                  dt        d¬«       |j                  dt        «      }t        | i |¤Ž5 } ||«      5 }|–— d d d «       d d d «       y # 1 sw Y   ŒxY w# 1 sw Y   y xY w­w)NzBtarball_context is deprecated. Use tarball or tarball_cwd instead.é   ©Ú
stacklevelr   )ÚwarningsÚwarnÚDeprecationWarningÚpopr   r%   )r3   r4   Ú	pushd_ctxÚtballr   s        r   Útarball_contextrL   p   ss   è ø€ ä‡M�MØLÜØõð
 —
‘
˜7¤EÓ*€IÜ	�$Ð	!˜&Ñ	!ð  U©I°eÓ,<ð ÀØŠ	÷÷ ÷ ñ ú÷ ð üs5   ‚>A7Á 	A+Á	AÁA+Á	A7ÁA(	Á$A+Á+A4Á0A7c                ó„   — t        j                  dt        d¬«       | dd }t        ddd¬	«      }|j	                  |d«      S )
a  
    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 replacementrC   rD   éþÿÿÿNÚzÚjÚJ)ÚgzÚbzÚxz)rF   rG   rH   ÚdictÚget)r!   Úcompression_indicatorÚmappings      r   Úinfer_compressionrY   |   sG   € ô ‡M�MØ=ÜØõð    ˜HÐÜ�c˜c cÔ*€Gà�;‰;Ð,¨cÓ2Ð2r-   c              #  óh   K  — t        j                  «       }	 |–—  | |«       y#  | |«       w xY w­w)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^   •   s0   è ø€ ô ×ÑÓ!€HðØŠá�Õø‰�Õüs   ‚2˜% œ	2¥
/¯2Tc              #  ó  K  — d| v rdnd} |«       5 }|d| |g}|r|j                  d|g«       t        t        j                  j                  d«      }|r|nd}t        j                  ||¬«       |–— ddd«       y# 1 sw Y   yxY w­w)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Úcmdrf   rd   s	            r   Úrepo_contextro   ¨   s„   è ø€ ð ˜C‘<‰% T€CÙ	‹ð �xØ�G˜S (Ð+ˆÙØ�J‰J˜
 FÐ+Ô,Ü”r—w‘w—‘¨Ó,ˆÙ!‘ tˆÜ×Ñ˜c¨&Õ1ØŠ÷÷ ñ üs   ‚B’A!A<Á3	BÁ<BÂBc                 ób   — t        j                  dt        d¬«       t        j                  «       S )aD  
    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.nullcontextrC   rD   )rF   rG   rH   r:   Únullcontextr2   r-   r   Únullrr   »   s*   € ô ‡M�MØ8ÜØõô
 ×!Ñ!Ó#Ð#r-   c                  ót   — e Zd ZdZdZeffd„Zd„ Zed„ «       Z	ed„ «       Z
ed„ «       Zd„ Zd	„ Zed
œd„Zd„ Zy)ÚExceptionTrapa©  
    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                ó   — || _         y r1   )Ú
exceptions)Úselfrv   s     r   Ú__init__zExceptionTrap.__init__ò   s	   € Ø$ˆ�r-   c                ó   — | S r1   r2   ©rw   s    r   Ú	__enter__zExceptionTrap.__enter__õ   ó   € Øˆr-   c                ó    — | j                   d   S ©Nr   ©Úexc_inforz   s    r   ÚtypezExceptionTrap.typeø   ó   € à�}‰}˜QÑÐr-   c                ó    — | j                   d   S )Nr(   r   rz   s    r   ÚvaluezExceptionTrap.valueü   r‚   r-   c                ó    — | j                   d   S )NrC   r   rz   s    r   ÚtbzExceptionTrap.tb   r‚   r-   c                óV   — |d   }|xr t        || j                  «      }|r|| _        |S r~   )Ú
issubclassrv   r€   )rw   r€   r�   Úmatchess       r   Ú__exit__zExceptionTrap.__exit__  s/   € Ø˜‰{ˆØÒ<œ: d¨D¯O©OÓ<ˆÙØ$ˆDŒMØˆr-   c                ó,   — t        | j                  «      S r1   )Úboolr�   rz   s    r   Ú__bool__zExceptionTrap.__bool__  s   € Ü�D—I‘I‹Ðr-   ©Ú_testc               óJ   ‡ ‡‡— t        j                  ‰«      ˆˆˆ fd„«       }|S )a±  
        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                 óx   •— t        ‰j                  «      5 } ‰| i |¤Ž d d d «        ‰«      S # 1 sw Y   ŒxY wr1   )rt   rv   )r3   r4   Útrapr�   Úfuncrw   s      €€€r   Úwrapperz%ExceptionTrap.raises.<locals>.wrapper!  s=   ø€ ä˜tŸ™Ó/ð &°4Ù�dÐ%˜fÒ%÷&á˜“;Ð÷&ð &ús   —	0°9)r=   Úwraps)rw   r“   r�   r”   s   ``` r   ÚraiseszExceptionTrap.raises  s'   ú€ ô& 
�‰˜Ó	õ	ó 
ð	ð
 ˆr-   c                óD   — | j                  |t        j                  ¬«      S )aª  
        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_)rw   r“   s     r   ÚpasseszExceptionTrap.passes)  s   € ð& �{‰{˜4¤x§}¡}ˆ{Ó5Ð5r-   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r€   Ú	Exceptionrx   r{   Úpropertyr�   r„   r†   rŠ   r�   rŒ   r–   rš   r2   r-   r   rt   rt   Î   ss   „ ñðB  €Hà#, ,ó %òð ñ ó ð ð ñ ó ð ð ñ ó ð òòð %)ô ó66r-   rt   c                  ó   — e Zd ZdZy)ÚsuppresszŸ
    A version of contextlib.suppress with decorator support.

    >>> @suppress(KeyError)
    ... def key_error():
    ...     {}['']
    >>> key_error()
    N)r›   rœ   r�   rž   r2   r-   r   r¢   r¢   ?  s   „ òr-   r¢   c                  ó$   — e Zd ZdZdd„Zd„ Zd„ Zy)Úon_interrupta  
    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               ó    — || _         || _        y r1   )ÚactionÚcode)rw   r¦   r§   s      r   rx   zon_interrupt.__init__]  s   € ØˆŒØˆ�	r-   c                ó   — | S r1   r2   rz   s    r   r{   zon_interrupt.__enter__a  r|   r-   c                óš   — |t         us| j                  dk(  ry | j                  dk(  rt        | j                  «      |‚| j                  dk(  S )NÚignoreÚerrorr¢   )ÚKeyboardInterruptr¦   Ú
SystemExitr§   )rw   ÚexctypeÚexcinstÚexctbs       r   rŠ   zon_interrupt.__exit__d  sE   € ØÔ+Ñ+¨t¯{©{¸hÒ/FØØ�[‰[˜GÒ#Ü˜TŸY™YÓ'¨WÐ4Ø�{‰{˜jÑ(Ð(r-   N)r«   r(   )r›   rœ   r�   rž   rx   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   rg   Úsysr[   Úurllib.requestr   rF   Útypingr   Úversion_infoÚ	backportsr   r;   r   r%   r   rA   Útarball_cwdrL   rY   r    r^   ro   rr   rt   r¢   ÚContextDecoratorr¤   r2   r-   r   ú<module>r¼      sO  ðÝ "ã Û Û Û 	Û Û Û 
Û Û Û Ý ð ×Ñ�gÒÞ!ãð ×Ñòó ðð  ×Ñà04ð"Ø-ð"à ò"ó ð"ð>Øðð óò:ñ< �u˜gÓ&€ð ×Ññó ðò3ð2 ×ÑØ—]‘]ò ó ðð$ ×ÑØ!¨¸ò ó ðò$$÷&n6ñ n6ôbˆz×"Ñ" J×$?Ñ$?ô ô)�:×.Ñ.õ )r-   