
    'e                         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d dlZdZ	d Z
efdZ	 ddZd Zd Zd	 Zd
 Zd Zd Zd Zd ZdS )    NzApyarrow.{} is deprecated as of {}, please use pyarrow.{} instead.c                        fd}|S )a  
    A decorator that takes docstring templates, concatenates them, and finally
    performs string substitution on them.
    This decorator will add a variable "_docstring_components" to the wrapped
    callable to keep track of the original docstring template for potential future use.
    If the docstring is a template, it will be saved as a string.
    Otherwise, it will be saved as a callable and the docstring will be obtained via
    the __doc__ attribute.
    This decorator can not be used on Cython classes due to a CPython constraint,
    which enforces the __doc__ attribute to be read-only.
    See https://github.com/python/cpython/issues/91309

    Parameters
    ----------
    *docstrings : None, str, or callable
        The string / docstring / docstring template to be prepended in order
        before the default docstring under the callable.
    **params
        The key/value pairs used to format the docstring template.
    c                    g }D ]a}|t          |d          r|                    |j                   0t          |t                    s|j        r|                    |           b| j        r,|                    t          j        | j                             fd|D             }d	                    d |D                       | _        || _        | S )N_docstring_componentsc                 ~    g | ]9}t          |t                    r t                    d k    r |j        di n|:S )r    )
isinstancestrlenformat).0	componentparamss     ,  /croot/pyarrow_1707330824290/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/python3.11/site-packages/pyarrow/util.py
<listcomp>z*doc.<locals>.decorator.<locals>.<listcomp>L   sg     
 
 
  )S)).1&kkAoo I&&v&&&
 
 
     c                 r    g | ]4}t          |t                    r|nt          j        |j        pd           5S )r   )r   r	   textwrapdedent__doc__)r   r   s     r   r   z*doc.<locals>.decorator.<locals>.<listcomp>T   sR         i-->		_Y%6%<"==  r   )
hasattrextendr   r   r	   r   appendr   r   join)	decorateddocstring_components	docstringparams_applied
docstringsr   s       r   	decoratorzdoc.<locals>.decorator:   s0   ! $ 	7 	7I y"9:: 7$++3    Is++ 7y/@ 7$++I666  	L ''	8I(J(JKKK
 
 
 
 2	
 
 
 GG  "0	  
 
	 ! 	' r   r   )r   r   r    s   `` r   docr!   $   s+    ,% % % % % %N r   c                 R    t                               | ||          fd}|S )Nc                  >    t          j                    | i |S N)warningswarn)argskwargsapimsgtypes     r   wrapperz_deprecate_api.<locals>.wrapperg   s*    c4   sD#F###r   )	_DEPR_MSGr   )old_namenew_namer)   next_versionr+   r,   r*   s     ` ` @r   _deprecate_apir1   d   sF    


8\8
<
<C$ $ $ $ $ $ $ Nr   Tc                 R      G  fddt                     } | fi           S )zM
    Raise warning if a deprecated class is used in an isinstance check.
    c                       e Zd Z fdZdS ))_deprecate_class.<locals>._DeprecatedMetac                     t          j        t                              j                  t
          d           t          |          S )N   )
stacklevel)r%   r&   r-   r   __name__FutureWarningr   )selfother	new_classr0   r.   s     r   __instancecheck__z;_deprecate_class.<locals>._DeprecatedMeta.__instancecheck__s   sL    M  <9KLL   
 eY///r   N)r8   
__module____qualname__r=   )r<   r0   r.   s   r   _DeprecatedMetar4   r   s8        	0 	0 	0 	0 	0 	0 	0 	0 	0r   r@   )r+   )r.   r<   r0   instancecheckr@   s   ```  r   _deprecate_classrB   m   s[    
0 0 0 0 0 0 0 0 0$ 0 0 0 ?8i\2666r   c                 H    	 t          |            dS # t          $ r Y dS w xY w)NTF)iter	TypeError)objs    r   _is_iterablerG   ~   s9    S			t   uus    
!!c                 L    t          | t                    pt          | d          S )N
__fspath__)r   r	   r   paths    r   _is_path_likerL      s!    dC  ?GD,$?$??r   c                    t          | t                    rt          j                            |           S 	 t          j                            |                                           S # t          $ r Y nw xY wt          d          )zA
    Convert *path* to a string or unicode path if possible.
    znot a path-like object)r   r	   osrK   
expanduserrI   AttributeErrorrE   rJ   s    r   _stringify_pathrQ      s     $ (w!!$'''w!!$//"3"3444    ,
-
--s   0A' '
A43A4c                 0    t          j        d | d          S )z-
    Return a product of sequence items.
    c                     | |z  S r$   r   )abs     r   <lambda>zproduct.<locals>.<lambda>   s
    1 r      )	functoolsreduce)seqs    r   productr[      s     ,,c1555r   c                 (   |sd}|t          |           z  }nxd}|}t          |           D ]<\  }}|dk    rdx}} n,||         }|dk    r|||dz
  z  z  }+|dk     r|||dz
  z  z  }=||z
  |t          |           z  k    rt          d          ||fS )z
    Return a contiguous span of N-D array data.

    Parameters
    ----------
    shape : tuple
    strides : tuple
    itemsize : int
      Specify array shape data

    Returns
    -------
    start, end : int
      The span end points.
    r   rW   zarray data is non-contiguous)r[   	enumerate
ValueError)shapestridesitemsizestartendidimstrides           r   get_contiguous_spanrg      s       ='&& 	, 	,FAsaxxQZFzzvq))!37++;(WU^^333;<<<#:r   c                  d   t          j         t           j        t           j                  } t          j        |           5 } |                     d           |                     t           j        t           j        d           | 	                                d         cd d d            S # 1 swxY w Y   d S )N)r   r   rW   )
socketAF_INETSOCK_STREAM
contextlibclosingbind
setsockopt
SOL_SOCKETSO_REUSEADDRgetsockname)socks    r   find_free_portrt      s    =);<<D		D	!	! %T		')6+>BBB!!!$% % % % % % % % % % % % % % % % % %s   AB%%B),B)c                  ,    ddl m}   |             j        S )Nr   uuid4)uuidrw   hexrv   s    r   guidrz      s"    577;r   c                 
   t          j        d          }t          j        |           }|rR|D ]"} | |urt	          | t
          j                  r n#n,d }|                                  t          j        |           }|Rd x}x} }d S )Nr   )sys	_getframegcget_referrersr   types	FrameTypeclear)frame
this_framerefss      r   !_break_traceback_cycle_from_framer      s     q!!JE""D
 ' 	 	EJ&&:eU_+M+M&  	 &&  ' !%$D$5:::r   )T)rN   rl   rX   r~   ri   r|   r   r   r%   r-   r!   r9   r1   rB   rG   rL   rQ   r[   rg   rt   rz   r   r   r   r   <module>r      s3  ( 
			         				  



    H 

= = =@ @M     $(7 7 7 7"  @ @ @. . . 6 6 6! ! !H% % %  
% % % % %r   