
    AHj`                    P   U d dl mZ d dlZd dlZd dlZd dlZd dlZd dlmZ d dl	m
Z
mZmZmZmZmZ d dlmZ d dlmZ d dlmZ d dlmZmZmZmZmZmZ d dlZd d	lmZ  d d
l!m"Z"m#Z#m$Z$ d dl!m%Z& d dl'm(Z( d dl)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1 d dl2m3Z3m4Z4 er]d dl	m5Z5m6Z6m7Z7m8Z8 d dlm9Z9m:Z:m;Z; d dlm<Z<m=Z= d dl>m?Z?m@Z@ ej                  dk\  rd dlmBZB nd dlCmBZB  e9d      ZD ed      ZE G d de:      ZFej                  dk\  rCi j                         i j                         i j                         gZJdeKd<    eLd eJD              ZM eN       ZOdeKd<   	 dQ	 	 	 dRdZPdSd ZQdTd!ZRd"d"d#	 	 	 	 	 	 	 dUd$ZSd"d%	 	 	 	 	 dVd&ZTd"d%	 	 	 	 	 dWd'ZUd"d%	 	 	 	 	 dXd(ZVdYd)ZWd"d"d#	 	 	 	 	 	 	 dZd*ZXd[d+ZYd\d,ZZ	 dQ	 	 	 	 	 	 	 d]d-Z[d^d.Z\d_d/Z]d_d0Z^d`d1Z_d2d3dad4Z`dbd5Zadcd6Zbddd7Zceded8       Zdedfd9       Zddgd:Zd	 	 	 	 	 	 dhd;Ze ed<      Zf G d= d>eg      Zh ej                  d?      Zj G d@ dAe      Zkekj                  Zmeekj                     Zn	 dQddddB	 	 	 	 	 	 	 	 	 didCZo	 	 	 	 	 	 	 	 	 	 djdDZpd_dEZqd"dF	 	 	 	 	 dkdGZrdldHZsd2dd"dIdJ	 	 	 	 	 	 	 	 	 	 	 dmdKZtd"dLdndMZudodNZv G dO dP      Zwy)p    )annotationsN)Counter)
Collection	GeneratorIterableMappingViewSequenceSized)Enum)BytesIO)Path)TYPE_CHECKINGAnyLiteralNoReturnTypeVaroverload)	functions)_check_for_numpyimport_optional
subprocess)numpy)find_stacklevel)BooleanDateDatetimeDecimalDurationInt64StringTime)FLOAT_DTYPESINTEGER_DTYPES)CallableIteratorMutableMapping
Reversible)	ParamSpecProtocol	TypeGuard)	DataFrameExpr)PolarsDataTypeSizeUnit)      )TypeIsPTc                      e Zd ZddZy)IdentityFunctionc                    y N )selffns     M/root/tools/cai/cai_env/lib/python3.12/site-packages/polars/_utils/various.py__call__zIdentityFunction.__call__D   s        N)r:   Callable[P, T]returnr>   )__name__
__module____qualname__r<   r8   r=   r;   r5   r5   B   s    Hr=   r5   r/      zlist[Reversible[Any]]_viewsc              #  D   K   | ]  }t        t        |              y wr7   )typereversed).0views     r;   	<genexpr>rK   J   s     "KD4#7"Ks    r   _Omittedc                X    t        | t              rt        | j                               S | S r7   )
isinstancedictlistitems)null_valuess    r;   _process_null_valuesrS   P   s(     +t$K%%'((r=   c                    t        | t        t        f      xr t        | t               xs7 t        | t              xs% t
        j                  dk\  xr t        | t              S )NrC   )rN   r   r   r
   r   sysversion_info_reverse_mapping_views)vals    r;   _is_generatorrY   Y   sY    	C)X.	/	N
38N4N 	
c;'	
 ' 83 67r=   c                ,    t        fd| D              S )z9Check whether the given iterable is of the given type(s).c              3  6   K   | ]  }t        |        y wr7   rN   )rI   xeltypes     r;   rK   z"_is_iterable_of.<locals>.<genexpr>f   s     2z!V$2s   )all)rX   r^   s    `r;   _is_iterable_ofr`   d   s    2c222r=   F)	allow_strinclude_seriesc                  |du rt        | t              ryt        |       rHt        | t        j                        r.t        j
                  | j                  t        j                        S |r7t        | t        j                        r| j                  t        j                  k(  S t        | t               xr( t        | t              xr t        | t        t        f      S )z
    Check that `val` is a sequence of strings or paths.

    Note that a single string is a sequence of strings by definition, use
    `allow_str=False` to return False on a single string.
    F)rN   strr   npndarray
issubdtypedtypestr_plSeriesr    bytesr	   r`   r   rX   ra   rb   s      r;   is_path_or_str_sequencern   i   s     Ejc2	#	:c2::#>}}SYY00	JsBII6yyBII%%sE"" 	.sH%	.C$-r=   )rb   c               <   t        |       r7t        | t        j                        r| j                  t        j
                  k(  S |r7t        | t        j                        r| j                  t        j                  k(  S t        | t              xr t        | t              S )z;Check whether the given sequence is a sequence of booleans.)r   rN   re   rf   rh   bool_rj   rk   r   r	   r`   boolrX   rb   s     r;   is_bool_sequencers      sh     C!<yyBHH$$	JsBII6yyBJJ&&c8$Cd)CCr=   c               X   t        |       rHt        | t        j                        r.t        j                  | j
                  t        j                        S |r4t        | t        j                        r| j
                  j                         S t        | t              xr t        | t              S )z;Check whether the given sequence is a sequence of integers.)r   rN   re   rf   rg   rh   integerrj   rk   
is_integerr	   r`   intrr   s     r;   is_int_sequencerx      sn     C!<}}SYY

