
    g                       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 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 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 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 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! 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( er6d d%l)Z*d d%l+Z,d d%l-Z.d d&l/m0Z0 d d'l/m1Z1 d d(l2m3Z3 d d)l4m5Z5 d d*l4m6Z6 d d+l4m7Z7 d d,l4m8Z8  ed-      Z9e:e;e<e=e>e?fZ@ed.d/	 	 	 	 	 d\d0       ZAed.d/	 	 	 	 	 d]d1       ZAed.d/	 	 	 	 	 d^d2       ZAed_d3       ZAd%d%d4	 	 	 	 	 	 	 d`d5ZAed.d.d6	 	 	 	 	 	 	 	 	 	 	 	 	 dad7       ZBed.d.d8	 	 	 	 	 	 	 	 	 	 	 	 	 dbd9       ZBed.d.d.d:	 	 	 	 	 	 	 	 	 	 	 	 	 dcd;       ZBed.d.d.d:	 	 	 	 	 	 	 	 	 	 	 	 	 ddd<       ZBed.d.d.d=	 	 	 	 	 	 	 	 	 	 	 	 	 ded>       ZBed.d.d.d=	 	 	 	 	 	 	 	 	 	 	 	 	 dfd?       ZBed.d.d.d@	 	 	 	 	 	 	 	 	 	 	 	 	 dgdA       ZBed.d.d.dB	 	 	 	 	 	 	 	 	 	 	 	 	 dhdC       ZBed.d.d.d.dD	 	 	 	 	 	 	 	 	 	 	 	 	 didE       ZBed.d.d.d.dD	 	 	 	 	 	 	 	 	 	 	 	 	 djdF       ZBed.d.d.d.dG	 	 	 	 	 	 	 	 	 	 	 	 	 dkdH       ZBed.d.d.d.dI	 	 	 	 	 	 	 	 	 	 	 	 	 dldJ       ZBed.d.d.d.dK	 	 	 	 	 	 	 	 	 	 	 	 	 dmdL       ZBed.d.d.d.dM	 	 	 	 	 	 	 	 	 	 	 	 	 dndN       ZBed.d.d.d.d.dO	 	 	 	 	 	 	 	 	 	 	 	 	 dodP       ZBedQdR	 	 	 	 	 	 	 	 	 	 	 	 	 dpdS       ZBd%d%dQdQdQd%dT	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dqdUZBdQdQdQdQd%dO	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 drdVZC	 	 	 	 dsdWZD	 dtd%d%dQdQdQdXdT	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dudYZEdvdZZFg d[ZGy%)w    )annotations)datetime)	timedeltawraps)TYPE_CHECKING)Any)Callable)Literal)TypeVar)overload)get_cudf)get_cupy)get_dask)get_dask_expr)	get_modin)	get_numpy)
get_pandas)
get_polars)get_pyarrow)get_pyspark)is_cudf_dataframe)is_cudf_series)is_dask_dataframe)is_duckdb_relation)is_ibis_table)is_modin_dataframe)is_modin_series)is_pandas_dataframe)is_pandas_series)is_polars_dataframe)is_polars_lazyframe)is_polars_series)is_pyarrow_chunked_array)is_pyarrow_table)is_pyspark_dataframe)VersionN	DataFrame	LazyFrameSeries)IntoDataFrameT)
IntoFrameT)
IntoSeries)IntoSeriesTT.pass_throughc                    y N narwhals_objectr4   s     G/var/www/openai/venv/lib/python3.12/site-packages/narwhals/translate.py	to_nativer;   A   s         c                    y r6   r7   r8   s     r:   r;   r;   E   s     r<   c                    y r6   r7   r8   s     r:   r;   r;   I   s     r<   c                    y r6   r7   r8   s     r:   r;   r;   M   s    CFr<   )strictr4   c                  ddl m} ddlm} ddlm}  |||dd      }t        | |      r| j                  j                  S t        | |      r| j                  j                  S |sdt        |        d	}t        |      | S )
a<  Convert Narwhals object to native one.

    Arguments:
        narwhals_object: Narwhals object.
        strict: Determine what happens if `narwhals_object` isn't a Narwhals class:

            - `True` (default): raise an error
            - `False`: pass object through as-is

            **Deprecated** (v1.13.0):
                Please use `pass_through` instead. Note that `strict` is still available
                (and won't emit a deprecation warning) if you use `narwhals.stable.v1`,
                see [perfect backwards compatibility policy](../backcompat.md/).
        pass_through: Determine what happens if `narwhals_object` isn't a Narwhals class:

            - `False` (default): raise an error
            - `True`: pass object through as-is

    Returns:
        Object of class that user started with.
    r   )	BaseFramer,   validate_strict_and_pass_thoughFTpass_through_defaultemit_deprecation_warningzExpected Narwhals object, got .)narwhals.dataframerB   narwhals.seriesr-   narwhals.utilsrD   
