+
    nDj                     &   ^ RI t ^ RIHt ^ RIHtHtHtHtHt ^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt ^ RIt^ RIHt ^ RIHt ^ RItRR lt]R 4       tR tR	 t]P@                  PC                  R
R4      ]P@                  PC                  RR4      R 4       4       t"R t#R t$R t%R t&R t'R t(R t)R t*R t+R t,R t-R t.R t/R t0R t1R t2R t3R t4R t5R  t6]P@                  PC                  R!. RO4      R" 4       t7]P@                  P(                  R# 4       t8]P@                  P(                  R$ 4       t9]P@                  P(                  R% 4       t:]P@                  P(                  R& 4       t;R' t<R( t=R) t>R* t?]P@                  P(                  R+ 4       t@]P@                  P(                  R, 4       tAR- tBR. tC]P@                  P(                  R/ 4       tDR0 tER1 tF]P@                  P(                  ]P@                  PC                  R2]P                  ! R3]P@                  P                  ]P                  P                  R47      R57      R6R7R8R9R:.4      R; 4       4       tK]P@                  P(                  ]P@                  PC                  R2]P                  ! R3]P@                  P                  ]P                  P                  R47      R57      R6R7R8R9R:.4      R< 4       4       tLR= tMR> tNR? tOR@ tPRA tQ]P@                  P(                  RB 4       tRRC tS]P                  RD 4       tURRE ltVRF tWRG tXRH tYRI tZRJ t[RK t\RL t]RM t^RN t_RO t`RP taRQ tbRR tcRS td]P@                  P                  ]P                  RT8H  RURV7      RW 4       tfRX tgRY thRZ tiR[ tj]P@                  P                  R\ 4       tlR] tmR^ tnR_ toR` tp]P@                  P(                  Ra 4       tq]P@                  P(                  Rb 4       trRc ts]P@                  P                  Rd 4       ttRe tu]P@                  P                  Rf 4       tvRg tw]P@                  P                  Rh 4       tx]P@                  P                  Ri 4       tyRj tz]P@                  P                  Rk 4       t{Rl t|Rm t}]P@                  PC                  RRR]P                  ! Rn4      R73]P                  ! Ro4      R93.4      Rp 4       tRq t]P@                  PC                  R2R3R6R7R8R9]P                  ! R:]P@                  P                  ]P                  P                  R47      R57      .4      Rr 4       t]P@                  PC                  R2. RO4      Rs 4       tRttRu t]P@                  PC                  Rv. RO4      Rw 4       t]P@                  PC                  RvRR.4      Rx 4       t]P@                  PC                  RvRR.4      Ry 4       t]P@                  PC                  RvRR.4      Rz 4       t]P@                  P                  R{ 4       tR| tR} t]P@                  P                  R~ 4       tR t]P@                  P                  R 4       t]P@                  P                  R 4       t]P@                  P                  R 4       tR tR tR tR t]P@                  P                  R 4       tR t]P@                  P                  R 4       tR t]P@                  P                  R 4       tR tR#   ] d    Rt ELi ; i)    N)contextmanager)BytesIOStringIOTextIOWrapperBufferedIOBaseIOBase)guid)Codecc                 f   \         P                  R9   d   \        P                  ! R4        \        P
                  ! RR7      p\        VR4      ;_uu_ 4       pVP                  R4       VP                  R	4       VP                  R4       RRR4       V'       d   V;_uu_ 4        V ! V4       RRR4       MV ! V4      ;_uu_ 4       pVP                  4       R8X  g   Q hVP                  R	4      R	8X  g   Q hVP                  4       R	8X  g   Q hVP                  ^4      R8X  g   Q hVP                  4       R8X  g   Q h RRR4       \        P                  ! V4       R#   + '       g   i     L; i  + '       g   i     L;; i  + '       g   i     LN; i  \        P                  ! X4       i ; i)
win32zneed sparse file supporttest_io)prefixwbs   mark
N)r   darwin
emscriptenl   
    l       )sysplatformpytestskiptempfilemktempopentruncateseekwritesizetellreadosunlink)file_factoryexpected_errorfilenamefs   &&  O/data/cameron/venvs/s3viz/lib/python3.14/site-packages/pyarrow/tests/test_io.pycheck_large_seeksr&   +   s4   
