zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
U
P±d¯‘ã @svddlZddlZddlZddlZddlZddlZddlZddlmZm    Z    m
Z
ddl m Z ddl mZmZmZddlZddddd    d
d d d ddddg Zdd„Zdd
„ZGdd„dƒZdd„Zdd„Zdd    „Zdd„Zd3dd „Zdd„Zdadad4dd „Zd5d!d"„Z e dƒd6d$d „ƒZ!e dƒej"fd%d „ƒZ#iZ$e %d&ej&¡Z'e dƒd7d)d„ƒZ(d*d+„Z)d,d-„Z*d.d„Z+d/d0„Z,d1d2„Z-dS)8éN)Ú issubclass_Ú issubsctypeÚ
issubdtype)Ú
set_module)ÚndarrayÚufuncÚasarrayrrrÚ    deprecateÚdeprecate_with_docÚ get_includeÚinfoÚsourceÚwhoÚlookforÚ byte_boundsÚ    safe_evalÚ show_runtimec    Cs²ddlm}m}m}ddlm}g}gg}}|D]"}||rJ| |¡q2| |¡q2| d|||dœi¡zddlm}| |ƒ¡Wnt    k
r¤t
dƒYnX||ƒdS)    aÈ
    Print information about various resources in the system
    including available intrinsic support and BLAS/LAPACK library
    in use
 
    See Also
    --------
    show_config : Show libraries in the system on which NumPy was built.
 
    Notes
    -----
    1. Information is derived with the help of `threadpoolctl <https://pypi.org/project/threadpoolctl/>`_
       library.
    2. SIMD related information is derived from ``__cpu_features__``,
       ``__cpu_baseline__`` and ``__cpu_dispatch__``
 
    Examples
    --------
    >>> import numpy as np
    >>> np.show_runtime()
    [{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
                          'found': ['SSSE3',
                                    'SSE41',
                                    'POPCNT',
                                    'SSE42',
                                    'AVX',
                                    'F16C',
                                    'FMA3',
                                    'AVX2'],
                          'not_found': ['AVX512F',
                                        'AVX512CD',
                                        'AVX512_KNL',
                                        'AVX512_KNM',
                                        'AVX512_SKX',
                                        'AVX512_CLX',
                                        'AVX512_CNL',
                                        'AVX512_ICL']}},
     {'architecture': 'Zen',
      'filepath': '/usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so',
      'internal_api': 'openblas',
      'num_threads': 12,
      'prefix': 'libopenblas',
      'threading_layer': 'pthreads',
      'user_api': 'blas',
      'version': '0.3.20'}]
    r©Ú__cpu_features__Ú__cpu_baseline__Ú__cpu_dispatch__)ÚpprintZsimd_extensions)ZbaselineÚfoundÚ    not_found)Úthreadpool_infoz¨WARNING: `threadpoolctl` not found in system! Install it by `pip install threadpoolctl`. Once installed, try `np.show_runtime` again for more detailed build informationN) Únumpy.core._multiarray_umathrrrrÚappendZ threadpoolctlrÚextendÚ ImportErrorÚprint)    rrrrZ config_foundZfeatures_foundZfeatures_not_foundÚfeaturer©r!úFd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/lib/utils.pyrs*/ 
  ýÿ cCsVddl}|jdkr.tj tj |j¡dd¡}n$ddlm}tj tj |j¡d¡}|S)a¬
    Return the directory that contains the NumPy \*.h header files.
 
    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.
 
    Notes
    -----
    When using ``distutils``, for example in ``setup.py``::
 
        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...
 
    rNÚcoreÚinclude)    ÚnumpyZ show_configÚosÚpathÚjoinÚdirnameÚ__file__Ú
numpy.corer#)r%Údr#r!r!r"r as 
 c@s"eZdZdZddd„Zdd„ZdS)Ú
