Ë
    	êñi #  ã                  ón  — d dl mZ d dlZd dl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  ej$                  e«      5  d dlmZ ddd«       erd d	lmZ d d
lmZmZmZ d dlmZmZ e	 	 	 ddddœ	 	 	 	 	 	 	 	 	 	 	 dd„«       Ze	 	 	 dddœ	 	 	 	 	 	 	 	 	 	 	 dd„«       Ze	 	 	 dddœ	 	 	 	 	 	 	 	 	 	 	 dd„«       Z	 	 	 d eddœ	 	 	 	 	 	 	 	 	 	 	 dd„Ze	 	 	 ddddœ	 	 	 	 	 	 	 	 	 	 	 dd„«       Ze	 	 	 dddœ	 	 	 	 	 	 	 	 	 	 	 dd„«       Ze	 	 	 dddœ	 	 	 	 	 	 	 	 	 	 	 dd„«       Z	 	 	 d eddœ	 	 	 	 	 	 	 	 	 	 	 dd„Ze	 	 	 ddddœ	 	 	 	 	 	 	 	 	 	 	 d!d„«       Z e	 	 	 dddœ	 	 	 	 	 	 	 	 	 	 	 d"d„«       Z e	 	 	 dddœ	 	 	 	 	 	 	 	 	 	 	 d#d„«       Z 	 	 	 d eddœ	 	 	 	 	 	 	 	 	 	 	 d#d„Z y# 1 sw Y   �Œ`xY w)$é    )ÚannotationsN)ÚTYPE_CHECKINGÚoverload)Ú	functions)Úparse_into_expression)Ú	wrap_exprÚwrap_s)ÚInt64)Úparse_into_datatype_expr)ÚLiteral)ÚDataTypeExprÚExprÚSeries)ÚIntoExprColumnÚPolarsIntegerType.©ÚdtypeÚeagerc                ó   — y ©N© ©ÚstartÚendÚstepr   r   s        úb/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/polars/functions/range/int_range.pyÚaranger      ó   € ð ó    )r   c                ó   — y r   r   r   s        r   r   r   !   ó   € ð r   c                ó   — y r   r   r   s        r   r   r   ,   ó   € ð r   Fc               ó"   — t        | ||||¬«      S )aS  
    Generate a range of integers.

    Alias for :func:`int_range`.

    Parameters
    ----------
    start
        Lower bound of the range (inclusive).
    end
        Upper bound of the range (exclusive).
    step
        Step size of the range.
    dtype
        Data type of the range. Defaults to `Int64`.
    eager
        Evaluate immediately and return a `Series`.
        If set to `False` (default), return an expression instead.

    Returns
    -------
    Expr or Series
        Column of integer data type `dtype`.

    See Also
    --------
    int_range : Generate a range of integers.
    int_ranges : Generate a range of integers for each row of the input columns.

    Examples
    --------
    >>> pl.arange(0, 3, eager=True)
    shape: (3,)
    Series: 'literal' [i64]
    [
            0
            1
            2
    ]
    r   )Ú	int_ranger   s        r   r   r   7   s   € ô` �U˜C ¨U¸%Ô@Ð@r   c                ó   — y r   r   r   s        r   r%   r%   j   r   r   c                ó   — y r   r   r   s        r   r%   r%   u   r!   r   c                ó   — y r   r   r   s        r   r%   r%   €   r#   r   c               óŽ  — |€| }d} t        |«      }t        | t        «      r=t        |t        «      r-|r+t        t	        j
                  | |||j                  «      «      S t        | «      }t        |«      }t        t	        j                  ||||j                  «      «      }|r#t        j                  |«      j                  «       S |S )u·  
    Generate a range of integers.

    Parameters
    ----------
    start
        Start of the range (inclusive). Defaults to 0.
    end
        End of the range (exclusive). If set to `None` (default),
        the value of `start` is used and `start` is set to `0`.
    step
        Step size of the range.
    dtype
        Data type of the range.
    eager
        Evaluate immediately and return a `Series`.
        If set to `False` (default), return an expression instead.

    Returns
    -------
    Expr or Series
        Column of integer data type `dtype`.

    See Also
    --------
    int_ranges : Generate a range of integers for each row of the input columns.

    Examples
    --------
    >>> pl.int_range(0, 3, eager=True)
    shape: (3,)
    Series: 'literal' [i64]
    [
            0
            1
            2
    ]

    `end` can be omitted for a shorter syntax.

    >>> pl.int_range(3, eager=True)
    shape: (3,)
    Series: 'literal' [i64]
    [
            0
            1
            2
    ]

    Generate an index column by using `int_range` in conjunction with :func:`len`.

    >>> df = pl.DataFrame({"a": [1, 3, 5], "b": [2, 4, 6]})
    >>> df.select(
    ...     pl.int_range(pl.len(), dtype=pl.UInt32).alias("index"),
    ...     pl.all(),
    ... )
    shape: (3, 3)
    â”Œâ”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”�
    â”‚ index â”† a   â”† b   â”‚
    â”‚ ---   â”† --- â”† --- â”‚
    â”‚ u32   â”† i64 â”† i64 â”‚
    â•žâ•�â•�â•�â•�â•�â•�â•�â•ªâ•�â•�â•�â•�â•�â•ªâ•�â•�â•�â•�â•�â•¡
    â”‚ 0     â”† 1   â”† 2   â”‚
    â”‚ 1     â”† 3   â”† 4   â”‚
    â”‚ 2     â”† 5   â”† 6   â”‚
    â””â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”˜
    r   )r   Ú
isinstanceÚintr	   ÚplrÚeager_int_rangeÚ_pydatatype_exprr   r   r%   ÚFÚselectÚ	to_series)	r   r   r   r   r   Ú
dtype_exprÚstart_pyexprÚ
end_pyexprÚresults	            r   r%   r%   ‹   s´   € ðV €{ØˆØˆä)¨%Ó0€JÜ�%œÔ¤*¨S´#Ô"6¹5ÜÜ×Ñ  s¨D°*×2MÑ2MÓNó
ð 	
ô )¨Ó/€LÜ& sÓ+€JÜÜ�‰�l J°°j×6QÑ6QÓRó€Fñ Ü�x‰x˜Ó×)Ñ)Ó+Ð+à€Mr   c                ó   — y r   r   r   s        r   Ú
int_rangesr7   ì   r   r   c                ó   — y r   r   r   s        r   r7   r7   ÷   r!   r   c                ó   — y r   r   r   s        r   r7   r7     r#   r   c               ó
  — |€| }d} t        |«      }t        | «      }t        |«      }t        |«      }t        t        j                  ||||j
                  «      «      }	|r#t        j                  |	«      j                  «       S |	S )u  
    Generate a range of integers for each row of the input columns.

    Parameters
    ----------
    start
        Start of the range (inclusive). Defaults to 0.
    end
        End of the range (exclusive). If set to `None` (default),
        the value of `start` is used and `start` is set to `0`.
    step
        Step size of the range.
    dtype
        Integer data type of the ranges. Defaults to `Int64`.
    eager
        Evaluate immediately and return a `Series`.
        If set to `False` (default), return an expression instead.

    Returns
    -------
    Expr or Series
        Column of data type `List(dtype)`.

    See Also
    --------
    int_range : Generate a single range of integers.

    Examples
    --------
    >>> df = pl.DataFrame({"start": [1, -1], "end": [3, 2]})
    >>> df.with_columns(int_range=pl.int_ranges("start", "end"))
    shape: (2, 3)
    â”Œâ”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”�
    â”‚ start â”† end â”† int_range  â”‚
    â”‚ ---   â”† --- â”† ---        â”‚
    â”‚ i64   â”† i64 â”† list[i64]  â”‚
    â•žâ•�â•�â•�â•�â•�â•�â•�â•ªâ•�â•�â•�â•�â•�â•ªâ•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•¡
    â”‚ 1     â”† 3   â”† [1, 2]     â”‚
    â”‚ -1    â”† 2   â”† [-1, 0, 1] â”‚
    â””â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

    `end` can be omitted for a shorter syntax.

    >>> df.select("end", int_range=pl.int_ranges("end"))
    shape: (2, 2)
    â”Œâ”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”�
    â”‚ end â”† int_range â”‚
    â”‚ --- â”† ---       â”‚
    â”‚ i64 â”† list[i64] â”‚
    â•žâ•�â•�â•�â•�â•�â•ªâ•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•�â•¡
    â”‚ 3   â”† [0, 1, 2] â”‚
    â”‚ 2   â”† [0, 1]    â”‚
    â””â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
    r   )	r   r   r   r,   r7   r.   r/   r0   r1   )
r   r   r   r   r   r2   r3   r4   Ústep_pyexprr5   s
             r   r7   r7     sƒ   € ð| €{ØˆØˆä)¨%Ó0€JÜ(¨Ó/€LÜ& sÓ+€JÜ'¨Ó-€KÜÜ�‰Ø˜* k°:×3NÑ3Nó	
ó€Fñ Ü�x‰x˜Ó×)Ñ)Ó+Ð+à€Mr   )...)r   úint | IntoExprColumnr   úint | IntoExprColumn | Noner   r+   r   ú PolarsIntegerType | DataTypeExprr   úLiteral[False]Úreturnr   )r   r<   r   r=   r   r+   r   r>   r   úLiteral[True]r@   r   )r   r<   r   r=   r   r+   r   r>   r   Úboolr@   úExpr | Series)r   Né   )r   r<   r   r=   r   r<   r   r>   r   r?   r@   r   )r   r<   r   r=   r   r<   r   r>   r   rA   r@   r   )r   r<   r   r=   r   r<   r   r>   r   rB   r@   rC   )!Ú
__future__r   Ú
contextlibÚtypingr   r   Úpolarsr   r/   Úpolars._utils.parser   Úpolars._utils.wrapr   r	   Úpolars.datatypesr
   Úpolars.datatypes._parser   ÚsuppressÚImportErrorÚpolars._plrÚ_plrr,   r   r   r   r   Úpolars._typingr   r   r   r%   r7   r   r   r   ú<module>rR      sÐ  ðÝ "ã ß *å !Ý 5ß 0Ý "Ý <à€Z×Ñ˜Ó%ñ Ý÷ñ Ýç1Ñ1ß@ð 
à"%Ø'*Øðð
 /2ØñØðà	$ðð ðð
 ,ðð ðð 
òó 
ðð 
à"%Ø'*Øðð
 /2ñØðà	$ðð ðð
 ,ðð ðð òó 
ðð 
à"%Ø'*Øðð
 /2ñØðà	$ðð ðð
 ,ðð ðð òó 
ðð #$Ø'+Øð0Að
 /4Øñ0AØð0Aà	$ð0Að ð0Að
 ,ð0Að ð0Að ó0Aðf 
à"%Ø'*Øðð
 /2ØñØðà	$ðð ðð
 ,ðð ðð 
òó 
ðð 
à"%Ø'*Øðð
 /2ñØðà	$ðð ðð
 ,ðð ðð òó 
ðð 
à"%Ø'*Øðð
 /2ñØðà	$ðð ðð
 ,ðð ðð òó 
ðð #$Ø'+Øð^ð
 /4Øñ^Øð^à	$ð^ð ð^ð
 ,ð^ð ð^ð ó^ðB 
à"%Ø'*Ø!$ðð
 /2ØñØðà	$ðð ðð
 ,ðð ðð 
òó 
ðð 
à"%Ø'*Ø!$ðð
 /2ñØðà	$ðð ðð
 ,ðð ðð òó 
ðð 
à"%Ø'*Ø!$ðð
 /2ñØðà	$ðð ðð
 ,ðð ðð òó 
ðð #$Ø'+Ø!"ðOð
 /4ØñOØðOà	$ðOð ðOð
 ,ðOð ðOð ôO÷Cñ ús   ÁF*Æ*F4