§
    èjñ  ã                  óÒ   d dl mZ d dl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 d dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZmZ d dlmZmZm Z m!Z! d dl"m#Z#  ej$        e%Š  «        5  d dl&m'Z( dddŠ  «         n# 1 swxY w Y   erd dlm)Z) d dlm*Z*m+Z+m,Z,m-Z- d dlm.Z.m/Z/m0Z0 dddddd;dZ1ddd d<d!Z2 eŠ   «         dd"d=d&Š   «         Z3d'dd(d>d1Z4d'ddd2d?d:Z5dS )@é    )ÚannotationsN)Ú	GeneratorÚIteratorÚSequence)Úreduce)Úchain)ÚTYPE_CHECKINGÚget_args)Ú	functions)ÚConcatMethod)Úreduce_balanced)Úunstable)Úordered_uniqueÚqualified_type_name)Úwrap_dfÚ	wrap_exprÚwrap_ldfÚwrap_s)ÚInvalidOperationError)ÚIterable)Ú	DataFrameÚExprÚ	LazyFrameÚSeries)Ú	FrameTypeÚJoinStrategyÚ
PolarsTypeÚverticalFT)ÚhowÚrechunkÚparallelÚstrictÚitemsúIterable[PolarsType]r   r   r    Úboolr!   r"   Úreturnr   c          
     ó   t          | Š  «        }|sd}t          |Š  «        t          |Š  «        dk    r?t          |d         t          j        t          j        t          j        fŠ  «        r|d         S |                     dŠ  «        r±t          |d         t          j        t          j        fŠ  «        s)|dt          |d         Š  «        }t          |Š  «        t          t          j        d |D Š   «         Š  «        Š  «        }d t          t          |Š  «        Š  «        D Š   «         t          Š  «        }t          t!          d t          d	 |D Š   «         Š  «        Š  «        fd
¬Š  «        s|d}t#          |Š  «        |dk    rdn|                     dŠ  «        d |D Š   «         }	d1fd}
dv rt'          |
|	Š  «        }nt!          |
|	Š  «        } |                     d¬Š  «        j        | }t          |d         t          j        Š  «        }|r|                     Š   «         n|S |d         }ddlm} t          |t          j        Š  «        r|dk    r#t3          t5          j        |Š  «        Š  «        }n|dk    rXt9          t5          j        d |D Š   «         ||dd¬Š  «        Š  «                             |                     Š   «         ¬Š  «        }n»|dk    r#t3          t5          j        |Š  «        Š  «        }n|dk    rXt9          t5          j         d  |D Š   «         ||dd¬Š  «        Š  «                             |                     Š   «         ¬Š  «        }n4|d!k    r%t3          t5          j!        ||¬"Š  «        Š  «        }n	d# "                    d$ tG          tH          Š  «        D Š   «         Š  «        }d%| d&|}t          |Š  «        t          |t          j        Š  «        rì|d'v r9t9          t5          j        |||| %                    d(Š  «        d¬Š  «        Š  «        S |d)v r9t9          t5          j         |||| %                    d(Š  «        d¬Š  «        Š  «        S |d!k    r$t9          t5          j&        |||¬*Š  «        Š  «        S d# "                    d+ tG          tH          Š  «        D Š   «         Š  «        }d,| d&|}t          |Š  «        t          |t          j        Š  «        r9|dk    r"tO          t5          j(        |Š  «        Š  «        }nyd-}t          |Š  «        t          |t          j)        Š  «        r,tU          t5          j+        d. |D Š   «         |Š  «        Š  «        S d/t          |Š  «        d0}t          |Š  «        |r| ,                    Š   «         S |S )2u:  
    Combine multiple DataFrames, LazyFrames, or Series into a single object.

    Parameters
    ----------
    items
        DataFrames, LazyFrames, or Series to concatenate.
    how : {'vertical', 'vertical_relaxed', 'diagonal', 'diagonal_relaxed', 'horizontal', 'align', 'align_full', 'align_inner', 'align_left', 'align_right'}
        Note that `Series` only support the `vertical` strategy.

        * vertical: Applies multiple `vstack` operations.
        * vertical_relaxed: Same as `vertical`, but additionally coerces columns to
          their common supertype *if* they are mismatched (eg: Int32 â Int64).
        * diagonal: Finds a union between the column schemas and fills missing column
          values with `null`.
        * diagonal_relaxed: Same as `diagonal`, but additionally coerces columns to
          their common supertype *if* they are mismatched (eg: Int32 â Int64).
        * horizontal: Stacks Series from DataFrames horizontally and fills with `null`
          if the lengths don't match.
        * align, align_full, align_left, align_right: Combines frames horizontally,
          auto-determining the common key columns and aligning rows using the same
          logic as `align_frames` (note that "align" is an alias for "align_full").
          The "align" strategy determines the type of join used to align the frames,
          equivalent to the "how" parameter on `align_frames`. Note that the common
          join columns are automatically coalesced, but other column collisions
          will raise an error (if you need more control over this you should use
          a suitable `join` method directly).
    rechunk
        Make sure that the result data is in contiguous memory.
    parallel
        Only relevant for LazyFrames. This determines if the concatenated
        lazy computations may be executed in parallel.
    strict
        When how=`horizontal`, require all DataFrames to be the same height, raising an error if not.

    Examples
    --------
    >>> df1 = pl.DataFrame({"a": [1], "b": [3]})
    >>> df2 = pl.DataFrame({"a": [2], "b": [4]})
    >>> pl.concat([df1, df2])  # default is 'vertical' strategy
    shape: (2, 2)
    âââââââ¬ââââââ
    â a   â b   â
    â --- â --- â
    â i64 â i64 â
    âââââââªââââââ¡
    â 1   â 3   â
    â 2   â 4   â
    âââââââŽââââââ

    >>> df1 = pl.DataFrame({"a": [1], "b": [3]})
    >>> df2 = pl.DataFrame({"a": [2.5], "b": [4]})
    >>> pl.concat([df1, df2], how="vertical_relaxed")  # 'a' coerced into f64
    shape: (2, 2)
    âââââââ¬ââââââ
    â a   â b   â
    â --- â --- â
    â f64 â i64 â
    âââââââªââââââ¡
    â 1.0 â 3   â
    â 2.5 â 4   â
    âââââââŽââââââ

    >>> df_h1 = pl.DataFrame({"l1": [1, 2], "l2": [3, 4]})
    >>> df_h2 = pl.DataFrame({"r1": [5, 6], "r2": [7, 8], "r3": [9, 10]})
    >>> pl.concat([df_h1, df_h2], how="horizontal")
    shape: (2, 5)
    âââââââ¬ââââââ¬ââââââ¬ââââââ¬ââââââ
    â l1  â l2  â r1  â r2  â r3  â
    â --- â --- â --- â --- â --- â
    â i64 â i64 â i64 â i64 â i64 â
    âââââââªââââââªââââââªââââââªââââââ¡
    â 1   â 3   â 5   â 7   â 9   â
    â 2   â 4   â 6   â 8   â 10  â
    âââââââŽââââââŽââââââŽââââââŽââââââ

    The "diagonal" strategy allows for some frames to have missing columns,
    the values for which are filled with `null`:

    >>> df_d1 = pl.DataFrame({"a": [1], "b": [3]})
    >>> df_d2 = pl.DataFrame({"a": [2], "c": [4]})
    >>> pl.concat([df_d1, df_d2], how="diagonal")
    shape: (2, 3)
    âââââââ¬âââââââ¬âââââââ
    â a   â b    â c    â
    â --- â ---  â ---  â
    â i64 â i64  â i64  â
    âââââââªâââââââªâââââââ¡
    â 1   â 3    â null â
    â 2   â null â 4    â
    âââââââŽâââââââŽâââââââ

    The "align" strategies require at least one common column to align on:

    >>> df_a1 = pl.DataFrame({"id": [1, 2], "x": [3, 4]})
    >>> df_a2 = pl.DataFrame({"id": [2, 3], "y": [5, 6]})
    >>> df_a3 = pl.DataFrame({"id": [1, 3], "z": [7, 8]})
    >>> pl.concat([df_a1, df_a2, df_a3], how="align")  # equivalent to "align_full"
    shape: (3, 4)
    âââââââ¬âââââââ¬âââââââ¬âââââââ
    â id  â x    â y    â z    â
    â --- â ---  â ---  â ---  â
    â i64 â i64  â i64  â i64  â
    âââââââªâââââââªâââââââªâââââââ¡
    â 1   â 3    â null â 7    â
    â 2   â 4    â 5    â null â
    â 3   â null â 6    â 8    â
    âââââââŽâââââââŽâââââââŽâââââââ
    >>> pl.concat([df_a1, df_a2, df_a3], how="align_left")
    shape: (2, 4)
    âââââââ¬ââââââ¬âââââââ¬âââââââ
    â id  â x   â y    â z    â
    â --- â --- â ---  â ---  â
    â i64 â i64 â i64  â i64  â
    âââââââªââââââªâââââââªâââââââ¡
    â 1   â 3   â null â 7    â
    â 2   â 4   â 5    â null â
    âââââââŽââââââŽâââââââŽâââââââ
    >>> pl.concat([df_a1, df_a2, df_a3], how="align_right")
    shape: (2, 4)
    âââââââ¬âââââââ¬âââââââ¬ââââââ
    â id  â x    â y    â z   â
    â --- â ---  â ---  â --- â
    â i64 â i64  â i64  â i64 â
    âââââââªâââââââªâââââââªââââââ¡
    â 1   â null â null â 7   â
    â 3   â null â 6    â 8   â
    âââââââŽâââââââŽâââââââŽââââââ
    >>> pl.concat([df_a1, df_a2, df_a3], how="align_inner")
    shape: (0, 4)
    âââââââ¬ââââââ¬ââââââ¬ââââââ
    â id  â x   â y   â z   â
    â --- â --- â --- â --- â
    â i64 â i64 â i64 â i64 â
    âââââââªââââââªââââââªââââââ¡
    âââââââŽââââââŽââââââŽââââââ
    úcannot concat empty listé   r   Úalignú strategy is not supported for c              3  ó>   K   | ]}|                      Š   «         V  d S ©N©Úcollect_schema©Ú.0Úes     ú[/home/longshao/multi-rider-rag/.venv/lib/python3.11/site-packages/polars/functions/eager.pyú	<genexpr>zconcat.<locals>.<genexpr>Ÿ   ó.   è è  Ð.QÐ.QÀašq×/?Ò/?Ñ/AÔ/AÐ.QÐ.QÐ.QÐ.QÐ.QÐ.Qó    c                ó    i | ]\  }}||	S © r8   ©r1   ÚkÚvs      r3   ú
