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  
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      0  /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/__init__.py	parse_gitr   /   s<    
 100000T %&5(((((    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                  dk    rt          j        nd            | dt          j                    | dt          j         dt          j                     | d	t          j                    | d
t          j                    | dt          j	                    | dt          j
                   dS )zJ
    Print various version information, to help with error reporting.
    c                 2    t          | dd|d           d S )Nz <26:  <8printlabelvalues     r   print_entryz"show_versions.<locals>.print_entryP   s*    ***u***+++++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   , , , 

6777K~233a77 !/ ; ;$& & & K+^-CDDDK$!-QQ0OQQS S SK*N,IJJJK(.*?@@@K+^-KLLLK&(ABBBBBr   c                 X    	 t          j        d|             dS # t          $ r Y dS w xY w)Nzpyarrow.TF)
_importlibimport_moduleImportError)modules    r   _module_is_availabler6   `   sL     !4F!4!4555 t    uus    
))c                     	 dd l }n# t          $ r Y dS w xY w	 t          |j        |            dS # t          t          f$ r Y dS w xY w)Nr   FT)
pyarrow.fsr4   getattrfsAttributeError)r:   pyarrows     r   _filesystem_is_availabler=   i   s       uu
B t (   uus    
0 AAc                     t                       d } t          d            | dt          j                     dt          j                                 | dt                      j                    | dt                      j                   t                      }t          d            | d|j	                    | d	|
                                 d
            | d|                                 d
            | dd                    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 ]1}t!          j        |          rdnd}t          d|dd|d           2dS )zN
    Print detailed version and platform information, for error reporting
    c                 4    t          d| dd|d           d S )N   <20r   r    r!   r#   s     r   r&   zshow_info.<locals>.print_entry}   s-    ,5,,,,,,-----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:)GcsFileSystemHadoopFileSystemS3FileSystemz
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_inforj   w   s{    OOO. . . 
-K	 0 2 2JJY5F5H5HJJKKKKlnn7888K%|~~'IJJJ  D	+K!4#4555K!d&:&:&<&<#D#D#DEEEK!2!2:::;;;K$dii0I0K0K&L&LMMM	
   ! ! !G 0 026::C.6...&...////	
GGGK , ,6r::C*2***f***++++	
!"""LLLF / /#077@S-5------..../ /r   )nullbool_int8int16int32int64uint8uint16uint32uint64time32time64	timestampdate32date64durationmonth_day_nano_intervalfloat16float32float64binarystringutf8large_binarylarge_string
large_utf8
decimal128
decimal256list_
large_listmap_structunionsparse_uniondense_union
dictionaryrun_end_encodedfixed_shape_tensorfieldtype_for_aliasDataTypeDictionaryType
StructTypeListTypeLargeListTypeMapTypeFixedSizeListType	UnionTypeSparseUnionTypeDenseUnionTypeTimestampType
Time32Type
Time64TypeDurationTypeFixedSizeBinaryTypeDecimal128TypeDecimal256TypeBaseExtensionTypeExtensionTypeRunEndEncodedTypeFixedShapeTensorTypePyExtensionTypeUnknownExtensionTyperegister_extension_typeunregister_extension_typeDictionaryMemoKeyValueMetadataFieldSchemaschemaunify_schemasArrayTensorarraychunked_arrayrecord_batchnullsrepeatSparseCOOTensorSparseCSRMatrixSparseCSCMatrixSparseCSFTensor
infer_typefrom_numpy_dtype	NullArrayNumericArrayIntegerArrayFloatingPointArrayBooleanArray	Int8Array
UInt8Array
Int16ArrayUInt16Array
Int32ArrayUInt32Array
Int64ArrayUInt64ArrayHalfFloatArray
FloatArrayDoubleArray	ListArrayLargeListArrayMapArrayFixedSizeListArray
UnionArrayBinaryArrayStringArrayLargeBinaryArrayLargeStringArrayFixedSizeBinaryArrayDictionaryArrayDate32ArrayDate64ArrayTimestampArrayTime32ArrayTime64ArrayDurationArrayMonthDayNanoIntervalArrayDecimal128ArrayDecimal256ArrayStructArrayExtensionArrayRunEndEncodedArrayFixedShapeTensorArrayscalarNA_NULLScalar
NullScalarBooleanScalar
Int8ScalarInt16ScalarInt32ScalarInt64ScalarUInt8ScalarUInt16ScalarUInt32ScalarUInt64ScalarHalfFloatScalarFloatScalarDoubleScalarDecimal128ScalarDecimal256Scalar
ListScalarLargeListScalarFixedSizeListScalarDate32ScalarDate64ScalarTime32ScalarTime64ScalarTimestampScalarDurationScalarMonthDayNanoIntervalScalarBinaryScalarLargeBinaryScalarStringScalarLargeStringScalarFixedSizeBinaryScalarDictionaryScalar	MapScalarStructScalarUnionScalarRunEndEncodedScalarExtensionScalar)BufferResizableBufferforeign_buffer	py_bufferrb   compress
decompressallocate_buffer)
MemoryPoolLoggingMemoryPoolProxyMemoryPooltotal_allocated_bytesset_memory_poolr\   system_memory_pooljemalloc_memory_poolmimalloc_memory_poollogging_memory_poolproxy_memory_poollog_memory_allocationsjemalloc_set_decay_msra   )
NativeFile
PythonFileBufferedInputStreamBufferedOutputStreamCompressedInputStreamCompressedOutputStreamTransformInputStreamtranscoding_input_streamFixedSizeBufferWriterBufferReaderBufferOutputStreamOSFileMemoryMappedFile
memory_mapcreate_memory_mapMockOutputStreaminput_streamoutput_stream)HdfsFilehave_libhdfs)ChunkedArrayRecordBatchTabletableconcat_arraysconcat_tablesTableGroupByRecordBatchReader)ArrowCancelledArrowCapacityErrorArrowExceptionArrowKeyErrorArrowIndexErrorArrowInvalidArrowIOErrorArrowMemoryErrorArrowNotImplementedErrorArrowTypeErrorArrowSerializationError)serialize_pandasdeserialize_pandas)
FileSystem)LocalFileSystem)rN   zIpyarrow.{0} is deprecated as of 2.0.0, please use pyarrow.fs.{1} instead.zy'pyarrow.{0}' is deprecated and will be removed in a future version. Use pickle or the pyarrow IPC functionality instead.rL  rK  rN   )localfsrK  rL  rN   c                     | t           v rGt           |          \  }}t          j        t                              | |          t
          d           |S t          d                    |                     )N   )
stacklevelz'module 'pyarrow' has no attribute '{0}')_deprecated	_warningswarn_msgformatFutureWarningr;   )nameobjnew_names      r   __getattr__rZ  6  sq    {#D)Xt{{422$	4 	4 	4 	4

188>>  r   )_deprecate_api_deprecate_class)MessageMessageReaderMetadataVersionRecordBatchFileReaderRecordBatchFileWriterRecordBatchStreamReaderRecordBatchStreamWriterc                      t           j                            t           j                            t                    d          S )zr
    Return absolute path to directory containing Arrow C++ include
    headers. Similar to numpy.get_include
    include)_ospathr`   dirname__file__ r   r   get_includerk  R  s*    
 8==))(33Y???r   c                  B    t           j                            dd          S )N
PKG_CONFIG
pkg-config)rf  environgetrj  r   r   _get_pkg_config_executablerq  Z  s    ;??<666r   c                 ~    dd l }	 |                    t                      d| g          dk    S # t          $ r Y dS w xY w)Nr   z--existsF)
subprocesscallrq  FileNotFoundError)pkgnamers  s     r   _has_pkg_configrw  ^  sf     : < < *G 5 6 69:; 	;   uus   '. 
<<c                 P   dd l }t                      | g|z   }|                    ||j        |j                  }|                                \  }}|j        dk    r%t          d|                    d          z             |                                                    d          S )Nr   )stdoutstderrzpkg-config failed: r   )	rs  rq  PopenPIPEcommunicate
returncodeRuntimeErrordecoderstrip)rv  cli_argsrs  cmdprocouterrs          r   _read_pkg_config_variabler  g  s    %''
1H
<CC
#-?  4 4D!!HC!03::f3E3EEFFF::<<v&&&r   c                  
    ddgS )zz
    Return list of library names to include in the `libraries` argument for C
    or Cython extensions using pyarrow
    arrow_pythonarrowrj  rj  r   r   get_librariesr  r  s    
 G$$r   c                  >   ddl } t          j        dk    rdS t          j                            t                    }t          j        dk    r7|                      t          j                            |d                    }d }n6|                      t          j                            |d                    }d }|D ]b} ||          }t          j                            |          r-	 t          j	        ||           D# t          $ r t          d	           Y _w xY wdS )
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                 :    |                      dd          d         S )N.r   r   )rsplit	hard_paths    r   get_symlink_pathz1create_library_symlinks.<locals>.get_symlink_path  s    ##C++A..r   z	*.*.dylibc                 d    d                     |                     dd          d         df          S )Nr  rO  r   dylib)r`   r  r  s    r   r  z1create_library_symlinks.<locals>.get_symlink_path  s.    88Y--c155a8'BCCCr   zyTried creating symlink {}. If you need to link to bundled shared libraries, run pyarrow.create_library_symlinks() as root)glob_sysplatformrf  rg  rh  ri  r`   existssymlinkPermissionErrorr"   )r  package_cwdbundled_libsr  lib_hard_pathsymlink_paths         r   create_library_symlinksr  z  sE    KKK}(""8,,K}yy{H!E!EFF	/ 	/ 	/ 	/ yy{K!H!HII	D 	D 	D & 	? 	?''668??<(( 		?K|4444 	? 	? 	? > ? ? ? ? ?	?	? 	?s   (C>>DDc                     t           j                            t                    } | gfd}t           j                            d          pd}dD ]n}t          |          r]t          |dg          }|rJ|                    d          s"t          d
                    |                     ||dd	                    ot          j        d