||88./??)4(D!!QJJ|$FF;GGI " X&   h''1vvx<///vvk*k999vvx;...vvayI---vvx</// ( 			( "!
   (' 			(sZ   +F 4EF 
F &	E2/F A6F?F E/	*F 2F	=F F	F F0c               #      "   \         P                  ! \        4      ;_uu_ 4        R x  R R R 4       R #   + '       g   i     R # ; i5iN)r   raisesFileNotFoundError     r%   assert_file_not_foundr-   B   s&     	(	)	) 
*	)	)	)s   #A4
AA		Ac                  n   \        4       p \        P                  ! V 4      pVP                  4       ^ 8X  g   Q hRpRpVP	                  V4       VP                  4       \        V4      8X  g   Q hVP	                  V4       W#,           pV P                  4       pWT8X  g   Q hVP                  '       d   Q hVP                  4        VP                  '       g   Q h\        P                  ! \        RR7      ;_uu_ 4        \        P                  ! \        4       4       RRR4       R#   + '       g   i     R# ; i)r   s	   engañados   foobarbinary file expectedmatchN)r   pa
PythonFiler   r   lengetvalueclosedcloser   r)   	TypeErrorr   )bufr$   s1s2expectedresults         r%   test_python_file_writer>   L   s    
)C
cA668q==	B	BGGBK668s2wGGBKwH\\^Fxxx<GGI888O8	y(>	?	?
hj! 
@	?	?	?s   :D##D4	c                     R p \        V 4      p\        P                  ! VRR7      pVP                  4       \	        V 4      8X  g   Q hVP                  4       ^ 8X  g   Q hVP                  ^4      R8X  g   Q hVP                  4       ^8X  g   Q hVP                  ^ 4       VP                  4       ^ 8X  g   Q hVP                  ^4       VP                  4       ^8X  g   Q hVP                  ^24      pVR8X  g   Q h\	        V4      ^8X  g   Q hVP                  4       \	        V 4      8X  g   Q hVP                  '       d   Q hVP                  4        VP                  '       g   Q h\        P                  ! \        RR7      ;_uu_ 4        \        P                  ! \        4       RR7       RRR4       R#   + '       g   i     R# ; i)   some sample datarmode   some   sample datar/   r0   N)r   r2   r3   r   r4   r   r   r   r6   r7   r   r)   r8   r   )datar9   r$   vs       r%   test_python_file_readrH   h   sE   D
$-C
c$A668s4y   668q==66!9668q==FF1I668q==FF1I668q==	r
Aq6R<<668s4y   xxx<GGI888O8	y(>	?	?
hjs+ 
@	?	?	?s   !F//G 	nbytesfile_offsetc                 *   R p\         P                  ! \        V4      RR7      pV ^ 8  g   V^ 8  d\   \        P                  ! \         P
                  RR7      ;_uu_ 4        VP                  WR7       RRR4       VP                  4        R# VP                  WR7      p\        V\        V4      4      p\        W,           \        V4      4      p\        W%V 4      pVP                  ^R7      VP                  ^4      8X  g   Q hVP                  ^R7      VP                  ^4      8X  g   Q hVP                  4       VP                  4       8X  g   Q h\        V4      ^,          pVP                  V4      VP                  V4      8X  g   Q h\        P                  ! \        RR7      ;_uu_ 4        VP                  ^ 4       RRR4       VP                  4        VP                  '       g   Q hR#   + '       g   i     EL; i  + '       g   i     LJ; i)	s   data1data2data3data4data5rA   rB   zshould be a positive valuer0   )rJ   rI   N)rI   seekable)r2   r3   r   r   r)   ArrowInvalid
get_streamr7   minr4   r   OSErrorr   r6   )	rI   rJ   rF   r$   streamstartendr9   ns	   &&       r%   test_python_file_get_streamrU      s    (D
gdm#.A z[1_]]2??!=? ?LL[L@? 	
	+E
 SY'E
k"CI
.C
$S/
"C ;;a; CHHQK///;;a; CHHQK/// ;;=CHHJ&&& 	D	AA;;q>SXXa[((( 
wj	1	1A 
2 LLN====?? ? ?6 
2	1s    G..H.G?	H	c                     R p \        V 4      p\        P                  ! VRR7      pVP                  ^^R7      pVR8X  g   Q h\	        V4      ^8X  g   Q hVP                  ^2^ R7      pW@8X  g   Q h\	        V4      ^8X  g   Q hR# )r@   rA   rB   )rI   offsets   e samN)r   r2   r3   read_atr4   )rF   r9   r$   rG   ws        r%   test_python_file_read_atrZ      s~    D
$-C
c$A 	
		1	%A==q6Q;; 	
		A	&A99q6R<<r,   c                      R p \        V 4      p\        P                  ! VRR7      ;_uu_ 4       pVP                  4       V 8X  g   Q h RRR4       R#   + '       g   i     R# ; i)r@   rA   rB   N)r   r2   r3   readall)rF   r9   r$   s      r%   test_python_file_readallr]      sF    D
$-C	s	%	%yy{d""" 
&	%	%	%s   AA"	c                  (   ^
p Rp\        V 4      p\        V4      p\        P                  ! VRR7      ;_uu_ 4       pVP	                  V4      ^
8X  g   Q hVRV  VRV  8X  g   Q h\        V4      V 8X  g   Q h RRR4       R#   + '       g   i     R# ; i)
   s   some sample data longer than 10rA   rB   N)	bytearrayr   r2   r3   readintor4   )lengthrF   dst_bufsrc_bufr$   s        r%   test_python_file_readintore      s    F-DGdmG	wS	)	)Qzz'"b(((w4=0007|v%%%	 
*	)	)	)s   :B  B	c                    aa ^
oRp \        V 4      o ! VV3R lR4      pV! 4       p\        P                  ! VRR7      ;_uu_ 4       pVP                  S4      p\	        V4      S8X  g   Q h\        V4      P                  4       SRS 8X  g   Q h\        R4      \        V4      ^ &   S^ ,          \        R4      8X  g   Q h RRR4       R#   + '       g   i     R# ; i)r_   s
   0123456798c                   F   <a  ] tR t^t o R t]R 4       tVV3R ltRtV t	R# )0test_python_file_read_buffer.<locals>.DuckReaderc                    R # r(   r+   selfs   &r%   r7   6test_python_file_read_buffer.<locals>.DuckReader.close       r,   c                    R # Fr+   rj   s   &r%   r6   7test_python_file_read_buffer.<locals>.DuckReader.closed       r,   c                2   < VS8X  g   Q h\        S4      R V # r(   )
memoryview)rk   rI   rc   rb   s   &&r%   read_buffer<test_python_file_read_buffer.<locals>.DuckReader.read_buffer   s#    V###g&w//r,   r+   N)
__name__
__module____qualname____firstlineno__r7   propertyr6   rt   __static_attributes____classdictcell__)__classdict__rc   rb   s   @r%   
DuckReaderrh      s(     	 
	 
		0 	0r,   r~   rA   rB   N   x)r`   r2   r3   rt   r4   rs   tobytesord)rF   r~   duck_readerr$   r9   rc   rb   s        @@r%   test_python_file_read_bufferr      s    FDoG
0 
0 ,K	{	-	-mmF#3x6!!!#&&(GGV,<<<< Y
3qzSY&&& 
.	-	-	-s   A7C		C	c                      \         P                  ! \        R 4      RR7      ;_uu_ 4       p \        V \        4      '       g   Q h\        V \
        4      '       g   Q h RRR4       R#   + '       g   i     R# ; i)r,   rA   rB   N)r2   r3   r   
isinstancer   r   r$   s    r%   test_python_file_correct_abcr      sN    	ws|#	.	.!!^,,,,!V$$$$ 
/	.	.	.s   1A&&A7	c                      R p \        V 4      p\        V 4      p\        P                  ! VRR7      ;_uu_ 4       p\        W24       F  w  rEWE8X  d   K  Q h	  RRR4       R#   + '       g   i     R# ; i)s   line1
    line2
    line3
    rA   rB   N)r   r2   r3   zip)rF   r9   buf2r$   r   r<   s         r%   test_python_file_iterabler      s[    D
 $-C4=D	s	%	%!!lND### + 
&	%	%	%s   A A  A1	c                  "    R  p \        V 4       R# )c                 B    \         P                  ! \        V R 4      4      # )rb)r2   r3   r   )r#   s   &r%   factory-test_python_file_large_seeks.<locals>.factory  s    }}T(D122r,   N)r&   )r   s    r%   test_python_file_large_seeksr     s    3 gr,   c                     R p \         P                  ! V 4      pVP                  4       ^ 8X  g   Q hVP                  4       \	        V 4      8X  g   Q hVP                  ^4      R8X  g   Q hVP                  4       ^8X  g   Q hVP                  ^ 4       VP                  4       ^ 8X  g   Q hVP                  ^ ^4       VP                  4       \	        V 4      8X  g   Q hVP                  ^4       VP                  4       ^8X  g   Q hVP                  ^24      R8X  g   Q hVP                  '       d   Q hVP                  4        VP                  '       g   Q hR# )r@   rD   rE   N)	r2   BufferReaderr   r   r4   r   r   r6   r7   )rF   r$   s     r%   test_bytes_readerr     s    D
A668q==668s4y   66!9668q==FF1I668q==FF1aL668s4y   FF1I668q==66":'''xxx<GGI888O8r,   c                      \         P                  ! \        4      ;_uu_ 4        \        P                  ! R 4       RRR4       R#   + '       g   i     R# ; i)zsome sample dataN)r   r)   r8   r2   r   r+   r,   r%   test_bytes_reader_non_bytesr   -  s-    	y	!	!
*+ 
"	!	!	!s   AA	c                      ^ RI p R pV! 4       pV P                  ! 4        VP                  4       R8X  g   Q hVP                  f   Q hR# )r   Nc                      R R,          p \         P                  ! V 4      pVP                  ^4       VP                  ^4      # )r@     )r2   r   r   rt   )rF   readers     r%   
get_buffer>test_bytes_reader_retains_parent_reference.<locals>.get_buffer6  s6    "T)&A!!!$$r,   s   sample)gccollect
to_pybytesparent)r   r   r9   s      r%   *test_bytes_reader_retains_parent_referencer   2  sA    % ,CJJL>>y(((::!!!r,   c                    \         P                  P                  \        V 4      R 4      p\	        VR4      ;_uu_ 4       p\
        P                  ! V4      pVP                  4       '       g   Q hVP                  4       '       d   Q hVP                  4       '       d   Q hVP                  R4       RRR4       \	        VR4      ;_uu_ 4       p\
        P                  ! V4      pVP                  4       '       g   Q hVP                  4       '       d   Q hVP                  4       '       g   Q hVP                  4       R8X  g   Q h RRR4       \        4       p\
        P                  ! V4      pVP                  4       '       g   Q hVP                  4       '       d   Q hVP                  4       '       d   Q hVP                  R4       VP                  4       R8X  g   Q hR#   + '       g   i     EL6; i  + '       g   i     L; i)foo.txtr   s   foobar
Nr   )r   pathjoinstrr   r2   r3   writablereadablerL   r   r   r   r5   )tmpdirr   r$   pfbios   &    r%   test_python_file_implicit_moder   B  sa   77<<FY/D	dD		Q]]1{{}}};;==  ;;==  	 
 
dD		Q]]1{{}}};;==  {{}}}wwyK''' 
 )C	s	B;;==={{}}{{}}HH[<<>[((() 
		 
	s1   AGGG
AG/G/'G/G,	/G?	c                    R R.p\         P                  P                  \        V 4      R4      p\	        VR4      ;_uu_ 4       p \
        P                  ! VRR7      pVP                  4       '       g   Q hVP                  V4       VP                  4         RRR4       \	        VR4      ;_uu_ 4       p \
        P                  ! VRR7      pVP                  4       '       g   Q hVP                  4       R	P                  V4      8X  g   Q h VP                  4         RRR4       R#   TP                  4        i ; i  + '       g   i     L; i  TP                  4        i ; i  + '       g   i     R# ; i)
s   line1
s   line2
line3r   r   rY   rB   Nr   rA   r,   )r   r   r   r   r   r2   r3   r   
writelinesr7   r   r   )r   linesr   r$   s   &   r%   test_python_file_writelinesr   [  s   ,-E77<<FY/D	dD		Q	ac*A::<<<LLGGI 
 
dD		Q	ac*A::<<<668sxx...GGI 
	 GGI 
	 GGI 
		sJ   D;AD&D;2E#4AEE#&D88D;;E	E  E##E4	c                  &   \        4       p \        P                  ! V 4      p\        P                  ! V4      p?V! 4       e   Q hV P
                  '       d   Q h\        P                  ! V 4      pVP                  4        V P
                  '       g   Q hR # r(   )r   r2   r3   weakrefrefr6   r7   )r   r   wrs      r%   test_python_file_closingr   o  sf    
)C	s	B	RB
4<<zzz>	s	BHHJ::::r,   c                    \        ^ VP                  ^,           4       F  pVP                  VP                  WR7      4      p\	        V4      \	        V 4      8X  g   Q h\        V4      \        V 4      8X  g   Q hVP                  4       V P                  4       8X  g   Q hVP                  V P                  8X  d   K  Q h	  R# )r   protocolN)rangeHIGHEST_PROTOCOLloadsdumpsr4   rs   r   
is_mutable)r9   picklerr   r=   s   &&  r%   check_buffer_picklingr     s    !W559:w}}S}DE6{c#h&&&&!Z_444  "cnn&6666  CNN222 ;r,   c                    R p\         P                  ! V4      p\        V\         P                  4      '       g   Q hVP                  '       d   Q hVP
                  '       g   Q hVP                  4       pW18X  g   Q h\        W 4       R# 	   some dataN)r2   	py_bufferr   Bufferr   is_cpur   r   pickle_modulevalr9   r=   s   &   r%   test_buffer_bytesr     sg    
C
,,s
Cc299%%%%~~~::::^^F==#-r,   c                 2   \         P                  ! ^ ^ R7      pVP                  4       R8X  g   Q hVP                  ^ 8X  g   Q h\	        V4      pVP                  4       R8X  g   Q h\         P                  ! V4      P                  ^ 8w  g   Q h\        W4       R# )r   )addressr   r,   N)r2   foreign_bufferr   r   rs   r   r   r   )r   	null_buffms   &  r%   test_buffer_null_datar     s    !!!!4I!S(((!!! 	9A99;#<<?""a''')3r,   c                    R p\         P                  ! V4      p\        V\         P                  4      '       g   Q hVP                  '       d   Q hVP
                  '       g   Q h\        V4      pW18X  g   Q h\        W 4       R# r   )r2   r   r   r   r   r   rs   r   r   s   &   r%   test_buffer_memoryviewr     sd    
C
,,s
Cc299%%%%~~~::::_F==#-r,   c                    \        R 4      p\        P                  ! V4      p\        V\        P                  4      '       g   Q hVP
                  '       g   Q hVP                  '       g   Q h\        V4      pW18X  g   Q h\        W 4       R# r   )r`   r2   r   r   r   r   r   r   r   s   &   r%   test_buffer_bytearrayr     sh    
L
!C
,,s
Cc299%%%%>>>>::::s^F==#-r,   c                      \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! R4       RRR4       R#   + '       g   i     R# ; i)z$(bytes-like object|buffer interface)r0   N)r   r)   r8   r2   r   r+   r,   r%   test_buffer_invalidr     s?    	yC
E 
E
T
E 
E 
E 
Es   AA	c                      \         P                  ! R 4      p \        P                  ! V 4      pV! 4       f   Q h? V! 4       e   Q hR# r   )r2   r   r   r   )r9   r   s     r%   test_buffer_weakrefr     s;    
,,|
$C	S	B44<<r,   zval, expected_hex_bufferc                 `    \         P                  ! V 4      pVP                  4       V8X  g   Q hR # r(   )r2   r   hex)r   expected_hex_bufferr9   s   && r%   test_buffer_hexr     s'    
 ,,s
C779++++r,   c                  .   \        ^4      p ^*V ^ &   \        P                  ! V 4      p\        P                  ! VRR7      pV^ ,          V ^ ,          8X  g   Q hV ^ ;;,          ^,          uu&   V^ ,          V ^ ,          8X  g   Q hVP
                  V8X  g   Q hR# )   uint8dtypeN)r`   r2   r   np
frombufferbase)
byte_arrayr9   arrays      r%   test_buffer_to_numpyr     s     2JJqM
,,z
"CMM#W-E8z!}$$$qMQM8z!}$$$::r,   c                     \         P                  ! ^\         P                  R7      P                  R4      p \        P
                  ! V 4      pVP                  '       g   Q hVP                  '       g   Q hVP                  4       V P                  4       8X  g   Q h\        P
                  ! V P                  4      pVP                  '       g   Q hVP                  '       g   Q hVP                  4       V P                  4       8X  g   Q h\        P                  ! \        RR7      ;_uu_ 4        \        P
                  ! V P                  R,          4      pRRR4       R#   + '       g   i     R# ; i)   r   znot contiguousr0   NN   N)      )r   arangeint8reshaper2   r   r   r   r   r   Tr   r)   
ValueError)arrr9   s     r%   test_buffer_from_numpyr     s     ))Bbgg
&
.
.v
6C
,,s
C::::>>>>>>s{{},,,
,,suu
C::::>>>>>>s{{},,,	z)9	:	:ll355:& 
;	:	:	:s   *(EE-	c                  `   R p \        V 4      p\        V 4      p\        P                  ! V 4      p\        P                  ! V 4      p\        P                  ! V4      p\        P                  ! V4      pVP                  ^ 8  g   Q hVP                  VP                  8X  g   Q hVP                  VP                  8w  g   Q hVP                  VP                  8w  g   Q h\        P
                  ! ^4      p\        P                  ! V4      pVP                  VP                  P                  8X  g   Q hR# 
   some data!N)r`   r2   r   r   r   r   ctypesrF   )	b1b2b3buf1r   buf3buf4r   r9   s	            r%   test_buffer_addressr     s    	B	2B	2B<<D<<D<<D<<D<<!<<4<<'''<<4<<'''<<4<<'''
))A,C
,,s
C;;#**//)))r,   c                     R  p R pRp\        V4      p\        V4      p^*V^ &   \        P                  ! V4      p\        P                  ! V4      p\        P                  ! V4      p\        P                  ! V4      p\        P                  ! \        P                  ! V\        P
                  R7      4      p	V ! WU4       V ! WV4       V ! Wg4       V! Wh4       V ! Wi4       R# )c                 X    V P                  V4      '       g   Q hW8X  g   Q hW8w  d   Q hR # r(   equalsabs   &&r%   eqtest_buffer_equals.<locals>.eq  s)    xx{{{vvF|Fr,   c                 X    V P                  V4      '       d   Q hW8X  d   Q hW8w  g   Q hR # r(   r  r  s   &&r%   netest_buffer_equals.<locals>.ne  s'    88A;;F|vvr,   r   r   N)r`   r2   r   r   r   int16)
r  r	  r   r   r   r   r   r   r   buf5s
             r%   test_buffer_equalsr    s    

 
B	2B	2BBqE<<D<<D<<D<<D<<b9:DtNtNtNtNtNr,   c                     \         P                  ! R 4      p V R 8X  g   Q hV \        R 4      8X  g   Q hV R8w  g   Q h\        P                  ! \
        4      ;_uu_ 4        V R8H   RRR4       R#   + '       g   i     R# ; i)r   s	   some dat1z	some dataN)r2   r   r`   r   r)   r8   r9   s    r%   test_buffer_eq_bytesr  )  se    
,,|
$C,)L)))),	y	!	!{ 
"	!	!	!s   A--A>	c                     \        R 4      p \        P                  ! V 4      p\        V 4      p\	        V) V^,
          4       F  pW,          W,          8X  d   K  Q h	  \
        P                  ! \        4      ;_uu_ 4        W,           RRR4       \
        P                  ! \        4      ;_uu_ 4        W) ^,
          ,           RRR4       R#   + '       g   i     LM; i  + '       g   i     R# ; ir   )r`   r2   r   r4   r   r   r)   
IndexError)rF   r9   rT   ixs       r%   test_buffer_getitemr  3  s    ]#D
,,t
CD	AQBAw$("""  
z	"	" 
# 
z	"	"BF 
#	" 
#	" 
#	"	"s   ?	C2C C	 C1	c                     R p \         P                  ! V 4      pVP                  ^4      p\         P                  ! R4      pVP                  V4      '       g   Q hVP                  ^^4      p\         P                  ! R4      pVP                  V4      '       g   Q hVP                  ^ 4      P                  V4      '       g   Q h\	        VP                  \	        V4      4      4      ^ 8X  g   Q h\
        P                  ! \        4      ;_uu_ 4        VP                  R4       RRR4       \
        P                  ! \        4      ;_uu_ 4        VP                  \	        V4      ^,           4       RRR4       VR,          P                  4       R8X  g   Q h\
        P                  ! \        4      ;_uu_ 4        VP                  ^\	        V4      4       RRR4       VR,          P                  4       VP                  4       R,          8X  g   Q h\
        P                  ! \        4      ;_uu_ 4        VP                  ^R4       RRR4       VR,          P                  VP                  ^4      4      '       g   Q hVR	,          P                  VP                  ^^4      4      '       g   Q hVRR P                  VP                  \	        V4      ^,
          4      4      '       g   Q hVRR P                  VP                  \	        V4      ^,
          ^4      4      '       g   Q h\
        P                  ! \        4      ;_uu_ 4        VRRR1,           RRR4       \
        P                  ! \        4      ;_uu_ 4        VR
,           RRR4       \	        V4      p\        V) ^,          V^,          4       FN  p\        V) ^,          V^,          4       F,  pWV P                  4       VP                  4       Wx 8X  d   K,  Q h	  KP  	  R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELd; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     L; i)r   s   me data!s   me dN:   NNr,   :   r  N:r  NN:r   NN:r      Nr   )
r2   r   slicer  r4   r   r)   r  r   r   )	rF   r9   slicedr<   sliced2	expected2rT   rR   stops	            r%   test_buffer_slicingr!  B  s   D
,,t
CYYq\F||K(H==""""ii1oGW%I>>)$$$$ 99Q<s#### syyS"#q(((	z	"	"		" 
# 
z	"	"		#c(Q, 
#s8 C''' 
z	"	"		!SX 
#t9!S^^%5b%9999 
z	"	"		!R 
# r7>>#))A,''''s8??399Q?++++rs8??399SX\23333r":SYYs3x!|Q78888	z	"	"DbD	 
#	z	"	"C 
# 	CArAvq1u%1"q&!a%(DT?--/3>>3CE3OOOO ) &9 
#	"	" 
#	"	"
 
#	"	"
 
#	"	" 
#	"	"	"	"sH   P
"P4P+-P? Q7
Q'P	P(	+P<	?Q	Q$	'Q7	c                      \         P                  ! \        R R7      ;_uu_ 4        \        \        P
                  ! R4      4       RRR4       R#   + '       g   i     R# ; i)
unhashabler0   s   123N)r   r)   r8   hashr2   r   r+   r,   r%   test_buffer_hashingr%  u  s3    	y	5	5R\\&!" 
6	5	5	5s    AA 	c                      R p \         P                  ! V 4      p\        P                  ! V\        P                  R7      pVP
                  P                  '       d   Q hR# )s   12345r   N)r2   r   r   r   r   flags	writeable)r  	arrow_ref	numpy_refs      r%   *test_buffer_protocol_respects_immutabilityr+  {  sC     	AQIirxx8I((((((r,   c                     \         P                  ! ^^.\         P                  R7      p V P                  R,          ^ ,          pV P                  p\
        P                  ! WV 4      p\        P                  ! V 4      p? \         P                  ! V\         P                  R7      P                  4       ^^.8X  g   Q hV! 4       f   Q h?V! 4       e   Q hR# )r  r   rF   N)r   r   int32__array_interface__rI   r2   r   r   r   r   tolist)objaddrr   r9   r   s        r%   test_foreign_bufferr2    s    
((Aq6
*C""6*1-D::D


D
,C	S	B==BHH-4461a&@@@44<<r,   c                  .   \         P                  ! ^d4      p V P                  ^d8X  g   Q hV P                  '       g   Q hV P                  e   Q hRp\         P
                  ! V 4      pVP                  V4       V P                  4       R,          V8X  g   Q hR# )d   Ns   abcde:Nr  N)r2   allocate_bufferr   r   r   FixedSizeBufferWriterr   r   )r9   bitwriters      r%   test_allocate_bufferr9    s{    


S
!C88s??>>>>::
C%%c*F
LL>>B3&&&r,   c                      \         P                  ! ^dRR7      p \        V \         P                  4      '       g   Q hV P	                  ^4       V P
                  ^8X  g   Q hR# )r4  T)	resizableN)r2   r5  r   ResizableBufferresizer   r  s    r%   test_allocate_buffer_resizabler>    sH    


SD
1Cc2--....JJsO88s??r,   c                 
   \         P                  ! R 4      pVP                  ^ 4      p\        P                  ! R.4      pVP                  V4      p\        P                  P                  \        P                  ! ^4      ^RV.4      pVP                  4       ^,          pVP                  VP                  8X  g   Q hVP                  VP                  8X  g   Q hVP                  VP                  8X  g   Q hVP                  '       g   Q hRpRpV\        V4      9   g   Q hV\        V4      9   g   Q hVP!                  ^4      p	VP"                  P%                  V	4      p
V
P'                  4       R8X  g   Q hVR,          p	VP"                  P%                  V	4      p
V
P'                  4       R8X  g   Q hV	P)                  VR,          4      '       g   Q hRp\         P*                  ! \,        VR	7      ;_uu_ 4        VP)                  \        P.                  ! V4      4       RRR4       R
p\        P                  ! R.4      pVP                  V4      p\         P*                  ! \0        VR	7      ;_uu_ 4        V	P)                  V4       RRR4       \        P                  P                  \        P                  ! ^4      ^RV.4      pVP                  4       ^,          p\         P*                  ! \0        VR	7      ;_uu_ 4        V	P)                  V4       RRR4       \         P*                  ! \0        VR	7      ;_uu_ 4        VP3                  4        RRR4       \         P*                  ! \0        VR	7      ;_uu_ 4        VP3                  4        RRR4       \         P*                  ! \0        VR	7      ;_uu_ 4        V^,           RRR4       \         P*                  ! \0        VR	7      ;_uu_ 4        VP'                  4        RRR4       \         P*                  ! \0        VR	7      ;_uu_ 4        V P5                  V^R7       RRR4       \         P*                  ! \0        VR	7      ;_uu_ 4        V P5                  V^R7       RRR4       \         P*                  ! \0        VR	7      ;_uu_ 4        \7        V4       RRR4       R#   + '       g   i     EL; i  + '       g   i     ELX; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELl; i  + '       g   i     ELC; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     R# ; i)zpyarrow.cudas   testingNz<pyarrow.Buffer address=z$size=7 is_cpu=False is_mutable=True>s   sting:r   r   Ns   stz8Device on which the data resides differs between buffersr0   z'Implemented only for data on CPU devicer   )r   importorskipContextr   r   buffer_from_datar2   FixedSizeBinaryArrayfrom_buffersbinarybuffersr   r   r   r   reprr  
CudaBufferfrom_bufferr   r  r)   r   r   NotImplementedErrorr   r   rs   )r   cudactxrF   cuda_bufr   
buf_on_gpurepr1repr2buf_on_gpu_slicedcuda_sliced
msg_devicemsg	arr_shortcuda_buf_shortbuf_on_gpu_shorts   &               r%   test_non_cpu_bufferrX    s   ~.D
,,q/C88ZL!D##D)H

!
!
.
.ryy|Qx@P
QCq!J??hmm+++!1!1111///     &E2ED$$$$D$$$$"((+//--.?@K!!#x///"3//--.?@K!!#u,,, ##HSM2222 LJ	z	4	4",,t,- 
5 4C($I)))4N	*#	6	6  0 
7''44
		!a$/I !((*1-	*#	6	6  !12 
7 
*#	6	6 
7 
*#	6	6 
7 
*#	6	61 
7 
*#	6	6 
7 
*#	6	6J3 
7 
*#	6	6Hq1 
7 
*#	6	6: 
7	6E 
5	4	4 
7	6	6 
7	6	6 
7	6	6 
7	6	6 
7	6	6 
7	6	6 
7	6	6 
7	6 
7	6	6sx   5&R>1S=S&;S:8T5
T"+T6(U
(U(U1>S	S#	&S7	:T	T	"T3	6U	
U	U.	1V	c                     \         P                  ! 4       p \         P                  ! R R7      p\         P                  ! RRR7      p\         P                  ! RR^R7      p\         P                  ! RRRR7      p\         P                  P                  ^d^R^@R	7      pV P                  R8X  g   Q hV P                  R8X  g   Q hV P
                  R
J g   Q hV P                  ^ 8X  g   Q hVP                  R 8X  g   Q hVP                  R8X  g   Q hVP
                  R
J g   Q hVP                  ^ 8X  g   Q hVP                  R8X  g   Q hVP                  R8X  g   Q hVP
                  R
J g   Q hVP                  ^ 8X  g   Q hVP                  R8X  g   Q hVP                  R8X  g   Q hVP
                  R
J g   Q hVP                  ^8X  g   Q hVP                  R8X  g   Q hVP                  R8X  g   Q hVP
                  RJ g   Q hVP                  ^ 8X  g   Q hVP
                  RJ g   Q hW 8X  g   Q hW8w  g   Q hW8w  g   Q hW#8w  g   Q hW48w  g   Q hWP8w  g   Q hR# )   )hole_size_limit       )r[  range_size_limit)r[  r^  prefetch_limitF)r[  r^  lazyg?)time_to_first_byte_millistransfer_bandwidth_mib_per_sec ideal_bandwidth_utilization_fracmax_ideal_request_size_mibTNi   )r2   CacheOptionsfrom_network_metricsr[  r^  r`  r_  )opts1opts2opts3opts4opts5opts6s         r%   test_cache_optionsrm    sT   OOEOOD1EOOD4HEOOD-1!EEOOD-1?EOO003PSRULN 1 PE
   D(((!!%5555::1$$$  D(((!!%5555::1$$$  D(((!!T)))::1$$$  D(((!!T)))::1$$$  D(((!!T)))::1$$$::>>>>>>>>>>>>r,   c                     \         P                  ! 4       \         P                  ! R RR^R7      .pV F*  pV P                  V P                  V4      4      V8X  d   K*  Q h	  R# )r\  r]  T)r[  r^  r`  r_  N)r2   re  r   r   )r   optionsoptions   &  r%   test_cache_options_picklingrq  !  sX    

t!!	5G ""=#6#6v#>?6III r,   compressionbz2)r)   )marksbrotligziplz4zstdsnappyc                 H   \         P                  ! V 4      '       g   \        P                  ! V  R 24       Rp\        P
                  P                  ^ ^VR7      P                  \        P                  4      P                  4       p\        P                  ! V4      p\        P                  ! W0R7      p\        P                  ! W RR7      p\        V\        4      '       g   Q h\        P                  ! WAV R7      p\        P                  ! WQV RR7      p\        V\        4      '       g   Q hVP!                  V4      '       g   Q hWr8X  g   Q h\        P"                  ! \$        4      ;_uu_ 4        \        P                  ! WPR7       RRR4       R#   + '       g   i     R# ; i) support is not built'  r   )codecT)r~  asbytesN)r
   is_availabler   r   r   randomrandintastyper   r   r2   r   compressr   bytes
decompressr  r)   r   )rr  
INPUT_SIZE	test_datatest_bufcompressed_bufcompressed_bytesdecompressed_bufdecompressed_bytess   &       r%   test_compress_decompressr  ,  s9    k**{m#89:J""1c
";&"')  ||I&H[[=N{{9+/1 &....}}^+68'7-8$H (%0000""8,,,,***	z	"	"
&: 
#	"	"	"s   .FF!	c                 b	   \         P                  ! V 4      '       g   \        P                  ! V  R 24       \        V 4      pVP                  R8X  d   VP
                  e   Q hM"\        VP
                  \        4      '       g   Q hR.pW9   Ed   \         P                  ! V 4      '       d   Q h\        P                  ! \        4      ;_uu_ 4        \        V ^ 4       RRR4       \        P                  ! \        4      ;_uu_ 4        \         P                  ! V 4       RRR4       \        P                  ! \        4      ;_uu_ 4        \         P                  ! V 4       RRR4       \        P                  ! \        4      ;_uu_ 4        \         P                  ! V 4       RRR4       R# Rp\        P                  P!                  ^ ^VR7      P#                  \        P$                  4      P'                  4       p\(        P*                  ! V4      p\         P                  ! V 4      p\         P                  ! V 4      p\         P                  ! V 4      pWg8  g   Q hW8  g   Q hW8:  g   Q h\-        Wg^,           4       F  p	\        W	4      pVP/                  V4      p
VP/                  VRR7      p\        V\0        4      '       g   Q hVP3                  W4      pVP3                  WRR7      p\        V\0        4      '       g   Q hVP5                  V4      '       g   Q hW8X  g   Q h\        P                  ! \        4      ;_uu_ 4        VP3                  V4       RRR4       K  	  \7        \        P                  R4      '       g   \        P                  ! R4       \        P                  P9                  ^*R	7      pVP;                  ^ ^dR
4      p\(        P<                  ! V4      pVP?                  4       ^,          p\        W4      pVP/                  V4      p\        W4      pVP/                  V4      p\A        V4      \A        V4      8  g   Q hR#   + '       g   i     ELy; i  + '       g   i     ELL; i  + '       g   i     EL; i  + '       g   i     R# ; i  + '       g   i     EK4  ; i)r{  ry  Nr|  r}  T)r  default_rngzRequires newer version of numpy)seedr   )!r
   r  r   r   namecompression_levelr   intsupports_compression_levelr)   r   minimum_compression_levelmaximum_compression_leveldefault_compression_levelr   r  r  r  r   r   r2   r   r   r  r  r  r  hasattrr  integersr   rF  r4   )rr  r~  no_levelr  r  r  	min_level	max_leveldefault_levelr  r  r  r  r  rngvaluesr   hard_to_compress_buffer
weak_codecweakly_compressed_bufstrong_codecstrongly_compressed_bufs   &                     r%   test_compression_levelr  U  s    k**{m#89:+EzzX&&...%1137777 zH33K@@@@]]:&&+q! ']]:&&++K8 ']]:&&++K8 ']]:&&++K8 'J""1c
";&"')  ||I&H//<I//<I33K@M   %%%%%%"9k:k51 >>)T>B*E2222 ++NG"--.>6: . < ,e4444&&x0000!...]]:&&-. '& ;2 299m,,56
))

R

(C\\!S$'F
((6
C!kkmA.{.J&//0GH0L*334KL$%,C(DDDD} '&&&&&&&&&&< '&&s<   QQ Q4RRQ	 Q1	4R	R	R.c                  x   R p \         P                  ! V 4      pVP                  '       d   Q h\        V\         P                  4      '       g   Q h\        V4      pVP                  '       g   Q h\        P                  ! \        4      ;_uu_ 4       pRV^ &   R\        VP                  4      9   g   Q h RRR4       \        V4      p\        P                  ! \        4      ;_uu_ 4       pRV^ &   R\        VP                  4      9   g   Q h RRR4       R#   + '       g   i     Lj; i  + '       g   i     R# ; i)r      hzcannot modify read-onlyN)r2   r   r   r   r   rs   readonlyr   r)   r8   r   valuer  )r   r9   r=   excr  s        r%   #test_buffer_memoryview_is_immutabler    s    
C
,,s
C~~~c299%%%%_F????	y	!	!Sq	(C		N::: 
" 	c
A	y	!	!S!(C		N::: 
"	! 
"	!
 
"	!	!s   "D("D(D%	(D9	c                      \         P                  ! \        4      ;_uu_ 4        \        P                  ! 4        R R R 4       R #   + '       g   i     R # ; ir(   )r   r)   r8   r2   r   r+   r,   r%   test_uninitialized_bufferr    s+     
y	!	!
		 
"	!	!	!s   AA	c                     R p \         P                  ! 4       pRp\        V4       F  pVP                  V 4       K  	  VP	                  4       p\        V4      \        V 4      V,          8X  g   Q hVP                  4       W,          8X  g   Q hR# )
   dataabcdefr   N)r2   BufferOutputStreamr   r   r5   r4   r   )r   r$   Kir9   s        r%   test_memory_output_streamr    sq    
C
AA1X	  **,Cs8s3x!|###>>sw&&&r,   c                  b   \         P                  ! 4       p V P                  R 4       V P                  '       d   Q hV P	                  4        V P                  '       g   Q h\
        P                  ! \        4      ;_uu_ 4        V P                  R4       RRR4       R#   + '       g   i     R# ; i)   oks   not okN)r2   r  r   r6   r5   r   r)   r   r   s    r%    test_inmemory_write_after_closedr    si    
AGGENxxx<JJL888O8	z	"	"		 
#	"	"	"s   BB.	c                      R  p V ! R4      p\         P                  ! 4        VR8X  g   Q hRp\        P                  ! V4      p\	        ^
4       F  pV ! V4       K  	  \         P                  ! 4        V\        P                  ! V4      8X  g   Q hR# )c                 @    \        \        P                  ! V 4      4      # r(   )r`   r2   r   )	bytes_objs   &r%   make_buffer6test_buffer_protocol_ref_counting.<locals>.make_buffer  s    i011r,      fooN)r   r   r   getrefcountr   )r  r9   r   refcount_beforer  s        r%   !test_buffer_protocol_ref_countingr    ss    2 f
CJJL&== Cooc*O2YC JJLcooc2222r,   c                     \         P                  ! 4       p R p\        P                  ! VRR7      pV P	                  V4       V P	                  \        V4      4       V P	                  \         P                  ! V4      4       \        P                  ! \        4      ;_uu_ 4        V P	                  VP                  R4      4       RRR4       V P                  4       pVP                  4       V^,          8X  g   Q hR#   + '       g   i     L@; i)r  S1r   utf8N)r2   r  r   r   r   r`   r   r   r)   r8   decoder5   r   )r$   rF   r   r9   s       r%    test_nativefile_write_memoryviewr    s    
AD
--D
)CGGCLGGIdOGGBLL	y	!	!	F#$ 
" **,C>>tax''' 
"	!s   "!C;;D	c                  J   R p \         P                  ! 4       p\         P                  ! 4       pRp\        V4       F%  pVP	                  V 4       VP	                  V 4       K'  	  VP                  4       \        VP                  4       4      8X  g   Q h\         P                  P                  \         P                  ! . RO4      .R.4      p\         P                  ! 4       p\         P                  ! 4       p\         P                  ! WP                  4      p\         P                  ! W%P                  4      pVP                  V4       VP                  V4       VP                  4        VP                  4        VP                  4       \        VP                  4       4      8X  g   Q hR# )r  r   r  N)r  r   r   )r2   MockOutputStreamr  r   r   r   r4   r5   RecordBatchfrom_arraysr   RecordBatchStreamWriterschemawrite_batchr7   )r   f1f2r  r  record_batchstream_writer1stream_writer2s           r%   test_mock_output_streamr  
  s0   
 C				B				 BA1X

  779BKKM**** >>--rxx	/B.CcUKL				B				 B//4G4GHN//4G4GHN|,|,779BKKM****r,   c                   a R p\        V4       Uu. uF  p\        P                  ! ^ ^4      NK  	  pp\        VRV 4      p\        P
                  P                  \        V4      \        4       4      o\        SR4      ;_uu_ 4       pVP                  V4       RRR4       V3R lpV P                  V4       SV3# u upi   + '       g   i     L0; i)r\  Nr   c                     < \        S 4       R # r(   )_try_deleter   s   r%   teardown"sample_disk_data.<locals>.teardown;  s    Dr,   )r   r  r  r  r   r   r   r   r	   r   r   addfinalizer)	requestr   SIZE_r   rF   r$   r  r   s	   &&      @r%   sample_disk_datar  0  s    D+0;
7;a6>>!S!;C
7UdD77<<FTV,D	dD		Q	 
 ": 8
 
	s    B;C  C	c                    Vw  r4V ! VR R7      pVP                  ^
4      VR,          8X  g   Q hVP                  ^ 4      R8X  g   Q hVP                  4       ^
8X  g   Q hVP                  4       VR,          8X  g   Q hVP                  4       \        V4      8X  g   Q hVP	                  ^ 4       VP                  4       ^ 8X  g   Q hV'       da   VP	                  \        V4      ^,           4       VP                  4       \        V4      ^,           8X  g   Q hVP                  ^4      R8X  g   Q hVP	                  ^4      ^8X  g   Q hVP	                  ^\
        P                  4      ^8X  g   Q hVP                  4       ^8X  g   Q h\        V4      ^,
          pVP	                  R\
        P                  4      V8X  g   Q hVP                  4       V8X  g   Q hR# )rA   rB   Nr_   Nr,   :r_   NNNr  )r   r   r   r4   r   r   SEEK_CURSEEK_END)FACTORYsample_dataallow_read_out_of_boundsr   rF   r$   	ex_lengths   &&&    r%   _check_native_file_readerr  B  sr   JD3A66":c"""66!9668r>>668tCy   668s4y   FF1I668q==  	s4y1}vvx3t9q=(((vvayC 66!9>>66!R[[!Q&&&668q==D	AI66"bkk"i///668y   r,   c                 >    \        \        P                  V R R7       R# )F)r  N)r  r2   
memory_mapr  s   &r%   test_memory_map_readerr  c  s    bmm-=7<>r,   c                    V w  r. p\         P                  ! VR 4      ;_uu_ 4       pVP                  VP                  ^d4      VR,          34       VP                  VP                  ^d4      VR,          34       VP                  VP                  ^d4      VR,          34       RRR4       \        P
                  ! 4        V F  w  rVVP                  4       V8X  d   K  Q h	  R#   + '       g   i     LI; i)r   :Nr4  N:r4     N:r  i,  NN)r2   r  appendrt   r   r   r   )r  r   rF   casesr$   r9   r<   s   &      r%   'test_memory_map_retain_buffer_referencer  h  s    !JDE	tT	"	"aammC($t*56ammC($w-89ammC($w-89 
# JJL~~8+++  
#	"s   A<C##C3	c                 :    \        \        P                  V 4       R # r(   )r  r2   OSFiler  s   &r%   test_os_file_readerr  x  s    bii)9:r,   c                  8    \        \        P                  4       R # r(   )r&   r2   r  r+   r,   r%   test_os_file_large_seeksr  |  s    bii r,   c                 l     \         P                  ! V 4       R #   \         P                   d     R # i ; ir(   )r   removeerrorr  s   &r%   r  r    s(    
		$88 s    33c                    \         P                  R 8X  d   \        P                  ! R4       Rp\	        V4       Uu. uF  p\
        P                  ! ^ ^4      NK  	  pp\        VRV 4      p\        P                  P                  \        V 4      \        4       4      p\        VR4      ;_uu_ 4       pVP                  V4       RRR4       \        P                   ! VRR7      pVP#                  ^
4       VP                  R4       VP%                  4       ^8X  g   Q hVP#                  ^
4       VP'                  ^4      R8X  g   Q h\        P                   ! VRR7      pVP#                  ^
4       VP                  R4       VP#                  ^
4       VP#                  ^
4       VP'                  ^4      R8X  g   Q h\        P                   ! VR	R7      pVP                  R
4       \        P                   ! V4      ;_uu_ 4       p	V	P)                  4       V8X  g   Q h RRR4       \        P*                  ! \,        4      ;_uu_ 4        VP'                  ^4       RRR4       VP#                  ^ 4       VP'                  ^4      R
8X  g   Q hR# u upi   + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     Lg; i)r   z:Multiple memory maps to same file don't work on emscriptenr\  Nr   r+brB   s   peekaboos   booapeakrY   r  )r   r   r   xfailr   r  r  r  r   r   r   r   r	   r   r   r2   r  r   r   r   r   r)   IOError)
r   r  r  r   rF   r   r$   r  f3f4s
   &         r%   test_memory_map_writerr    s   
|||#QRD+0;
7;a6>>!S!;C
7UdD77<<FTV,D	dD		Q	 
 	d'AFF2JGGK668r>>FF2J66!9###	t%	(BGGBKHH[GGBKFF2J66!9### 
t#	&BHHV	t		wwyD    
 
w		

 
  FF1I66!9I 8 
		2 
	 
 	s)    J0J?J J3J	 J0	3K	c                    R p\        V4       Uu. uF  p\        P                  ! ^ ^4      NK  	  pp\        VRV^,           4      p\        W1^,          R 4      p\        P
                  P                  \        V 4      \        4       4      p\        P                  ! Wa^,          4      pVP                  V4       VP                  V4       VP                  V4       VP                  4        \        VR4      ;_uu_ 4       pVP                  4       \        VRV 4      8X  g   Q h RRR4       R# u upi   + '       g   i     R# ; i)r\  Nr   )r   r  r  r  r   r   r   r   r	   r2   create_memory_mapr   r=  r7   r   r   )	r   r  r  r   data1data2r   mmapr$   s	   &        r%   test_memory_map_resizer    s    D+0;
7;a6>>!S!;C
7#l	#$E#qyl#$E77<<FTV,DQh/DJJuKKJJuJJL	dD		Qvvx5Ud,,,, 
	 8 
		s    D/ $D44E	c                 J   \         P                  P                  \        V 4      \	        4       4      p\        VR 4      pVP                  4        \        P                  ! VRR7      ;_uu_ 4       pVP                  4       ^ 8X  g   Q h RRR4       R#   + '       g   i     R# ; i)r   r  rB   N)
r   r   r   r   r	   r   r7   r2   r  r   )r   r   r$   r  s   &   r%   test_memory_zero_lengthr    sh    77<<FTV,DT4AGGI	t%	(	(J A%%% 
)	(	(	(s   .BB"	c                      \         P                  R8  d   Rp M&\        P                  ! \        P
                  RR7      p \        \        P                  V R7       R# )r   NzARequested memory map length 4294967306 does not fit in a C size_tr0   r"   l        )r   maxsizer   r)   r2   ArrowCapacityErrorr&   r  r  s    r%   test_memory_map_large_seeksr    s?    
{{e!!/0 bmmNCr,   c                 
   \         P                  P                  \        V 4      \	        4       4      p\
        P                  ! VR 4      pVP                  4        VP                  '       g   Q h\         P                  ! V4       R# r\  N)
r   r   r   r   r	   r2   r   r7   r6   r  )r   r   r  s   &  r%   test_memory_map_close_remover    sP    77<<FTV,Dd+DJJL;;;;IIdOr,   c                     \         P                  P                  \        V 4      \	        4       4      p\
        P                  ! VR 4       \         P                  ! V4       R# r  )r   r   r   r   r	   r2   r   r  )r   r   s   & r%   test_memory_map_deref_remover    s7    77<<FTV,Dt$IIdOr,   c                 h   R p\        V4       Uu. uF  p\        P                  ! ^ ^4      NK  	  pp\        VRV 4      p\        P
                  P                  \        V 4      \        4       4      p\        VR4      ;_uu_ 4       pVP                  V4       RRR4       \        P                  ! VRR7      pVP                  R4       \        P                  ! V4      ;_uu_ 4       pVP                  4       ^8X  g   Q h RRR4       \        P                  ! \         4      ;_uu_ 4        VP#                  ^4       RRR4       VP%                  4        \        P                  ! VRR7      ;_uu_ 4       p	V	P                  R4       RRR4       \        P                  ! V4      ;_uu_ 4       p
V
P                  4       ^8X  g   Q h RRR4       R# u upi   + '       g   i     ELE; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)r\  Nr   rY   rB   r  abs   bar)r   r  r  r  r   r   r   r   r	   r   r   r2   r  r   r   r)   r  r   r7   )r   r  r  r   rF   r   r$   r  r  r  f5s   &          r%   test_os_file_writerr    sb   D+0;
7;a6>>!S!;C
7UdD77<<FTV,D	dD		Q	 
 
4c	"BHHV	4BwwyA~~ 
 
w		

 
 HHJ 
4d	#	#r
 
$	4BwwyA~~ 
+ 8 
		 
 
 	
 
$	#	sA    GG&G')G:3H+H G$	'G7	:H
	H	 H1	c                      \         P                  ! 4       p \        P                  ! \        4      ;_uu_ 4        V P                  R 4       RRR4       R#   + '       g   i     R# ; i)fooN)r2   r  r   r)   r8   r   )nfs    r%   %test_native_file_write_reject_unicoder    s9    				 B	y	!	!
 
"	!	!	!s   AA%	c                 ,   \         P                  P                  \        V 4      \	        4       4      p\        VR 4      ;_uu_ 4       pVP                  R4       RRR4       \        P                  ! VRR7      ;_uu_ 4       pVP                  R8X  g   Q hVP                  4       '       g   Q hVP                  4       '       d   Q hVP                  4       '       g   Q h RRR4       \        P                  ! VRR7      ;_uu_ 4       pVP                  R8X  g   Q hVP                  4       '       g   Q hVP                  4       '       d   Q hVP                  4       '       g   Q h RRR4       \        P                  ! VRR7      ;_uu_ 4       pVP                  R 8X  g   Q hVP                  4       '       d   Q hVP                  4       '       g   Q hVP                  4       '       d   Q h RRR4       \        P                  ! VR R7      ;_uu_ 4       pVP                  R 8X  g   Q hVP                  4       '       d   Q hVP                  4       '       g   Q hVP                  4       '       d   Q h RRR4       \        P                  ! VRR7      ;_uu_ 4       pVP                  R8X  g   Q hVP                  4       '       d   Q hVP                  4       '       g   Q hVP                  4       '       d   Q h RRR4       \        P                  ! VRR7      ;_uu_ 4       pVP                  R8X  g   Q hVP                  4       '       d   Q hVP                  4       '       g   Q hVP                  4       '       d   Q h RRR4       \        VR 4      ;_uu_ 4       pVP                  R4       RRR4       \        P                  ! VR4      ;_uu_ 4       pVP                  R8X  g   Q hVP                  4       '       g   Q hVP                  4       '       d   Q hVP                  4       '       g   Q h RRR4       \        P                  ! VR	4      ;_uu_ 4       pVP                  R
8X  g   Q hVP                  4       '       g   Q hVP                  4       '       g   Q hVP                  4       '       g   Q h RRR4       \        P                  ! VR4      ;_uu_ 4       pVP                  R
8X  g   Q hVP                  4       '       g   Q hVP                  4       '       g   Q hVP                  4       '       g   Q h RRR4       R#   + '       g   i     EL; i  + '       g   i     ELz; i  + '       g   i     EL	; i  + '       g   i     EL; i  + '       g   i     EL'; i  + '       g   i     EL; i  + '       g   i     ELE; i  + '       g   i     EL+; i  + '       g   i     EL; i  + '       g   i     ELK; i  + '       g   i     R# ; i)r      fooooNrA   rB   r   rY   r  r  zr+zrb+r  )r   r   r   r   r	   r   r   r2   r  rC   r   r   rL   r  )r   r   r$   s   &  r%   test_native_file_modesr  
  s#   77<<FTV,D	dD		Q	 
 
4c	"	"avv~~zz|||::<<zz|||	 
# 
4d	#	#qvv~~zz|||::<<zz|||	 
$ 
4c	"	"avv~~::<<zz|||::<<<	 
# 
4d	#	#qvv~~::<<zz|||::<<<	 
$ 
4d	#	#qvv~~::<<zz|||::<<<	 
$ 
4c	"	"avv~~::<<zz|||::<<<	 
# 
dD		Q	 
 
tS	!	!Qvv~~zz|||::<<zz|||	 
" 
tT	"	"avvzz|||zz|||zz|||	 
# 
tU	#	#qvvzz|||zz|||zz|||	 
$	#m 
		 
#	"	" 
$	#	# 
#	"	" 
$	#	# 
$	#	# 
#	"	" 
		 
"	!	! 
#	"	" 
$	#	#s&  T: )U*UUU)U"/U"U"U"
)U64U6U6$U6)V
9V
V
)V
)V>VV.V)V2V2V23V2W)W5WW%W)W.9W.W.)W.)X=XX-X:U	U	"U3	6V	
V	V/	2W	W	W+	.W?	X	r   z umask doesn't work on Emscripten)reasonc                    \         P                  ! ^4      p\         P                  ! V4       \         P                  P                  \	        V 4      \        4       4      p\        P                  ! VRR7      ;_uu_ 4         RRR4       \         P                  ! V4      P                  R,          RV( ,          8X  g   Q h\         P                  P                  \	        V 4      \        4       4      p\        P                  ! VR4      ;_uu_ 4         RRR4       \         P                  ! V4      P                  R,          RV( ,          8X  g   Q hR#   + '       g   i     L; i  + '       g   i     L[; i)r   rY   rB   Ni  i  )r   umaskr   r   r   r	   r2   r  statst_moder  )r   	cur_umaskr   s   &  r%   test_native_file_permissionsr"  I  s    
 IHHY77<<FTV,D	4c	"	" 