33	JsBII6yy##%%c8$Bc)BBr=   c                   t        |       xr t        | t        j                        xs; t        | |rt        j
                  t        fnt              xr t        | t               S )zBCheck whether the given input is a numpy array or python sequence.)r   rN   re   rf   rj   rk   r	   rd   rr   s     r;   is_sequencerz      sO     S!Ajbjj&A 3H-XN 	%3$$r=   c                r    t        t        t        |       t              x}t        uxr t	        ||            S r7   )rq   nextiter
NO_DEFAULTrN   )objtpfirsts      r;   is_non_empty_sequence_ofr      s6    tCy*-	-j@ 	"ub! r=   c                  |du rt        | t              ryt        |       rHt        | t        j                        r.t        j
                  | j                  t        j                        S |r7t        | t        j                        r| j                  t        j                  k(  S t        | t              xr t        | t              S )z
    Check that `val` is a sequence of strings.

    Note that a single string is a sequence of strings by definition, use
    `allow_str=False` to return False on a single string.
    F)rN   rd   r   re   rf   rg   rh   ri   rj   rk   r    r	   r`   rm   s      r;   is_str_sequencer      s     Ejc2	#	:c2::#>}}SYY00	JsBII6yyBII%%c8$Bc)BBr=   c                ^    ddl m} t        | |      xr | j                  j	                         S )z9Indicate if the given object is a basic/unaliased column.r   )r,   )polars.exprr,   rN   meta	is_column)r   r,   s     r;   r   r      s$     c4 9SXX%7%7%99r=   c                R    | %t        j                  dt        t                      yy)z6Warn for possibly unintentional comparisons with None.Nz]Comparisons with None always result in null. Consider using `.is_null()` or `.is_not_null()`.)
stacklevel)warningswarnUserWarningr   r   s    r;   warn_null_comparisonr      s$    
{k&(	
 r=   c                V   |xs t         }|j                         r9t        j                  |j                  |j
                  |j                  |d      }nFt        j                  |j                  |j
                  |j                  d      j                  |      }|j                  |       S )z/Fast conversion of the given range to a Series.T)startendsteprh   eager)r   r   r   r   )	r   rv   F	int_ranger   stopr   castalias)namerngrh   ranges       r;   range_to_seriesr      s     NUE))T
 ))

$u+ 	 ;;tr=   c                X    t        | j                  | j                  | j                        S )z.Return the given range as an equivalent slice.)slicer   r   r   )r   s    r;   range_to_slicer      s    CHHchh//r=   c                 t    	 ddl m}   |        x}rd|j                  vryy# t        $ r Y yt        $ r Y yw xY w)Nr   )get_ipythonIPKernelAppFT)IPythonr   configImportErrorAttributeError)r   ipys     r;   _in_notebookr      sL    
' = C 3::-
 	   s   ! 	777c                 J    	 dd l } | j                         S # t        $ r Y yw xY w)Nr   F)marimorunning_in_notebookr   )mos    r;   _in_marimo_notebookr      s+    %%'' s    	""c                r    	 t        | t        t        t        f      rdS t	        |       S # t
        $ r Y yw xY w)zLReturn length of (non-string/dict) sequence; returns None for non-sequences.N)rN   rd   rl   rO   len	TypeErrorr   s    r;   arrlenr      s8    !#UD'9:tHCH s   * 
* 	66T)check_not_directoryc                   t         j                  j                  |       } |rOt         j                  j                  |       r0t         j                  j	                  |       rd| d}t        |      | S )z>Create a string path, expanding the home directory if present.zexpected a file path; z is a directory)ospath
expanduserexistsisdirIsADirectoryError)r   r   msgs      r;   normalize_filepathr      sY     77d#DGGNN4 GGMM$&tho>$$Kr=   c                h    t        | t              r| j                  d      } t        d | D              S )zASimple version parser; split into a tuple of ints for comparison..c           
   3  n   K   | ]-  }t        t        j                  d dt        |                   / yw)z\D N)rw   resubrd   )rI   vs     r;   rK   z parse_version.<locals>.<genexpr>  s&     AARVVE2s1v./As   35)rN   rd   splittuple)versions    r;   parse_versionr     s+    '3--$AAAAr=   c                t    t               }|j                  }| D cg c]  }||v r ||      r| c}S c c}w )zMReturn unique list of sequence values, maintaining their order of appearance.)setadd)valuesseenadd_r   s       r;   ordered_uniquer     s2    UD88D<!a4i47A<<<s   	555c                    t               }g }| D ]0  }|j                  ||v r| ||   dz
   n|       ||xx   dz  cc<   2 |S )zGEnsure name uniqueness by appending a counter to subsequent duplicates.   )r   append)namesr   dedupednms       r;   deduplicate_namesr     sV    %,YDG d
"d2hl^,CRA Nr=   c                     y r7   r8   szunits     r;   scale_bytesr   %  s    9<r=   c                     y r7   r8   r   s     r;   r   r   )  s    36r=   c                v    |dv r| S |dv r| dz  S |dv r| dz  S |dv r| dz  S |dv r| d	z  S d
|}t        |      )zEScale size in bytes to other size units (eg: "kb", "mb", "gb", "tb").>   brl   >   kb	kilobytesi   >   mb	megabytesi   >   gb	gigabytesi   @>   tb	terabytesl        z9`unit` must be one of {'b', 'kb', 'mb', 'gb', 'tb'}, got )
ValueError)r   r   r   s      r;   r   r   -  sq    ~		$	$Dy	$	$G|	$	$G|	$	$G|KD8Tor=   c           
        | j                         s8| j                  j                         D ]  }|t        k7  sd|}t	        |       h d}d}dddd||dz  |dz  dz  |dz  d	z  |dz  d	z  d
z  d	d)fd}i }|j                         D ]  \  }}|
|j                         t        k(  r
t        |j                        }	t        j                  |      j                  j                  dd      }
t        j                  |
j                  j                         dk(        j                  |
dz         j!                  |
dz         j                  j#                  dd      j                  j%                  |	d      ||<   t'        |dd      ||   j(                  j+                  |j,                        ||<   ,|t.        k(  r4t        j                  |      j                  j%                  |d      ||<   i|t0        k(  rt        j                  t        j                  |      j                  j                         dk(        j                  t        j                  |      dz         j!                  t        j                  |      dz         j                  j#                  dd      j                  j%                  |d      ||<   8|t2        k(  rVt        j                  |      j5                  |t6              j9                  t3        d            j9                  |      ||<   |t:        k(  r,t        j                  |      j=                  ddd      ||<   |t>        v rt        j                  |      j                  jA                  d d      }tC        j                  |j                  j                         dkD        j                  |      j9                  |      ||<   V|tD        v s|j                         tF        k(  r+t        j                  |      j                  j                  d!d"      }t        j                  |      j                  j                  d!d#      }tC        j                  t        j                  |      j                  jI                  d$      t        j                  |      j                  jK                         jM                  |      z        j                  tC        j                  t        j                  |      j                  j                         dkD        j                  t        j                  |                  j                  t        j                  |      j                  jI                  d%            j                  t        j                  |      j                  j                  d&d'            j!                  tC        jN                  |j                  jA                  d d      |d'(            j9                  t              j9                  |      ||<   || j                  |   k7  st        j                  |      j9                  |      ||<    |r | jP                  d*i |S | S )+a  
    Utility function to cast table repr/string values into frame-native types.

    Parameters
    ----------
    df
        Dataframe containing string-repr column data.
    schema
        DataFrame schema containing the desired end-state types.

    Notes
    -----
    Table repr strings are less strict (or different) than equivalent CSV data, so need
    special handling; as this function is only used for reprs, parsing is flexible.
    z6DataFrame should contain only String repr data; found >   +inf-infinfnani ʚ;r   i  i@B <   i        )	nsusu   µsmssmhdwc                \    | d S t        fdt        j                  d|       D              S )Nc              3  b   K   | ]&  \  }}t        |      |j                            z   ( y wr7   )rw   strip)rI   valuer   duration_scalings      r;   rK   zH_cast_repr_strings_with_schema.<locals>.str_duration_.<locals>.<genexpr>l  s2      E4 E
-djjl;;s   ,/z([+-]?\d+)(\D+))sumr   findall)tdr   s    r;   str_duration_z5_cast_repr_strings_with_schema.<locals>.str_duration_h  s<     z 	
  #%::.@"#E 	
r=   Nz[A-Z ]+$r      z
.000000000	000000000r      z%Y-%m-%d %H:%M:%S.%9f	time_zonez%Y-%m-%d      z%H:%M:%S.%9f)return_dtyper   TF)truefalsez[^\d+-]z^(.*)\D(\d*)$z$1z$2z
^[+-]?\d*$z[eE]z	[^eE\d+-]r   )	separator)r   
str | Noner?   
int | Noner8   ))is_emptyschemar   r    r   rQ   	base_typer   	time_unitr   colrd   replacewhen	len_bytesthen	otherwiser   strptimegetattrdtreplace_time_zoner  r   r!   r   map_elementsr   r   r   replace_strictr#   replace_allrj   r"   r   containsto_lowercaseis_in
concat_strwith_columns)dfr  r   r   special_floatsns_secr   	cast_colsctp_baser   
int_stringinteger_partfractional_partr   s                 @r;   _cast_repr_strings_with_schemar+  >  s   & ;;=))""$ 	%BV|NrfUn$	%
 4N Fb[b[2e^b e^b 1$

 I @12>||~)"2<<0EE!HLL((b9FF155??,23T!l*+Yq;/Sq"S'+BC ! 2{D1=#,Q<??#D#DR\\#RIaLt uuQx||44RD	!tFF1558<<113q89T!%%(\12YquuQx+56Sq"S"n5 ! xEE!H!\-e\DT(4.)T"X	 ! w uuQx66u7UV	!~%UU1X\\55j"E
GGJNN446:;@@LQQRTU ! |#r||~'@ uuQx||334DdK"#%%(,,"6"67G"N GGa--m<%%(,,335;;NKL T"''!%%(,,"8"8":Q">?DDQUU1XNOT!%%(,,//78T!%%(,,..|SABY(,,88RH+&) T&\T"X' !* ryy|# uuQx}}R0	!A@1D ,5?2??'Y'<"<r=   NSc                       e Zd Z	 	 	 	 	 	 ddZy)sphinx_accessorc                x    	 | j                  t        ||      r|      S |      S # t        t        f$ r | cY S w xY wr7   )fgetrN   r   r   )r9   instanceclss      r;   __get__zsphinx_accessor.__get__  sL    
	99&x5 ;>  , 	K	s   % % 99N)r1  r   r2  ztype[NS]r?   r,  )r@   rA   rB   r3  r8   r=   r;   r.  r.    s#    

 
 
	
r=   r.  BUILDING_SPHINX_DOCSc                      e Zd ZdZddZy)
_NoDefaultr~   c                     y)Nz<no_default>r8   )r9   s    r;   __repr__z_NoDefault.__repr__  s    r=   N)r?   rd   )r@   rA   rB   
no_defaultr8  r8   r=   r;   r6  r6    s     Jr=   r6  )named	n_objectsn_framesc                   i }d}t        |t              r|f}|t        j                  }t	        j
                         r }n!t         t              rt                d fd}|/t        |t              r|f}nt        |t              st        |      }t	        j                         }t        |dd      }	 |r||k  rt        |j                  j                               }t        |      D ]7  \  }	}
|	|vs||	|v s 	 ||
      s|
||	<   |%t        |      |k\  s4|c ~S  |j                   }|dz  }|r||k  r~|S # ~w xY w)a@  
    Retrieve f_locals from all (or the last 'n') stack frames from the calling location.

    Parameters
    ----------
    of_type
        Only return objects of this type; can be a single class, tuple of
        classes, or a callable that returns True/False if the object being
        tested is considered a match.
    n_objects
        If specified, return only the most recent `n` matching objects.
    n_frames
        If specified, look at objects in the last `n` stack frames only.
    named
        If specified, only return objects matching the given name(s).
    r   Nc                    t        |       S r7   r\   )r   of_types    r;   matches_typez'_get_stack_locals.<locals>.matches_type  s    c7++r=   f_backr   r   r   r?   rq   )rN   rd   rU   maxsizeinspect
isfunctionr   r   r   currentframer  rP   f_localsrQ   rH   r   rA  )r?  r:  r;  r<  objectsexamined_framesr@  stack_framelocal_itemsr   r   s   `          r;   _get_stack_localsrL    sY   . GO%;;'"gz*GnG	, eS!HEE3'JE&&(K+x6Ko8{3399;<K#K0 'Cg%"+ L,="%GBK ,W1J& #' &,,Kq O o8& N s0   7?E 7E >
E 	E E  E %E Ec           	         t        | t              r| g|z  n| }|t        |      k7  r#d| dt        |       d| d| d	}t        |      |S )zAEnsure the given bool or sequence of bools is the correct length.zthe length of `z` (z ) does not match the length of `))rN   rq   r   r   )r   n_match
value_name
match_namer   r   s         r;   extend_boolrR  '  sf     #-UD"9eWwuF#f+j\S[M :--7LG9AG 	 oMr=   c                    t        t        j                  d      rt        j                  j                         xr t        j                  dk7  xsn dt
        j                  v xsZ dt
        j                  v xsF t
        j                  j                  d      dk(  xs" t
        j                  j                  d      dk(  xs" t
        j                  j                  d	      d
k(  S y)z
    Determine (within reason) if we are in an interactive terminal that supports color.

    Note: this is not exhaustive, but it covers a lot (most?) of the common cases.
    isattywin32ANSICON
WT_SESSIONTERM_PROGRAMvscodeTERMzxterm-256colorPYCHARM_HOSTED1F)hasattrrU   stdoutrT  platformr   environgetr8   r=   r;    in_terminal_that_supports_colourrb  8  s     szz8$ JJ ' >

*>2::-> ::>>.1X=> ::>>&)-==	5 ZZ^^,-4		5 r=   )inject_medianc                   t        | t              r| g} n| g } t        d | D              sd}t        |      t	        d | D              }t	        d | D              }|r|r|d   dk7  rdg|}g ||S )z
    Transforms raw percentiles into our preferred format, adding the 50th percentile.

    Raises a ValueError if the percentile sequence is invalid
    (e.g. outside the range [0, 1])
    c              3  <   K   | ]  }d |cxk  xr dk  nc   yw)r   r   Nr8   rI   ps     r;   rK   z$parse_percentiles.<locals>.<genexpr>Z  s     2Q!2s   z-`percentiles` must all be in the range [0, 1]c              3  ,   K   | ]  }|d k  s	|  yw      ?Nr8   rf  s     r;   rK   z$parse_percentiles.<locals>.<genexpr>^  s     Ba!c'B   