_Deprecatez†
    Decorator class to deprecate old functions.
 
    Refer to `deprecate` for details.
 
    See Also
    --------
    deprecate
 
    NcCs||_||_||_dS©N)Úold_nameÚnew_nameÚmessage)Úselfr/r0r1r!r!r"Ú__init__Šsz_Deprecate.__init__c s2|j}|j}|j}|dkr ˆj}|dkr2d|‰n d||f‰|dk    rRˆd|7‰t ˆ¡‡‡fdd„ƒ}||_ˆj}|dkr„ˆ}n¤| ¡ d¡}    t    |    dd…ƒ}
|    d 
¡r¼|
d    |}nNt |    dƒd} |    dd…D]$} t | ƒ|
krìqþ| t | ƒd7} qØ|| d…}t   ˆd    |
¡‰d
 ˆ|g¡}||_|S) z:
        Decorator call.  Refer to ``decorate``.
 
        Nz`%s` is deprecated!z%`%s` is deprecated, use `%s` instead!Ú
cstjˆtddˆ||ŽS)Né)Ú
stacklevel)ÚwarningsÚwarnÚDeprecationWarning)ÚargsÚkwds©ZdepdocÚfuncr!r"Únewfunc£sz$_Deprecate.__call__.<locals>.newfuncérú z
 
)r/r0r1Ú__name__Ú    functoolsÚwrapsÚ__doc__Ú
expandtabsÚsplitÚ _get_indentÚlstripÚlenÚtextwrapÚindentr() r2r=r:Úkwargsr/r0r1r>ÚdocÚlinesrKÚskipÚliner!r<r"Ú__call__s@
ÿ    z_Deprecate.__call__)NNN)rAÚ
__module__Ú __qualname__rDr3rQr!r!r!r"r-~s
r-cCsDtj}|D]&}t| ¡ƒ}|r
t|t|ƒ|ƒ}q
|tjkr@d}|S)zU
    Determines the leading whitespace that could be removed from all the lines.
    r)ÚsysÚmaxsizerIrHÚmin)rNrKrPÚcontentr!r!r"rGÂs 
rGcOs4|r&|d}|dd…}t||Ž|ƒSt||ŽSdS)aœ
    Issues a DeprecationWarning, adds warning to `old_name`'s
    docstring, rebinds ``old_name.__name__`` and returns the new
    function object.
 
    This function may also be used as a decorator.
 
    Parameters
    ----------
    func : function
        The function to be deprecated.
    old_name : str, optional
        The name of the function to be deprecated. Default is None, in
        which case the name of `func` is used.
    new_name : str, optional
        The new name for the function. Default is None, in which case the
        deprecation message is that `old_name` is deprecated. If given, the
        deprecation message is that `old_name` is deprecated and `new_name`
        should be used instead.
    message : str, optional
        Additional explanation of the deprecation.  Displayed in the
        docstring after the warning.
 
    Returns
    -------
    old_func : function
        The deprecated function.
 
    Examples
    --------
    Note that ``olduint`` returns a value after printing Deprecation
    Warning:
 
    >>> olduint = np.deprecate(np.uint)
    DeprecationWarning: `uint64` is deprecated! # may vary
    >>> olduint(6)
    6
 
    rr?N©r-)r:rLÚfnr!r!r"r    Ðs
, cCs
t|dS)a
    Deprecates a function and includes the deprecation in its docstring.
 
    This function is used as a decorator. It returns an object that can be
    used to issue a DeprecationWarning, by passing the to-be decorated
    function as argument, this adds warning to the to-be decorated function's
    docstring and returns the new function object.
 
    See Also
    --------
    deprecate : Decorate a function such that it issues a `DeprecationWarning`
 
    Parameters
    ----------
    msg : str
        Additional explanation of the deprecation. Displayed in the
        docstring after the warning.
 
    Returns
    -------
    obj : object
 
    )r1rX)Úmsgr!r!r"r
