
    .hb                    >   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(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/ d dl0m1Z1m2Z2 erfd dl	m3Z3m4Z4m5Z5 d dlm6Z6m7Z7 d dl8m9Z9m:Z: ejv                  dk\  rd dlm<Z< nd dl=m<Z< ejv                  dk\  r	d dlm>Z>m?Z? nd dl=m>Z>m?Z?  e>d      Z@ ed      ZAejv                  dk\  rCi j                         i j                         i j                         gZEdeFd<    eGd eED              ZH	 dM	 	 	 dNdZIdOdZJdPdZKddd	 	 	 	 	 	 	 dQd ZLdd!	 	 	 	 	 dRd"ZMdd!	 	 	 	 	 dSd#ZNdd!	 	 	 	 	 dTd$ZOddd	 	 	 	 	 	 	 dUd%ZPdVd&ZQdWd'ZR	 dM	 	 	 	 	 	 	 dXd(ZSdYd)ZTdZd*ZUdZd+ZVd[d,ZWd-d.d\d/ZXd]d0ZYd^d1ZZd_d2Z[ed`d3       Z\edad4       Z\dbd5Z\	 	 	 	 	 	 dcd6Z] ed7      Z^ G d8 d9e_      Z` ej                  d:      Zb G d; d<e      Zcecj                  Zdeecj                     Zeddd=Zfded>Zg	 dMdddd?	 	 	 	 	 	 	 	 	 dfd@ZheifdgdAZj	 	 	 	 	 	 	 	 	 	 dhdBZkdZdCZlddD	 	 	 	 	 didEZmdjdFZnd-dddGdH	 	 	 	 	 	 	 	 	 	 	 dkdIZoddJdldKZpdmdLZqy)n    )annotationsN)Counter)
Collection	GeneratorIterableMappingViewSequenceSized)Enum)BytesIO)Path)TYPE_CHECKINGAnyCallableLiteralTypeVaroverload)	functions)_check_for_numpyimport_optional
subprocess)numpy)BooleanDateDatetimeDecimalDurationInt64StringTime)FLOAT_DTYPESINTEGER_DTYPES)IteratorMutableMapping
Reversible)	DataFrameExpr)PolarsDataTypeSizeUnit)      )TypeIs)r*   
   )	ParamSpec	TypeGuardPTr*      zlist[Reversible[Any]]_viewsc              #  D   K   | ]  }t        t        |              y wN)typereversed).0views     S/var/www/html/ai-service/venv/lib/python3.12/site-packages/polars/_utils/various.py	<genexpr>r<   C   s     "KD4#7"Ks    c                X    t        | t              rt        | j                               S | S r6   )
isinstancedictlistitems)null_valuess    r;   _process_null_valuesrC   F   s(     +t$K%%'((    c                    t        | t        t        f      xr t        | t               xs7 t        | t              xs% t
        j                  dk\  xr t        | t              S )Nr2   )r>   r   r   r
   r   sysversion_info_reverse_mapping_views)vals    r;   _is_generatorrJ   O   sV    	C)X.	/	N
38N4N 	Uc;'	U'SJs<R,SrD   c                ,    t        fd| D              S )z9Check whether the given iterable is of the given type(s).c              3  6   K   | ]  }t        |        y wr6   r>   )r9   xeltypes     r;   r<   z"_is_iterable_of.<locals>.<genexpr>Y   s     2z!V$2s   )all)rI   rO   s    `r;   _is_iterable_ofrQ   W   s    2c222rD   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)r>   strr   npndarray
issubdtypedtypestr_plSeriesr   bytesr	   rQ   r   rI   rR   rS   s      r;   is_path_or_str_sequencer_   \   s     Ejc2	#	:c2::#>}}SYY00	JsBII6yyBII%%sE"" 	.sH%	.C$-rD   )rS   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   r>   rV   rW   rY   bool_r[   r\   r   r	   rQ   boolrI   rS   s     r;   is_bool_sequencerd   r   sh     C!<yyBHH$$	JsBII6yyBJJ&&c8$Cd)CCrD   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   r>   rV   rW   rX   rY   integerr[   r\   
is_integerr	   rQ   intrc   s     r;   is_int_sequenceri   }   sn     C!<}}SYY

33	JsBII6yy##%%c8$Bc)BBrD   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   r>   rV   rW   r[   r\   r	   rU   rc   s     r;   is_sequencerk      sO     S!Ajbjj&A 3H-XN 	%3$$rD   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)r>   rU   r   rV   rW   rX   rY   rZ   r[   r\   r   r	   rQ   r^   s      r;   is_str_sequencerm      s     Ejc2	#	:c2::#>}}SYY00	JsBII6yyBII%%c8$Bc)BBrD   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'   r>   meta	is_column)objr'   s     r;   rq   rq      s$     c4 9SXX%7%7%99rD   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UserWarningfind_stacklevelrr   s    r;   warn_null_comparisonrz      s$    
{k&(	
 rD   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steprY   eager)r|   r}   r~   r   )	r   rg   F	int_ranger|   stopr~   castalias)namerngrY   ranges       r;   range_to_seriesr      s     NUE))T
 ))