#774=  5(EYJ,>>>>77<<FTV,D	tS	!	! 
"774=  5(EYJ,>>>> 
#	"
 
"	!s   >EE#E 	#E3	c           	      T   \         P                  P                  \        V 4      \	        4       4      p\        VR 4      ;_uu_ 4       pVP                  R4       RRR4       \        P                  ! VRR7      ;_uu_ 4       pVP                  '       d   Q h RRR4       XP                  '       g   Q h\        P                  ! VRR7      ;_uu_ 4       pVP                  '       d   Q h RRR4       XP                  '       g   Q hVV.p. ROpV FH  pV F?  w  rx\        P                  ! \        4      ;_uu_ 4        \        W'4      ! V!   RRR4       KA  	  KJ  	  R#   + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     K  ; i)r   r  Nr   rB   ))r   r+   )r   )r   )r   r+   )flushr+   )r   r+   )r   r+   )rL   r+   )r   r   r   r   r	   r   r   r2   r  r6   r  r   r)   r   getattr)	r   r   r$   os_file	mmap_filefilesmethodsmethodargss	   &        r%   .test_native_file_raises_ValueError_after_closer,  \  s.   77<<FTV,D	dD		Q	 
 
4d	#	#w>>>!!> 
$>>>>	t$	'	'9###### 
(E!G #LFz**"D) +* $ - 
		 
$	# 
(	'" +**s0   E E0F:F	E-	0F 	F	F'c                    R p\         P                  P                  \        V 4      \	        4       4      p\        VR4      ;_uu_ 4       pVP                  VP                  R4      4       RRR4       \        \        P                  ! VRR7      4      ;_uu_ 4       pVP                  4       '       g   Q hVP                  4       pWQ8X  g   Q h RRR4       XP                  '       g   Q h\        \        P                  ! VRR7      4      ;_uu_ 4       p\        V4      pRP                  V4      V8X  g   Q h RRR4       \         P                  P                  \        V 4      \	        4       4      p\        \        P                  ! VRR7      4      ;_uu_ 4       pVP                  4       '       g   Q hVP                  V4       RRR4       \        \        P                  ! VRR7      4      ;_uu_ 4       pVP                  4       pWQ8X  g   Q h RRR4       R#   + '       g   i     EL; i  + '       g   i     ELh; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     R# ; i)zfoooo
barrr
bazzz
r   utf-8Nr   rB    )r   r   r   r   r	   r   r   encoder   r2   r  r   r   r6   listr   )r   rF   r   r$   filresr   path2s   &       r%   test_native_file_TextIOWrapperr5  z  s   D 77<<FTV,D	dD		Q	G$% 
 