sc
Csœ|j}|dd}|d}|d}t|ƒjj}|}}|dkrN||j|7}nFt||ƒD]2\}}    |    dkrz||d|    7}qX||d|    7}qX||7}||fS)a#
    Returns pointers to the end-points of an array.
 
    Parameters
    ----------
    a : ndarray
        Input array. It must conform to the Python-side of the array
        interface.
 
    Returns
    -------
    (low, high) : tuple of 2 integers
        The first integer is the first byte of the array, the second
        integer is just past the last byte of the array.  If `a` is not
        contiguous it will not use every byte between the (`low`, `high`)
        values.
 
    Examples
    --------
    >>> I = np.eye(2, dtype='f'); I.dtype
    dtype('float32')
    >>> low, high = np.byte_bounds(I)
    >>> high - low == I.size*I.itemsize
    True
    >>> I = np.eye(2); I.dtype
    dtype('float64')
    >>> low, high = np.byte_bounds(I)
    >>> high - low == I.size*I.itemsize
    True
 
    ÚdatarÚstridesÚshapeNr?)Z__array_interface__rÚdtypeÚitemsizeÚsizeÚzip)
ÚaZaiZa_dataZastridesZashapeZbytes_aZa_lowZa_highr]Zstrider!r!r"r$s   c Cs$|dkrt ¡j}|j}g}i}| ¡D]ˆ}t||tƒr(||}t|ƒ}|| ¡krl|d||}d}n|||<|}d}d t    t
|j ƒ¡}    t
|j ƒ}
|  ||    |
|jj|g¡q(d} d} d} d}|D]t}| t|dƒkræt|dƒ} | t|dƒkrt|dƒ} | t|dƒkr"t|dƒ} |drÆ|t|dƒ7}qÆt|ƒdkr¢td| ƒ}td| ƒ}td| ƒ}d    |d
|d
|d
f}t|d d t|ƒd d ƒ|D]l}td|dd
|t|dƒd|dd
|t|dƒd |dd
|t|dƒd |dfƒq¦td|ƒdS)a%
    Print the NumPy arrays in the given dictionary.
 
    If there is no dictionary passed in or `vardict` is None then returns
    NumPy arrays in the globals() dictionary (all NumPy arrays in the
    namespace).
 
    Parameters
    ----------
    vardict : dict, optional
        A dictionary possibly containing ndarrays.  Default is globals().
 
    Returns
    -------
    out : None
        Returns 'None'.
 
    Notes
    -----
    Prints out the name, shape, bytes and type of all of the ndarrays
    present in `vardict`.
 
    Examples
    --------
    >>> a = np.arange(10)
    >>> b = np.ones(20)
    >>> np.who()
    Name            Shape            Bytes            Type
    ===========================================================
    a               10               80               int64
    b               20               160              float64
    Upper bound on total bytes  =       240
 
    >>> d = {'x': np.arange(2.0), 'y': np.arange(3.0), 'txt': 'Some str',
    ... 'idx':5}
    >>> np.who(d)
    Name            Shape            Bytes            Type
    ===========================================================
    x               2                16               float64
    y               3                24               float64
    Upper bound on total bytes  =       40
 
    Nz (%s)rr?z x r5éé
zName %s Shape %s Bytes %s Typer@r4ú=éz%s %s %s %s %s %s %séz'
Upper bound on total bytes  =       %d)rTÚ    _getframeÚf_backÚ    f_globalsÚkeysÚ
isinstancerÚidr(ÚmapÚstrr]Únbytesrr^ÚnamerIÚintÚmaxr)ÚvardictÚframeZstaÚcacherqÚvarZidvÚnamestrÚoriginalZshapestrZbytestrZmaxnameZmaxshapeZmaxbyteZ
totalbytesÚvalZsp1Zsp2Zsp3Zprvalr!r!r"r]sb,
 
ÿ   
 
 
  ý  c