<dictcomp>zconcat.<locals>.<dictcomp>¿   ó    ÐGÐGÐG1q!ÐGÐGÐGr6   c                ó@    t          | Š  «        t          |Š  «        z  S r-   ©Úset©ÚxÚys     r3   ú<lambda>zconcat.<locals>.<lambda>Ã   ó    S VV¥cš!¡f€f_ r6   c              3  ó>   K   | ]}|                      Š   «         V  d S r-   r.   r0   s     r3   r4   zconcat.<locals>.<genexpr>Ä   ó.   è è  Ð8Ð8šQa×&Ò&Ñ(Ô(Ð8Ð8Ð8Ð8Ð8Ð8r6   c                ó0                          | dŠ  «        S ©Nr   ©Úget©r:   Úkeys    r3   rD   zconcat.<locals>.<lambda>Æ   ó   ø #'' ! Q-- r6   ©rM   ú- strategy requires at least one common columnÚfullÚalign_c                ó6    g | ]}|                      Š   «         S r8   ©Úlazy©r1   Údfs     r3   ú
<listcomp>zconcat.<locals>.<listcomp>Ò   ó     Ð1Ð1Ð1 RrwwyyÐ1Ð1Ð1r6   rB   úpl.LazyFramerC   r&   c                ó8    |                       |dd¬Š  «        S )NÚ
right_leftT©Úonr   Úmaintain_orderÚcoalesce©Újoin©rB   rC   Úcommon_colsÚjoin_methods     r3   Újoin_fnzconcat.<locals>.join_fnÔ   s-   ø Ø66ØØØØ+Øð ñ ô ð r6   ©rQ   ÚinnerT©Úbyr_   ©ÚQueryOptFlagsr   Úvertical_relaxedc                ó6    g | ]}|                      Š   «         S r8   rT   rV   s     r3   rX   zconcat.<locals>.<listcomp>ó   ó     Ð/Ð/Ð/ 2RWWYYÐ/Ð/Ð/r6   ©r    r!   Úto_supertypesr_   ©ÚoptimizationsÚdiagonalÚdiagonal_relaxedc                ó6    g | ]}|                      Š   «         S r8   rT   rV   s     r3   rX   zconcat.<locals>.<listcomp>   ro   r6   Ú
horizontal©r"   ú, c              3  ó4   K   | ]}t          |Š  «        V  d S r-   ©Úrepr©r1   Úms     r3   r4   zconcat.<locals>.<genexpr>
  ó(   è è  ÐHÐHšA¥ Q¡€ÐHÐHÐHÐHÐHÐHr6   ú DataFrame `how` must be one of {ú}, got ©r   rm   Úrelaxed©rt   ru   ©r!   r"   c              3  ó4   K   | ]}t          |Š  «        V  d S r-   r{   r}   s     r3   r4   zconcat.<locals>.<genexpr>,  r   r6   ú LazyFrame `how` must be one of {ú/Series only supports 'vertical' concat strategyc                ó    g | ]	}|j         
S r8   ©Ú_pyexprr0   s     r3   rX   zconcat.<locals>.<listcomp>8  ó    Ð)CÐ)CÐ)Cžš!¬)Ð)CÐ)CÐ)Cr6   údid not expect type: ú in `concat`©rB   rZ   rC   rZ   r&   rZ   )-ÚlistÚ
ValueErrorÚlenÚ
isinstanceÚplr   r   r   Ú
startswithr   Ú	TypeErrorr   Úfrom_iterableÚ	enumerater   Úsortedr   r   Úremoveprefixr   ÚsortÚselectÚcollectÚpolars.lazyframe.opt_flagsrl   r   ÚplrÚ	concat_dfr   Ú	concat_lfÚ_eagerÚconcat_df_diagonalÚconcat_lf_diagonalÚconcat_df_horizontalrb   r
   r   ÚendswithÚconcat_lf_horizontalr   Úconcat_seriesr   r   Úconcat_exprr    )r#   r   r    r!   r"   ÚelemsÚmsgÚall_columnsÚoutput_column_orderÚjoin_framesrf   ÚlfÚeagerÚfirstrl   ÚoutÚallowedrd   re   rM   s                    @@@r3   ÚconcatrŽ      s>  øøø õd KKEàð Ø(ÝooÐÝ	UqZØa2<¥€­B¬LÐ9ñô ð Qxà