ryyD1	2	2c||~~~hhj{{ 
3 ::::	ryyD1	2	2cS	wwu~%%% 
3 GGLLVdf-E	ryyT2	3	3s||~~~		$ 
4 
ryyT2	3	3shhj{{ 
4	3) 
		 
3	2	2 
3	2	2 
4	3 
4	3	3s<   !H1H+$H?*I3I&H(	+H<	?I	I#	&I7	c           	      n   R p\        V R,          4      p\        VR4      ;_uu_ 4       pVP                  VR,          4       RRR4       \        P                  ! VRR7      p\        V4      ;_uu_ 4       pVP                  4       ^ 8X  g   Q hRpVP                  V4      p\        V4      \        P                  ! ^V,          \        V4      ,          4      8X  g   Q hWTP                  4       u;8:  d   V^,          8:  g   Q h Q h RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)s	   foo
quux
largefile.txtr   i Nr   rB   i N  )r   r   r   r2   r  r   r   	readlinesr4   mathceil)r   rF   r   r$   binary_filerI   r   s   &      r%   #test_native_file_TextIOWrapper_perfr<    s     Dv'(D	dD		Q	w 
 ))Dt,K	{	#	#q!Q&&&F#5zTYYq6zCI'=>>>>))+9vz99999 
$	#	 
	 
$	#	#s   D5BD#D 	#D4	c                 b   R R,          p\        V R,          4      p\        VR4      ;_uu_ 4       pVP                  V4       RRR4       . p\        P                  ! VRR7      ;_uu_ 4       p VP                  4       p\        V4      \        V4      8  g   Q hVP                  V4       VP                  R4      p\        V4      R8:  g   Q hVP                  V4       V'       d   K{   RRR4       RP                  T4      T8X  g   Q hR#   + '       g   i     L; i  + '       g   i     L=; i)	s   123
i@B r7  r   Nr   rB   i0u  r,   )	r   r   r   r2   r  read1r4   r  r   )r   rF   r   r$   chunksr  s   &     r%   test_native_file_read1r@    s     iDv'(D	dD		Q	 
 F	4d	#	#q	Aq6CI%%%MM!Aq6V###MM!1 