Cst|ƒ}|}|}d}| |¡}|D]h}||kr4d}    n|}    |t|ƒt|    ƒ}||kr~|dt|ƒ}|dd|d|}q"||    |}q"|S)Nz, Úr?z,
r@r5)rIrF)
rqÚ    argumentsÚwidthZ
firstwidthÚkZnewstrZsepstrZarglistZargumentZaddstrr!r!r"Ú _split_lineÄs
rr%cCs¦t|tƒtƒgƒ}|j|ji}|jg}|jg}t|ƒdkr<qž| d¡}| ¡D]L}t||t    j
ƒrN||j}||krN||j}|  |¡|  |¡|||<qNq.||fS)Nr) Ú
__import__ÚglobalsÚlocalsrAÚ__dict__rIÚpoprkrlÚtypesÚ
ModuleTyper)ÚmoduleZthedictZdictlistZ
totraverseZthisdictÚxÚmodnameZmoddictr!r!r"Ú _makenamedictÜs   
 
 
 
 
 rŠc
Cs†d}d}dd„}t|dt|ƒƒ}t|d|ƒ}|j}|jj}|dkrHtj}td||dtd    |j|dtd
||dtd |j    |dtd ||j
j ƒ|dtd ||j
j ƒ|dtd|j
j |dtdt|jjjƒ|f|dtdd|d|dkrtd|tj|f|dd}    nH|dkr@td||f|dtjdk}    ntd||f|dtjdk}    td||    ƒ|dtd|j|ddS)aOProvide information about ndarray obj.
 
    Parameters
    ----------
    obj : ndarray
        Must be ndarray, not checked.
    output
        Where printed output goes.
 
    Notes
    -----
    Copied over from the numarray module prior to its removal.
    Adapted somewhat as only numpy is an option now.
 
    Called by info.
 
    r{cSs|Sr.r!)rˆr!r!r"Ú<lambda>óz_info.<locals>.<lambda>Ú    __class__rANzclass: ©Úfilezshape: z    strides: z
itemsize: z    aligned: z contiguous: z    fortran: zdata pointer: %s%sz byteorder: r@)Úendr)ú|rez%s%s%sFú>z%sbig%sÚbigz
%slittle%sÚlittlez
byteswap: ztype: %s)ÚgetattrÚtyper\r^Ú    byteorderrTÚstdoutrr]r_ÚflagsZalignedÚ
contiguousZfortranÚhexÚctypesZ_as_parameter_Úvalue)
ÚobjÚoutputÚextraZticZbpÚclsÚnmr\ZendianZbyteswapr!r!r"Ú_infoðs> þ
 
 
r£éLc    Cs^ddl}ddl}t|dƒs$t|dƒr,|j}nt|dƒr<|j}|dkrJtj}|dkr^ttƒnüt|t    ƒrxt
||dnât|t ƒr^t dkr˜t |ƒ\a ad}g}tD]ˆ}zlt ||}    t|    ƒ|krÔtd||dn6| t|    ƒ¡td    ||dt|    ƒtd
||d|d 7}Wq¤tk
r*Yq¤Xq¤|dkrJtd ||dntd ||dnü| |¡sv| |¡rü|j}
zt | |¡ƒ} Wntk
r¨d} YnXt|
| ƒ|krÊt|
| |ƒ} n|
| } td| d|dt| |¡|dn^| |¡r<|j}
zt | |¡ƒ} Wntk
r:d} YnXt|
| ƒ|kr\t|
| |ƒ} n|
| } td| d|d| |¡} | dkr®t|dƒrÀt| |j¡|dnt| |¡|d| |¡}dd„|Dƒ}|rZtd|d|D]J}t||dƒ}|dk    r"| | |¡pd¡\}}td||f|dqînt|dƒrZt| |¡|ddS)a¼
    Get help information for a function, class, or module.
 
    Parameters
    ----------
    object : object or str, optional
        Input object or name to get information about. If `object` is a
        numpy object, its docstring is given. If it is a string, available
        modules are searched for matching objects.  If None, information
        about `info` itself is returned.
    maxwidth : int, optional
        Printing width.
    output : file like object, optional
        File like object that the output is written to, default is
        ``None``, in which case ``sys.stdout`` will be used.
        The object has to be opened in 'w' or 'a' mode.
    toplevel : str, optional
        Start search at this level.
 
    See Also
    --------
    source, lookfor
 
    Notes
    -----
    When used interactively with an object, ``np.info(obj)`` is equivalent
    to ``help(obj)`` on the Python prompt or ``obj?`` on the IPython
    prompt.
 
    Examples
    --------
    >>> np.info(np.polyval) # doctest: +SKIP
       polyval(p, x)
         Evaluate the polynomial p at x.
         ...
 
    When using a string for `object` it is possible to get multiple results.
 
    >>> np.info('fft') # doctest: +SKIP
         *** Found in numpy ***
    Core FFT routines
    ...
         *** Found in numpy.fft ***
     fft(a, n=None, axis=-1)
    ...
         *** Repeat reference found in numpy.fft.fftpack ***
         *** Total of 3 references found. ***
 
    rNZ_ppimport_importerÚ_ppimport_moduleÚ_ppimport_attr)rŸz+
     *** Repeat reference found in %s *** rŽz     *** Found in %s ***ú-r?zHelp for %s not found.z+
     *** Total of %d references found. ***z()r@r4r3cSsg|]}|ddkr|‘qS)rÚ_r!)Ú.0Úmethr!r!r"Ú