isinstance_compliant_frame_native_frame_compliant_series_native_seriestype	TypeError)r9   r@   r4   rB   r-   rD   msgs          r:   r;   r;   Q   s    6 -&>25SWL /9-//===/6*00???.tO/D.EQGnr<   )
eager_onlyseries_onlyc                    y r6   r7   native_objectr4   rT   eager_or_interchange_onlyrU   allow_seriess         r:   from_nativer[           !$r<   )rY   rU   c                    y r6   r7   rW   s         r:   r[   r[      s     7:r<   )rT   rU   rZ   c                    y r6   r7   rW   s         r:   r[   r[      r\   r<   c                    y r6   r7   rW   s         r:   r[   r[           	r<   )rY   rU   rZ   c                    y r6   r7   rW   s         r:   r[   r[      r\   r<   c                    y r6   r7   rW   s         r:   r[   r[      r`   r<   )rT   rY   rU   c                    y r6   r7   rW   s         r:   r[   r[      s	     KNr<   )rT   rY   rZ   c                    y r6   r7   rW   s         r:   r[   r[           r<   )rT   rY   rU   rZ   c                    y r6   r7   rW   s         r:   r[   r[           58r<   c                    y r6   r7   rW   s         r:   r[   r[      r`   r<   )r4   rT   rU   rZ   c                    y r6   r7   rW   s         r:   r[   r[      r\   r<   )r4   rY   rU   rZ   c                    y r6   r7   rW   s         r:   r[   r[     r\   r<   )r4   rT   rY   rU   c                    y r6   r7   rW   s         r:   r[   r[     rg   r<   )r4   rT   rY   rZ   c                    y r6   r7   rW   s         r:   r[   r[     re   r<   r4   rT   rY   rU   rZ   c                    y r6   r7   rW   s         r:   r[   r[   '  rg   r<   F)rY   c                    y r6   r7   rW   s         r:   r[   r[   4  s     r<   )r@   r4   rT   rY   rU   rZ   c          	     f    ddl m}  |||dd      }t        | |||||t        j                        S )a	  Convert `native_object` to Narwhals Dataframe, Lazyframe, or Series.

    Arguments:
        native_object: Raw object from user.
            Depending on the other arguments, input object can be:

            - a Dataframe / Lazyframe / Series supported by Narwhals (pandas, Polars, PyArrow, ...)
            - an object which implements `__narwhals_dataframe__`, `__narwhals_lazyframe__`,
              or `__narwhals_series__`
        strict: Determine what happens if the object can't be converted to Narwhals:

            - `True` or `None` (default): raise an error
            - `False`: pass object through as-is

            **Deprecated** (v1.13.0):
                Please use `pass_through` instead. Note that `strict` is still available
                (and won't emit a deprecation warning) if you use `narwhals.stable.v1`,
                see [perfect backwards compatibility policy](../backcompat.md/).
        pass_through: Determine what happens if the object can't be converted to Narwhals:

            - `False` or `None` (default): raise an error
            - `True`: pass object through as-is
        eager_only: Whether to only allow eager objects:

            - `False` (default): don't require `native_object` to be eager
            - `True`: only convert to Narwhals if `native_object` is eager
        eager_or_interchange_only: Whether to only allow eager objects or objects which
            have interchange-level support in Narwhals:

            - `False` (default): don't require `native_object` to either be eager or to
              have interchange-level support in Narwhals
            - `True`: only convert to Narwhals if `native_object` is eager or has
              interchange-level support in Narwhals

            See [interchange-only support](../extending.md/#interchange-only-support)
            for more details.
        series_only: Whether to only allow Series:

            - `False` (default): don't require `native_object` to be a Series
            - `True`: only convert to Narwhals if `native_object` is a Series
        allow_series: Whether to allow Series (default is only Dataframe / Lazyframe):

            - `False` or `None` (default): don't convert to Narwhals if `native_object` is a Series
            - `True`: allow `native_object` to be a Series

    Returns:
        DataFrame, LazyFrame, Series, or original object, depending
            on which combination of parameters was passed.
    r   rC   FTrE   )r4   rT   rY   rU   rZ   version)rK   rD   _from_native_implr'   MAIN)rX   r@   r4   rT   rY   rU   rZ   rD   s           r:   r[   r[   @  sD    v ?25SWL !";! r<   c          	        ddl m} ddl m} ddlm}	 ddlm}
 ddlm} t        | ||f      r|s| S t        | |	      r|s|r| S |r|du rd}t        |      d	}|r|rd
}t        |      t        | d      r+|r|sd}t        |      | S  || j                         d      S t        | d      r@|r|sd}t        |      | S |s|r|sd}t        |      | S  || j                         d      S t        | d      r+|s|sd}t        |      | S  |	| j                         d      S t        |       rFddlm} |r|sd}t        |      | S t%               } | ||  ||j&                        |      d      S t)        |       r[ddlm} |r|sd}t        |      | S |s|r|sd}t        |      | S t%               } | ||  ||j&                        |      d      S t-        |       rFddlm} t%               }|s|sd}t        |      | S  |	 ||  ||j&                        |      d      S t3        |       rQddlm} |r|sd}t        |      | S t9               } | ||  ||j&                        |
j:                  |      d      S t=        |       rQddlm } |s|sd}t        |      | S t9               } |	 || |
j:                   ||j&                        |      d      S tC        |       rQddlm} tE               }|r|sd }t        |      | S  | || |
jF                   ||j&                        |      d      S tI        |       rQddlm } tE               }|s|sd}t        |      | S  |	 || |
jF                   ||j&                        |      d      S tK        |       rQddlm} tM               }|r|sd!}t        |      | S  | || |
jN                   ||j&                        |      d      S tQ        |       rQddlm } tM               }|s|sd}t        |      | S  |	 || |
jN                   ||j&                        |      d      S tS        |       rFdd"l*m+} tY               }|r|sd#}t        |      | S  | ||  ||j&                        |      d      S t[        |       rGdd$l.m/} tY               }|s|sd}t        |      | S  |	 ||  ||j&                        d%|&      d      S ta        |       rpdd'l1m2} |r|sd(}t        |      | S |s|r|sd)}t        |      | S tg               d*}ti        |       | ||  |tk               j&                        |      d      S tm        |       ridd+l7m8} |s|r|sd,}t        |      | S dd l9} ||j&                        }|tt        jv                  u r | || ||      d-      S  | || ||      d      S ty        |       rDdd.l=m>} |s|r|sd/}t        |      | S dd l?} ||j&                        } | || ||0      d-      S t        |       rQdd1lAmB} |rd2}t        |      |s|rd3}t        |       | ||  |t               j&                        |      d      S t        | d4      r-dd5lDmE}  |s|r|sd6}t        |      | S  | | | |7      d-      S |sd8t        |        }t        |      | S )9Nr   r(   r*   r,   )Implementation)parse_versionFzJInvalid parameter combination: `series_only=True` and `allow_series=False`TzUInvalid parameter combination: `eager_only=True` and `eager_or_interchange_only=True`__narwhals_dataframe__z,Cannot only use `series_only` with dataframefull)level__narwhals_lazyframe__z,Cannot only use `series_only` with lazyframezJCannot only use `eager_only` or `eager_or_interchange_only` with lazyframe__narwhals_series__z4Please set `allow_series=True` or `series_only=True`)PolarsDataFramez3Cannot only use `series_only` with polars.DataFrame)backend_versionrq   )PolarsLazyFramez3Cannot only use `series_only` with polars.LazyFramezQCannot only use `eager_only` or `eager_or_interchange_only` with polars.LazyFramelazy)PolarsSeries)PandasLikeDataFrame)r}   implementationrq   )PandasLikeSeries)r   r}   rq   z2Cannot only use `series_only` with modin.DataFramez1Cannot only use `series_only` with cudf.DataFrame)ArrowDataFramez.Cannot only use `series_only` with arrow table)ArrowSeries )r}   namerq   )DaskLazyFramez1Cannot only use `series_only` with dask DataFramezOCannot only use `eager_only` or `eager_or_interchange_only` with dask DataFramezPlease install dask-expr)DuckDBLazyFramezNCannot only use `series_only=True` or `eager_only=False` with DuckDBPyRelationinterchange)IbisInterchangeFramezHCannot only use `series_only=True` or `eager_only=False` with Ibis table)rq   r}   )SparkLikeLazyFramez4Cannot only use `series_only` with pyspark DataFramezRCannot only use `eager_only` or `eager_or_interchange_only` with pyspark DataFrame__dataframe__)InterchangeFramezhCannot only use `series_only=True` or `eager_only=False` with object which only implements __dataframe__)rq   zLExpected pandas-like dataframe, Polars dataframe, or Polars lazyframe, got: )GrI   r)   r+   rJ   r-   rK   ru   rv   rL   
ValueErrorhasattrrR   rw   rz   r{   r!   narwhals._polars.dataframer|   r   __version__r"   r~   r#   narwhals._polars.seriesr   r   narwhals._pandas_like.dataframer   r   PANDASr    narwhals._pandas_like.seriesr   r   r   MODINr   r   r   CUDFr   r%   narwhals._arrow.dataframer   r   r$   narwhals._arrow.seriesr   r   narwhals._dask.dataframer   r   ImportErrorr   r   narwhals._duckdb.dataframer   duckdbr'   V1r   narwhals._ibis.dataframer   ibisr&   narwhals._spark_like.dataframer   r   narwhals._interchange.dataframer   rQ   )!rX   r4   rT   rY   rU   rZ   rq   r)   r+   r-   ru   rv   rS   r|   plr~   r   r   pdr   mpdcudfr   par   r   r   r   r}   r   r   r   r   s!                                    r:   rr   rr     s    -,&-, -)Y!78-(k\5 ^CS/!/eo }67Dn$  002
 	
 
 8	9Dn$  2bn$  002
 	
 
 5	6Ln$  --/
 	
 
]	+>Kn$  \ -bnn =
 
 	
 
]	+>Kn$  2in$  \ -bnn =
 
 	
 
