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ZCd ZDy# e$ r. 	 ddlZd Z ej&                  de      Zn# e$ r dZY nw xY wY {w xY w)a  
PyArrow is the python implementation of Apache Arrow.

Apache Arrow is a cross-language development platform for in-memory data.
It specifies a standardized language-independent columnar memory format for
flat and hierarchical data, organized for efficient analytic operations on
modern hardware. It also provides computational libraries and zero-copy
streaming messaging and interprocess communication.

For more information see the official page at https://arrow.apache.org
    N   )versionc                 *    ddl m} d|d<    || fi |S )z
            Parse function for setuptools_scm that ignores tags for non-C++
            subprojects, e.g. apache-arrow-js-XXX tags.
            r   parsezBgit describe --dirty --tags --long --match 'apache-arrow-[0-9]*.*'describe_command)setuptools_scm.gitr   )rootkwargsr   s      E/var/www/openai/venv/lib/python3.12/site-packages/pyarrow/__init__.py	parse_gitr   /   s%    
 1T %&(((    z../r   )	BuildInfoRuntimeInfoset_timezone_db_pathMonthDayNanoVersionInfocpp_build_infocpp_versioncpp_version_inforuntime_info	cpu_countset_cpu_countenable_signal_handlersio_thread_countset_io_thread_countc                     d } t        d        | dt        t        j                        dkD  rt        j                  nd        | dt        j                          | dt        j
                   dt        j                           | d	t        j                          | d
t        j                          | dt        j                          | dt        j                         y)zJ
    Print various version information, to help with error reporting.
    c                 (    t        | dd|d       y )Nz <26:  <8printlabelvalues     r   print_entryz"show_versions.<locals>.print_entryP   s    tBuSk*+r   z)pyarrow version info
--------------------zPackage kindr   znot indicatedzArrow C++ library versionzArrow C++ compiler zArrow C++ compiler flagszArrow C++ git revisionzArrow C++ git descriptionzArrow C++ build typeN)r"   lenr   package_kindr   compiler_idcompiler_versioncompiler_flagsgit_idgit_description
build_type)r&   s    r   show_versionsr0   L   s    , 

67~223a7 !/ ; ;$& +^-C-CD$!--.a0O0O/PQS*N,I,IJ(.*?*?@+^-K-KL&(A(ABr   c                 T    	 t        j                  d|         y# t        $ r Y yw xY w)Nzpyarrow.TF)
_importlibimport_moduleImportError)modules    r   _module_is_availabler6   `   s5      8F8!45   s    	''c                     	 dd l }	 t        |j                  |        y# t        $ r Y yw xY w# t        t        f$ r Y yw xY w)Nr   FT)
pyarrow.fsr4   getattrfsAttributeError)r:   pyarrows     r   _filesystem_is_availabler=   i   sN    

B   
 ( s    - 	**??c                  `   t                d } t        d        | dt        j                          dt        j                                  | dt               j                          | dt               j                         t               }t        d        | d|j                          | d	|j                          d
        | d|j                          d
        | ddj                  t                            t        d       g d}|D ]$  }t        |      rdnd}t        d|dd|d       & t        d       g d}|D ]$  }t        |      rdnd}t        d|dd|d       & t        d       g d}|D ].  }t!        j"                  |      rdnd}t        d|dd|d       0 y)zN
    Print detailed version and platform information, for error reporting
    c                 *    t        d| dd|d       y )N   <20r   r    r!   r#   s     r   r&   zshow_info.<locals>.print_entry}   s    5,bs,-r   z