<listcomp>­s zinfo.<locals>.<listcomp>z
 
Methods:
ÚNonez   %s  --  %srD) ÚpydocÚinspectÚhasattrr¥r¦rTr˜r rlrr£roÚ    _namedictrŠÚ    _dictlistrmrrÚKeyErrorÚ
isfunctionÚismethodrAÚ    signatureÚ    ExceptionrIrÚgetdocÚisclassr3Z
allmethodsr•Zsplitdoc)ÚobjectZmaxwidthrŸÚtoplevelr­r®ZnumfoundZobjlistrxržrqr|ZargstrZdoc1ÚmethodsZpublic_methodsrªZthisobjZmethstrÚotherr!r!r"r &s¢5
ÿ
 
    ÿþ 
ÿþ
 
 
 
 
 
 
ÿ cCsZddl}z,td| |¡|dt| |¡|dWn tk
rTtd|dYnXdS)aí
    Print or write to a file the source code for a NumPy object.
 
    The source code is only returned for objects written in Python. Many
    functions and classes are defined in C and will therefore not return
    useful information.
 
    Parameters
    ----------
    object : numpy object
        Input object. This can be any object (function, class, module,
        ...).
    output : file object, optional
        If `output` not supplied then source code is printed to screen
        (sys.stdout).  File object must be created with either write 'w' or
        append 'a' modes.
 
    See Also
    --------
    lookfor, info
 
    Examples
    --------
    >>> np.source(np.interp)                        #doctest: +SKIP
    In file: /usr/lib/python2.6/dist-packages/numpy/lib/function_base.py
    def interp(x, xp, fp, left=None, right=None):
        """.... (full docstring printed)"""
        if isinstance(x, (float, int, number)):
            return compiled_interp([x], xp, fp, left, right).item()
        else:
            return compiled_interp(x, xp, fp, left, right)
 
    The source code is only returned for objects written in Python.
 
    >>> np.source(np.array)                         #doctest: +SKIP
    Not available for this object.
 
    rNz In file: %s
rŽzNot available for this object.)r®rÚ getsourcefileÚ    getsourcer¶)r¹rŸr®r!r!r"r ¼s )z[a-z0-9_]+\(.*[,=].*\)TFc    sÂddl}t|||ƒ‰g}t|ƒ ¡ ¡‰ˆs0dSˆ ¡D]@\}\}}    }
|    dkrPq8| ¡‰t‡fdd„ˆDƒƒr8| |¡q8dddddœ‰‡‡fd    d
„‰‡‡fd d „} |j| d dd     ˆ¡} | dt
| ƒg} |ddd…D]€}ˆ|\‰}    }dd„ˆ  ¡ d¡Dƒ}z(|d  ¡}t   |¡r,|d  ¡}Wntk
rHd}YnX|  d||f¡qÜ|sn|  d¡|dk    rŠ| d     | ¡¡n4t
| ƒdkr°| ¡}|d     | ¡ƒntd     | ¡ƒdS)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.
    ...
 
    rN)r‡r¹c3s|]}|ˆkVqdSr.r!©r©Úw)rMr!r"Ú    <genexpr>7szlookfor.<locals>.<genexpr>ièéüÿÿ)r=Úclassr‡r¹cs¦d}d | ¡ ¡ d¡dd…¡‰|t‡fdd„ˆDƒƒ7}|t‡fdd„ˆDƒƒ7}|tˆƒ d7}|ˆ |d¡7}|ˆ d    ¡ d
