
    k h%                     z    d dl Z d dlZd dlZd dlmZ i Z ej                  dej                        Zd Z	d Z
ddZy)    N)ufuncz[a-z0-9_]+\(.*[,=].*\)c           	          dd l }	 |j                  |       }|S # t        $ r; t        |       D cg c]  }t	        | |      s|t        | |      f nc c}w }}Y |S w xY w)Nr   )inspect
getmembers	Exceptiondirhasattrgetattr)itemr   membersxs       {/home/developers/rajanand/mypropertyqr-fmb-refixing-v2/venv/lib/python3.12/site-packages/skimage/_vendored/numpy_lookfor.py_getmembersr      si    Q$$T* N  Q25d)PQwtQ?OAwtQ'(PPPNQs     AAAAAc                    ddl }ddlm} | d} t        | t              r 	 t        |        t        j                  |    } nGt        | t              st        | t              r'i }| D ]  }|j                  t        |||               |S t        |       t        v r|st        t        |          S i }|t        t        |       <   i }d}| j                  | fg}	|	r|	j!                  d      \  }
}t        |      |v r%d|t        |      <   |dz  }d}|j#                  |      rd}	 |j$                  }|rDt)        |d	      r7|j*                  D ]'  }t-        j.                  |      D ]  }t,        j0                  j3                  ||      }t,        j0                  j3                  ||d
      }t,        j0                  j5                  |      r|j7                  d      r|dd }n#t,        j0                  j5                  |      r|}n|dk(  r	 t        j8                  }t        j:                  }	  |       t        _         |       t        _        t        |
 d|        |t        _        |t        _         * tA        |      D ]  \  }}	 tC        |d|
 d|       }tC        |dd      }d|vr	|r| d| }|jG                  |
dz         st        |tH              rnY|j#                  |      s|||v sq|	jK                  |
 d| |f        nM|jM                  |      r.d}tA        |      D ]  \  }}|	jK                  |
 d| |f        nt)        |d      rd}	 |jO                  |      }||||f||
<   |	r|S # t        $ r i cY S w xY w# t&        $ r d}Y lw xY w# |t        _        |t        _        w xY w# t<        $ r  t>        $ r Y kw xY w# tD        $ r |
 d| }d}Y Aw xY w# tD        $ r d}Y w xY w)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%> 	SCLL0njQR	S	&z_$Zr&z** E"'OBvJDEoov&'E
YYq\
dd8tRX
D!D||
 '$
";== %C$&JJsO %"$'',,sH"="$'',,sHm"L77>>'2x7H7H7O(0"IWW^^G4(0I$$
2$%),J),J8-5Z
-5Z
 *dV1YK+@ A-7
-7
+%%> $D) 11$ '"&!!I
  'q,=H i'H#+*Ai[ 9I ++D3J7!!U+ !**1-dasmQ/0314 __T"D#D) 11asmQ/01T:&D	..&C ?e,E$Kq t LY  	I	> " 4 .8
-7
0 "!, % %% ! $ $(&!I#H	$6  	C	sq   M: !N  N8(0NN8OO* :NNNNN55N88OOO'&O'*O87O8c                 h   ddl }t        |||      g }t        |       j                         j	                         syj                         D ]D  \  }\  }}	}
|	dv r|j                         t        fdD              s4|j                  |       F dddddfdfd	}|j                  |
       ddj                         d}|dt        |      z  g}|ddd   D ]  }|   \  }	}j                         j	                  d      D cg c]#  }|j                         s|j                         % }}	 |d   j                         }t        j                  |      r|d   j                         }|j                  | d|         |s|j                  d       |!|j                  dj                  |             yt        |      dkD  r(|j!                         } |dj                  |             yt#        dj                  |             yc c}w # t        $ r d}Y w xY w)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   &   K   | ]  }|v  
 y wN ).0wrT   s     r   	<genexpr>zlookfor.<locals>.<genexpr>   s     'AqCx's   i  )r   r   r   r   c                    d}dj                  |j                         j                         j                  d      d d       }|t	        D cg c]	  }||v sd c}      z  }|t	        D cg c]	  }|| v sd c}      z  }|t        |        dz  z  }|j                  |d      z  }|| j                  d       d	z  z  }|t        | d
z  d      z  }|S c c}w c c}w )Nr   
            r\   r   
   d   i)	r3   lowerstripsplitsumlengetcountmax)	rF   docstrrG   rD   r	first_docrZ   kind_relevancewhatss	          r   	relevancezlookfor.<locals>.relevance   s    IIflln224::4@!DE		Su7!Y#788	Se1qDy"122	c$iZ!^	^e,,	djjo""	S%#t$$ 81s   	C
C
.	C
8C
c                      | g|     S rW   rX   )arA   rr   s    r   relevance_valuez lookfor.<locals>.relevance_value  s    &U1X&&    )keyzSearch results for ' '-r^   r    z
    zNothing found.rc   )pydocr)   r!   re   rg   itemsallr<   sortr3   ri   rf   _function_signature_research
IndexErrorwritegetpagerprint)whatr   r?   r@   outputr}   foundrF   	docstringrG   rD   ru   s	help_textixlinedoclinesro   pagerrA   rT   rp   rr   rq   s                      @@@@@r   lookforr      s   Z  $FNJGE EIOO##%E*/++- &&y$''oo'''LL #TUeTN ' 
JJ?J# sxx/q1AC#a&L!Idd 5dT2-0YY[->->t-DUT

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