~~gÑÔñ .-Ý% (¥R€\µ2Ž<Ð$@ÑAÔAð 	!ØÐ\Ð\Õ;NÈuÐUVÌxÑ;XÔ;XÐ\Ð\CÝC..Ð õ 5Ô.Ð.QÐ.QÈ5Ð.QÑ.QÔ.QÑQÔQÑRÔRØGÐG¥	­.žÑ*EÔ*EÑ FÔ FÐGÑGÔGÝ" 3iiÐÝÝØ,Ð,ÝÐ8Ð8°%Ð8Ñ8Ô8Ñ8Ô8ñô ð (Ð'Ð'Ð'ð
ñ 
ô 
ð ð 	-ØÐIÐIÐICÝ'šÑ,Ô,Ð,ð
 WnnFFš#×*:Ò*:ž8Ñ*DÔ*Dð 	ð 2Ð1š5Ð1Ñ1Ô1ð	ð 	ð 	ð 	ð 	ð 	ð 	ð Ð+Ð+Ð+å  š+Ñ6Ô6BBõ  Ñ-Ô-BØ@RWW°DWÑ9Ô9Ô@ÐBUÐVå5 8¥R€\Ñ2Ô2Ø$Ð,rzz|||š"Ð,ð !HEà8Ð8Ð8Ð8Ð8Ð8å%Ñ&Ô&ñ NØ*ÒÐÝ#-šÑ.Ô.Ñ/Ô/CCØÐ&Ò&Ð&ÝÝØ/Ð/šÐ/Ñ/Ô/Ø#Ø%Ø"&Ø#'ðñ ô ñô ÷ g M×$8Ò$8Ñ$:Ô$:gÑ;Ô;ð Cð JÒÐÝ#Ô0°Ñ7Ô7Ñ8Ô8CCØÐ&Ò&Ð&ÝÝÔ&Ø/Ð/šÐ/Ñ/Ô/Ø#Ø%Ø"&Ø#'ðñ ô ñô ÷ g M×$8Ò$8Ñ$:Ô$:gÑ;Ô;ð Cð LÒ Ð Ý#Ô2°5ÀÐHÑHÔHÑIÔICCàiiÐHÐHµœ,Ñ1GÔ1GÐHÑHÔHÑHÔHGØN°gÐNÐNÀsÐNÐNCÝS//Ð!å	E2<Ñ	(Ô	(ð -ØÐ2Ð2Ð2ÝÝØØ#Ø%Ø"%§,¢,šyÑ"9Ô"9Ø#'ðñ ô ñô ð ð Ð4Ð4Ð4ÝÝÔ&ØØ#Ø%Ø"%§,¢,šyÑ"9Ô"9Ø#'ðñ ô ñô ð ð LÒ Ð ÝÝÔ(ØØ%Ø!ðñ ô ñô ð ð iiÐHÐHµœ,Ñ1GÔ1GÐHÑHÔHÑHÔHGØN°gÐNÐNÀsÐNÐNCÝS//Ð!å	E29Ñ	%Ô	%ð Ø*ÒÐÝÔ*š5Ñ1Ô1Ñ2Ô2CCàCCÝS//Ð!å	E27Ñ	#Ô	#ð ÝÐ)CÐ)CžUÐ)CÑ)CÔ)CÀWÑMÔMÑNÔNÐNàPÕ&9ž%Ñ&@Ô&@ÐPÐPÐPÝnnÐàð Ø{{}}ÐØJr6   )r   r"   c          
     óø
   t          | Š  «        }|sd}t          |Š  «        t          |Š  «        dk    r?t          |d         t          j        t          j        t          j        fŠ  «        r|d         S |                     dŠ  «        r±t          |d         t          j        t          j        fŠ  «        s)|dt          |d         Š  «        }t          |Š  «        t          t          j        d |D Š   «         Š  «        Š  «        }d t          t          |Š  «        Š  «        D Š   «         t          Š  «        }t          t!          d t          d	 |D Š   «         Š  «        Š  «        fd
