§
    OŠtjJ  ã            	       óæ   — d dl mZ d dlmZ d dlZddlmZ ddee         defd„Zddee         defd	„Z	ddee         d
ee         fd„Z
ddee         ded
efd„Z	 	 	 ddee         deded
dfd„ZdS )é    )ÚOptional)ÚprotonNé   )ÚflagsÚsessionÚphasec                 óš   — | €dS t           j        r| dk    rt          d¦  «        ‚t          j        t          j        | |¦  «        ¦  «        S )zë
    Retrieves profiling data for a given session.

    Args:
        session (Optional[int]): The session ID of the profiling session, or None if profiling is inactive.
    Returns:
        str: The profiling data in JSON format.
    Nr   úEOnly one session can be retrieved when running from the command line.)r   Úcommand_lineÚ
ValueErrorÚjsonÚloadsÚ	libprotonÚget_data©r   r   s     úR/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/triton/profiler/data.pyÚgetr      sN   € ð €ØˆtÝÔð b˜g¨šl˜lÝÐ`ÑaÔaÐaÝŒ:•iÔ(¨°%Ñ8Ô8Ñ9Ô9Ð9ó    c                 óv   — | €dS t           j        r| dk    rt          d¦  «        ‚t          j        | |¦  «        S )a  
    Retrieves profiling data for a given session encoded with MessagePack.

    Args:
        session (Optional[int]): The session ID of the profiling session, or None if profiling is inactive.

    Returns:
        bytes: The profiling data encoded with MessagePack.
    Nr   r
   )r   r   r   r   Úget_data_msgpackr   s     r   Úget_msgpackr      sD   € ð €ØˆtÝÔð b˜g¨šl˜lÝÐ`ÑaÔaÐaÝÔ% g¨uÑ5Ô5Ð5r   Úreturnc                 ót   — | €dS t           j        r| dk    rt          d¦  «        ‚t          j        | ¦  «        S )zþ
    Advances the profiling phase for a given session.

    Args:
        session (Optional[int]): The session ID of the profiling session, or None if profiling is inactive.

    Returns:
        Optional[int]: The next phase number after advancing.
    Nr   zFOnly one session can advance phase when running from the command line.)r   r   r   r   Úadvance_data_phase)r   s    r   Úadvance_phaser   (   sB   € ð €ØˆtÝÔð c˜g¨šl˜lÝÐaÑbÔbÐbÝÔ'¨Ñ0Ô0Ð0r   c                 óv   — | €dS t           j        r| dk    rt          d¦  «        ‚t          j        | |¦  «        S )a  
    Checks if the profiling data for a given session and phase is complete.

    A "complete" phase is safe to read/clear because all device-side records for
    the phase have been flushed to the host and the phase will no longer receive
    new records.

    Args:
        session (Optional[int]): The session ID of the profiling session, or None if profiling is inactive.
        phase (int): The phase number to check. Defaults to 0.

    Returns:
        bool: True if the phase data is complete, False otherwise.
    NFr   zVOnly one session can check phase completion status when running from the command line.)r   r   r   r   Úis_data_phase_completer   s     r   Úis_phase_completer   9   sD   € ð €ØˆuÝÔð s˜g¨šl˜lÝÐqÑrÔrÐrÝÔ+¨G°UÑ;Ô;Ð;r   FÚclear_up_to_phasec                 ó|   — | €dS t           j        r| dk    rt          d¦  «        ‚t          j        | ||¦  «         dS )aC  
    Clears profiling data for a given session.

    Args:
        session (Optional[int]): The session ID of the profiling session, or None if profiling is inactive.
        phase (int): The phase number to clear. Defaults to 0.
        clear_up_to_phase (bool): If True, clear all phases up to and including `phase`.
    Nr   zCOnly one session can be cleared when running from the command line.)r   r   r   r   Ú
clear_data)r   r   r   s      r   Úclearr"   O   sM   € ð €ØˆÝÔð `˜g¨šl˜lÝÐ^Ñ_Ô_Ð_ÝÔ˜ %Ð):Ñ;Ô;Ð;Ð;Ð;r   )r   r   )r   )r   r   F)Útypingr   Útriton._C.libprotonr   r   r   r   Úintr   r   r   Úboolr   r"   © r   r   ú<module>r(      sT  ðØ Ð Ð Ð Ð Ð Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø Ð Ð Ð Ø Ð Ð Ð Ð Ð ð:ð :�˜#”ð :¨3ð :ð :ð :ð :ð 6ð 6˜ #œð 6°3ð 6ð 6ð 6ð 6ð"1ð 1˜8 Cœ=ð 1°¸#´ð 1ð 1ð 1ð 1ð"<ð <˜x¨œ}ð <¸ð <ÀTð <ð <ð <ð <ð. ØØ#ð<ð <Ø�cŒ]ð<àð<ð ð<ð 
ð	<ð <ð <ð <ð <ð <r   