c              3  ,   K   | ]  }|d k\  s	|  ywri  r8   rf  s     r;   rK   z$parse_percentiles.<locals>.<genexpr>_  s     'Ka!s('Krk  r   rj  )rN   floatr_   r   sorted)percentilesrc  r   sub_50_percentilesat_or_above_50_percentiless        r;   parse_percentilesrr  M  s     +u%"m		2k22=oB;BB!''K;'K!K&*DQ*G3*N&)%G,F%G"=="<==r=   c                <    d}t        j                  d| dd|       S )z1Escape a string for use in a Polars (Rust) regex.z\\?()|\[\]{}^$#&~.+*-z([z])z\\\1)r   r   )r   re_rust_metacharss     r;   	re_escaperu  i  s(     166B(),gq99r=   )g      0@g      (@)showoutput_path
raw_outputfigsizec                B   |r| S |t        |      j                  d      s&t               st               sdt        j
                  v rdnd}	 t        j                  ddd|z   g|  j                               }|rt        |      j                  |       |sy t               rd
dlm}m}	  |	 ||            S t               r$d
d l}
|
j#                  |j%                                S t        j
                  j'                  dd       x}td
d l}|j+                  d      5 }|j-                  |       |j/                          |j1                  d|j2                        }t        j4                  |d       d d d        y t7        ddd       d
d lm} d
d lm} |jA                  |       |jC                  tE        |            }|jG                  d       |jI                  |       |jK                          y # t        t        f$ r d	}t        |      d w xY w# 1 sw Y   y xY w)Nz.svgPOLARS_DOT_SVG_VIEWERsvgpngdotz-Nshape=boxz-T)inputzythe graphviz `dot` binary should be on your PATH.(If not installed you can download here: https://graphviz.org/download/)r   )SVGdisplay)suffixz%file%T)shell
matplotlibr   z"should be installed to show graphs)
err_prefix
err_suffix)ry  off)&rd   endswithr   r   r   r`  r   check_outputencoder   FileNotFoundErrorr   write_bytesIPython.displayr  r  r   Htmldecodera  tempfileNamedTemporaryFilewriteflushr  r   runr   matplotlib.imageimagematplotlib.pyplotpyplotfigureimreadr   axisimshowrv  )r~  rv  rw  rx  ry  output_typegraphr   r  r  r   cmdr  filempimgpltimgs                    r;   display_dot_graphr  r  s    
 #K(8(A(A&(I> "bjj0	 	
  	)''M4+#56oo>O
 [%%e,~0s5z""		ww%,,.)++::>>"94@@CM,,F,; 0t

5!

kk(DII6s$/	0
 ;	

 	)'

7
#ll75>*

3
[ *+ )W 	 #D()20
 s   ,G4 AH4HH)qualify_polarsc                   t        | t              r| j                  }| j                  }n,| j                  j                  }| j                  j                  }|r|dk(  s|s|j                  d      r|S | d| S )a  
    Return the module-qualified name of the given object as a string.

    Parameters
    ----------
    obj
        The object to get the qualified name for.
    qualify_polars
        If False (default), omit the module path for our own (Polars) objects.
    builtinszpolars.r   )rN   rG   rA   r@   	__class__
startswith)r   r  moduler   s       r;   qualified_type_namer    sq     #t||))}}%% Z6#4#4Y#?XQtfr=   c                    t        |t        |             s;t        | t        |            s%dt        |       dt        |      }t        |      yy)aB  
    Raise an error if the two arguments are not of the same type.

    The check will not raise an error if one object is of a subclass of the other.

    Parameters
    ----------
    current
        The object the type of which is being checked against.
    other
        An object that has to be of the same type.
    zexpected `other` to be a z, not N)rN   rG   r  r   )currentotherr   s      r;   require_same_typer    s]     eT']+JwU4T'(;G(D'G H&u-02 	 n 5U+r=   c                      e Zd ZdZddZy)_NamespaceSuggestMixinzAMixin that adds suggestions to AttributeError on namespace typos.c                N   dd l }t        t        |             D cg c]  }|j                  d      r| }}|j	                  ||dd      }|r-dt        |       j
                   d|d|d   d	}t        |      dt        |       j
                   d|}t        |      c c}w )
Nr   _r   g333333?)ncutoff'z' object has no attribute z. Did you mean: ?)difflibdirrG   r  get_close_matchesr@   r   )r9   r   r  r   publicmatchesr   s          r;   __getattr__z"_NamespaceSuggestMixin.__getattr__  s     d_FALL4E!FF++D&Ac+Jd4j))**DTHL\]def]g\jjklC S!! d4j))**DTHMCS!! Gs
   B"B"N)r   rd   r?   r   )r@   rA   rB   __doc__r  r8   r=   r;   r  r    s
    K	"r=   r  r7   )rR   z+None | str | Sequence[str] | dict[str, str]r?   z2None | str | Sequence[str] | list[tuple[str, str]])rX   zobject | Iterator[T]r?   zTypeIs[Iterator[T]])rX   zIterable[object]r^   ztype | tuple[type, ...]r?   rq   )rX   objectra   rq   rb   rq   r?   zTypeGuard[Sequence[str | Path]])rX   r  rb   rq   r?   zTypeGuard[Sequence[bool]])rX   r  rb   rq   r?   zTypeGuard[Sequence[int]])rX   r  rb   rq   r?   zTypeGuard[Sequence[Any]])r   Sequence[Any]r   ztype[T]r?   zTypeIs[Sequence[T]])rX   r  ra   rq   rb   rq   r?   zTypeGuard[Sequence[str]]rB  )r   r   r?   None)r   rd   r   r   rh   zPolarsDataType | Noner?   z	pl.Series)r   r   r?   r   )r?   rq   )r   r   r?   r  )r   z
str | Pathr   rq   r?   rd   )r   zSequence[str | int]r?   ztuple[int, ...])r   r  r?   z	list[Any])r   zIterable[str]r?   z	list[str])r   rw   r   r.   r?   zint | float)r   r,   r   r.   r?   r,   )r   z
int | Exprr   r.   r?   zint | float | Expr)r"  r+   r  z dict[str, PolarsDataType | None]r?   r+   )
r?  z6type | Collection[type] | Callable[[Any], bool] | Noner:  zstr | Collection[str] | Noner;  r  r<  r  r?   zdict[str, Any])
r   zbool | Sequence[bool]rO  rw   rP  rd   rQ  rd   r?   zSequence[bool])ro  zSequence[float] | float | Nonerc  rq   r?   zSequence[float])r   rd   r?   rd   )r~  rd   rv  rq   rw  zstr | Path | Nonerx  rq   ry  ztuple[float, float]r?   r
  )r   r   r  rq   r?   rd   )r  r   r  r   r?   r  )x
__future__r   rD  r   r   rU   r   collectionsr   collections.abcr   r   r   r   r	   r
   enumr   ior   pathlibr   typingr   r   r   r   r   r   polarsrj   r   r   polars._dependenciesr   r   r   r   re   polars._warningsr   polars.datatypesr   r   r   r   r   r   r    r!   polars.datatypes.groupr"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   polars._typingr-   r.   rV   r1   typing_extensionsr2   r3   r5   keysr   rQ   rE   __annotations__r   rW   r  rL   rS   rY   r`   rn   rs   rx   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r+  r,  propertyr.  getenvr4  r6  r9  r~   	NoDefaultrL  rR  rb  rr  ru  r  r  r  r  r8   r=   r;   <module>r     s   "  	 	 
         ! N N , ,	 	 	 @  65&7
7"!,#AAI8 I w%'WWY		RXXZ$HF!H""KF"KK #  @D<73 ',E	#=A$. ,1D	D$(DD ,1C	C$(CC ,1	$( ',EC	C#C=ACC$:
 ;?
"7 0
 IM B= 
 < 
 < 
 6 
 6"w=w=;w=w=z T]h  !ryy!78   ""
J))*	 GKF +/ FCF (F 	F
 F FR   	
 ", KP>/>CG>>8: %)#/F	F F #	F
 F !F FR =B 8*" "r=   