¬Š  «        s|d}t#          |Š  «        |dk    rdn|                     dŠ  «        d |D Š   «         }d/fd}dv rt'          ||Š  «        }	nt!          ||Š  «        }	 |	                     d¬Š  «        j        | }	t          |d         t          j        Š  «        }
|
r|	                     Š   «         n|	S |d         }ddlm} t          |t          j        Š  «        rQ|dv rkt3          t5          j        d |D Š   «         dd|                     dŠ  «        d¬Š  «        Š  «                             |                     Š   «         ¬Š  «        }n£|dv rkt3          t5          j        d  |D Š   «         dd|                     dŠ  «        d¬Š  «        Š  «                             |                     Š   «         ¬Š  «        }n4|d!k    r%t?          t5          j         ||¬"Š  «        Š  «        }n	d# !                    d$ tE          tF          Š  «        D Š   «         Š  «        }d%| d&|}t          |Š  «        t          |t          j        Š  «        rì|dv r9t3          t5          j        |dd|                     dŠ  «        d¬Š  «        Š  «        S |dv r9t3          t5          j        |dd|                     dŠ  «        d¬Š  «        Š  «        S |d!k    r$t3          t5          j$        |d|¬'Š  «        Š  «        S d# !                    d( tE          tF          Š  «        D Š   «         Š  «        }d)| d&|}t          |Š  «        t          |t          j        Š  «        r9|d*k    r"tK          t5          j&        |Š  «        Š  «        }nyd+}t          |Š  «        t          |t          j'        Š  «        r,tQ          t5          j)        d, |D Š   «         dŠ  «        Š  «        S d-t          |Š  «        d.}t          |Š  «        |S )0u	  
    Combine multiple DataFrames, LazyFrames, or Series into a single object.

    .. warning::
        This function does not guarantee any specific ordering of rows in the result.
        If you need predictable row ordering, use `pl.concat()` instead.

    Parameters
    ----------
    items
        DataFrames, LazyFrames, or Series to concatenate.
    how : {'vertical', 'vertical_relaxed', 'diagonal', 'diagonal_relaxed', 'horizontal', 'align', 'align_full', 'align_inner', 'align_left', 'align_right'}
        Note that `Series` only support the `vertical` strategy.

        * vertical: Applies multiple `vstack` operations.
        * vertical_relaxed: Same as `vertical`, but additionally coerces columns to
          their common supertype *if* they are mismatched (eg: Int32 â Int64).
        * diagonal: Finds a union between the column schemas and fills missing column
          values with `null`.
        * diagonal_relaxed: Same as `diagonal`, but additionally coerces columns to
          their common supertype *if* they are mismatched (eg: Int32 â Int64).
        * horizontal: Stacks Series from DataFrames horizontally and fills with `null`
          if the lengths don't match.
        * align, align_full, align_left, align_right: Combines frames horizontally,
          auto-determining the common key columns and aligning rows using the same
          logic as `align_frames` (note that "align" is an alias for "align_full").
          The "align" strategy determines the type of join used to align the frames,
          equivalent to the "how" parameter on `align_frames`. Note that the common
          join columns are automatically coalesced, but other column collisions
          will raise an error (if you need more control over this you should use
          a suitable `join` method directly).
    strict
        When how=`horizontal`, require all DataFrames to be the same height, raising an error if not.

    Examples
    --------
    >>> df1 = pl.DataFrame({"a": [1], "b": [3]})
    >>> df2 = pl.DataFrame({"a": [2], "b": [4]})
    >>> pl.union([df1, df2])  # default is 'vertical' strategy
    shape: (2, 2)
    âââââââ¬ââââââ
    â a   â b   â
    â --- â --- â
    â i64 â i64 â
    âââââââªââââââ¡
    â 1   â 3   â
    â 2   â 4   â
    âââââââŽââââââ

    >>> df1 = pl.DataFrame({"a": [1], "b": [3]})
    >>> df2 = pl.DataFrame({"a": [2.5], "b": [4]})
    >>> pl.union([df1, df2], how="vertical_relaxed")  # 'a' coerced into f64
    shape: (2, 2)
    âââââââ¬ââââââ
    â a   â b   â
    â --- â --- â
    â f64 â i64 â
    âââââââªââââââ¡
    â 1.0 â 3   â
    â 2.5 â 4   â
    âââââââŽââââââ

    >>> df_h1 = pl.DataFrame({"l1": [1, 2], "l2": [3, 4]})
    >>> df_h2 = pl.DataFrame({"r1": [5, 6], "r2": [7, 8], "r3": [9, 10]})
    >>> pl.union([df_h1, df_h2], how="horizontal")
    shape: (2, 5)
    âââââââ¬ââââââ¬ââââââ¬ââââââ¬ââââââ
    â l1  â l2  â r1  â r2  â r3  â
    â --- â --- â --- â --- â --- â
    â i64 â i64 â i64 â i64 â i64 â
    âââââââªââââââªââââââªââââââªââââââ¡
    â 1   â 3   â 5   â 7   â 9   â
    â 2   â 4   â 6   â 8   â 10  â
    âââââââŽââââââŽââââââŽââââââŽââââââ

    The "diagonal" strategy allows for some frames to have missing columns,
    the values for which are filled with `null`:

    >>> df_d1 = pl.DataFrame({"a": [1], "b": [3]})
    >>> df_d2 = pl.DataFrame({"a": [2], "c": [4]})
    >>> pl.union([df_d1, df_d2], how="diagonal")
    shape: (2, 3)
    âââââââ¬âââââââ¬âââââââ
    â a   â b    â c    â
    â --- â ---  â ---  â
    â i64 â i64  â i64  â
    âââââââªâââââââªâââââââ¡
    â 1   â 3    â null â
    â 2   â null â 4    â
    âââââââŽâââââââŽâââââââ

    The "align" strategies require at least one common column to align on:

    >>> df_a1 = pl.DataFrame({"id": [1, 2], "x": [3, 4]})
    >>> df_a2 = pl.DataFrame({"id": [2, 3], "y": [5, 6]})
    >>> df_a3 = pl.DataFrame({"id": [1, 3], "z": [7, 8]})
    >>> pl.union([df_a1, df_a2, df_a3], how="align")  # equivalent to "align_full"
    shape: (3, 4)
    âââââââ¬âââââââ¬âââââââ¬âââââââ
    â id  â x    â y    â z    â
    â --- â ---  â ---  â ---  â
    â i64 â i64  â i64  â i64  â
    âââââââªâââââââªâââââââªâââââââ¡
    â 1   â 3    â null â 7    â
    â 2   â 4    â 5    â null â
    â 3   â null â 6    â 8    â
    âââââââŽâââââââŽâââââââŽâââââââ
    >>> pl.union([df_a1, df_a2, df_a3], how="align_left")
    shape: (2, 4)
    âââââââ¬ââââââ¬âââââââ¬âââââââ
    â id  â x   â y    â z    â
    â --- â --- â ---  â ---  â
    â i64 â i64 â i64  â i64  â
    âââââââªââââââªâââââââªâââââââ¡
    â 1   â 3   â null â 7    â
    â 2   â 4   â 5    â null â
    âââââââŽââââââŽâââââââŽâââââââ
    >>> pl.union([df_a1, df_a2, df_a3], how="align_right")
    shape: (2, 4)
    âââââââ¬âââââââ¬âââââââ¬ââââââ
    â id  â x    â y    â z   â
    â --- â ---  â ---  â --- â
    â i64 â i64  â i64  â i64 â
    âââââââªâââââââªâââââââªââââââ¡
    â 1   â null â null â 7   â
    â 3   â null â 6    â 8   â
    âââââââŽâââââââŽâââââââŽââââââ
    >>> pl.union([df_a1, df_a2, df_a3], how="align_inner")
    shape: (0, 4)
    âââââââ¬ââââââ¬ââââââ¬ââââââ
    â id  â x   â y   â z   â
    â --- â --- â --- â --- â
    â i64 â i64 â i64 â i64 â
    âââââââªââââââªââââââªââââââ¡
    âââââââŽââââââŽââââââŽââââââ
    r(   r)   r   r*   r+   c              3  ó>   K   | ]}|                      Š   «         V  d S r-   r.   r0   s     r3   r4   zunion.<locals>.<genexpr>á  r5   r6   c                ó    i | ]\  }}||	S r8   r8   r9   s      r3   r<   zunion.<locals>.<dictcomp>â  r=   r6   c                ó@    t          | Š  «        t          |Š  «        z  S r-   r?   rA   s     r3   rD   zunion.<locals>.<lambda>æ  rE   r6   c              3  ó>   K   | ]}|                      Š   «         V  d S r-   r.   r0   s     r3   r4   zunion.<locals>.<genexpr>ç  rG   r6   c                ó0                          | dŠ  «        S rI   rJ   rL   s    r3   rD   zunion.<locals>.<lambda>é  rN   r6   rO   rP   rQ   rR   c                ó6    g | ]}|                      Š   «         S r8   rT   rV   s     r3   rX   zunion.<locals>.<listcomp>õ  rY   r6   rB   rZ   rC   r&   c                ó8    |                       |dd¬Š  «        S )NÚnoneTr]   ra   rc   s     r3   rf   zunion.<locals>.join_fn÷  s-   ø Ø66ØØØØ%Øð ñ ô ð r6   rg   Fri   rk   r   c                ó6    g | ]}|                      Š   «         S r8   rT   rV   s     r3   rX   zunion.<locals>.<listcomp>  ro   r6   Tr   rp   rr   r   c                ó6    g | ]}|                      Š   «         S r8   rT   rV   s     r3   rX   zunion.<locals>.<listcomp>  ro   r6   rw   rx   ry   c              3  ó4   K   | ]}t          |Š  «        V  d S r-   r{   r}   s     r3   r4   zunion.<locals>.<genexpr>(  r   r6   r   r   r   c              3  ó4   K   | ]}t          |Š  «        V  d S r-   r{   r}   s     r3   r4   zunion.<locals>.<genexpr>J  r   r6   r   r   r   c                ó    g | ]	}|j         