7}|t| d d ƒ7}|S) Nrr4rgcsg|]}|ˆkrd‘qS)éÈr!r¿)Ú    first_docr!r"r«Esz.lookfor.<locals>.relevance.<locals>.<listcomp>csg|]}|ˆkrd‘qS)ér!r¿)rqr!r"r«GsrfrÂÚ.rdédiœÿÿÿ)    r(ÚlowerÚstriprFÚsumrIÚgetÚcountrs)rqZdocstrÚkindÚindexÚr)Úkind_relevanceÚwhats)rÅrqr"Ú    relevanceAs zlookfor.<locals>.relevancecsˆ|fˆ|žŽSr.r!)rb)rvrÓr!r"Úrelevance_valueQsz lookfor.<locals>.relevance_value)ÚkeyzSearch results for '%s'r@r§éÿÿÿÿcSsg|]}| ¡r| ¡‘qSr!)rÊ)r©rPr!r!r"r«[sÿzlookfor.<locals>.<listcomp>r4r?r{z    %s
    %szNothing found.rd)r­Ú_lookfor_generate_cacherorÉrFÚitemsÚallrÚsortr(rIrÊÚ_function_signature_reÚsearchÚ
IndexErrorÚwriteZgetpagerr)Úwhatr‡Úimport_modulesÚ
regeneraterŸr­rrqZ    docstringrÎrÏrÔÚsÚ    help_textÚixZdoclinesrÅZpagerr!)rvrMrÑrÓrÒr"r÷sN/  ÿ   
 
 
c
CsÈddl}ddlm}|dkr d}t|tƒr\z t|ƒWntk
rNiYSXtj|}n8t|t    ƒspt|t
ƒr”i}|D]}|  t |||ƒ¡qx|St |ƒtkr°|s°tt |ƒSi}|tt |ƒ<i}d}|j|fg}    |    rÄ|     d¡\}
} t | ƒ|kröqÔd|t | ƒ<|d7}d} | | ¡r6d} z
| j} Wntk
rBd} YnX|rZt| d    ƒrZ| jD]ü}t |¡D]ê}tj ||¡}tj ||d
¡}tj |¡r´| d ¡r´|dd …}ntj |¡rj|}nqj|d krڐqjzDtj}tj}z$|ƒt_|ƒt_td|
|fƒW5|t_|t_XWn2tk
r6‚Yntk
rPYqjYnXqjq\t | ƒD]Ð\}}z$t!|dd|
|fƒ}t!|ddƒ}Wn&t"k
r´d|
|f}d}YnXd|krÒ|rÒd||f}| #|
d¡söt|t$ƒrbnqbn$| |¡s| dks|| ksqb|     %d|
|f|f¡qbnL| &| ¡rrd} t | ƒD] \}}|     %d|
|f|f¡qNnt| dƒr‚d} z| '| ¡}Wnt"k
rªd}YnX|dk    rÔ|| |f||
<qÔ|S)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.
 
    rN)ÚStringIOr%Tr?r¹r‡Ú__path__z __init__.pyz.pyéýÿÿÿr3z%s.%srArRrÇrÃrQr=)(r®Úiorårlror€rrTÚmodulesÚlistÚtupleÚupdater×rmÚ_lookfor_cachesrAr„ÚismoduleÚ__all__ÚAttributeErrorr¯rær&Úlistdirr'r(ÚisfileÚendswithr˜ÚstderrÚKeyboardInterruptÚ BaseExceptionÚ _getmembersr•Ú    NameErrorÚ
startswithrrr¸r·)r‡ràrár®rårvÚmodÚseenrÏÚstackrqÚitemrÎZ_allÚpthZmod_pathZthis_pyZinit_pyZ    to_importZ
old_stdoutZ
old_stderrÚnÚvZ    item_nameÚmod_namerMr!r!r"r×ssº 
 
 
ÿ      
 
 
ÿ
 
     
r×csFddl}z| ˆ¡}Wn*tk
r@‡fdd„tˆƒDƒ}YnX|S)Nrcs$g|]}tˆ|ƒr|tˆ|ƒf‘qSr!)r¯r•)r©rˆ©rýr!r"r«s
ÿz_getmembers.<locals>.<listcomp>)r®Ú
getmembersr¶Údir)rýr®Úmembersr!rr"r÷þs r÷cCsddl}| |¡S)au
    Protected string evaluation.
 
    Evaluate a string containing a Python literal expression without
    allowing the execution of arbitrary non-literal code.
 
    .. warning::
 
        This function is identical to :py:meth:`ast.literal_eval` and
        has the same security implications.  It may not always be safe
        to evaluate large input strings.
 
    Parameters
    ----------
    source : str
        The string to evaluate.
 
    Returns
    -------
    obj : object
       The result of evaluating `source`.
 
    Raises
    ------
    SyntaxError
        If the code has invalid Python syntax, or if it contains
        non-literal code.
 
    Examples
    --------
    >>> np.safe_eval('1')
    1
    >>> np.safe_eval('[1, 2, 3]')
    [1, 2, 3]
    >>> np.safe_eval('{"foo": ("bar", 10.0)}')
    {'foo': ('bar', 10.0)}
 
    >>> np.safe_eval('import os')
    Traceback (most recent call last):
      ...
    SyntaxError: invalid syntax
 
    >>> np.safe_eval('open("/home/user/.ssh/id_dsa").read()')
    Traceback (most recent call last):
      ...
    ValueError: malformed node or string: <_ast.Call object at 0x...>
 
    rN)ÚastÚ literal_eval)r rr!r!r"rs2cCsr|jdkr|St |jd|d¡}tj |¡r8| d¡}t | ¡¡dkrnt    |tj
