§
    dŠtjÕ  ã                   ó  — d 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	e	j
        Z
e	j        Zej        j        Ze	j        j        Ze	j        Ze	j        j        Ze	j        j        Ze	j        j        Ze	j        Zd„ Zdd„ZdS )z
Helper for testing.
é    Nc                  óD   ‡— t           j        Šdˆfd„	} | t           _        dS )z Redirect all warnings to stdout.Nr   c                 ót   •—  ‰| |t           j                             |¦  «        |t          j        ¦  «         d S )N)ÚosÚpathÚbasenameÚsysÚstdout)ÚmsgÚcatÚfnameÚlnoÚfileÚlineÚshowwarning_origs         €úL/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/joblib/testing.pyÚshowwarningz'warnings_to_stdout.<locals>.showwarning   s4   ø€ ØÐ˜˜c¥2¤7×#3Ò#3°EÑ#:Ô#:¸DÅ#Ä*ÑMÔMÐMÐMÐMó    )Nr   )Úwarningsr   )r   r   s    @r   Úwarnings_to_stdoutr      s@   ø€ åÔ+ÐðNð Nð Nð Nð Nð Nð '…HÔÐÐr   é   c                 ó²  ‡ ‡— t          j        ‰ t           j        t           j        ¬¦  «        Šˆ ˆfd„}ˆ ˆfd„}	 |�Ut          j        ||¦  «        }|                     ¦   «          t          j        d|z  |¦  «        }|                     ¦   «          ‰                     ¦   «         \  }}	|                     ¦   «         |	                     ¦   «         }	}‰j        dk    r+d 	                    ‰j        ||	¦  «        }
t          |
¦  «        ‚|�8t          j        ||¦  «        s#t          d 	                    ||¦  «        ¦  «        ‚|�8t          j        ||	¦  «        s#t          d	 	                    ||	¦  «        ¦  «        ‚|�*|                     ¦   «          |                     ¦   «          dS dS # |�)|                     ¦   «          |                     ¦   «          w w xY w)
a  Runs a command in a subprocess with timeout in seconds.

    A SIGTERM is sent after `timeout` and if it does not terminate, a
    SIGKILL is sent after `2 * timeout`.

    Also checks returncode is zero, stdout if stdout_regex is set, and
    stderr if stderr_regex is set.
    )r	   Ústderrc                  ó^   •— t          j        d‰ › �¦  «         ‰                     ¦   «          dS )zË
        Attempt to terminate a leftover process spawned during test execution:
        ideally this should not be needed but can help avoid clogging the CI
        workers in case of deadlocks.
        úTimeout running N)r   ÚwarnÚ	terminate©ÚcmdÚprocs   €€r   Úterminate_processz0check_subprocess_call.<locals>.terminate_process0   s4   ø€ õ 	ŒÐ.¨Ð.Ð.Ñ/Ô/Ð/Ø�ŠÑÔÐÐÐr   c                  ó^   •— t          j        d‰ › �¦  «         ‰                     ¦   «          dS )z»
        Kill a leftover process spawned during test execution: ideally this
        should not be needed but can help avoid clogging the CI workers in
        case of deadlocks.
        r   N)r   r   Úkillr   s   €€r   Úkill_processz+check_subprocess_call.<locals>.kill_process9   s/   ø€ õ 	ŒÐ.¨Ð.Ð.Ñ/Ô/Ð/Ø�	Š	‰Œˆˆˆr   Né   r   z/Non-zero return code: {}.
Stdout:
{}
Stderr:
{}z,Unexpected stdout: {!r} does not match:
{!r}z,Unexpected stderr: {!r} does not match:
{!r})Ú
subprocessÚPopenÚPIPEÚ	threadingÚTimerÚstartÚcommunicateÚdecodeÚ
returncodeÚformatÚ
ValueErrorÚreÚsearchÚcancel)r   ÚtimeoutÚstdout_regexÚstderr_regexr    r#   Úterminate_timerÚ
kill_timerr	   r   Úmessager   s   `          @r   Úcheck_subprocess_callr9   %   s  øø€ õ Ô˜C­
¬Å
ÄÐPÑPÔP€Dðð ð ð ð ð ðð ð ð ð ð ð ØÐÝ'œo¨gÐ7HÑIÔIˆOØ×!Ò!Ñ#Ô#Ð#Ý"œ¨¨W©°lÑCÔCˆJØ×ÒÑÔÐØ×)Ò)Ñ+Ô+‰ˆ�ØŸš™œ¨&¯-ª-©/¬/�ˆØŒ?˜aÒÐØL×TÒTØ” ¨ñô ˆGõ ˜WÑ%Ô%Ð%àÐ#­B¬I°lÀFÑ,KÔ,KÐ#ÝØ?×FÒFØ  &ñô ñô ð ð
 Ð#­B¬I°lÀFÑ,KÔ,KÐ#ÝØ?×FÒFØ  &ñô ñô ð ð ÐØ×"Ò"Ñ$Ô$Ð$Ø×ÒÑÔÐÐÐð Ðøˆ7ÐØ×"Ò"Ñ$Ô$Ð$Ø×ÒÑÔÐÐð øøøs   »E F) Æ)-G)r   NN)Ú__doc__Úos.pathr   r0   r%   r   r(   r   Ú_pytestÚpytestÚraisesÚwarnsÚrunnerÚSkippedÚSkipTestÚmarkÚskipifÚfixtureÚparametrizer3   ÚxfailÚparamr   r9   © r   r   ú<module>rJ      sÚ   ððð ð €€€Ø 	€	€	€	Ø Ð Ð Ð Ø 
€
€
€
Ø Ð Ð Ð Ø €€€à €€€Ø €€€à	Œ€ØŒ€ØŒ>Ô!€Ø	ŒÔ	€Ø
Œ.€ØŒkÔ%€Ø
Œ+Ô
€ØŒÔ€ØŒ€ð'ð 'ð 'ð; ð ; ð ; ð ; ð ; ð ; r   