S r8   r   r0   s     r3   rX   zunion.<locals>.<listcomp>V  r   r6   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   rl   r   r   r¡   rŠ   r¢   r€   r   r¥   rb   r
   r   r§   r   rš   r   r   r©   )r#   r   r"   rª   r«   r¬   r­   r®   rf   r¯   r°   r±   rl   r²   r³   rd   re   rM   s                  @@@r3   ÚunionrÃ   B  s÷  øøø õ^ KKEàð Ø(ÝooÐÝ	UqZØa2<¥€­B¬LÐ9ñô ð Qxà
~~gÑÔñ .-Ý% (¥R€\µ2Ž<Ð$@ÑAÔAð 	!ØÐ\Ð\Õ;NÈuÐUVÌxÑ;XÔ;XÐ\Ð\CÝC..Ð õ 5Ô.Ð.QÐ.QÈ5Ð.QÑ.QÔ.QÑQÔQÑRÔRØGÐG¥	­.žÑ*EÔ*EÑ FÔ FÐGÑGÔGÝ" 3iiÐÝÝØ,Ð,ÝÐ8Ð8°%Ð8Ñ8Ô8Ñ8Ô8ñô ð (Ð'Ð'Ð'ð
ñ 
ô 
ð ð 	-ØÐIÐIÐICÝ'šÑ,Ô,Ð,ð
 WnnFFš#×*:Ò*:ž8Ñ*DÔ*Dð 	ð 2Ð1š5Ð1Ñ1Ô1ð	ð 	ð 	ð 	ð 	ð 	ð 	ð Ð+Ð+Ð+å  š+Ñ6Ô6BBõ  Ñ-Ô-BØARWW°EWÑ:Ô:ÔAÐCVÐWå5 8¥R€\Ñ2Ô2Ø$Ð,rzz|||š"Ð,ð !HEà8Ð8Ð8Ð8Ð8Ð8å%Ñ&Ô&ñ IØÐ2Ð2Ð2ÝÝØ/Ð/šÐ/Ñ/Ô/Ø!Ø!Ø"%§,¢,šyÑ"9Ô"9Ø#(ðñ ô ñô ÷ g M×$8Ò$8Ñ$:Ô$:gÑ;Ô;ð Cð Ð4Ð4Ð4ÝÝÔ&Ø/Ð/šÐ/Ñ/Ô/Ø!Ø!Ø"%§,¢,šyÑ"9Ô"9Ø#(ðñ ô ñô ÷ g M×$8Ò$8Ñ$:Ô$:gÑ;Ô;ð Cð LÒ Ð Ý#Ô2°5ÀÐHÑHÔHÑIÔICCàiiÐHÐHµœ,Ñ1GÔ1GÐHÑHÔHÑHÔHGØN°gÐNÐNÀsÐNÐNCÝS//Ð!å	E2<Ñ	(Ô	(ð -ØÐ2Ð2Ð2ÝÝØØ!Ø!Ø"%§,¢,šyÑ"9Ô"9Ø#(ðñ ô ñô ð ð Ð4Ð4Ð4ÝÝÔ&ØØ!Ø!Ø"%§,¢,šyÑ"9Ô"9Ø#(ðñ ô ñô ð ð LÒ Ð ÝÝÔ(ØØ!Ø!ðñ ô ñô ð ð iiÐHÐHµœ,Ñ1GÔ1GÐHÑHÔHÑHÔHGØN°gÐNÐNÀsÐNÐNCÝS//Ð!å	E29Ñ	%Ô	%ð Ø*ÒÐÝÔ*š5Ñ1Ô1Ñ2Ô2CCàCCÝS//Ð!å	E27Ñ	#Ô	#ð ÝÐ)CÐ)CžUÐ)CÑ)CÔ)CÀUÑKÔKÑLÔLÐLàPÕ&9ž%Ñ&@Ô&@ÐPÐPÐPÝnnÐàJr6   )r_   rM   Ústrr_   c               ó4   t          | Š  «        }|sd}t          |Š  «        t          |Š  «        dk    r4t          |d         t          j        t          j        fŠ  «        r|d         S t          |d         t          j        t          j        fŠ  «        s'dt          |d         Š  «        }t          |Š  «        d |D Š   «         }dfd
}t          ||Š  «        }t          |d         t          j        Š  «        }|r| 
                    Š   «         n|S )u`  
    Merge multiple sorted DataFrames or LazyFrames by the sorted key.

    The output of this operation will also be sorted.
    It is the callers responsibility that the frames
    are sorted in ascending order by that key otherwise
    the output will not make sense.

    .. warning::
        This functionality is considered **unstable**. It may be changed
        at any point without it being considered a breaking change.

    Parameters
    ----------
    items
        DataFrames or LazyFrames to merge.
    key
        Key that is sorted.
    maintain_order
        If ``True``, the output is guaranteed to have left-biased ordering
        for equal keys: rows from the left frame appear before rows from
        the right frame when their keys are equal.

    Examples
    --------
    >>> df0 = pl.DataFrame(
    ...     {"name": ["steve", "elise", "bob"], "age": [42, 44, 18]}
    ... ).sort("age")
    >>> df1 = pl.DataFrame(
    ...     {"name": ["anna", "megan", "steve", "thomas"], "age": [21, 33, 17, 20]}
    ... ).sort("age")
    >>> df2 = pl.DataFrame({"name": ["ida", "maya"], "age": [37, 27]}).sort("age")
    >>> pl.merge_sorted([df0, df1, df2], key="age")
    shape: (9, 2)
    ââââââââââ¬ââââââ
    â name   â age â
    â ---    â --- â
    â str    â i64 â
    ââââââââââªââââââ¡
    â steve  â 17  â
    â bob    â 18  â
    â thomas â 20  â
    â anna   â 21  â
    â maya   â 27  â
    â megan  â 33  â
    â ida    â 37  â
    â steve  â 42  â
    â elise  â 44  â
    ââââââââââŽââââââ


    Notes
    -----
    Unless ``maintain_order=True``, no guarantee is given over the output
    row order when the key is equal between dataframes.

    The key must be sorted in ascending order.
    zcannot merge_sort empty listr)   r   z"merge_sorted is not supported for c                ó6    g | ]}|                      Š   «         S r8   rT   rV   s     r3   rX   z merge_sorted.<locals>.<listcomp>«  s     Ð(Ð(Ð(BbggiiÐ(Ð(Ð(r6   rB   rZ   rC   r&   c                ó4    |                       |¬Š  «        S )N)rM   r_   )Úmerge_sorted)rB   rC   rM   r_   s     r3   Ú	reduce_fnzmerge_sorted.<locals>.reduce_fn­  s   ø Ø~~a Sž~ÑHÔHÐHr6   r   )r   r   r   r   r   r   r   r   r   r   r   )	r#   rM   r_   rª   r«   ÚframesrÉ   r¯   r°   s	    ``      r3   rÈ   rÈ   ^  s  øø õB KKEàð Ø,ÝooÐÝ
5zzQ: ešA€hµŽœrŒ|Ð0LÑMÔMØQxåeAh¥€­r¬|Ð <Ñ=Ô=ð ØTÕ3FÀuÈQÄxÑ3PÔ3PÐTÐTÝnnÐà(Ð( %Ð(Ñ(Ô(FðIð Ið Ið Ið Ið Ið Iõ 
 FÑ	+Ô	+BÝuQx¥€Ñ.Ô.EØ Ð(2::<<< bÐ(r6   rQ   )r   Ú
descendingÚ
idx_framesútuple[int, LazyFrame]Úalign_onú	list[str]r   rË   úbool | Sequence[bool]r   c                ó    t          |Š  «        dk    }d fd}ddlm} t          ||Š  «        d	                               |d
¬Š  «        }|r:|                     |                     Š   «         ¬Š  «                             Š   «         }|S )zLCreate a single master frame with all rows aligned on the common key values.éú   Úidx_xrÍ   Úidx_yr&   c           
     ó\    | |c\  }}\  }}||                      |d| ddd¬Š  «        fS )Nú:Tr\   )r   r^   ÚsuffixÚnulls_equalr`   r_   ra   )rÓ   rÔ   Ú_rB   Úy_idxrC   rÎ   r   s         r3   Ú	join_funcz"_alignment_join.<locals>.join_funcÀ  sV   ø ð # EÐA
