
    j3$                         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     V/lsinfo/ai/hellotax_ai/base_platform/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)r9   
__module____qualname__r>   )r=   r0   r.   s   r   _DeprecatedMetar4   r   s8        	0 	0 	0 	0 	0 	0 	0 	0 	0r   rA   )r+   )r.   r=   r0   instancecheckrA   s   ```  r   _deprecate_classrC   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_iterablerH   ~   s9    S			t   uus    
!!c                 L    t          | t                    pt          | d          S )N
__fspath__)r   r	   r   paths    r   _is_path_likerM      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	   osrL   
expanduserrJ   AttributeErrorrF   rK   s    r   _stringify_pathrR      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   rX   zarray data is non-contiguous)r\   	enumerate
ValueError)shapestridesitemsizestartendidimstrides           r   get_contiguous_spanrh      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   rX   )
socketAF_INETSOCK_STREAM
contextlibclosingbind
setsockopt
SOL_SOCKETSO_REUSEADDRgetsockname)socks    r   find_free_portru      s    =);<<D		D	!	! %T		')6+>BBB!!!$% % % % % % % % % % % % % % % % % %s   AB%%B),B)c                  ,    ddl m}   |             j        S )Nr   uuid4)uuidrx   hexrw   s    r   guidr{      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}m}  || ddi          } ||          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Requestz
User-Agentpyarrow)headerswb)urllib.requestr   r   openwriteread)urlout_pathr   r   reqresponsefs          r   _download_urllibr      s   ////////
'#i8
9
9
9C	 %(D!! 	%QGGHMMOO$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%% % % % % % % % % % % % % % % % % %s4   B (A(B (A,	,B /A,	0B  BB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t          d           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           	 ddl}t          }n# t          $ r
 t          }Y nw xY w |||            |||           t          j                            |          sJ t          j                            |          sJ |                     |                              |           dS )aB  
    Download and extract latest IANA timezone database into the
    location expected by Arrow which is %USERPROFILE%\Downloads\tzdata.

    .. deprecated:: 24.0.0
       This function is deprecated and will be removed in a future version.
       PyArrow now uses the operating system's timezone database on Windows.
    zpyarrow.util.download_tzdata_on_windows is deprecated as of 24.0.0 and will be removed in a future version. PyArrow now uses the operating system's timezone database on most Windows builds.r6   r7   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%   r&   r:   r}   platformrF   tarfilerO   rL   
expandvarsr   makedirsr   r   ImportErrorr   existsr   
extractall)r   
tzdata_urltzdata_pathtzdata_compressed_pathwindows_zones_urlwindows_zones_pathr   download_fns           r   download_tzdata_on_windowsr      s~    M	G 	    |wRCLRRSSSNNNHJ'$$%FGGKW\\+GGxk3EFFKd++++'( ' ' '&' K
2333K!#56667>>0111117>>,-----LL'((33K@@@@@s   C C'&C')T)rO   rm   rY   r   rj   r}   r   r   r%   r-   r!   r:   r1   rC   rH   rM   rR   r\   rh   ru   r{   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   