Platform:z	OS / Archr'   z
SIMD LevelzDetected SIMD Levelz
Memory:zDefault backendzBytes allocatedz bytesz
Max memoryzSupported Backendsz, z
Optional modules:)
csvcudadatasetfeatherflightr:   gandivajsonorcparquetEnabled-r@   rA   r   r    z
Filesystems:)AzureFileSystemGcsFileSystemHadoopFileSystemS3FileSystemz
Compression Codecs:)brotlibz2gzip	lz4_framelz4snappyzstdN)r0   r"   	_platformsystemmachiner   
simd_leveldetected_simd_leveldefault_memory_poolbackend_namebytes_allocated
max_memoryjoinsupported_memory_backendsr6   r=   Codecis_available)	r&   poolmodulesr5   statusfilesystemsr:   codecscodecs	            r   	show_infork   w   s    O. 
-	 0 0 231Y5F5F5H4IJKln778%|~'I'IJ D	+!4#4#45!d&:&:&<%=V#DE!2 36:;$dii0I0K&LM	
 !G26:6$-r&./  

7K6r:2d)2fS\*+  

!"LF#007S5,b-. r   )nullbool_int8int16int32int64uint8uint16uint32uint64time32time64	timestampdate32date64durationmonth_day_nano_intervalfloat16float32float64binarystringutf8binary_viewstring_viewlarge_binarylarge_string
large_utf8
decimal128
decimal256list_
large_list	list_viewlarge_list_viewmap_structunionsparse_uniondense_union
dictionaryrun_end_encodedbool8fixed_shape_tensoropaqueuuidfieldtype_for_aliasDataTypeDictionaryType
StructTypeListTypeLargeListTypeFixedSizeListTypeListViewTypeLargeListViewTypeMapType	UnionTypeSparseUnionTypeDenseUnionTypeTimestampType
Time32Type
Time64TypeDurationTypeFixedSizeBinaryTypeDecimal128TypeDecimal256TypeBaseExtensionTypeExtensionTypeRunEndEncodedType	Bool8TypeFixedShapeTensorType
OpaqueTypeUuidTypePyExtensionTypeUnknownExtensionTyperegister_extension_typeunregister_extension_typeDictionaryMemoKeyValueMetadataFieldSchemaschemaunify_schemasArrayTensorarraychunked_arrayrecord_batchnullsrepeatSparseCOOTensorSparseCSRMatrixSparseCSCMatrixSparseCSFTensor
infer_typefrom_numpy_dtype	NullArrayNumericArrayIntegerArrayFloatingPointArrayBooleanArray	Int8Array
UInt8Array
Int16ArrayUInt16Array
Int32ArrayUInt32Array
Int64ArrayUInt64ArrayHalfFloatArray
FloatArrayDoubleArray	ListArrayLargeListArrayFixedSizeListArrayListViewArrayLargeListViewArrayMapArray
UnionArrayBinaryArrayStringArrayLargeBinaryArrayLargeStringArrayBinaryViewArrayStringViewArrayFixedSizeBinaryArrayDictionaryArrayDate32ArrayDate64ArrayTimestampArrayTime32ArrayTime64ArrayDurationArrayMonthDayNanoIntervalArrayDecimal128ArrayDecimal256ArrayStructArrayExtensionArrayRunEndEncodedArray
Bool8ArrayFixedShapeTensorArrayOpaqueArray	UuidArrayscalarNA_NULLScalar
NullScalarBooleanScalar
Int8ScalarInt16ScalarInt32ScalarInt64ScalarUInt8ScalarUInt16ScalarUInt32ScalarUInt64ScalarHalfFloatScalarFloatScalarDoubleScalarDecimal128ScalarDecimal256Scalar
ListScalarLargeListScalarFixedSizeListScalarListViewScalarLargeListViewScalarDate32ScalarDate64ScalarTime32ScalarTime64ScalarTimestampScalarDurationScalarMonthDayNanoIntervalScalarBinaryScalarLargeBinaryScalarBinaryViewScalarStringScalarLargeStringScalarStringViewScalarFixedSizeBinaryScalarDictionaryScalar	MapScalarStructScalarUnionScalarRunEndEncodedScalarBool8ScalarExtensionScalarFixedShapeTensorScalarOpaqueScalar
UuidScalar)DeviceAllocationTypeDeviceMemoryManagerdefault_cpu_memory_manager)BufferResizableBufferforeign_buffer	py_bufferrc   compress
decompressallocate_buffer)
MemoryPoolLoggingMemoryPoolProxyMemoryPooltotal_allocated_bytesset_memory_poolr]   system_memory_pooljemalloc_memory_poolmimalloc_memory_poollogging_memory_poolproxy_memory_poollog_memory_allocationsjemalloc_set_decay_msrb   )
NativeFile
PythonFileBufferedInputStreamBufferedOutputStreamCacheOptionsCompressedInputStreamCompressedOutputStreamTransformInputStreamtranscoding_input_streamFixedSizeBufferWriterBufferReaderBufferOutputStreamOSFileMemoryMappedFile
memory_mapcreate_memory_mapMockOutputStreaminput_streamoutput_streamhave_libhdfs)ChunkedArrayRecordBatchTabletableconcat_arraysconcat_tablesTableGroupByRecordBatchReader)ArrowCancelledArrowCapacityErrorArrowExceptionArrowKeyErrorArrowIndexErrorArrowInvalidArrowIOErrorArrowMemoryErrorArrowNotImplementedErrorArrowTypeErrorArrowSerializationError)serialize_pandasdeserialize_pandas)_deprecate_api_deprecate_class)MessageMessageReaderMetadataVersionRecordBatchFileReaderRecordBatchFileWriterRecordBatchStreamReaderRecordBatchStreamWriterc                      t         j                  j                  t         j                  j                  t              d      S )zr
    Return absolute path to directory containing Arrow C++ include
    headers. Similar to numpy.get_include
    include)_ospathra   dirname__file__ r   r   get_includer{  3  s(    
 88==))(3Y??r   c                  B    t         j                  j                  dd      S )N
