
    g"                         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y)    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 ][  }|t        |d      r|j                  |j                         .t        |t              s|j
                  sK|j                  |       ] | j
                  r.|j                  t        j                  | j
                               |D cg c]4  }t        |t              r t              dkD  r |j                  di n|6 }}dj                  |D cg c]7  }t        |t              r|n"t        j                  |j
                  xs d      9 c}      | _        || _        | S c c}w c c}w )N_docstring_componentsr     )hasattrextendr   
isinstancestr__doc__appendtextwrapdedentlenformatjoin)	decorateddocstring_components	docstring	componentparams_applied
docstringsparamss        A/var/www/openai/venv/lib/python3.12/site-packages/pyarrow/util.py	decoratorzdoc.<locals>.decorator:   sY   ! $I y"9:$++33 Is+y/@/@$++I6 $  ''	8I8I(JK 2	
 2	 )S)c&kAo I&v& 2	 	 
 GG
 "0	 "0I i- __Y%6%6%<"=> "0	
	 ! 	' '
s   "9D=,<Er   )r   r   r   s   `` r   docr   $   s    ,%N     c                 H    t         j                  | ||      fd}|S )Nc                  @    t        j                          | i |S N)warningswarn)argskwargsapimsgtypes     r   wrapperz_deprecate_api.<locals>.wrapperg   s!    c4 D#F##r   )	_DEPR_MSGr   )old_namenew_namer%   next_versionr'   r(   r&   s     ` ` @r   _deprecate_apir-   d   s#    


8\8
<C$ Nr   c                 D      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y))_deprecate_class.<locals>._DeprecatedMetac                     t        j                  t        j                  j                        t
        d       t        |      S )N   )
stacklevel)r!   r"   r)   r   __name__FutureWarningr
   )selfother	new_classr,   r*   s     r   __instancecheck__z;_deprecate_class.<locals>._DeprecatedMeta.__instancecheck__s   s<    MM  <9K9KL
 eY//r   N)r4   
__module____qualname__r9   )r8   r,   r*   s   r   _DeprecatedMetar0   r   s    	0r   r<   )r'   )r*   r8   r,   instancecheckr<   s   ```  r   _deprecate_classr>   m   s'    
0 0$ 0 8i\266r   c                 :    	 t        |        y# t        $ r Y yw xY w)NTF)iter	TypeError)objs    r   _is_iterablerC   ~   s#    S	 s    	c                 >    t        | t              xs t        | d      S )N
__fspath__)r
   r   r   paths    r   _is_path_likerH      s    dC ?GD,$??r   c                     t        | t              rt        j                  j	                  |       S 	 t        j                  j	                  | j                               S # t        $ r Y t        d      w xY w)zA
    Convert *path* to a string or unicode path if possible.
    znot a path-like object)r
   r   osrG   
expanduserrE   AttributeErrorrA   rF   s    r   _stringify_pathrM      sb     $ww!!$''ww!!$//"344 
,
--s   ,A 	A43A4c                 2    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   productrW      s     ,c155r   c                    |sd}|t        |       z  }||fS d}|}t        |       D ]7  \  }}|dk(  rdx}} n)||   }|dkD  r|||dz
  z  z  }'|dk  s-|||dz
  z  z  }9 ||z
  |t        |       z  k7  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   rS   zarray data is non-contiguous)rW   	enumerate
ValueError)shapestridesitemsizestartendidimstrides           r   get_contiguous_spanrc      s      ' #: &FAsaxQZFzvq))!37++ ' ;(WU^33;<<#:r   c                  b   t        j                   t         j                  t         j                        } t        j                  |       5 } | j                  d       | j                  t         j                  t         j                  d       | j                         d   cd d d        S # 1 sw Y   y xY w)N)r   r   rS   )
socketAF_INETSOCK_STREAM
contextlibclosingbind
setsockopt
SOL_SOCKETSO_REUSEADDRgetsockname)socks    r   find_free_portrp      sq    ==););<D			D	!T		'))6+>+>B!!$ 
"	!	!s   AB%%B.c                  0    ddl m}   |        j                  S )Nr   uuid4)uuidrs   hexrr   s    r   guidrv      s    7;;r   c                    t        j                  d      }t        j                  |       }|rS|D ]#  } | |ust	        | t
        j                        s# n n*d }| j                          t        j                  |       }|rSd x}x} }y )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 
  	 &  !%$D$5:r   c                  T   t         j                  dk7  rt        dt         j                         ddl} t        j
                  j                  d      }t        j
                  j                  |d      }t	        j                  |d       dd	l	m
}  |d
      5 }t        |d      5 }|j                  |j                                ddd       ddd       t        j
                  j                  |      sJ | j                  |      j                  |        |d      5 }t        t        j
                  j                  |d      d      5 }|j                  |j                                ddd       ddd       y# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   *xY w# 1 sw Y   yxY w)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   Nz%USERPROFILE%\Downloads\tzdataztzdata.tar.gzT)exist_ok)urlopenz5https://data.iana.org/time-zones/tzdata-latest.tar.gzwbz^https://raw.githubusercontent.com/unicode-org/cldr/master/common/supplemental/windowsZones.xmlzwindowsZones.xml)rx   platformrA   tarfilerJ   rG   
expandvarsr   makedirsurllib.requestr   openwritereadexists
extractall)r   tzdata_pathtzdata_compressedr   responsefresponse_zoness          r   download_tzdata_on_windowsr      sB   
 ||wCCLL>RSS''$$%FGK[/BKKd+&	H	IX#T*aGGHMMO$ + 
J 77>>+,,,LL"#..{;	q	r  wE"'',,{,>?F!GGN'')* G 
s	r +* 
J	I GF 
s	rsH   F% E:F+F	 F)F:F	?FFF	FF')T)rJ   rh   rT   rz   re   rx   r   r|   r!   r)   r   r5   r-   r>   rC   rH   rM   rW   rc   rp   rv   r   r   r   r   r   <module>r      sx   ( 
   	  
    H 

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