
    `i$                     n    d dl mZmZmZ dZ G d de          Z G d de          Zd Zd Zd	 Z	d
 Z
dS )    )	Structurec_intc_byte   c                   *    e Zd Zdefdefdeez  fgZdS )action_tactionlengthvalueN__name__
__module____qualname__r   r   _VALUE_BUFFER_SIZE_fields_     p/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/cupyx/distributed/_klv_utils.pyr   r      s3        	5	5	&--.0HHHr   r   c                   *    e Zd Zdefdefdeez  fgZdS )result_action_tstatusr
   r   Nr   r   r   r   r   r      s5         
5	5	&--.	0HHHr   r   c                 .   t          |          }t          |          t          dt          t          |          z
  z            z   }t          t          z                      |          }t          t          |          z
  dk    sJ t          | ||          S N    r   )len	bytearrayr   r   from_bufferr   )r	   r   l_vs      r   get_action_tr      s    
e**Cey%E

23 5  5 5E((55e<<EU+1111FC'''r   c                 .   t          |          }t          |          t          dt          t          |          z
  z            z   }t          t          z                      |          }t          t          |          z
  dk    sJ t          | ||          S r   )r   r   r   r   r   r   )r   r   r   s      r   get_result_action_tr!      s    
e**Cey%E

23 5  5 5E((55e<<EU+111163...r   c                 4   t          |           t          u r"t          d          }|t          |           z   }n_t          |           t          u r7t          d          }|t          |                     dd                    z   }nt          d|            |S )N   b   i   big)	byteorderzinvalid type for self.value )typebytesr   intto_bytes
ValueError)r   vs     r   create_value_bytesr.   (   s    E{{edOO	%   	e		dOO	%..e.<<===???@@@Hr   c                     | dd         dk    rAt          | dd                    dk    sJ t                              | dd          d          } n%| dd         dk    rt          | dd                    } | S )Nr      r$   r%   r&   r#   )r   r*   
from_bytesr)   )r-   s    r   get_value_from_bytesr2   4   st    1v~~1QRR5zzQNN1QRR5%((	
1Q34!ABB%LLHr   N)ctypesr   r   r   r   r   r   r   r!   r.   r2   r   r   r   <module>r4      s    + + + + + + + + + +  0 0 0 0 0y 0 0 00 0 0 0 0i 0 0 0( ( (/ / /	 	 	    r   