ØaffØØØØu;;ØØØ'ð ñ 
ô 
ð 
ð 	
r6   r   rk   r)   T)rj   rË   r_   rr   )rÓ   rÍ   rÔ   rÍ   r&   rÍ   )r   Úpolars.lazyframerl   r   r   r   rœ   rU   )rÎ   r   rË   rÌ   Úpost_align_collectrÛ   rl   Újoineds   ``      r3   Ú_alignment_joinrß   µ  s¹   øø õ ZšCÒ/Ðð
ð 
ð 
ð 
ð 
ð 
ð 
ð /Ð.Ð.Ð.Ð.Ð.åIzÑ*Ô*š1Ô-×2Ò2Ø 
ž4ð 3ñ ô Fð ð KØšm×.@Ò.@Ñ.BÔ.BÑCÔC×HÒHÑJÔJØMr6   )r   r   rË   rÊ   úFrameType | Iterable[FrameType]r^   úBstr | Expr | Sequence[str] | Sequence[Expr] | Sequence[str | Expr]r   ú(str | Expr | Sequence[str | Expr] | Noneúlist[FrameType]c                ó   |sg S t          |Š  «        dk    r4t          |d         t          j        t          j        fŠ  «        s|d         }t          |t
          t          fŠ  «        rt          |Š  «        }t          d |D Š   «         Š  «        dk    rd}t          |Š  «        t          |d         t          j        Š  «        }t          | t          Š  «        st          | t          Š  «        s| gn| } d | D Š   «         }d t          |Š  «        D Š   «         }t          ||||d}	t          |	                     Š   «         Š  «        g }
|D ]a\  }}d| fd	|                     Š   «         D Š   «         } |	j        | }||                     |Š  «        }|
                     |Š  «         b|rt#          j        |