$ 88Ft### 
	 
$	#s   D,A7D(DD	D.	c           	         ^ RI p^ RIHp RR,          p\        V R,          4      p\	        VR4      ;_uu_ 4       pVP                  V4       RRR4       \        P                  ! VRR7      ;_uu_ 4       pVP                  V^
R7      pVP                  R	R	.^
,          R
R
.^
,          /4      pVP                  Wg4       VP                  4       R8:  g   Q h RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r   Ns   a,b
i r7  r   r   rB   )nrowsr  r  i   )pandaspandas.testingtestingr   r   r   r2   r  read_csv	DataFrameassert_frame_equalr   )r   pdtmrF   r   r$   dfr<   s   &       r%   #test_native_file_pandas_text_readerrL    s     j Dv'(D	dD		Q	 
 
4d	#	#q[["[%<<sebj#urz BC
b+vvx:%%% 
$	# 
	 
$	#	#s   C 4A!C3 C0	3D	c                     \        4       ;_uu_ 4        \        P                  ! R R4       RRR4       \        4       ;_uu_ 4        \        P                  ! R R4       RRR4       R#   + '       g   i     LD; i  + '       g   i     R# ; i)non_existent_filer   N)r-   r2   r  r  r+   r,   r%   test_native_file_open_errorrO    sR    		 	 
		%t, 
