§
    Ò¬¸jê  ã                  óX  — 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mZ d d	lmZ d d
lmZmZ er*d dlZd dlmZ d dlmZmZ ej        dk    rd dlmZ nd dlmZ  ed¦  «        	 d)dd eddœd*d„¦   «         Z  ed¦  «        	 d)ddd dddœd+d(„¦   «         Z!dS ),é    )Úannotations)ÚSequence)ÚTYPE_CHECKINGÚAnyN)ÚInvalidArgument)Ú
deprecated)Úis_polars_dtype)Ú
_COL_LIMITÚcolumn)Úlists)Ú_instantiate_dtypeÚdtypes)ÚSearchStrategy)ÚOneOrMoreDataTypesÚPolarsDataType)é   é   zX`columns` is deprecated; use `column` instead, in conjunction with a list comprehension.F)ÚdtypeÚmin_colsÚmax_colsÚuniqueÚcolsúint | Sequence[str] | Noner   úOneOrMoreDataTypes | Noner   Úintr   r   ÚboolÚreturnúlist[column]c               ó  ‡— | €(t          j        ||¬¦  «                             ¦   «         } t          | t          ¦  «        rd„ t          | ¦  «        D ¦   «         }n| }t          |¦  «        }|€dg|z  }not          |¦  «        r|g|z  }nYt          |t          ¦  «        r0t          |¦  «        x}|k    rd|› d|› d�}	t          |	¦  «        ‚|}n|›d�}	t          |	¦  «        ‚ˆfd„t          ||d	¬
¦  «        D ¦   «         S )aG  
    Define multiple columns for use with the @dataframes strategy.

    .. deprecated:: 0.20.26
        Use :class:`column` instead, in conjunction with a list comprehension.

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

    Generate a fixed sequence of `column` objects suitable for passing to the
    @dataframes strategy, or using standalone (note that this function is not itself
    a strategy).

    Notes
    -----
    Additional control is available by creating a sequence of columns explicitly,
    using the `column` class (an especially useful option is to override the default
    data-generating strategy for a given col/dtype).

    Parameters
    ----------
    cols : {int, [str]}, optional
        integer number of cols to create, or explicit list of column names. if
        omitted a random number of columns (between mincol and max_cols) are
        created.
    dtype : PolarsDataType, optional
        a single dtype for all cols, or list of dtypes (the same length as `cols`).
        if omitted, each generated column is assigned a random dtype.
    min_cols : int, optional
        if not passing an exact size, can set a minimum here (defaults to 0).
    max_cols : int, optional
        if not passing an exact size, can set a maximum value here (defaults to
        MAX_COLS).
    unique : bool, optional
        indicate if the values generated for these columns should be unique
        (per-column).

    Examples
    --------
    >>> from polars.testing.parametric import columns, dataframes
    >>> from hypothesis import given
    >>> @given(dataframes(columns(["x", "y", "z"], unique=True)))  # doctest: +SKIP
    ... def test_unique_xyz(df: pl.DataFrame) -> None:
    ...     assert_something(df)
    N)Ú	min_valueÚ	max_valuec                ó   — g | ]}d |› �‘ŒS )Úcol© )Ú.0Úns     ú{/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/polars/testing/parametric/strategies/legacy.pyú
<listcomp>zcolumns.<locals>.<listcomp>Z   s   € Ð?Ð?Ð?¨a 	 a 	 	Ð?Ð?Ð?ó    zgiven z dtypes for z namesz is not a valid polars datatypec                ó:   •— g | ]\  }}t          ||‰¬ ¦  «        ‘ŒS ))Únamer   r   )r   )r%   ÚnmÚtpr   s      €r'   r(   zcolumns.<locals>.<listcomp>m   s<   ø€ ð ð ð áˆB�õ 	�B˜b¨Ð0Ñ0Ô0ðð ð r)   T)Ústrict)ÚstÚintegersÚexampleÚ
isinstancer   ÚrangeÚlenr	   r   r   Úzip)
r   r   r   r   r   ÚnamesÚn_colsr   Ún_dtypesÚmsgs
       `     r'   Úcolumnsr:      sC  ø€ ðv €|ÝŒ{ X¸ÐBÑBÔB×JÒJÑLÔLˆÝ�$�ÑÔð Ø?Ð?µ5¸±;´;Ð?Ñ?Ô?ˆˆàˆÝ�‰ZŒZ€Fà€}Ø37°&¸6±/ˆˆÝ	˜Ñ	Ô	ð 	#Ø�˜6Ñ!ˆˆÝ	�E�8Ñ	$Ô	$ð #Ý˜E™
œ
Ð"ˆH vÒ-Ð-Ø?˜8Ð?Ð?°Ð?Ð?Ð?ˆCÝ! #Ñ&Ô&Ð&ØˆˆàÐ9Ð9Ð9ˆÝ˜cÑ"Ô"Ð"ðð ð ð å˜% °Ð5Ñ5Ô5ðñ ô ð r)   z:`create_list_strategy` is deprecated; use `lists` instead.)Úselect_fromÚsizeÚmin_sizeÚmax_sizer   Úinner_dtypeúPolarsDataType | Noner;   úSequence[Any] | Noner<   ú
int | Noner=   r>   úSearchStrategy[list[Any]]c               ó¾   — |�|x}}| €!t          ¦   «                              ¦   «         } n!t          | ¦  «                             ¦   «         } t          | ||||¬¦  «        S )aÉ  
    Create a strategy for generating Polars :class:`List` data.

    .. deprecated:: 0.20.26
        Use :func:`lists` instead.

    Parameters
    ----------
    inner_dtype : PolarsDataType
        type of the inner list elements (can also be another List).
    select_from : list, optional
        randomly select the innermost values from this list (otherwise
        the default strategy associated with the innermost dtype is used).
    size : int, optional
        if set, generated lists will be of exactly this size (and
        ignore the min_size/max_size params).
    min_size : int, optional
        set the minimum size of the generated lists (default: 0 if unset).
    max_size : int, optional
        set the maximum size of the generated lists (default: 3 if
        min_size is unset or zero, otherwise 2x min_size).
    unique : bool, optional
        ensure that the generated lists contain unique values.

    Examples
    --------
    Create a strategy that generates a list of i32 values:

    >>> from polars.testing.parametric import create_list_strategy
    >>> lst = create_list_strategy(inner_dtype=pl.Int32)  # doctest: +SKIP
    >>> lst.example()  # doctest: +SKIP
    [-11330, 24030, 116]
    N)r;   r=   r>   r   )r   r1   r   r   )r?   r;   r<   r=   r>   r   s         r'   Úcreate_list_strategyrE   s   sq   € ðV ÐØ"Ð"ˆ�8àÐÝ‘h”h×&Ò&Ñ(Ô(ˆˆå(¨Ñ5Ô5×=Ò=Ñ?Ô?ˆåØØØØØðñ ô ð r)   )N)r   r   r   r   r   r   r   r   r   r   r   r   )r?   r@   r;   rA   r<   rB   r=   r   r>   rB   r   r   r   rC   )"Ú
__future__r   Úcollections.abcr   Útypingr   r   Úhypothesis.strategiesÚ
strategiesr/   Úhypothesis.errorsr   Úpolars._utils.deprecationr   Úpolars.datatypesr	   Ú)polars.testing.parametric.strategies.corer
   r   Ú)polars.testing.parametric.strategies.datar   Ú*polars.testing.parametric.strategies.dtyper   r   Úsysr   Úpolars._typingr   r   Úversion_infoÚwarningsÚtyping_extensionsr:   rE   r$   r)   r'   ú<module>rV      só  ðØ "Ð "Ð "Ð "Ð "Ð "à $Ð $Ð $Ð $Ð $Ð $Ø %Ð %Ð %Ð %Ð %Ð %Ð %Ð %à "Ð "Ð "Ð "Ð "Ð "Ø -Ð -Ð -Ð -Ð -Ð -à 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø HÐ HÐ HÐ HÐ HÐ HÐ HÐ HØ ;Ð ;Ð ;Ð ;Ð ;Ð ;Ø QÐ QÐ QÐ QÐ QÐ QÐ QÐ Qàð 
1Ø€J€J€Jà4Ð4Ð4Ð4Ð4Ð4àAÐAÐAÐAÐAÐAÐAÐAà
Ô˜7Ò"Ð"Ø'Ð'Ð'Ð'Ð'Ð'Ð'à0Ð0Ð0Ð0Ð0Ð0ð €ð0ñô ð
 (,ðPð (,ØØØðPð Pð Pð Pð Pñ	ô ðPðf €ÐHÑIÔIà)-ð8ð )-ØØØØð8ð 8ð 8ð 8ð 8ñ JÔIð8ð 8ð 8r)   