
    z-Ph                    b    d dl mZ d dlZd dlZ G d dej                  Z G d d          ZdS )    )annotationsNc                  2    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
S )DlpackDeviceTypez3Integer enum for device type codes matching DLPack.                  	   
   N)__name__
__module____qualname____doc__CPUCUDA
CPU_PINNEDOPENCLVULKANMETALVPIROCM     Z/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pyarrow/interchange/buffer.pyr   r      s<        ==
CDJFFE
CDDDr   r   c                  b    e Zd ZdZddd	Zedd            Zedd            Zd ZddZ	ddZ
dS )_PyArrowBufferaY  
    Data in the buffer is guaranteed to be contiguous in memory.

    Note that there is no dtype attribute present, a buffer can be thought of
    as simply a block of memory. However, if the column that the buffer is
    attached to has a dtype that's supported by DLPack and ``__dlpack__`` is
    implemented, then that dtype information will be contained in the return
    value from ``__dlpack__``.

    This distinction is useful to support both data exchange via DLPack on a
    buffer and (b) dtypes like variable-length strings which do not have a
    fixed number of bytes per element.
    Tx	pa.Buffer
allow_copyboolreturnNonec                    || _         dS )z)
        Handle PyArrow Buffers.
        N)_x)selfr   r!   s      r   __init__z_PyArrowBuffer.__init__4   s     r   intc                    | j         j        S )z'
        Buffer size in bytes.
        )r&   sizer'   s    r   bufsizez_PyArrowBuffer.bufsize:   s    
 w|r   c                    | j         j        S )z?
        Pointer to start of the buffer as an integer.
        )r&   addressr,   s    r   ptrz_PyArrowBuffer.ptrA   s    
 wr   c                     t          d          )a}  
        Produce DLPack capsule (see array API standard).

        Raises:
            - TypeError : if the buffer contains unsupported dtypes.
            - NotImplementedError : if DLPack support is not implemented

        Useful to have to connect to array libraries. Support optional because
        it's not completely trivial to implement for a Python-only library.
        
__dlpack__)NotImplementedErrorr,   s    r   r2   z_PyArrowBuffer.__dlpack__H   s     ",///r   #tuple[DlpackDeviceType, int | None]c                T    | j         j        rt          j        dfS t	          d          )z
        Device type and device ID for where the data in the buffer resides.
        Uses device type codes matching DLPack.
        Note: must be implemented even if ``__dlpack__`` is not.
        N__dlpack_device__)r&   is_cpur   r   r3   r,   s    r   r6   z _PyArrowBuffer.__dlpack_device__U   s-     7> 	;$($//%&9:::r   strc                    dt          | j        | j        |                                 d         j        d          z   dz   S )NzPyArrowBuffer(r   )r-   r0   device))r8   r-   r0   r6   namer,   s    r   __repr__z_PyArrowBuffer.__repr__`   sQ    #|8"4466q9>   
	
r   N)T)r   r    r!   r"   r#   r$   )r#   r)   )r#   r4   )r#   r8   )r   r   r   r   r(   propertyr-   r0   r2   r6   r=   r   r   r   r   r   %   s                 X    X0 0 0	; 	; 	; 	;
 
 
 
 
 
r   r   )
__future__r   enumpyarrowpaIntEnumr   r   r   r   r   <module>rD      s   $ # " " " " "     
 
 
 
 
t| 
 
 
F
 F
 F
 F
 F
 F
 F
 F
 F
 F
r   