
    ˀh[                    \    d dl mZ d dlZd dlZd dlmZ d dlmZ 	 d	dd	 	 	 	 	 d
dZddZ	y)    )annotationsN)settings)ParametricProfileNamesF)set_environmentc                  ddd}t        |       }dD ]   \  }}t        j                  d
d| |d| " |j                         st	        j
                  d|      r8t        |j                  dd	            }d| }t        j                  d
||d| d|j                  dd	       }t        j                  |       |rt        |       yy)ae  
    Load a named (or custom) hypothesis profile for use with the parametric tests.

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

    Parameters
    ----------
    profile : {str, int}, optional
        Name of the profile to load; one of "fast", "balanced", "expensive", or
        the integer number of iterations to run (which will create and register
        a custom profile with that value).

    set_environment : bool, default False
        If True, also set the environment variable `POLARS_HYPOTHESIS_PROFILE`
        to the given profile name/value.

    Examples
    --------
    >>> # load a custom profile that will run with 1500 iterations
    >>> from polars.testing.parametric import load_profile
    >>> load_profile(1500)
    TN)
print_blobdeadline))fastd   )balancedi  )	expensivei'  zpolars.)namemax_exampleszpolars\.custom\.[\d_]+$zpolars.custom.  )
strr   register_profileisdigitrematchintreplaceload_profileset_profile)profiler   common_settingsprofile_namer   
iterationsn_iterationss          ~/var/www/html/wine-match-dev/backend/winematch-backend/venv/lib/python3.12/site-packages/polars/testing/parametric/profiles.pyr   r      s    6 &*t<Ow<L 	
j
 	!! 	
4&!#	
 	
	
 *Dl!S<//0@"EF'~6!! 	
%	
 	
 \11)R@ABL,'L!     c                    t        |       j                  d      d   }|j                  dd      j                         rt        t	        |            }n)ddlm}  |t              }||vrd|d|}t        |      |t        j                  d	<   y
)a  
    Set the env var `POLARS_HYPOTHESIS_PROFILE` to the given profile name/value.

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

    Parameters
    ----------
    profile : {str, int}, optional
        Name of the profile to load; one of "fast", "balanced", "expensive", or
        the integer number of iterations to run (which will create and register
        a custom profile with that value).

    Examples
    --------
    >>> # prefer the 'balanced' profile for running parametric tests
    >>> from polars.testing.parametric import set_profile
    >>> set_profile("balanced")
    ._r   r   )get_argszinvalid profile name z; expected one of POLARS_HYPOTHESIS_PROFILEN)r   splitr   r   r   typingr&   r   
ValueErrorosenviron)r   r   r&   valid_profile_namesmsgs        r    r   r   J   s    * w<%%c*2.LC$,,.3|,- 	$&'=>22),)99KL_KbcCS/!.:BJJ*+r!   )r
   )r   ParametricProfileNames | intr   boolreturnNone)r   r/   r1   r2   )

__future__r   r+   r   
hypothesisr   polars._typingr   r   r   r   r!   r    <module>r6      sD    " 	 	  1 -3<"OT<")<"HL<"	<"~!;r!   