Š  «        n|
S )
u#  
    Align a sequence of frames using common values from one or more columns as a key.

    Frames that do not contain the given key values have rows injected (with nulls
    filling the non-key columns), and each resulting frame is sorted by the key.

    The original column order of input frames is not changed unless `select` is
    specified (in which case the final column order is determined from that). In the
    case where duplicate key values exist, the alignment behaviour is determined by
    the given alignment strategy specified in the `how` parameter (by default this
    is a full outer join, but if your data is suitable you can get a large speedup
    by setting `how="left"` instead).

    Note that this function does not result in a joined frame - you receive the same
    number of frames back that you passed in, but each is now aligned by key and has
    the same number of rows.

    Parameters
    ----------
    frames
        Sequence of DataFrames or LazyFrames.
    on
        One or more columns whose unique values will be used to align the frames.
    select
        Optional post-alignment column select to constrain and/or order
        the columns returned from the newly aligned frames.
    descending
        Sort the alignment column values in descending order; can be a single
        boolean or a list of booleans associated with each column in `on`.
    how
        By default the row alignment values are determined using a full outer join
        strategy across all frames; if you know that the first frame contains all
        required keys, you can set `how="left"` for a large performance increase.

    Examples
    --------
    >>> from datetime import date
    >>> df1 = pl.DataFrame(
    ...     {
    ...         "dt": [date(2022, 9, 1), date(2022, 9, 2), date(2022, 9, 3)],
    ...         "x": [3.5, 4.0, 1.0],
    ...         "y": [10.0, 2.5, 1.5],
    ...     }
    ... )
    >>> df2 = pl.DataFrame(
    ...     {
    ...         "dt": [date(2022, 9, 2), date(2022, 9, 3), date(2022, 9, 1)],
    ...         "x": [8.0, 1.0, 3.5],
    ...         "y": [1.5, 12.0, 5.0],
    ...     }
    ... )
    >>> df3 = pl.DataFrame(
    ...     {
    ...         "dt": [date(2022, 9, 3), date(2022, 9, 2)],
    ...         "x": [2.0, 5.0],
    ...         "y": [2.5, 2.0],
    ...     }
    ... )  # doctest: +IGNORE_RESULT
    >>> pl.Config.set_tbl_formatting("UTF8_FULL")  # doctest: +IGNORE_RESULT
    #
    # df1                              df2                              df3
    # shape: (3, 3)                    shape: (3, 3)                    shape: (2, 3)
    # ââââââââââââââ¬ââââââ¬âââââââ      ââââââââââââââ¬ââââââ¬âââââââ      ââââââââââââââ¬ââââââ¬ââââââ
    # â dt         â x   â y    â      â dt         â x   â y    â      â dt         â x   â y   â
    # â ---        â --- â ---  â      â ---        â --- â ---  â      â ---        â --- â --- â
    # â date       â f64 â f64  â      â date       â f64 â f64  â      â date       â f64 â f64 â
    # ââââââââââââââªââââââªâââââââ¡      ââââââââââââââªââââââªâââââââ¡      ââââââââââââââªââââââªââââââ¡
    # â 2022-09-01 â 3.5 â 10.0 â\  ,->â 2022-09-02 â 8.0 â 1.5  â\  ,->â 2022-09-03 â 2.0 â 2.5 â
    # ââââââââââââââŒââââââŒâââââââ€ \/   ââââââââââââââŒââââââŒâââââââ€ \/   ââââââââââââââŒââââââŒââââââ€
    # â 2022-09-02 â 4.0 â 2.5  â_/\,->â 2022-09-03 â 1.0 â 12.0 â_/`-->â 2022-09-02 â 5.0 â 2.0 â
    # ââââââââââââââŒââââââŒâââââââ€  /\  ââââââââââââââŒââââââŒâââââââ€      ââââââââââââââŽââââââŽââââââ
    # â 2022-09-03 â 1.0 â 1.5  â_/  `>â 2022-09-01 â 3.5 â 5.0  â-//-
    # ââââââââââââââŽââââââŽâââââââ      ââââââââââââââŽââââââŽâââââââ
    ...

    Align frames by the "dt" column:

    >>> af1, af2, af3 = pl.align_frames(
    ...     df1, df2, df3, on="dt"
    ... )  # doctest: +IGNORE_RESULT
    #
    # df1                              df2                              df3
    # shape: (3, 3)                    shape: (3, 3)                    shape: (3, 3)
    # ââââââââââââââ¬ââââââ¬âââââââ      ââââââââââââââ¬ââââââ¬âââââââ      ââââââââââââââ¬âââââââ¬âââââââ
    # â dt         â x   â y    â      â dt         â x   â y    â      â dt         â x    â y    â
    # â ---        â --- â ---  â      â ---        â --- â ---  â      â ---        â ---  â ---  â
    # â date       â f64 â f64  â      â date       â f64 â f64  â      â date       â f64  â f64  â
    # ââââââââââââââªââââââªâââââââ¡      ââââââââââââââªââââââªâââââââ¡      ââââââââââââââªâââââââªâââââââ¡
    # â 2022-09-01 â 3.5 â 10.0 â----->â 2022-09-01 â 3.5 â 5.0  â----->â 2022-09-01 â null â null â
    # ââââââââââââââŒââââââŒâââââââ€      ââââââââââââââŒââââââŒâââââââ€      ââââââââââââââŒâââââââŒâââââââ€
    # â 2022-09-02 â 4.0 â 2.5  â----->â 2022-09-02 â 8.0 â 1.5  â----->â 2022-09-02 â 5.0  â 2.0  â
    # ââââââââââââââŒââââââŒâââââââ€      ââââââââââââââŒââââââŒâââââââ€      ââââââââââââââŒâââââââŒâââââââ€
    # â 2022-09-03 â 1.0 â 1.5  â----->â 2022-09-03 â 1.0 â 12.0 â----->â 2022-09-03 â 2.0  â 2.5  â
    # ââââââââââââââŽââââââŽâââââââ      ââââââââââââââŽââââââŽâââââââ      ââââââââââââââŽâââââââŽâââââââ
    ...

    Align frames by "dt" using "left" alignment, but keep only cols "x" and "y":

    >>> af1, af2, af3 = pl.align_frames(
    ...     df1, df2, df3, on="dt", select=["x", "y"], how="left"
    ... )  # doctest: +IGNORE_RESULT
    #
    # af1                 af2                 af3
    # shape: (3, 3)       shape: (3, 3)       shape: (3, 3)
    # âââââââ¬âââââââ      âââââââ¬âââââââ      ââââââââ¬âââââââ
    # â x   â y    â      â x   â y    â      â x    â y    â
    # â --- â ---  â      â --- â ---  â      â ---  â ---  â
    # â f64 â f64  â      â f64 â f64  â      â f64  â f64  â
    # âââââââªâââââââ¡      âââââââªâââââââ¡      ââââââââªâââââââ¡
    # â 3.5 â 10.0 â      â 3.5 â 5.0  â      â null â null â
    # âââââââŒâââââââ€      âââââââŒâââââââ€      ââââââââŒâââââââ€
    # â 4.0 â 2.5  â      â 8.0 â 1.5  â      â 5.0  â 2.0  â
    # âââââââŒâââââââ€      âââââââŒâââââââ€      ââââââââŒâââââââ€
    # â 1.0 â 1.5  â      â 1.0 â 12.0 â      â 2.0  â 2.5  â
    # âââââââŽâââââââ      âââââââŽâââââââ      ââââââââŽâââââââ
    ...

    Now data is aligned, and you can easily calculate the row-wise dot product:

    >>> (af1 * af2 * af3).fill_null(0).select(pl.sum_horizontal("*").alias("dot"))
    shape: (3, 1)
    âââââââââ
    â dot   â
    â ---   â
    â f64   â
    âââââââââ¡
    â 0.0   â
    âââââââââ€
    â 167.5 â
    âââââââââ€
    â 47.0  â
    âââââââââ
    r)   r   c                ó,    h | ]}t          |Š  «        S r8   )Útype)r1   Úfs     r3   ú	<setcomp>zalign_frames.<locals>.<setcomp>m  s    Ð$Ð$Ð$DGGÐ$Ð$Ð$r6   zJinput frames must be of a consistent type (all LazyFrame or all DataFrame)c                óx    g | ]7}t          |t          j        Š  «        r|j                             Š   «         n|8S r8   )r   r   r   ÚmetaÚoutput_name)r1   Úcs     r3   rX   z align_frames.<locals>.<listcomp>u  s<    ÐTÐTÐTÈA­°AµrŽwÑ)?Ô)?ÐF×#Ò#Ñ%Ô%Ð%ÀQÐTÐTÐTr6   c                ó@    g | ]\  }}||                      Š   «         fS r8   rT   )r1   ÚidxÚframes      r3   rX   z align_frames.<locals>.<listcomp>y  s)    ÐJÐJÐJ©*š#šu3