!		 	 
)40 
!	  
!	 	 	 	 s   A'A:'A7	:B	c                  0   \         P                  ! R 4      p \         P                  ! V ^R7      pVP                  ^4      R8X  g   Q hV P	                  4       ^8X  g   Q hVP                  4        VP                  '       g   Q hV P                  '       g   Q hR# )	   123456789buffer_size   12N)r2   r   BufferedInputStreamr   r   r7   r6   )rawr$   s     r%   test_buffered_input_streamrW    sn    
//,
'C
s2A66!988:??GGI888O8::::r,   c                     \         P                  ! \         P                  ! R 4      ^R7      p V P                  ^4      R8X  g   Q hV P	                  4       pV P
                  '       g   Q hVP
                  '       d   Q hVP                  4       '       g   Q hVP                  ^4      R8X  g   Q hVP                  ^4       VP                  ^4      R8X  g   Q hR# )rQ  rR  rT     5678s   3456N)r2   rU  r   r   detachr6   rL   r   r$   rV  s     r%   *test_buffered_input_stream_detach_seekabler\    s    
r|<!LA66!9
((*C888O8zzz><<>>>88A;'!!!HHQK88A;'!!!r,   c                  *   \         P                  ! \         P                  ! \         P                  ! R 4      ^R7      ^R7      p V P                  ^4      R8X  g   Q hV P	                  4       pV P
                  '       g   Q hVP
                  '       d   Q hVP                  4       '       d   Q hVP                  ^4      R8X  g   Q h\        P                  ! \        4      ;_uu_ 4        VP                  ^4       RRR4       R#   + '       g   i     R# ; i)rQ  rR  rT  rY  N)r2   rU  r   r   rZ  r6   rL   r   r)   EnvironmentErrorr   r[  s     r%   .test_buffered_input_stream_detach_non_seekabler_    s    

r|<!L	A 66!9
((*C888O8zzz>||~~88A;'!!!	'	(	( 
)	(	(	(s   %DD	c                  b   \         P                  ! ^d\         P                  R7      p \        P                  ! V 4      p\        P
                  ! V4      p\        P                  ! V^R7      pVP                  R4       V R,          P                  4       R8X  g   Q hVP                  4        V R,          P                  4       R8X  g   Q hVP                  R4       VP                  4        VP                  '       g   Q hVP                  '       g   Q hV R,          P                  4       R	8X  g   Q hR
# )r4  r   rR  rT  Nr   N          12  s   3456789r  s
   123456789 N)r   zerosr   r2   r   r6  BufferedOutputStreamr   r   r$  r7   r6   )np_bufr9   rV  r$   s       r%   test_buffered_output_streamrg    s    XXc)F
,,v
C

"
"3
'C
3AGGEN":;...GGI":9,,,GGJGGI888O8::::#; N222r,   c                     \         P                  ! ^d\         P                  R7      p \        P                  ! V 4      p\        P
                  ! \        P                  ! V4      ^R7      pVP                  R4       V R,          P                  4       R8X  g   Q hVP                  4       pVP                  '       g   Q hVP                  '       d   Q hV R,          P                  4       R8X  g   Q hR# )r4  r   rR  rT  ra  rb  rc  N)r   rd  r   r2   r   re  r6  r   r   rZ  r6   )rf  r9   r$   rV  s       r%   "test_buffered_output_stream_detachri    s    XXc)F
,,v
C
 8 8 =1MAGGEN":;...
((*C888O8zzz>":9,,,r,   c                    \         P                  ! VR R7      p\         P                  ! W24      ;_uu_ 4       pVP                  '       d   Q hVP	                  4       '       g   Q hVP                  4       '       d   Q hVP                  4       '       d   Q hVP                  4       pWP8X  g   Q h RRR4       XP                  '       g   Q hVP                  '       g   Q h\         P                  ! VR R7      p\         P                  ! W24      ;_uu_ 4       pVP                  4       p\        V\         P                  4      '       g   Q hVP                  4       V 8X  g   Q h RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; ir   rB   N)r2   r  CompressedInputStreamr6   r   r   rL   r   rt   r   r   r   )rF   fnrr  rV  
compressedgotr9   s   &&&    r%   check_compressed_inputrp  '  s/   
))BT
"C		!	!#	3	3z$$$$$""$$$$&&((((&&((((oo{{ 
4 :::: ))BT
"C		!	!#	3	3z$$&#ryy))))~~4''' 
4	3 
4	3 
4	3	3s*   *E("E(:E(E(A
E;(E8	;F	c                     Rp\        V R,          4      p\        P                  ! VR4      ;_uu_ 4       pVP                  V4       RRR4       \	        WR4       R#   + '       g   i     L; i)   some test data
zcompressed_input_test.gzr   Nrv     some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
eof
)r   rv  r   r   rp  r   rF   rm  r$   s   &   r%   test_compressed_input_gzipru  ;  sM    .D	V00	1B	2t			 
4V, 
	s   AA,	c                 P   Rp\        V R,          4      p\        P                  ! VR4      ;_uu_ 4       pVP                  V4       RRR4        \	        WR4       R#   + '       g   i     L; i  \
         d+   p\        P                  ! \        T4      4        Rp?R# Rp?ii ; i)rr  zcompressed_input_test.bz2rY   Nrs  rs  )r   rs  BZ2Filer   rp  rJ  r   r   )r   rF   rm  r$   es   &    r%   test_compressed_input_bz2ry  D  sv    .D	V11	2B	R			 
t/ 
	  CFs#   AA0 A-	0B%;B  B%c                 8   \         P                  ! R 4      '       g   \        P                  ! R4       Rp\	        V R,          4      p\
        P                  ! VR4      ;_uu_ 4       pVP                  V4       RRR4       \        P                  ! VR 4      ;_uu_ 4       pVP                  4       pVP                  4       V8X  g   Q h RRR4       XP                  '       g   Q h\        P                  ! \        P                  ! V4      R 4      ;_uu_ 4       pVP                  4       pVP                  4       V8X  g   Q h RRR4       VP                  '       g   Q h\        VR4      p\        P                  ! VR 4      ;_uu_ 4       pVP                  4       pVP                  4       V8X  g   Q h RRR4       VP                  '       g   Q hR#   + '       g   i     EL_; i  + '       g   i     EL#; i  + '       g   i     L; i  + '       g   i     La; i)rv  gzip support is not builtz!test_compressed_input_openfile.gzr   Nr   rs  )r
   r  r   r   r   rv  r   r   r2   rl  rt   r   r6   pathlibPath)r   rF   rm  r$   rn  r9   s   &     r%   test_compressed_input_openfiler~  O  s   f%%/0.D	V99	:B	2t			 
 
	!	!"f	-	-$$&~~4''' 
. 		!	!',,r"2F	;	;z$$&~~4''' 
< RA		!	!!V	,	,
$$&~~4''' 
- 888O8# 
		 
.	-	-
 
<	; 
-	,s0   &G(G"(G6(H	G	"G3	6H		H	c                     \         P                  ! VR R7      p\         P                  ! W24      ;_uu_ 4       pVP                  4       pWP8X  g   Q h RRR4       R#   + '       g   i     R# ; irk  )r2   r  rl  r   )rF   rm  rr  rV  rn  ro  s   &&&   r%   check_compressed_concatenatedr  j  sJ    
))BT
"C		!	!#	3	3zoo{{ 
4	3	3	3s   AA,	c                    Rp\        V R,          4      p\        P                  ! VR4      ;_uu_ 4       pVP                  VR,          4       RRR4       \        P                  ! VR4      ;_uu_ 4       pVP                  VR,          4       RRR4       \	        WR4       R#   + '       g   i     L^; i  + '       g   i     L1; i)	rr  zcompressed_input_test2.gzr   :N2   NNr  :r  NNrv  rs  )r   rv  r   r   r  rt  s   &   r%   !test_compressed_concatenated_gzipr  q  s    .D	V11	2B	2t			S	 
	2t			S	 
!$F3	 
			s   B#4B6#B3	6C	c            	         Rp \         P                  ! V 4      p\        P                  ! \        4      ;_uu_ 4        \         P
                  ! VR4       RRR4       \        P                  ! \        4      ;_uu_ 4        \         P
                  ! VR4       RRR4       \         P
                  ! VR4      ;_uu_ 4       p\        P                  ! \        RR7      ;_uu_ 4        VP                  4        RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L@; i  + '       g   i     R# ; i)r  unknown_compressionNrv  zzlib inflate failedr0   s   foofoofoofoofoofoofoofoofoofoo)	r2   r   r   r)   r   rl  r8   r  r   )rF   rV  rn  s      r%   test_compressed_input_invalidr  |  s    D
//$
C	z	"	"
  &;< 
#	y	!	!
  d+ 
" 
	!	!#v	.	.*]]7*?@@OO A 
/	. 
#	"	!	! A@ 
/	.	.s;   D=D<%D=!D*	2D=D	D'	*D:5D==E	c                 n   \         P                  ! 4       p\         P                  ! W24      ;_uu_ 4       pVP                  '       d   Q hVP	                  4       '       d   Q hVP                  4       '       g   Q hVP                  4       '       d   Q hVP                  V 4       R R R 4       XP                  '       g   Q hVP                  '       g   Q h\        VR4      ;_uu_ 4       pVP                  VP                  4       4       R R R 4       R #   + '       g   i     Lv; i  + '       g   i     R # ; i)Nr   )
r2   r  CompressedOutputStreamr6   r   r   rL   r   r   r5   )rF   rm  rr  rV  rn  r$   s   &&&   r%   make_compressed_outputr    s    



!C		"	"3	4	4
$$$$$&&((((""$$$$&&(((( 
5 ::::	b$1	 
 
5	4 
s)   *DD7DD& D#D 	#D4	c                     Rp\        V R,          4      p\        WR4       \        P                  ! VR4      ;_uu_ 4       pVP	                  4       pWA8X  g   Q h RRR4       R#   + '       g   i     R# ; i)rr  zcompressed_output_test.gzrv  r   Nrs  )r   r  rv  r   r   )r   rF   rm  r$   ro  s   &    r%   test_compressed_output_gzipr    sX    .D	V11	2B4V,	2t		ffh{{ 
			s    A$$A5	c                 `   Rp\        V R,          4      p \        WR4       \
        P                  ! VR4      ;_uu_ 4       pVP                  4       pWQ8X  g   Q h RRR4       R#   \         d*   p\        P                  ! \        T4      4        Rp?LrRp?ii ; i  + '       g   i     R# ; i)rr  zcompressed_output_test.bz2rs  NrA   rs  )r   r  rJ  r   r   rs  rw  r   )r   rF   rm  rx  r$   ro  s   &     r%   test_compressed_output_bz2r    s    .D	V22	3Bt/ 
R		ffh{{ 
	  CF			s#   A% B%B0BBB-	c           	      "   \         P                  ! R 4      '       g   \        P                  ! R4       \        P
                  ! V R,          R 4      ;_uu_ 4       pVP                  R4       RRR4       V R,          P                  R4      ;_uu_ 4       p\        P
                  ! VR 4      ;_uu_ 4       pVP                  R4       RRR4       RRR4       R#   + '       g   i     Lt; i  + '       g   i     L-; i  + '       g   i     R# ; i)rv  r{  zctor.gzs   testNzctor2.gzr   )r
   r  r   r   r2   r  r   r   )r   rQ   r$   s   &  r%   test_output_stream_constructorr    s    f%%/0		"	"6I#5v	>	>&W 
?
:
	#	#D	)	)Q&&q&11VLL! 2 
*	) 
?	> 21 
*	)	)s0   C C=3C*	C=C'	*C:5C==D	zfile.gzzpath/to/file.zstc                    \         P                  ! V4      '       gX   \        P                  ! \        P
                  P                  4      ;_uu_ 4        \         P                  ! V 4       R R R 4       R # \         P                  ! V 4      p\        V\         4      '       g   Q hVP                  V8X  g   Q hR #   + '       g   i     R # ; ir(   )
r
   r  r   r)   r2   libArrowNotImplementedErrordetectr   r  )r   expected_compressionr~  s   && r%   test_compression_detectionr    s     233]]266::;;LL <; T"%''''zz1111 <;;s   B77C	c                     \         P                  ! \        4      ;_uu_ 4        \        P                  ! R 4       RRR4       \         P                  ! \
        4      ;_uu_ 4        \        R4       RRR4       \         P                  ! \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     L~; i  + '       g   i     L[; i  + '       g   i     R# ; i)unknownN)r   r)   r   r
   r  r8   r+   r,   r%   test_unknown_compression_raisesr    sx    	z	"	"9% 
#	y	!	!d 
"	z	"	"i 
#	"	 
#	"	!	!	"	"	"s#   B0$CC0C 	C	C'	c                 ^   \         P                  ! V 4      '       g   \        P                  ! V  R 24       Rp\        P
                  ! 4       p\        P                  ! W 4      ;_uu_ 4       pVP                  V4       RRR4       VP                  4       p\        V4      \        V4      8  g   Q h\        P                  ! V4      p\        P                  ! W 4      ;_uu_ 4       pVP                  4       pWQ8X  g   Q h RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r{  Nrs  )r
   r  r   r   r2   r  r  r   r5   r4   r   rl  r   )rr  rF   rV  rn  cdataro  s   &     r%   test_compressed_roundtripr    s     k**{m#89:.D



!C		"	"3	4	4
 
5 LLNEu:D	!!!
//%
 C		!	!#	3	3zoo{{ 
4	3 
5	4 
4	3	3s   +D$DD	D,	c                    \         P                  ! V 4      '       g   \        P                  ! V  R 24       \        P
                  P                  \        P                  ! . RO4      .R.4      p\        P                  ! 4       p\        P                  ! W 4      p\        P                  ! W1P                  4      pVP                  V^R7       VP                  4        VP                  4        VP                  4       p\        P                  ! \        P                   ! V4      V 4      p\        P"                  ! V4      P%                  4       pWa8X  g   Q hR# )r{  r  )max_chunksizeN)r  r   r   r   r  )r
   r  r   r   r2   Tabler  r   r  r  r  r  write_tabler7   r5   rl  r   RecordBatchStreamReaderread_all)rr  tablerV  rQ   r8  r9   	got_tables   &      r%   "test_compressed_recordbatch_streamr    s    
 k**{m#89: HH  "((?";!<seDE



!C&&s8F''=F
uA.
LLN
LLN
,,.C%%booc&:KHF**62;;=Ir,   u   Dès Noël où un zéphyr haï me vêt de glaçons würmiens je dîne d’exquis rôtis de bœuf au kir à l’aÿ d’âge mûr & cætera !c                 T   \        V4      p\        P                  ! \        P                  ! V P	                  V4      4      W4      p. p VP                  \        V4      4      pVP                  V4       V'       d   K6   RP                  T4      pTP                  T4      T 8X  g   Q hR# )Tr,   N)
iterr2   transcoding_input_streamr   r0  r   nextr  r   r  )rF   src_encodingdest_encodingchunk_sizesrQ   outr9   s   &&&&   r%   check_transcodingr    s    {#K((
L12%F C
kk${+,

3s
((3-C::m$,,,r,   zsrc_encoding, dest_encodingc           	      z    \        \        WR ^ .4       \        \        W\        P                  ! . RO4      4       R# )r   N)r  r   r   r  )r  unicode_transcoding_example	itertoolscycle)r  r  s   &&r%   test_transcoding_input_streamr    s4     1"D!9> 1"ool35r,   c                 l    \         P                  ! R 4      p\         P                  ! W V4      VJ g   Q hR# )s   abc123N)r2   r   r  r  r  rQ   s   && r%   test_transcoding_no_opsr  +  s7    
 __Y'F&&m-067 7 7r,   c                    \         P                  ! \         P                  ! R P                  V 4      4      V V4      p\        P
                  ! \        4      ;_uu_ 4        VP                  ^4       RRR4       R#   + '       g   i     R# ; i)u   ĀN)r2   r  r   r0  r   r)   UnicodeEncodeErrorr   r  s   && r%   test_transcoding_encoding_errorr  5  s[     ((
56F 
)	*	*A 
+	*	*	*s   A::B	c                     \         P                  ! \         P                  ! R 4      V V4      p\        P                  ! \
        4      ;_uu_ 4        VP                  ^4       RRR4       R#   + '       g   i     R# ; i)s   N)r2   r  r   r   r)   UnicodeErrorr   r  s   && r%   test_transcoding_decoding_errorr  C  sR     ((
+,F 
|	$	$A 
%	$	$	$s   A++A<	c                     Rp \         P                  ! V 4      \        V 4      3 F0  p\         P                  ! V4      pVP	                  4       V 8X  d   K0  Q h	  \
        P                  ! V 4      p\         P                  ! \        V4      4      pVP	                  4       V8X  g   Q h\         P                  ! \        V4      RR7      pVP	                  4       V 8X  g   Q hR# rr  rv  rr  Nrs  )r2   r   rs   input_streamr   rv  r  )rF   argrQ   gz_datas       r%   test_input_stream_bufferr  T  s    .DT"Jt$45%{{}$$$ 6 mmD!G__Z01F;;=G###__Z0fEF;;=D   r,   c                       ! R  R4      p \         P                  ! V ! 4       4      pVP                  ^4      R8X  g   Q hR# )c                   @   a  ] tR tRt o R t]R 4       tRR ltRtV t	R# )1test_input_stream_duck_typing.<locals>.DuckReaderid  c                    R # r(   r+   rj   s   &r%   r7   7test_input_stream_duck_typing.<locals>.DuckReader.closef  rm   r,   c                    R # ro   r+   rj   s   &r%   r6   8test_input_stream_duck_typing.<locals>.DuckReader.closedi  rq   r,   Nc                    R # )   hellor+   )rk   rI   s   &&r%   r   6test_input_stream_duck_typing.<locals>.DuckReader.readm  s    r,   r+   r(   )
rv   rw   rx   ry   r7   rz   r6   r   r{   r|   r}   s   @r%   r~   r  d  s(     	 
	 
		 	r,   r~   r  N)r2   r  r   )r~   rQ   s     r%   test_input_stream_duck_typingr  b  s4    
 
 __Z\*F;;q>X%%%r,   c                 
   RpV R,          p\        \        V4      R4      ;_uu_ 4       pVP                  V4       RRR4       \        P                  ! V4      pVP                  4       V8X  g   Q h\        P                  ! \        V4      4      pVP                  4       V8X  g   Q h\        P                  ! \        P                  ! \        V4      4      4      pVP                  4       V8X  g   Q hR#   + '       g   i     L; i)rr  r  r   Nrs  )r   r   r   r2   r  r   r|  r}  )r   rF   	file_pathr$   rQ   s   &    r%   test_input_stream_file_pathr  t  s    .D'I	c)nd	#	#q	 
$ __Y'F;;=D   __S^,F;;=D   __W\\#i.9:F;;=D    
$	#s   C22D	c                    Rp\         P                  ! V4      pV R,          p\        \        V4      R4      ;_uu_ 4       pVP	                  V4       RRR4       \
        P                  ! V4      pVP                  4       V8X  g   Q h\
        P                  ! \        V4      4      pVP                  4       V8X  g   Q h\
        P                  ! \        P                  ! \        V4      4      4      pVP                  4       V8X  g   Q h\
        P                  ! VRR7      pVP                  4       V8X  g   Q h\
        P                  ! VRR7      pVP                  4       V8X  g   Q hR#   + '       g   i     EL; i)rr  zinput_stream.gzr   Nrv  r  rs  
rv  r  r   r   r   r2   r  r   r|  r}  r   rF   r  r  r$   rQ   s   &     r%   &test_input_stream_file_path_compressedr    s   .DmmD!G**I	c)nd	#	#q	 
$ __Y'F;;=D   __S^,F;;=D   __W\\#i.9:F;;=D   __YF;F;;=D   __YD9F;;=G### 
$	#	#s   E&&E7	c                    R	pV R,          p\        \        V4      R4      ;_uu_ 4       pVP                  V4       RRR4       \        P                  ! V^ R7      p\        V\        P                  4      '       g   Q hVP                  4       V8X  g   Q h\        P                  ! \        V4      ^@R7      p\        V\        P                  4      '       g   Q hVP                  4       V8X  g   Q h\        P                  ! \        P                  ! \        V4      4      RR7      p\        V\        P                  4      '       g   Q hVP                  4       V8X  g   Q h\        P                  ! V^ R7      p\        V\        P                  4      '       g   Q hRp\        P                  ! \        VR7      ;_uu_ 4        \        P                  ! VR
R7       RRR4       \        P                  ! \        4      ;_uu_ 4        \        P                  ! VRR7       RRR4       R#   + '       g   i     EL; i  + '       g   i     Li; i  + '       g   i     R# ; i)rr  zinput_stream.bufferedr   NrR  rZ  $Buffer size must be larger than zeror0   millionrs  r  )r   r   r   r2   r  r   rU  r   r|  r}  r  r   r)   r   r8   )r   rF   r  r$   rQ   unbuffered_streamrT  s   &      r%   $test_input_stream_file_path_bufferedr    s   .D00I	c)nd	#	#q	 
$ __YB7Ffb445555;;=D   __S^<Ffb445555;;=D   __W\\#i.9tLFfb445555;;=D   	qA'3333
0C	z	-	-
	r2 
.	y	!	!
	y9 
"	!' 
$	#	#" 
.	-	!	!	!s#   H"<H6?I	"H3	6I		I	c                 D   Rp\         P                  ! V4      pV R,          p\        \        V4      R4      ;_uu_ 4       pVP	                  V4       RRR4       \
        P                  ! V^ RR7      pVP                  4       V8X  g   Q h\
        P                  ! \        V4      ^@R7      pVP                  4       V8X  g   Q h\
        P                  ! \        P                  ! \        V4      4      RR7      pVP                  4       V8X  g   Q hR#   + '       g   i     L; i)	rr  z'input_stream_compressed_and_buffered.gzr   Nrv  rS  rr  rR  rZ    some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
some test data
eof
r  r  s   &     r%   3test_input_stream_file_path_compressed_and_bufferedr    s    /DmmD!GBBI	c)nd	#	#q	 
$ __YBFKF;;=D   __S^<F;;=D   __W\\#i.9tLF;;=D    
$	#s   DD	c                    Rp\        V4      p\        P                  ! V4      pVP                  4       V8X  g   Q h\        P
                  ! V4      p\        V4      p\        P                  ! V4      pVP                  4       V8X  g   Q hVP                  ^ 4       \        P                  ! VRR7      pVP                  4       V8X  g   Q hV R,          p\        \        V4      R4      ;_uu_ 4       pVP                  V4       RRR4       \        \        V4      R4      ;_uu_ 4       p\        P                  ! V4      pVP                  4       V8X  g   Q h RRR4       R#   + '       g   i     Lf; i  + '       g   i     R# ; i)rr  rv  r  r  r   Nr   rs  )
r   r2   r  r   rv  r  r   r   r   r   )r   rF   r   rQ   r  r  r$   s   &      r%   test_input_stream_python_filer    s   .D
$-C__S!F;;=D   mmD!G
'
C__S!F;;=G###HHQK__Sf5F;;=D   'I	c)nd	#	#q	 
$	c)nd	#	#q#{{}$$$ 
$	# 
$	#	#	#	#s   /E&.E2E/	2F	c                  &   Rp \         P                  ! V 4      p\        P                  ! V4      p\        P                  ! V4      pW2J g   Q h\        P                  ! V4      p\        P                  ! VRR7      pVP                  4       V 8X  g   Q hR# r  )rv  r  r2   r   r  r   )rF   r  r   rQ   s       r%   test_input_stream_native_filer    so    .DmmD!G__W%F__V$F__W%F__V8F;;=D   r,   c           	      b   \        R 4      p\        P                  ! \        4      ;_uu_ 4        \        P
                  ! VRR7       RRR4       \        4       \        4       3 FD  p\        P                  ! \        4      ;_uu_ 4        \        P
                  ! V4       RRR4       KF  	  \        4       ;_uu_ 4        \        P
                  ! R4       RRR4       \        \        V R,          4      R4      ;_uu_ 4       p\        P                  ! \        RR7      ;_uu_ 4        \        P
                  ! V4       RRR4       RRR4       R#   + '       g   i     EL; i  + '       g   i     EK  ; i  + '       g   i     L; i  + '       g   i     LV; i  + '       g   i     R# ; i)	r,   r  r  NrN  new_filer   zreadable file expectedr0   )rs   r   r)   r   r2   r  r`   r   r8   r-   r   r   )r   r9   r  r$   s   &   r%   test_input_stream_errorsr    s    
