
    y-Ph!                         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 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 cannot 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     L/var/www/html/test/jupyter/venv/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   c                     ddl m}  ||           5 }t          |d          5 }|                    |                                           d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nr   )urlopenwb)urllib.requestr   openwriteread)urlout_pathr   responsefs        r   _download_urllibr      s    &&&&&&	 %(D!! 	%QGGHMMOO$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%% % % % % % % % % % % % % % % % % %s4   A/(AA/A	A/A	A//A36A3c                     dd l }|                    |           5 }t          |d          5 }|                    |j                   d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nr   r   )requestsgetr   r   content)r   r   r   r   r   s        r   _download_requestsr      s    OOO	c		 &h(D!! 	&QGGH$%%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&& & & & & & & & & & & & & & & & & &s4   A*AA*A	A*A	A**A.1A.c                     t           j        dk    rt          dt           j                   ddl} d}t          j                            d          }t          j                            |d          }d}t          j                            |d	          }t	          j        |d
           	 t          ||           t          ||           n0# t          $ r# t          ||           t          ||           Y nw xY wt          j                            |          sJ t          j                            |          sJ |                     |                              |           dS )z
    Download and extract latest IANA timezone database into the
    location expected by Arrow which is %USERPROFILE%\Downloads\tzdata.
    win32z)Timezone database is already provided by r   Nz5https://data.iana.org/time-zones/tzdata-latest.tar.gzz%USERPROFILE%\Downloads\tzdataztzdata.tar.gzz^https://raw.githubusercontent.com/unicode-org/cldr/master/common/supplemental/windowsZones.xmlzwindowsZones.xmlT)exist_ok)r|   platformrE   tarfilerN   rK   
expandvarsr   makedirsr   ImportErrorr   existsr   
extractall)r   
tzdata_urltzdata_pathtzdata_compressed_pathwindows_zones_urlwindows_zones_paths         r   download_tzdata_on_windowsr      si   
 |wRCLRRSSSNNNHJ'$$%FGGKW\\+GGxk3EFFKd++++@:'=>>>,.@AAAA @ @ @%;<<<*,>?????@ 7>>0111117>>,-----LL'((33K@@@@@s   + C *C98C9)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   r   r   r   <module>r      se  ( 
			         				  



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

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