Ë
    D�DjE  ã                   óH   — d Z ddlmZ ddlmZ ddlZ G d„ d«      Zd„ Zd„ Zy)	az  global_random_seed fixture

The goal of this fixture is to prevent tests that use it to be sensitive
to a specific seed value while still being deterministic by default.

See the documentation for the SKLEARN_TESTS_GLOBAL_RANDOM_SEED
variable for insrtuctions on how to use this fixture.

https://scikit-learn.org/dev/computing/parallelism.html#sklearn-tests-global-random-seed
é    )Úenviron)ÚRandomNc                   ó   — e Zd Zdd„Zy)Ú
XDistHooksNc                 óX   — |j                   j                  d«      }||j                  d<   y )NÚrandom_seeds)ÚconfigÚ	getoptionÚworkerinput)ÚselfÚnoder   s      ú]C:\Crop_Prediction\Backend\crop-ai-system\venv\Lib\site-packages\sklearn/tests/random_seed.pyÚpytest_configure_nodez XDistHooks.pytest_configure_node   s&   € Ø—{‘{×,Ñ,¨^Ó<ˆØ+7ˆ×Ñ˜Ò(ó    )ÚreturnN)Ú__name__Ú
__module__Ú__qualname__r   © r   r   r   r      s   „ ô8r   r   c                 óð  ‡— | j                   j                  d«      r#| j                   j                  t        «       «       t	        t        d«      «      }t        j                  d«      }t        | d«      rd| j                  v r| j                  d   Šn§|€dgŠn¡|dk(  rt        «       j                  |«      gŠn�|dk(  r|Šnyd	|v r?|j                  d	«      \  }}t	        t        t        |«      t        |«      d
z   «      «      Šnt        |«      gŠt        ‰«      dk  st        ‰«      dkD  rt!        d|› �«      ‚‰| j"                  _         G ˆfd„d«      }| j                   j                   |«       «       y )NÚxdistéd   Ú SKLEARN_TESTS_GLOBAL_RANDOM_SEEDr   r   é*   ÚanyÚallú-é   r   éc   z�The value(s) of the environment variable SKLEARN_TESTS_GLOBAL_RANDOM_SEED must be in the range [0, 99] (or 'any' or 'all'), got: c                   óB   •— e Zd Z ej                  W ° ¬«      d„ «       Zy)ú0pytest_configure.<locals>.GlobalRandomSeedPlugin)Úparamsc              3   ó(   K  — |j                   –— y­w)aÙ  Fixture to ask for a random yet controllable random seed.

            All tests that use this fixture accept the contract that they should
            deterministically pass for any seed value from 0 to 99 included.

            See the documentation for the SKLEARN_TESTS_GLOBAL_RANDOM_SEED
            variable for insrtuctions on how to use this fixture.

            https://scikit-learn.org/dev/computing/parallelism.html#sklearn-tests-global-random-seed
            N)Úparam)r   Úrequests     r   Úglobal_random_seedzCpytest_configure.<locals>.GlobalRandomSeedPlugin.global_random_seed:   s   è ø€ ð —-‘-Óùs   ‚N)r   r   r   ÚpytestÚfixturer&   )r   s   €r   ÚGlobalRandomSeedPluginr!   9   s    ø„ Ø	ˆ�‰™|Ô	,ñ	 ó 
-ñ	 r   r)   )ÚpluginmanagerÚ	haspluginÚregisterr   ÚlistÚranger   ÚgetÚhasattrr   r   ÚchoiceÚsplitÚintÚminÚmaxÚ
ValueErrorÚoptionr   )r	   ÚRANDOM_SEED_RANGEÚrandom_seed_varÚstartÚstopr)   r   s         @r   Úpytest_configurer<      sV  ø€ Ø×Ñ×%Ñ% gÔ.Ø×Ñ×%Ñ%¤j£lÔ3äœU 3›ZÓ(ÐÜ—k‘kÐ"DÓE€OÜˆv�}Ô%¨.¸F×<NÑ<NÑ*Nà×)Ñ)¨.Ñ9‰Ø	Ð	 à�t‰Ø	˜EÒ	!ä›Ÿ™Ð(9Ó:Ð;‰Ø	˜EÒ	!Ø(‰à�/Ñ!Ø)×/Ñ/°Ó4‰KˆE�4Ü¤¤c¨%£j´#°d³)¸a±-Ó @ÓA‰Lä Ó0Ð1ˆLäˆ|Ó˜qÒ ¤C¨Ó$5¸Ò$:Üð-à-<Ð,=ð?óð ð
 ".€F‡M�MÔ÷ ó  ð ×Ñ×!Ñ!Ñ"8Ó":Õ;r   c                 óx   — t        j                  d«      }|dk(  r dd| j                  j                  d   › d�dgS y )Nr   r   zCTo reproduce this test run, set the following environment variable:z&    SKLEARN_TESTS_GLOBAL_RANDOM_SEED="r   ú"z]See: https://scikit-learn.org/dev/computing/parallelism.html#sklearn-tests-global-random-seed)r   r/   r7   r   )r	   r9   s     r   Úpytest_report_headerr?   K   sN   € Ü—k‘kÐ"DÓE€OØ˜%ÒàQØ4°V·]±]×5OÑ5OÐPQÑ5RÐ4SÐSTÐUð4ð	
ð 	
ð  r   )	Ú__doc__Úosr   Úrandomr   r'   r   r<   r?   r   r   r   ú<module>rC      s*   ðñ	õ Ý ã ÷8ñ 8ò/<ód

r   