-	(8\Ln$   -bnn =
 
 	
 
]	+GDn$  \ -bnn =-44	 
 	
 
-	(ALn$  \-44 -bnn =	 
 	
 
M	*GkJn$  -33 -coo >	 
 	
 
	'AkLn$  -33 -coo >	 
 	
 
=	)GzIn$  -22 -d.>.> ?	 
 	
 
	&AzLn$  -22 -d.>.> ?	 
 	
 
-	(<]Fn$   -bnn =
 
 	
 
"-	06]Ln$   -bnn =	 
 	
 
=	):In$  2gn$  ?",Cc"" -hj.D.D E
 
 	
 
M	*>,  C.  %$'(:(:;gjj !?G $	   	
 	
 
}	%A&   n$  '(8(89 w  	
 	
 
m	,EHCC. 2fCC.  -km.G.G H
 
 	
 
	0DF   n$  ]G<
 	

 \]abo]p\qrnr<   c                   t        | d      r| j                         S t        |       st        |       r
t	               S t        |       st        |       r
t               S t        |       st        |       r
t               S t        |       st        |       r
t               S t        |       r
t               S t!        |       st#        |       st%        |       r
t'               S dt)        |        }t+        |      )a  Get native namespace from object.

    Arguments:
        obj: Dataframe, Lazyframe, or Series.

    Returns:
        Native module.

    Examples:
        >>> import polars as pl
        >>> import pandas as pd
        >>> import narwhals as nw
        >>> df = nw.from_native(pd.DataFrame({"a": [1, 2, 3]}))
        >>> nw.get_native_namespace(df)
        <module 'pandas'...>
        >>> df = nw.from_native(pl.DataFrame({"a": [1, 2, 3]}))
        >>> nw.get_native_namespace(df)
        <module 'polars'...>
    __native_namespace__z4Could not get native namespace from object of type: )r   r   r   r    r   r   r   r   r%   r$   r   r   r   r   r   r   r!   r"   r#   r   rQ   rR   )objrS   s     r:   get_native_namespacer     s    > s*+''))3#3C#8|#/#"6{ 8 =}!4zz3#6s#;?OPS?T|@c