$u+ 	 ;;trD   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//rD   c                 n    	 ddl m}  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AttributeErrorr   s    r;   _in_notebookr      sF    ' 4 44 5 	   s    	444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                h    	 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)r>   rU   r?   len	TypeErrorry   s    r;   arrlenr      s5    !#T{3tASA s   % 
% 	11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>$$KrD   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)rh   resubrU   )r9   vs     r;   r<   z parse_version.<locals>.<genexpr>   s&     AARVVE2s1v./As   35)r>   rU   splittuple)versions    r;   parse_versionr      s+    '3--$AAAArD   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 NrD   c                     y r6    szunits     r;   scale_bytesr     s    9<rD   c                     y r6   r   r   s     r;   r   r     s    36rD   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").>   br]   >   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rD   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r6   )rh   strip)r9   valuer   duration_scalings      r;   r<   zH_cast_repr_strings_with_schema.<locals>.str_duration_.<locals>.<genexpr>U  s2      E4 E
-djjl;;s   ,/z([+-]?\d+)(\D+))sumr   findall)tdr   s    r;   str_duration_z5_cast_repr_strings_with_schema.<locals>.str_duration_Q  s<     z 	
  #%::.@"#E 	
rD   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 | Nonereturn
int | Noner   ))is_emptyschemar   r   r   rA   	base_typer   	time_unitr   colrU   replacewhen	len_bytesthen	otherwiser   strptimegetattrdtreplace_time_zoner   r   r    r   map_elementsr   r   r   replace_strictr"   replace_allr[   r!   r   containsto_lowercaseis_in
concat_strwith_columns)dfr   tpr   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!%%(,,..z3?@Y(,,88RH+&) T&\T"X' !* ryy|# uuQx}}R0	!A@1D ,5?2??'Y'<"<rD   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r6   )fgetr>   r   r   )selfinstanceclss      r;   __get__zsphinx_accessor.__get__  sL    
	99&x5 ;>  , 	K	s   % % 99N)r   r   r!  ztype[NS]r   r  )__name__
__module____qualname__r"  r   rD   r;   r  r    s#    

 
 
	
rD   r  BUILDING_SPHINX_DOCSc                      e Zd ZdZddZy)
_NoDefault
NO_DEFAULTc                     y)Nz<no_default>r   )r  s    r;   __repr__z_NoDefault.__repr__  s    rD   N)r   rU   )r#  r$  r%  
no_defaultr+  r   rD   r;   r(  r(    s     JrD   r(  c                 p   t        t        t        j                        j                        } t        j                         }d}	 |rit        j                  |      }|j                  |       s*t        |j                  dd      x}r#|j                  d      r|j                  }|dz  }n	 ~|S |ri~|S # ~w xY w)z
    Find the first place in the stack that is not inside Polars.

    Taken from:
    https://github.com/pandas-dev/pandas/blob/ab89c53f48df67709a533b6a95ce3d911871a0a8/pandas/util/_exceptions.py#L30-L51
    r   co_qualnameNzsingledispatch.r   )rU   r   r[   __file__parentinspectcurrentframegetfile
startswithr  f_codef_back)pkg_dirframenfnamequalnames        r;   rx   rx     s     $r{{#**+G   "E	AOOE*E($U\\=$GGG''(9:Q H#   H s   A$B2 ,B2 2B5c                F    t        j                  d| |t               d| y)a   
    Issue a warning.

    Parameters
    ----------
    message
        The message associated with the warning.
    category
        The warning category.
    **kwargs
        Additional arguments for `warnings.warn`. Note that the `stacklevel` is
        determined automatically.
    )messagecategoryrt   Nr   ru   rv   rx   )r=  r>  kwargss      r;   issue_warningrA    s'     MM (7HLRrD   )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 r6   rM   )rr   of_types    r;   matches_typez'_get_stack_locals.<locals>.matches_type   s    c7++rD   r6  r   rr   r   r   rb   )r>   rU   rF   maxsizer1  
isfunctionr   r   r   r2  r  r@   f_localsrA   r8   r   r6  )rG  rB  rC  rD  objectsexamined_framesrH  stack_framelocal_itemsr   rr   s   `          r;   _get_stack_localsrQ    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                D    t        j                  | |t                      y )N)r>  rt   r?  )r   r>  s     r;   _polars_warnrS  E  s    MM"$rD   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 `))r>   rb   r   r   )r   n_match
value_name
match_namer   r   s         r;   extend_boolrY  M  sf     #-UD"9eWwuF#f+j\S[M :--7LG9AG 	 oMrD   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)hasattrrF   stdoutr[  platformr   environgetr   rD   r;    in_terminal_that_supports_colourri  ^  s     szz8$ JJ ' >

