
    i                     :   % S r SSKrSSKrSSKJr  SSKJrJr  \(       a  SSKJ	r	  \
\S-  \\   4   r\\S'   SrS\4S	 jrS
\S\4   S\S\4S jrSSS
\S\4   S\SS4S jrS\4S jrS\S\4S jrSq\" 5       rS\4S jr\S:X  a  SSKr\" \" 5       5        gg)aN  
This is a toolkit for determining which module set the "flush to zero" flag.

For details, see the docstring and comments in `identify_ftz_culprit()`.  This module
is defined outside the main Hypothesis namespace so that we can avoid triggering
import of Hypothesis itself from each subprocess which must import the worker function.
    N)Callable)TYPE_CHECKING	TypeAlias)QueueFTZCulprits)1zarchive-pdf-toolszbgfx-pythonzbicleaner-ai-gloveBTreescadbiomctranslate2dyNETdyNET38geventzglove-python-binaryhigrahybridqikomiaiohz	jij-cimodlavavuzlavavu-osmesaMulticoreTSNEzneural-compressornwhyopenjij	openturnsperfmetricspHashPyz
pyace-litepyapr
pycompadrezpycompadre-serialPyKEPpykepzpylimer-toolspyqubopyscfPyTATzpython-prtreez
qiskit-aerzqiskit-aer-gpu
RelStoragezsail-mlsegmentationsentesinrsnapmlsuperman	symenginezsystran-alignztexture-toolztsne-mpxcsfreturnc                      SS:H  $ )Ng       r    r*       W/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/_hypothesis_ftz_detector.pyflush_to_zeror-   .   s    ?r+   fn.argsc                     SS K nUR                  SSS9  UR                  5       nUR                  [        X0/UQ7S9nUR                  5         UR                  5       nUR                  5         U$ )Nr   spawnT)force)targetr/   )multiprocessingset_start_methodr   Processr3   startgetjoin)r.   r/   mpqpretvals         r,   run_in_processr>   3   s]     t,HHJA


&~~
6AGGIUUWFFFHMr+   r;   zQueue[FTZCulprits]c                 ,    U R                  U" U6 5        g N)put)r;   r.   r/   s      r,   r3   r3   ?   s     EE"d)r+   c                  H    [        5       [        [        R                  5      4$ r@   )r-   setsysmodulesr*   r+   r,   always_imported_modulesrF   E   s    ?C,,,r+   modc                     [        [        R                  5      n [        R                  " U 5        [        [        R                  5      U-
  n[        5       U4$ ! [
         a    S[        5       4s $ f = f)z7Return the set of modules imported transitively by mod.N)rC   rD   rE   	importlibimport_module	Exceptionr-   )rG   beforeimportss      r,   modules_imported_byrN   I   sb    F$ #++'G?G##  SU{s   A A21A2c                  .   [         (       a  [         $ [        [        5      u  pU (       a  [        S5      e[        R                  U5        S[        S[        [        [        [        4   4S jn[        [        R                  5      [        -
  n0 nU(       ag  [        X2S9nUR                  U5        [        [        U5      u  pgU[        -  nU(       a	  XtU'   X7-  nOX7-  n[        R                  U5        U(       a  Mg  [        S U 5       5      nU V	s1 s H  oR!                  U5      (       a  M  U	iM     n
n	[#        U
5       H:  n[#        U
5       H(  nXU   ;   d  M  XU   ;  d  M  U
R                  U5        M*     M<     [        U
5      q [         $ s  sn	f )zAFind the modules in sys.modules which cause "mod" to be imported.z3Python is always in FTZ mode, even without imports!namer(   c                 8    U [         ;  U R                  S5      U 4$ )zEPrefer known-FTZ modules, then top-level packages, then alphabetical..)KNOWN_EVER_CULPRITScount)rP   s    r,   key"identify_ftz_culprits.<locals>.keyk   s    //C$GGr+   )rU   c              3   *   #    U  H	  oS -   v   M     g7f)rR   Nr*   ).0ns     r,   	<genexpr>(identify_ftz_culprits.<locals>.<genexpr>   s     9&8W&8s   )	KNOWN_FTZr>   rF   RuntimeErrorCHECKED_CACHEupdatestrtupleboolintrC   rD   rE   mindiscardrN   
startswithsorted)always_enables_ftzalways_importsrU   
candidatestriggering_modulesrG   enables_ftzrM   prefixeskresultabs                r,   identify_ftz_culpritsrr   Z   sf    y *88O)P&PQQ(H# H%c3/ H
 S[[!M1J
*&3-.A3G= &-s#!J!J  ) *" 9&899H+J+A<<3Ia+FJ F^Aq))a!7L.Lq!    FI Ks   F0F__main__)__doc__rI   rD   collections.abcr   typingr   r   r4   r   ra   rb   rC   r`   r   __annotations__rS   r-   objectr>   r3   rF   rN   r\   r^   rr   __name__	grequestsprintr*   r+   r,   <module>r|      s     
 $ +%td{CH45Y 5  t 
	x[ 01 	& 	[ 	!)#{*:!;DJ	- -$S $[ $ 	8s 8v z  


!" r+   