
    h%                     |    S SK r S SKrS SKrS SKJr  0 r\R                  " S\R                  5      rS r	S r
SS jrg)    N)ufuncz[a-z0-9_]+\(.*[,=].*\)c           	          SS K n UR                  U 5      nU$ ! [         aB    [        U 5       Vs/ s H"  n[	        X5      (       d  M  U[        X5      4PM$     Os  snf nn U$ f = f)Nr   )inspect
getmembers	Exceptiondirhasattrgetattr)itemr   membersxs       Y/var/www/fran/franai/venv/lib/python3.13/site-packages/skimage/_vendored/numpy_lookfor.py_getmembersr      sk    Q$$T* N  Q25d)P)Qwt?O(Awt'()PPNQs     A%AAA%$A%c                    SSK nSSKJn  U c  Sn [        U [        5      (       a    [        U 5        [        R                  U    n OR[        U [        5      (       d  [        U [        5      (       a(  0 nU  H  nUR                  [        XaU5      5        M      U$ [        U 5      [        ;   a  U(       d  [        [        U 5         $ 0 nU[        [        U 5      '   0 nSnU R                  U 4/n	U	(       Ga  U	R!                  S5      u  p[        U5      U;   a  M,  SU[        U5      '   US-  nSnUR#                  U5      (       Ga)  Sn UR$                  nU(       Ga^  [)        US	5      (       GaL  UR*                   GH;  n[,        R.                  " U5       GH  n[,        R0                  R3                  X5      n[,        R0                  R3                  XS
5      n[,        R0                  R5                  U5      (       a  UR7                  S5      (       a  USS nO)[,        R0                  R5                  U5      (       a  UnOM  US:X  a  M   [        R8                  n[        R:                  n U" 5       [        l        U" 5       [        l        [        U
 SU 35        U[        l        U[        l        GM     GM>     [A        U5       H  u  nn [C        USU
 SU 35      n[C        USS5      nSU;  a  U(       a  U SU 3nURG                  U
S-   5      (       d  [        U[H        5      (       a  O#Mk  UR#                  U5      (       d  Ub  UU;   d  M  U	RK                  U
 SU 3U45        M     OYURM                  U5      (       a0  Sn[A        U5       H  u  nnU	RK                  U
 SU 3U45        M      O[)        US5      (       a  Sn URO                  U5      nUb  UX4XZ'   U	(       a  GM  U$ ! [         a    0 s $ f = f! [&         a    Sn GNf = f! U[        l        U[        l        f = f! [<         a    e [>         a     GM  f = f! [D         a    U
 SU 3nSn GNuf = f! [D         a    Sn Nf = f)a  
Generate docstring cache for given module.

Parameters
----------
module : str, None, module
    Module for which to generate docstring cache
import_modules : bool
    Whether to import sub-modules in packages.
regenerate : bool
    Re-generate the docstring cache

Returns
-------
cache : dict {obj_full_name: (docstring, kind, index), ...}
    Docstring cache for the module, either cached one (regenerate=False)
    or newly generated.

r   N)StringIOnumpyT   objectmodule__path__z__init__.pyz.py__init__.__name__
__module__class__call__func)(r   ior   
isinstancestr
__import__ImportErrorsysmoduleslisttupleupdate_lookfor_generate_cacheid_lookfor_cachesr   popismodule__all__AttributeErrorr	   r   oslistdirpathjoinisfileendswithstdoutstderrKeyboardInterruptBaseExceptionr   r
   	NameError
startswithr   appendisclassgetdoc)r   import_modules
regenerater   r   cachemodseenindexstacknamer   kind_allpthmod_paththis_pyinit_py	to_import
old_stdout
old_stderrnv	item_namemod_namedocs                             r   r)   r)   "   s   * ~&#	v V$	FD	!	!Z%>%>CLL0jQR 	&z_$Zr&z** E"'OBvJDEoov&'E
YYq\
d8tRX
D!!D||
 '$
";";==C$&JJsO"$'',,s"="$'',,sm"L77>>'22x7H7H7O7O(0"IWW^^G44(0I$$
2$%),J),J8-5Z
-5Z
 *dV1YK+@ A-7
-7
+ %4 )> $D)1$ '"&!!I
  'q,=H i'H#+*Ai[ 9I ++D3J77!!U++ !**1--dasmQ/03 *4 __T""D#D)1asmQ/0 *T:&&D	..&C ?,EKq %t LY  	I	> " 4 .8
-7
0 "!, % %% ! $ $(&!I#H	$6  	C	sq   O+ O=  P+'0PP+	QQ! +O:9O:=PPP((P++QQQQ!Q0/Q0c                   ^^^^^ SSK n[        XU5      m/ n[        U 5      R                  5       R	                  5       mT(       d  gTR                  5        HN  u  nu  pn
U	S;   a  M  UR                  5       m[        U4S jT 5       5      (       d  M=  UR                  U5        MP     SSSSS.mUU4S jmUU4S	 jnUR                  US
9  SSR                  T5       S3nUS[        U5      -  /nUSSS2    H  nTU   u  mpTR                  5       R	                  S5       Vs/ s H)  oR                  5       (       d  M  UR                  5       PM+     nn US   R                  5       n[        R                  U5      (       a  US   R                  5       nUR                  U SU 35        M     U(       d  UR                  S5        Ub!  UR                  SR                  U5      5        g[        U5      S:  a(  UR!                  5       nU" SR                  U5      5        g[#        SR                  U5      5        gs  snf ! [         a    Sn Nf = f)a&  
Do a keyword search on docstrings.

A list of objects that matched the search is displayed,
sorted by relevance. All given keywords need to be found in the
docstring for it to be returned as a result, but the order does
not matter.

Parameters
----------
what : str
    String containing words to look for.
module : str or list, optional
    Name of module(s) whose docstrings to go through.
import_modules : bool, optional
    Whether to import sub-modules in packages. Default is True.
regenerate : bool, optional
    Whether to re-generate the docstring cache. Default is False.
output : file-like, optional
    File-like object to write the output to. If omitted, use a pager.

See Also
--------
source, info

Notes
-----
Relevance is determined only roughly, by checking if the keywords occur
in the function name, at the start of a docstring, etc.

Examples
--------
>>> np.lookfor('binary representation') # doctest: +SKIP
Search results for 'binary representation'
------------------------------------------
numpy.binary_repr
    Return the binary representation of the input number as a string.
numpy.core.setup_common.long_double_representation
    Given a binary dump as given by GNU od -b, look for long double
numpy.base_repr
    Return a string representation of a number in the given base system.
...

r   N)r   r   c              3   ,   >#    U  H	  oT;   v   M     g 7fN ).0wrT   s     r   	<genexpr>lookfor.<locals>.<genexpr>   s     'ACxs   i  )r   r   r   r   c                   > SnSR                  UR                  5       R                  5       R                  S5      S S 5      nU[	        T Vs/ s H  ofU;   d  M
  SPM     sn5      -  nU[	        T Vs/ s H  ofU ;   d  M
  SPM     sn5      -  nU[        U 5      * S-  -  nUTR                  US5      -  nX@R                  S5      * S	-  -  nU[        U* S
-  S5      -  nU$ s  snf s  snf )Nr   
            r]   r   
   d   i)	r3   lowerstripsplitsumlengetcountmax)	rF   docstrrG   rD   r	first_docrZ   kind_relevancewhatss	          r   	relevancelookfor.<locals>.relevance   s    IIflln224::4@!DE		Su7u!Y#u788	Se1eDy"e122	c$iZ!^	^e,,	jjo""	S%#t$$ 81s   	C"
C"
3	C'
 C'
c                    > T" U /TU    Q76 $ rW   rX   )arA   rs   s    r   relevance_value lookfor.<locals>.relevance_value  s    &U1X&&    )keyzSearch results for ' '-r_   r    z
    zNothing found.rd   )pydocr)   r!   rf   rh   itemsallr<   sortr3   rj   rg   _function_signature_research
IndexErrorwritegetpagerprint)whatr   r?   r@   outputr   foundrF   	docstringrG   rD   rw   s	help_textixlinedoclinesrp   pagerrA   rT   rq   rs   rr   s                      @@@@@r   lookforr      s   Z  $FJGE EIOO##%E*/++-&&y''oo''''LL +8 #TUeTN ' 
JJ?J# sxx/q1AC#a&L!IdddT-0YY[->->t-DU-DT

LDJJL-DU	 ))+I%,,Y77$QK--/	 	D6	{34  )* TYYy)*	Y"	 dii	"#dii	"#+ V  	I	s   &IIA III)NTFN)r$   r0   rer   r   r+   compileIr   r   r)   r   rX   ry   r   <module>r      sD     	 	  
 $=rttD K\w$ry   