ƒrd|j   tj ¡Stj ||<|S)a{
    Utility function to check median result from data for NaN values at the end
    and return NaN in that case. Input result can also be a MaskedArray.
 
    Parameters
    ----------
    data : array
        Sorted input data to median function
    result : Array or MaskedArray
        Result of median function.
    axis : int
        Axis along which the median was computed.
 
    Returns
    -------
    result : scalar or ndarray
        Median or NaN in axes which contained NaN in the input.  If the input
        was an array, NaN will be inserted in-place.  If a scalar, either the
        input itself or a scalar NaN.
    rrÖ)ÚaxisF)r`ÚnpÚisnanZtakeÚmaZ isMaskedArrayZfilledZ count_nonzeroZravelrlZgenericr^r–Únan)r[Úresultrrÿr!r!r"Ú_median_nancheck>s
 
 
rcCsrddlm}m}m}t|ƒdkr0t|ƒdkr0dSd |¡}|D].}||r\|d|›d7}q>|d|›d7}q>|S)a‰
    Returns a string contains the supported CPU features by the current build.
 
    The string format can be explained as follows:
        - dispatched features that are supported by the running machine
          end with `*`.
        - dispatched features that are "not" supported by the running machine
          end with `?`.
        - remained features are representing the baseline.
    rrr{r@Ú*ú?)rrrrrIr()rrrZenabled_featuresr r!r!r"Ú    _opt_infobs 
r)N)r%)N)Nr¤Nr%)NTFN).r&rTrJr…Úrer7rBZnumpy.core.numerictypesrrrZnumpy.core.overridesrr+rrrr%r    rïrr r-rGr    r
rrrr°r±rŠr£r r˜r ríÚcompileÚIrÛrr×r÷rrrr!r!r!r"Ú<module>sl ýLD59
g
 
6 3ÿ { 
6$