PKG_CONFIG
pkg-config)rv  environgetrz  r   r   _get_pkg_config_executabler  ;  s    ;;??<66r   c                 h    dd l }	 |j                  t               d| g      dk(  S # t        $ r Y yw xY w)Nr   z--existsF)
subprocesscallr  FileNotFoundError)pkgnamer  s     r   _has_pkg_configr  ?  sE     : < *G 5 69:; 	; s   % 	11c                 4   dd l }t               | g|z   }|j                  ||j                  |j                        }|j	                         \  }}|j
                  dk7  rt        d|j                  d      z         |j                         j                  d      S )Nr   )stdoutstderrzpkg-config failed: r   )	r  r  PopenPIPEcommunicate
returncodeRuntimeErrordecoderstrip)r  cli_argsr  cmdprocouterrs          r   _read_pkg_config_variabler  H  s    %'
1H
<CC
#-??  4D!HC!03::f3EEFF::<v&&r   c                  
    ddgS )zz
    Return list of library names to include in the `libraries` argument for C
    or Cython extensions using pyarrow
    arrow_pythonarrowrz  rz  r   r   get_librariesr  S  s    
 G$$r   c                  *   ddl } t        j                  dk(  ryt        j                  j                  t              }t        j                  dk(  r3| j                  t        j                  j                  |d            }d }n2| j                  t        j                  j                  |d            }d }|D ]A  } ||      }t        j                  j                  |      r+	 t        j                  ||       C y# t        $ r t        d	       Y [w xY w)