k    rt           j                            t          j                  }t           j                            |dd          }t           j                            t           j                            |d                    r ||           t           j                            d          r: |t           j                            t           j        d         d                     nJ |t           j                            t           j                            t                                         S )z
    Return lists of directories likely to contain Arrow C++ libraries for
    linking C or Cython extensions using pyarrow
    c                 >    | vr                     |            d S d S )N)append)library_dirlibrary_dirss    r   append_library_dirz,get_library_dirs.<locals>.append_library_dir  s0    l**,,,,, +*r   rm  rn  )r  r  z--libs-only-Lz-Lz7pkg-config --libs-only-L returned unexpected value {!r}rO  Nr  Librarylibz	arrow.lib
ARROW_HOME)rf  rg  rh  ri  ro  rp  rw  r  
startswith
ValueErrorrU  r  r  
executabler`   r  abspath)r  r  pkg_config_executablerv  r  python_base_installr  s         @r   get_library_dirsr    s   
 (""8,,K=L- - - - -  KOOL99I\, 4 47## 
	43G5D4EG GK  4"--d33 :$%%+VK%8%8: : : #";qrr?333} "h..t??hmm$7EJJ8??38==kBBCC 	,{+++ {|$$ I38==\)BEJJKKKK 	38++CH,<,<X,F,FGGHHHr   (6  __doc__gc_gc	importlibr2   osrf  r  rW   sysr  warningsrR  _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=   rj   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   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  rb   r  r  r  r  r  r  r  r  r\   r  r  r  r  r  r   r!  ra   r"  r#  r$  r%  r&  r'  r(  r)  r*  r+  r,  r-  r.  r/  r0  r1  r2  r3  pyarrow._hdfsior4  r5  r6  r7  r8  r9  r:  r;  r<  r=  r>  r?  r@  rA  rB  rC  rD  rE  rF  rG  rH  pyarrow.hdfshdfspyarrow.ipcrI  rJ  ipcpyarrow.typestypespyarrow.filesystemrK  _FileSystemrL  _LocalFileSystemrN   _HadoopFileSystem_get_instance_localfsrT  _serialization_msgrQ  rZ  pyarrow.utilr[  r\  r]  r^  r_  r`  ra  rb  rc  rk  rq  rw  r  r  r  r  rj  r   r   <module>r     s  (
 
                        :::::::   	) 	) 	) 1n07@B B B   #, cmoo        CJLLL? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?C C C(    &/ &/ &/RF? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F? F?RG G G G G G G G G G G G G G G G G G G G4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 46 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 3 2 2 2 2 2 2 2, , , , , , , , , , , , , , , , , , , ,

2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2       < < < < < < < <             9 8 8 8 8 8 B B B B B B > > > > > > *)++ P 
;  +,-(*;<*,>?	 	 	 	 : 9 9 9 9 9 9 9K K K K K K K K K K K K K K K K K K@ @ @7 7 7  ' ' '% % %(? (? (?V- - - - -s2   # AAAA
AAAA