S/C	z	"	"
/ 
# XZ(]]9%%OOC  &% ) 
	 	 
+, 
! 
c&:%&	-	-]]9,DEEOOA F 
.	- 
#	"	" &%% 
!	  FE 
.	-	-sG   EE"=E7 %F%F
	<FE	"E47F	
FFF.	c                  P   Rp \        \        V 4      4      p\        P                  ! \        P                  ! V4      4      pVP                  V 4       W8X  g   Q h\        \        V 4      4      p\        P                  ! \        V4      4      pVP                  V 4       W8X  g   Q hR# )rr  Nrs  )r`   r4   r2   output_streamr   r   rs   )rF   r9   rQ   s      r%   test_output_stream_bufferr    s|    .D
CI
Cbll3/0F
LL;;
CI
Cjo.F
LL;;r,   c                       ! R  R4      p V ! 4       p\         P                  ! V4      pVP                  R4      '       g   Q hVP                  P	                  4       P                  4       R8X  g   Q hR# )c                   B   a  ] tR tRt o R tR t]R 4       tR tRt	V t
R# )2test_output_stream_duck_typing.<locals>.DuckWriteri  c                :    \         P                  ! 4       V n        R # r(   )r2   r  r9   rj   s   &r%   __init__;test_output_stream_duck_typing.<locals>.DuckWriter.__init__  s    ,,.DHr,   c                    R # r(   r+   rj   s   &r%   r7   8test_output_stream_duck_typing.<locals>.DuckWriter.close	  rm   r,   c                    R # ro   r+   rj   s   &r%   r6   9test_output_stream_duck_typing.<locals>.DuckWriter.closed  rq   r,   c                <    V P                   P                  V4       R # r(   )r9   r   )rk   rF   s   &&r%   r   8test_output_stream_duck_typing.<locals>.DuckWriter.write  s    HHNN4 r,   r  N)rv   rw   rx   ry   r  r7   rz   r6   r   r{   r|   r  s   @r%   
DuckWriterr    s-     	/	 
	 
		! 	!r,   r  r  N)r2   r  r   r9   r5   r   )r  duck_writerrQ   s      r%   test_output_stream_duck_typingr    s^    ! ! ,Kk*F<<!!!!??##%002h>>>r,   c                     RpV R,          pR pV! W!4       V! \        V4      V4       V! \        P                  ! \        V4      4      V4       R# )rr  r  c                 @   \         P                  ! V 4      ;_uu_ 4       pVP                  V4       R R R 4       \        \	        V 4      R4      ;_uu_ 4       pVP                  4       V8X  g   Q h R R R 4       R #   + '       g   i     LP; i  + '       g   i     R # ; iNr   r2   r  r   r   r   r   )r  rF   rQ   r$   s   &&  r%   