LC
C.r<   Tc               \    ddl m}  ||dd      dfd}| |S  ||       S )a  Decorate function so it becomes dataframe-agnostic.

    This will try to convert any dataframe/series-like object into the Narwhals
    respective DataFrame/Series, while leaving the other parameters as they are.
    Similarly, if the output of the function is a Narwhals DataFrame or Series, it will be
    converted back to the original dataframe/series type, while if the output is another
    type it will be left as is.
    By setting `pass_through=False`, then every input and every output will be required to be a
    dataframe/series-like object.

    Arguments:
        func: Function to wrap in a `from_native`-`to_native` block.
        strict: **Deprecated** (v1.13.0):
            Please use `pass_through` instead. Note that `strict` is still available
            (and won't emit a deprecation warning) if you use `narwhals.stable.v1`,
            see [perfect backwards compatibility policy](../backcompat.md/).

            Determine what happens if the object can't be converted to Narwhals:

            - `True` or `None` (default): raise an error
            - `False`: pass object through as-is
        pass_through: Determine what happens if the object can't be converted to Narwhals:

            - `False` or `None` (default): raise an error
            - `True`: pass object through as-is
        eager_only: Whether to only allow eager objects:

            - `False` (default): don't require `native_object` to be eager
            - `True`: only convert to Narwhals if `native_object` is eager
        eager_or_interchange_only: Whether to only allow eager objects or objects which
            have interchange-level support in Narwhals:

            - `False` (default): don't require `native_object` to either be eager or to
              have interchange-level support in Narwhals
            - `True`: only convert to Narwhals if `native_object` is eager or has
              interchange-level support in Narwhals

            See [interchange-only support](../extending.md/#interchange-only-support)
            for more details.
        series_only: Whether to only allow Series:

            - `False` (default): don't require `native_object` to be a Series
            - `True`: only convert to Narwhals if `native_object` is a Series
        allow_series: Whether to allow Series (default is only Dataframe / Lazyframe):

            - `False` or `None`: don't convert to Narwhals if `native_object` is a Series
            - `True` (default): allow `native_object` to be a Series

    Returns:
        Decorated function.

    Examples:
        Instead of writing

        >>> import narwhals as nw
        >>> def agnostic_group_by_sum(df):
        ...     df = nw.from_native(df, pass_through=True)
        ...     df = df.group_by("a").agg(nw.col("b").sum())
        ...     return nw.to_native(df)

        you can just write

        >>> @nw.narwhalify
        ... def agnostic_group_by_sum(df):
        ...     return df.group_by("a").agg(nw.col("b").sum())
    r   rC   TrE   c                <     t               d fd       }|S )Nc                    | D cg c]  }t        |
       } }|j                         D ci c]  \  }}|t        |
       }}}g | |j                         D ch c]  }t        |dd       x}r |        }}t	        |      dkD  rd}t        |       | i |}	t        |	      S c c}w c c}}w c c}w )Nrm   r      z_Found multiple backends. Make sure that all dataframe/series inputs come from the same backend.r3   )r[   itemsvaluesgetattrlenr   r;   )argskwargsargr   valuevbbackendsrS   resultrZ   rT   rY   funcr4   rU   s             r:   wrapperz.narwhalify.<locals>.decorator.<locals>.wrapper  s      
  C !-).G +!-    