Ð%ÐJÐJÐJr6   )rÎ   r   rË   rÖ   c                ó    g | ]I}|  v r+t          j        |  Š  «                             |Š  «        nt          j        |Š  «        JS r8   )ÚFÚcolÚalias)r1   rì   Úaligned_colsÚsfxs     r3   rX   z align_frames.<locals>.<listcomp>  si   ø ð 
ð 
ð 
àð /0š;°š;š;ž,Ð+FÐ+FAEQ+++ÑÔ×$Ò$ QÑ'Ô'Ð'ÍAÌEÐRSÉHÌHð
ð 
ð 
r6   )r   r   r   r   r   r   r   Útupler   rÄ   r   r   rß   r@   r/   r   Úappendrñ   Úcollect_all)r^   r   r   rË   rÊ   r«   r°   rÎ   rÌ   Úalignment_frameÚaligned_framesrî   r¯   Údf_colsrç   rô   rõ   s                  @@r3   Úalign_framesrü   Ù  s  øø ðX ð Ø	å
6{{aÒÐ¥
š6°!¬9µrŽ|ÅRÄ\Ð6RÑ SÔ SÐØÝ&9¥hÐ/Ñ0Ô0ð Ývå
Ð$Ð$VÐ$Ñ$Ô$Ñ%Ô%šÒ*Ð*àXð 	õ nnÐåvay¥"€,Ñ/Ô/EÝR¥Ñ%Ô%Ð	N­ZžœHÑ-EÔ-EÐ	N"ÈBBØTÐTÐQSÐTÑTÔTHð KÐJœ	À&Ñ8IÔ8IÐJÑJÔJJÝ%Ø	hšCžJðð ð Oõ
 ×5Ò5Ñ7Ô7Ñ8Ô8LØNØð 	!ð 	!RØ#iið
ð 
ð 
ð 
ð 
à×&Ò&Ñ(Ô(ð
ñ 
ô 
ð #OÔ" GÐ,ØÐØÑ Ô AØ×ÒaÑ Ô Ð Ð à,1ÐE1=Ñ(Ô(Ð(°~ÐEr6   )r#   r$   r   r   r    r%   r!   r%   r"   r%   r&   r   )r#   r$   r   r   r"   r%   r&   r   )r#   r$   rM   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ã   )6Ú
__future__r   Ú
contextlibÚcollections.abcr   r   r   Ú	functoolsr   Ú	itertoolsr   Útypingr	   r
   Úpolars._reexportÚ	_reexportr   Úpolarsr   rñ   Úpolars._typingr   Úpolars._utils.reduce_balancedr   Úpolars._utils.unstabler   Úpolars._utils.variousr   r   Úpolars._utils.wrapr   r   r   r   Úpolars.exceptionsr   ÚsuppressÚImportErrorÚpolars._plrÚ_plrr   r   r   r   r   r   r   r   r   rŽ   rÃ   rÈ   rß   rü   r8   r6   r3   ú<module>r     s  ðØ "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø *Ð *Ð *Ð *Ð *Ð *Ð *Ð *à Ð Ð Ð Ð Ð Ø !Ð !Ð !Ð !Ð !Ð !Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø +Ð +Ð +Ð +Ð +Ð +Ø EÐ EÐ EÐ EÐ EÐ EÐ EÐ EØ CÐ CÐ CÐ CÐ CÐ CÐ CÐ CÐ CÐ CÐ CÐ CØ 3Ð 3Ð 3Ð 3Ð 3Ð 3àZÔÑ%Ô%ð ð ØÐÐÐÐÐðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð ð CØ(Ð(Ð(Ð(Ð(Ð(à9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9ØBÐBÐBÐBÐBÐBÐBÐBÐBÐBð #ØØØðcð cð cð cð cð cðR	 #Øð	Yð Yð Yð Yð Yð Yðx 
ð
 !ð	S)ð S)ð S)ð S)ð S)ñ ðS)ðr Ø(-ð	!ð !ð !ð !ð !ð !ðN Ø7;Ø(-ðsFð sFð sFð sFð sFð sFð sFð sFs   Á1BÂBÂB