
    (ThB                     X    S SK Jr  SSKJr  S SKJr   " S S5      rS\SS	4S
 jr	SS jr
g	)    )proton   )get_profiling_onwrapsc                   @    \ rS rSrSrS\SS4S jrS rSS jrS	 r	S
r
g)state   a:  
A context manager and decorator for entering and exiting a state.

Usage:
    context manager:
    ```python
    with proton.state("test0"):
        foo[1,](x, y)
    ```

    decorator:
    ```python
    @proton.state("test0")
    def foo(x, y):
        ...
    ```

Args:
    name (str): The name of the state.
namereturnNc                     Xl         g Nr   )selfr   s     M/var/www/auris/envauris/lib/python3.13/site-packages/triton/profiler/state.py__init__state.__init__   s    	    c                 h    [        5       (       d  U $ [        R                  " U R                  5        U $ r   )r   	libprotonenter_stater   )r   s    r   	__enter__state.__enter__   s'    !!Kdii(r   c                 N    [        5       (       d  g [        R                  " 5         g r   )r   r   
exit_state)r   exc_type	exc_value	tracebacks       r   __exit__state.__exit__%   s    !!r   c                 4   ^ ^ [        T5      UU 4S j5       nU$ )Nc                     > [        5       (       a   [        R                  " TR                  5        T" U 0 UD6n[        5       (       a  [        R                  " 5         U$ r   )r   r   r   r   r   )argskwargsretfuncr   s      r   wrapperstate.__call__.<locals>.wrapper,   sG    !!%%dii0''C!!$$&Jr   r   )r   r&   r'   s   `` r   __call__state.__call__*   s     	t	 
	 r   r   r   N)__name__
__module____qualname____firstlineno____doc__strr   r   r   r)   __static_attributes__ r   r   r	   r	      s)    *S T 
r   r	   r   r   Nc                 0    [         R                  " U 5        g r   )r   r   r   s    r   r   r   8   s    $r   c                  .    [         R                  " 5         g r   )r   r   r3   r   r   r   r   <   s    r   r+   )triton._C.libprotonr   r   flagsr   	functoolsr   r	   r1   r   r   r3   r   r   <module>r9      s1    3 # / /d c  d  r   