* $*<<>
 $2KD% k!-).G +!-  $2  
 342&--/22A $:DAAAA 2   8}q w o%4*6*FV,??I

s   B8B=)C)r   r	   r   r	   returnr	   r   )r   r   rZ   rT   rY   r4   rU   s   ` r:   	decoratorznarwhalify.<locals>.decorator  s)    	t%	@ %	@ 
%	@N r<   )r   Callable[..., Any]r   r   )rK   rD   )	r   r@   r4   rT   rY   rU   rZ   rD   r   s	     `````  r:   
narwhalifyr   J  sA    X ?24RVL) )V | r<   c                   | yt        | t              r| S t               }|rPt        | |j                        r:| j                  dk(  r+t        ddd      t        | j                         dz        z   S |r-|j                  |       rt        | d      r| j                         S t               }|r&t        | |j                        r| j                         S |r&t        | |j                        r| j                         S |r;|j                  j                   j#                  |       r	  |j$                  |       }|ryt        | t
        t        f      r| S t)               }|r&t        | |j*                        r| j-                         S t/               }|r5t        | |j0                        r| j2                  dk(  r| j                         S dt5        |        d	}t7        |      # t&        $ r Y w xY w)
au  If a scalar is not Python native, converts it to Python native.

    Arguments:
        scalar_like: Scalar-like value.

    Returns:
        Python scalar.

    Raises:
        ValueError: If the object is not convertible to a scalar.

    Examples:
        >>> import narwhals as nw
        >>> import pandas as pd
        >>> df = nw.from_native(pd.DataFrame({"a": [1, 2, 3]}))
        >>> nw.to_py_scalar(df["a"].item(0))
        1
        >>> import pyarrow as pa
        >>> df = nw.from_native(pa.table({"a": [1, 2, 3]}))
        >>> nw.to_py_scalar(df["a"].item(0))
        1
        >>> nw.to_py_scalar(1)
        1
    Nzdatetime64[ns]i  r   i  )microsecondsitemz/Expected object convertible to a scalar, found zH. Please report a bug to https://github.com/narwhals-dev/narwhals/issues)rL   NON_TEMPORAL_SCALAR_TYPESr   