check_data0test_output_stream_file_path.<locals>.check_data  sh    i((FLL )#i.$''1668t### (' )('''s   A9B9B		B	Nrs  )r   r|  r}  r   rF   r  r  s   &   r%   test_output_stream_file_pathr    sE    .D(I$ ys9~t$w||C	N+T2r,   c           	      V   R	pV R,          pR p\         P                  ! V! W!4      4      V8X  g   Q h\         P                  ! V! \        V4      V4      4      V8X  g   Q h\         P                  ! V! \        P                  ! \        V4      4      V4      4      V8X  g   Q h\         P                  ! V! W!RR7      4      V8X  g   Q hV! W!RR7      V8X  g   Q h\
        P                  ! \        RR7      ;_uu_ 4        V! W!RR7      V8X  g   Q h RRR4       R#   + '       g   i     R# ; i)
rr  zoutput_stream.gzc                 2   \         P                  ! V 3/ VB ;_uu_ 4       pVP                  V4       R R R 4       \        \	        V 4      R4      ;_uu_ 4       pVP                  4       uuR R R 4       #   + '       g   i     LH; i  + '       g   i     R # ; ir  r  r  rF   kwargsrQ   r$   s   &&,  r%   r  ;test_output_stream_file_path_compressed.<locals>.check_data-  b    i2622fLL 3#i.$''1668 (' 32'''   A2B2B	B	rv  r  NzInvalid value for compressionr0   rabbitrs  )rv  r  r   r|  r}  r   r)   r   r  s   &   r%   'test_output_stream_file_path_compressedr  (  s   .D++I ??:i674?????:c)nd;<DDD??7<<I/68;?@ @ @ ??979<@A A Ai48D@@@	z)H	I	I)x@DHHH 
J	I	I	Is   :DD(	c                    RpV R,          pR p\         P                  ! V^ R7      p\        V\         P                  4      '       g   Q hRp\        P
                  ! \        VR7      ;_uu_ 4        V! W!R	R7      V8X  g   Q h RRR4       V! W!^ R7      V8X  g   Q hV! W!RR7      V8X  g   Q hV! \        V4      V^ R7      V8X  g   Q hV! \        P                  ! \        V4      4      V^ R7      pWa8X  g   Q hR#   + '       g   i     L; i)
rr  output_stream.bufferedc                    \         P                  ! V 3/ VB ;_uu_ 4       pVP                  R ^ 4      ^ 8  d#   \        V\         P                  4      '       g   Q hVP                  V4       RRR4       \        \        V 4      R4      ;_uu_ 4       pVP                  4       uuRRR4       #   + '       g   i     LH; i  + '       g   i     R# ; i)rS  Nr   )	r2   r  getr   re  r   r   r   r   r  s   &&,  r%   r  9test_output_stream_file_path_buffered.<locals>.check_dataD  s    i2622fzz-+a/!&"*A*ABBBBLL 3 #i.$''1668 ('	 32 (''s   AB+B>+B;	>C	rR  r  r0   NrZ  rs  i)
r2   r  r   r  r   r)   r   r   r|  r}  )r   rF   r  r  r  rT  r=   s   &      r%   %test_output_stream_file_path_bufferedr  @  s    .D11I ((B'3333
0C	z	-	-)t<DDD 
. i26$>>>i48D@@@c)nd;tCCCS^4dKF>> 
.	-s   /C99D		c                    RpV R,          pR pV! W!^ R7      p\         P                  ! V4      V8X  g   Q hV! W!RR7      p\         P                  ! V4      V8X  g   Q hV! W!RRR7      p\         P                  ! V4      V8X  g   Q hR# )	rr  z(output_stream_compressed_and_buffered.gzc                 2   \         P                  ! V 3/ VB ;_uu_ 4       pVP                  V4       R R R 4       \        \	        V 4      R4      ;_uu_ 4       pVP                  4       uuR R R 4       #   + '       g   i     LH; i  + '       g   i     R # ; ir  r  r  s   &&,  r%   r  Htest_output_stream_file_path_compressed_and_buffered.<locals>.check_data`  r  r  rR  rZ  rv  r  Nr  rv  r  )r   rF   r  r  r=   s   &    r%   4test_output_stream_file_path_compressed_and_bufferedr  [  s    /DCCI 	R8F??6"d***	T:F??6"d***	TvNF??6"d***r,   c                 f    R pV R,          pR pV! W!^ R7      V8X  g   Q hV! W!RR7      V8X  g   Q hR# )rr  r
  c                    \         P                  ! V 3/ VB pVP                  V4       ?\        P                  ! 4        \        \        V 4      R 4      ;_uu_ 4       pVP                  4       uuRRR4       #   + '       g   i     R# ; i)r   N)r2   r  r   r   r   r   r   r   r  s   &&,  r%   r  1test_output_stream_destructor.<locals>.check_dataw  sZ    !!)6v6T


#i.$''1668 ('''s   A77B	rR  rZ  Nr+   r  s   &   r%   test_output_stream_destructorr  p  sE     D11I i15===i48D@@@r,   c                    a  RpV 3R lpV! V4      V8X  g   Q h\         P                  ! V! VRR7      4      V8X  g   Q hR# )rr  c           	        < \        SR ,          4      p\        VR4      ;_uu_ 4       p\        P                  ! V3/ VB ;_uu_ 4       pVP	                  V 4       RRR4       RRR4       \        VR4      ;_uu_ 4       pVP                  4       uuRRR4       #   + '       g   i     LG; i  + '       g   i     LR; i  + '       g   i     R# ; i)output_stream_filer   Nr   )r   r   r2   r  r   r   )rF   r  rm  r$   rQ   r   s   &,   r%   r  2test_output_stream_python_file.<locals>.check_data  s     ../"d^^q!!!.v..&T" /  "d^^q668 ^ /. ^ ^^s/    B,B	B,>B?B)$B,,B<	?C	rv  r  Nrs  r  )r   rF   r  s   f  r%   test_output_stream_python_filer    s@    .D	 dt###??:d?@DHHHr,   c           	      L   \        \        4       4      p\        P                  ! \        4      ;_uu_ 4        \
        P                  ! VR R7       RRR4       \        4       \        4       3 FD  p\        P                  ! \        4      ;_uu_ 4        \
        P                  ! V4       RRR4       KF  	  \        V R,          4      p\        VR4      ;_uu_ 4       p RRR4       \        VR4      ;_uu_ 4       p\        P                  ! \        RR7      ;_uu_ 4        \
        P                  ! V4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     K  ; i  + '       g   i     L; i  + '       g   i     LT; i  + '       g   i     R# ; i)r  r  Nr  r   r   zwritable file expectedr0   )rs   r`   r   r)   r   r2   r  r   r8   r   r   )r   r9   r  rm  r$   s   &    r%   test_output_stream_errorsr    s    
Y[
!C	z	"	"
%0 
# XZ(]]9%%S! &% ) 
Vj 	!B	b$1 
	b$1]]9,DEEQ F 
 
#	" &%% 
 FE 
sG   EEE,7%FE?	3FE	E),E<	?F
FF#	r(   )r  r   r  r  r4  )r  r   r  r4  ))s   checks
   636865636B)s   0s   0730)r,   r,   )T)r   r  )zfile.bz2rs  )zfile.lz4rw  )rs  ru  rv  rw  rx  r.  utf-16r   r.  )r  r!  )r.  z	utf-32-le)r.  z	utf-32-be)r.  r.  )r.  UTF8)r.  ascii)r.  zlatin-1)rs  
contextlibr   ior   r   r   r   r   r  r   rv  r9  r   r|  r   r  r   r   r   numpyr   ImportErrorpyarrow.utilr	   pyarrowr
   r2   r&   r-   r>   rH   markparametrizerU   rZ   r]   re   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+  r2  r9  r>  rX  rm  rq  paramr  r  r  r  r  r  r  r  r  r  r  r  fixturer  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r"  r,  r5  r<  r@  rC  rL  rO  rW  r\  r_  rg  ri  rp  ru  ry  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%   <module>r.     s;  $  % I I  	   	    
     .  "8,B #568' 9 7'T"#
&'8%$6,
" )2(	 3.
4.. 3&',	',
 	 	 ' '" * *(  :0Pf# ) ) 
 

' C CL-`J 
LLV[[&&bff.M.M&N 
	
	) 	;	 ;< 
LLV[[&&bff.M.M&N 
	
	) 	LE	 LE^;('3" ( (*+L  "!B>
, ;!(V-(&D6<~ LLL )K  ?? *<>:"$. & &$1
" 3 3" 
- 
- (( - -  4 4 4 
 
   	" 9\\)f%\\$%v.	< 22 	
	

LLkkrvv'F'FG
) 

" ,	,V - 655 6,+-.7.7 6,.	 6--	 
! 
!&$! $ $(:4 ! ! % %. ! !"
?,3 I I.6 + +(A& I I$ gC  	Bs   \ 	\\