*>2::-> ::>>.1X=> ::>>&)-==	5 ZZ^^,-4		5 rD   )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   Nr   r9   ps     r;   r<   z$parse_percentiles.<locals>.<genexpr>  s     2Q!2s   z-`percentiles` must all be in the range [0, 1]c              3  ,   K   | ]  }|d k  s	|  yw      ?Nr   rm  s     r;   r<   z$parse_percentiles.<locals>.<genexpr>  s     Ba!c'B   
c              3  ,   K   | ]  }|d k\  s	|  ywrp  r   rm  s     r;   r<   z$parse_percentiles.<locals>.<genexpr>  s     'Ka!s('Krr  r   rq  )r>   floatrP   r   sorted)percentilesrj  r   sub_50_percentilesat_or_above_50_percentiless        r;   parse_percentilesry  s  s     +u%"m		2k22=oB;BB!''K;'K!K&*DQ*G3*N&)%G,F%G"=="<==rD   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_escaper|    s(     166B(),gq99rD   )g      0@g      (@)showoutput_path
raw_outputfigsizec                
   |r| 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+                          |j-                  d|j.                        }t	        j0                  |d       d d d        y t3        ddd       d	d lm} d	d lm} |j=                  |       |j?                  tA        |            }|jC                  d       |jE                  |       |jG                          y # t        t        f$ r d}t        |      d w xY w# 1 sw Y   y xY w)N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displayz.svg)suffixz%file%T)shell
matplotlibr   z"should be installed to show graphs)
err_prefix
err_suffix)r  off)$r   r   r   rg  r   check_outputencoder   FileNotFoundErrorr   write_bytesIPython.displayr  r  r   Htmldecoderh  tempfileNamedTemporaryFilewriteflushr   r   runr   matplotlib.imageimagematplotlib.pyplotpyplotfigureimreadr   axisimshowr}  )r  r}  r~  r  r  output_typegraphr   r  r  r   cmdr  filempimgpltimgs                    r;   display_dot_graphr    s    
 > "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   ,G AG9G69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   )r>   r7   r$  r#  	__class__r4  )rr   r  moduler   s       r;   qualified_type_namer    sq     #t||))}}%% Z6#4#4Y#?XQtfrD   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)r>   r7   r  r   )currentotherr   s      r;   require_same_typer    s]     eT']+JwU4T'(;G(D'G H&u-02 	 n 5U+rD   r6   )rB   z+None | str | Sequence[str] | dict[str, str]r   z2None | str | Sequence[str] | list[tuple[str, str]])rI   zobject | Iterator[T]r   zTypeIs[Iterator[T]])rI   zIterable[object]rO   ztype | tuple[type, ...]r   rb   )rI   objectrR   rb   rS   rb   r   zTypeGuard[Sequence[str | Path]])rI   r  rS   rb   r   zTypeGuard[Sequence[bool]])rI   r  rS   rb   r   zTypeGuard[Sequence[int]])rI   r  rS   rb   r   zTypeGuard[Sequence[Any]])rI   r  rR   rb   rS   rb   r   zTypeGuard[Sequence[str]]rI  )rr   r   r   None)r   rU   r   r   rY   zPolarsDataType | Noner   z	pl.Series)r   r   r   r   )r   rb   )rr   r   r   r   )r   z
str | Pathr   rb   r   rU   )r   zSequence[str | int]r   ztuple[int, ...])r   zSequence[Any]r   z	list[Any])r   zIterable[str]r   z	list[str])r   rh   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   rh   )r=  rU   r>  type[Warning]r@  r   r   r  )
rG  z6type | Collection[type] | Callable[[Any], bool] | NonerB  zstr | Collection[str] | NonerC  r   rD  r   r   zdict[str, Any])r   rU   r>  r  r   r  )
r   zbool | Sequence[bool]rV  rh   rW  rU   rX  rU   r   zSequence[bool])rv  zSequence[float] | float | Nonerj  rb   r   zSequence[float])r   rU   r   rU   )r  rU   r}  rb   r~  zstr | Path | Noner  rb   r  ztuple[float, float]r   r   )rr   r   r  rb   r   rU   )r  r   r  r   r   r  )r
__future__r   r1  r   r   rF   ru   collectionsr   collections.abcr   r   r   r   r	   r
   enumr   ior   pathlibr   typingr   r   r   r   r   r   polarsr[   r   r   polars._dependenciesr   r   r   r   rV   polars.datatypesr   r   r   r   r   r   r   r    polars.datatypes.groupr!   r"   r#   r$   r%   r&   r'   polars._typingr(   r)   rG   r,   typing_extensionsr.   r/   r0   r1   keysr   rA   r4   __annotations__r   rH   rC   rJ   rQ   r_   rd   ri   rk   rm   rq   rz   r   r   r   r   r   r   r   r   r   r   r  r  propertyr  getenvr&  r(  r,  	NoDefaultrx   rA  rQ  rw   rS  rY  ri  ry  r|  r  r  r  r   rD   r;   <module>r     s   "  	 	 
         ! N N ,	 	 	 @DD&7
7"!,
7"//:#AA 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))*	B( GKF +/ FCF (F 	F
 F FT 6A    	
 ", KP>/>CG>>8: %)#/E	E E #	E
 E !E EP =B 8rD   