datetime64dtyper   r   r   isscalarr   r   	Timestampto_pydatetime	Timedeltato_pytimedeltaapitypes	is_scalarisna	Exceptionr   Scalaras_pyr   ndarraysizerQ   r   )scalar_likenpr   is_nar   cupyrS   s          r:   to_py_scalarr     s   2 +89	B
{BMM2!11a#i[=M=M=OSW=W&XXX	bkk+&7;+G!!	B	jbll3((**	jbll3))++	bffll$$[1	BGGK(E  +)45	B	jbii0  "":DK6;;K;Kq;P!! :${:K9L MQ 	Q  S/3  		s   #G 	G)(G))r   r   r;   r   )r9   DataFrame[IntoDataFrameT]r4   Literal[False]r   r.   )r9   zLazyFrame[IntoFrameT]r4   r   r   r/   )r9   Series[IntoSeriesT]r4   r   r   r1   )r9   r	   r4   boolr   r	   )r9   CDataFrame[IntoFrameT] | LazyFrame[IntoFrameT] | Series[IntoSeriesT]r@   bool | Noner4   r   r   zIntoFrameT | Any)rX   IntoDataFrameT | IntoSeriesTr4   Literal[True]rT   r   rY   r   rU   r   rZ   r   r   r   )rX   r   r4   r   rT   r   rY   r   rU   r   rZ   r   r   z/DataFrame[IntoDataFrameT] | Series[IntoSeriesT])rX   r.   r4   r   rT   r   rY   r   rU   r   rZ   Noner   r   )rX   r2   r4   r   rT   r   rY   r   rU   r   rZ   r   r   r2   )rX   r.   r4   r   rT   r   rY   r   rU   r   rZ   r   r   r   )rX   r2   r4   r   rT   r   rY   r   rU   r   rZ   r   r   r2   )rX   IntoFrameT | IntoSeriesTr4   r   rT   r   rY   r   rU   r   rZ   r   r   r   )rX   r1   r4   r   rT   r   rY   r   rU   r   rZ   r   r   r   )rX   r/   r4   r   rT   r   rY   r   rU   r   rZ   r   r   -DataFrame[IntoFrameT] | LazyFrame[IntoFrameT])rX   r2   r4   r   rT   r   rY   r   rU   r   rZ   r   r   r2   )rX   r.   r4   r   rT   r   rY   r   rU   r   rZ   r   r   r   )rX   r.   r4   r   rT   r   rY   r   rU   r   rZ   r   r   r   )rX   r   r4   r   rT   r   rY   r   rU   r   rZ   r   r   z-DataFrame[Any] | LazyFrame[Any] | Series[Any])rX   r1   r4   r   rT   r   rY   r   rU   r   rZ   r   r   r   )rX   r/   r4   r   rT   r   rY   r   rU   r   rZ   r   r   r   )rX   r	   r4   r   rT   r   rY   r   rU   r   rZ   r   r   r	   )rX   zIntoFrameT | IntoSeries | Tr@   r   r4   r   rT   r   rY   r   rU   r   rZ   r   r   zGLazyFrame[IntoFrameT] | DataFrame[IntoFrameT] | Series[IntoSeriesT] | T)rX   r	   r4   r   rT   r   rY   r   rU   r   rZ   r   rq   r'   r   r	   )r   zDataFrame[Any] | LazyFrame[Any] | Series[Any] | pd.DataFrame | pd.Series | pl.DataFrame | pl.LazyFrame | pl.Series | pa.Table | pa.ChunkedArrayr   r	   r6   )r   zCallable[..., Any] | Noner@   r   r4   r   rT   r   rY   r   rU   r   rZ   r   r   r   )r   r	   r   r	   )H
__future__r   r   r   	functoolsr   typingr   r	   r
   r   r   r   narwhals.dependenciesr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   rK   r'   pandasr   polarsr   pyarrowr   rI   r)   r+   rJ   r-   narwhals.typingr.   r/   r0   r1   r2   r   bytesstrintfloatcomplexr   r;   r[   rr   r   r   r   __all__r7   r<   r:   <module>r      sR	   "           * * * / + + , , - - 3 0 3 4 / 4 1 5 2 5 5 2 : 2 6 ",,&.**+CL 			  
RU.AO 
 
NQ*=K 
 
LO(;I 
 
 F 
 F  $	+X+ + 	+
 +\ 

 "%"%$/$  $ 	$
  -$  $  $ $ 
$ 
 14"%:/:  : 	:
  .:  :  : 5: 
: 

 "%"%$!$  $ 	$
  -$  $ $ $ 
$ 

 "%"%   	
  -     
 
 14"%$!$  $ 	$
  .$  $ $ $ 
$ 
 14"%   	
  .     
 

 "%03"%N+N  N 	N
  .N  N  N IN 
N 

 "%03   	
  .    
 

 "%03"%88  8 	8
  .8  8 8 38 
8 

 "%03"%   	
  .     
 
 $'!$"%$!$ !$ 	$
  -$  $ $ $ 
$ 
 $'03"%$!$ !$ 	$
  .$  $ $ $ 
$ 
 $'!$03"%8+8 !8 	8
  .8  8  8 38 
8 
 $'!$03 ! 	
  .    
 
 $'!$03"%88 !8 	8
  .8  8 8 38 
8 
 ',  	
  $   	 
  $&+ $I.I I 	I
 I  $I I I MI^ &+ $JJ J 	J
  $J J J J 	JZ.	
. 	.d '+A  $&+ $A
#A A 	A
 A  $A A A AHJZr<   