+
    QV-j¾  ã                   óº   € R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHt ^RIHt ]! ]4      t]R R	 l4       tRR
 R llt]RR R ll4       tR# )zFContains utilities to easily handle subprocesses in `huggingface_hub`.N)Ú	Generator)Úcontextmanager)ÚStringIO)ÚPath)ÚIO)Ú
get_loggerc                ó@   € V ^8„  d   QhR\         \        RR3,          /# )é   ÚreturnN)r   r   )Úformats   "Úr/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/huggingface_hub/utils/_subprocess.pyÚ__annotate__r       s   € ÷ %ñ %œ	¤(¨D°$Ð"6Õ7ñ %ó    c               #  ó˜   "  € \        4       p \        P                  pV \        n         V x € V\        n        R#   T\        n        i ; i5i)a  Capture output that is printed to terminal.

    Taken from https://stackoverflow.com/a/34738440

    Example:
    ```py
    >>> with capture_output() as output:
    ...     print("hello world")
    >>> assert output.getvalue() == "hello world
"
    ```
    N)r   ÚsysÚstdout)ÚoutputÚprevious_outputs     r   Úcapture_outputr      s6   é € ô ‹Z€FÜ—j‘j€OØ„C„Jð%ØŠà$ŒŽ
ø�_Œ�
üs   ‚&A
©: ­A
ºAÁA
c                ó    € V ^8„  d   QhR\         \        \         ,          ,          R\         \        ,          R,          R\        P                  /# ©r	   ÚcommandÚfolderNr
   )ÚstrÚlistr   Ú
subprocessÚCompletedProcess)r   s   "r   r   r   5   s=   € ÷ (ñ (Ü”4œ•9�_ð(ä”$�J˜Õð(ô
 × Ñ ñ(r   c                ó  € \        V \        4      '       d   V P                  4       p \        V\        4      '       d   \        V4      p\        P
                  ! V 3RRRTRRRRRT;'       g    \        P                  ! 4       /VB # )	a  
Method to run subprocesses. Calling this will capture the `stderr` and `stdout`,
please call `subprocess.run` manually in case you would like for them not to
be captured.

Args:
    command (`str` or `list[str]`):
        The command to execute as a string or list of strings.
    folder (`str`, *optional*):
        The folder in which to run the command. Defaults to current working
        directory (from `os.getcwd()`).
    check (`bool`, *optional*, defaults to `True`):
        Setting `check` to `True` will raise a `subprocess.CalledProcessError`
        when the subprocess has a non-zero exit code.
    kwargs (`dict[str]`):
        Keyword arguments to be passed to the `subprocess.run` underlying command.

Returns:
    `subprocess.CompletedProcess`: The completed process.
r   TÚcheckÚencodingúutf-8ÚerrorsÚreplaceÚcwd)Ú
isinstancer   Úsplitr   r   ÚrunÚosÚgetcwd)r   r   r   Úkwargss   &&&,r   Úrun_subprocessr*   5   sŽ   € ô4 �'œ3×ÒØ—-‘-“/ˆä�&œ$×ÒÜ�V“ˆä�>Š>Øñàðð ðð ð	ð
 ðð ×!Ð!”b—i’i“kðð ñð r   c          
      óö   € V ^8„  d   QhR\         \        \         ,          ,          R\         \        ,          R,          R\        \        \
        \         ,          \
        \         ,          3,          RR3,          /# r   )r   r   r   r   Útupler   )r   s   "r   r   r   a   sU   € ÷ .,ñ .,Ü”4œ•9�_ð.,ä”$�J˜Õð.,ô Œu”Rœ•Wœb¤�gÐ%Õ&¨¨dÐ2Õ3ñ	.,r   c              +  ó   "  € \        V \        4      '       d   V P                  4       p \        P                  ! V 3R\        P
                  R\        P
                  R\        P                  RRRRRT;'       g    \        P                  ! 4       /VB ;_uu_ 4       pVP                  f   Q R
4       hVP                  f   Q R
4       hVP                  VP                  3x € R	R	R	4       R	#   + '       g   i     R	# ; i5i)a›  Run a subprocess in an interactive mode in a context manager.

    Args:
        command (`str` or `list[str]`):
            The command to execute as a string or list of strings.
        folder (`str`, *optional*):
            The folder in which to run the command. Defaults to current working
            directory (from `os.getcwd()`).
        kwargs (`dict[str]`):
            Keyword arguments to be passed to the `subprocess.run` underlying command.

    Returns:
        `tuple[IO[str], IO[str]]`: A tuple with `stdin` and `stdout` to interact
        with the process (input and output are utf-8 encoded).

    Example:
    ```python
    with _interactive_subprocess("git credential-store get") as (stdin, stdout):
        # Write to stdin
        stdin.write("url=hf.co
username=obama
".encode("utf-8"))
        stdin.flush()

        # Read from stdout
        output = stdout.read().decode("utf-8")
    ```
    Ústdinr   Ústderrr   r    r!   r"   r#   Nz'subprocess is opened as subprocess.PIPE)r$   r   r%   r   ÚPopenÚPIPEÚSTDOUTr'   r(   r.   r   )r   r   r)   Úprocesss   &&, r   Úrun_interactive_subprocessr4   `   sî   é € ô@ �'œ3×ÒØ—-‘-“/ˆä	×	Ò	Øñ	
ä�o‰oð	
ô �‰ð	
ô × Ñ ð		
ð
 ð	
ð ð	
ð ×!Ð!”b—i’i“kð	
ð ÷	
ò 	
ð 
Ø�}‰}Ò(ÐSÐ*SÓSÐ(Ø�~‰~Ò)ÐTÐ+TÓTÐ)Ø�m‰m˜WŸ^™^Ð+Ò+÷	
÷ 	
÷ 	
ò 	
üs%   ‚A6C>Á9"C>ÂAC*Ã 
C>Ã*C;	Ã5	C>)NT)N)Ú__doc__r'   r   r   Úcollections.abcr   Ú
contextlibr   Úior   Úpathlibr   Útypingr   Úloggingr   Ú__name__Úloggerr   r*   r4   © r   r   Ú<module>r?      s`   ðñ Mã 	Û Û 
Ý %Ý %Ý Ý Ý å ñ 
�HÓ	€ð ô%ó ð%÷*(ðV ö.,ó ò.,r   