a#  
    With Linux and macOS wheels, the bundled shared libraries have an embedded
    ABI version like libarrow.so.17 or libarrow.17.dylib and so linking to them
    with -larrow won't work unless we create symlinks at locations like
    site-packages/pyarrow/libarrow.so. This unfortunate workaround addresses
    prior problems we had with shipping two copies of the shared libraries to
    permit third party projects like turbodbc to build their C++ extensions
    against the pyarrow wheels.

    This function must only be invoked once and only when the shared libraries
    are bundled with the Python package, which should only apply to wheel-based
    installs. It requires write access to the site-packages/pyarrow directory
    and so depending on your system may need to be run with root.
    r   Nwin32linuxz*.so.*c                 ,    | j                  dd      d   S )N.r   r   )rsplit	hard_paths    r   get_symlink_pathz1create_library_symlinks.<locals>.get_symlink_pathr  s    ##C+A..r   z	*.*.dylibc                 N    dj                  | j                  dd      d   df      S )Nr     r   dylib)ra   r  r  s    r   r  z1create_library_symlinks.<locals>.get_symlink_pathw  s(    88Y--c15a8'BCCr   zyTried creating symlink {}. If you need to link to bundled shared libraries, run pyarrow.create_library_symlinks() as root)glob_sysplatformrv  rw  rx  ry  ra   existssymlinkPermissionErrorr"   )r  package_cwdbundled_libsr  lib_hard_pathsymlink_paths         r   create_library_symlinksr  [  s     }}((""8,K}}yy{H!EF	/ yy{K!HI	D &'688??<(	?KK|4 &  	? > ?	?s   "C;;DDc                     t         j                  j                  t              } | gfd}t         j                  j                  d      xs d}dD ]T  }t        |      st        |dg      }|s|j                  d      st        dj                  |             ||dd	        V t        j                  d
k(  rt         j                  j                  t        j                        }t         j                  j                  |dd      }t         j                  j                  t         j                  j                  |d            r ||       t         j                  j                  d      r9 |t         j                  j                  t         j                  d   d             S  |t         j                  j                  t         j                  j!                  t                           S )z
    Return lists of directories likely to contain Arrow C++ libraries for
    linking C or Cython extensions using pyarrow
    c                 2    | vrj                  |        y y )N)append)library_dirlibrary_dirss    r   append_library_dirz,get_library_dirs.<locals>.append_library_dir  s    l*, +r   r}  r~  )r  r  z--libs-only-Lz-Lz7pkg-config --libs-only-L returned unexpected value {!r}r  Nr  Librarylibz	arrow.lib
ARROW_HOME)rv  rw  rx  ry  r  r  r  r  
startswith
ValueErrorformatr  r  
executablera   r  abspath)r  r  pkg_config_executabler  r  python_base_installr  s         @r   get_library_dirsr    sr   
 ((""8,K=L-  KKOOL9I\,7#3G5D4EGK "--d3$%%+VK%8: : #;qr?3 - }} "hh..t?hhmm$7EJ88??388==kBC{+ {{|$388==\)BEJK
  	388++CHH,<,<X,FGHr   (E  __doc__gc_gc	importlibr2   osrv  r  rX   sysr  warnings	_warnings_generated_versionr   __version__r4   setuptools_scmr   get_version	isenabled_gc_enableddisablepyarrow.libr  _libenabler   r   r   r   r   r   r   r   r   r   r   r   r   r   r0   r6   r=   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   NULLr   r   r   r  r  r  r  r  r  r  r  r	  r
  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r!  r"  r#  r$  r%  r&  r'  r(  r)  r*  r+  r,  r-  r.  r/  r0  r1  r2  rc   r3  r4  r5  r6  r7  r8  r9  r:  r]   r;  r<  r=  r>  r?  r@  rA  rb   rB  rC  rD  rE  rF  rG  rH  rI  rJ  rK  rL  rM  rN  rO  rP  rQ  rR  rS  rT  rU  rV  rW  rX  rY  rZ  r[  r\  r]  r^  r_  r`  ra  rb  rc  rd  re  rf  rg  rh  pyarrow.ipcri  rj  ipcpyarrow.typestypespyarrow.utilrk  rl  rm  rn  ro  rp  rq  rr  rs  r{  r  r  r  r  r  r  rz  r   r   <module>r     s'  (
      :. cmmo  CJJL? ? ? ?C('/TNK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NK NKb5 5G G G4 4 4 4 4 4	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	', , , , ,

2 
2 
2 
2 
2 
2 = <     : 9K K K K K@7'%(?V-{
  	) 1n007@B #s5   M+ +N1NNNNNNN