zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
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
U
O±díã@sxdZddlZddlZddlmZgZeeeddœdd„Zedœd    d
„Zed d d ƒedd dƒede    eƒdƒeƒZ
dS)z=A module for creating docstrings for sphinx ``data`` domains.éNé)ÚNDArray)ÚnameÚvalueÚdocÚreturncCst |||f¡dS)zþAppend ``_docstrings_list`` with a docstring for `name`.
 
    Parameters
    ----------
    name : str
        The name of the object.
    value : str
        A string-representation of the object.
    doc : str
        The docstring of the object.
 
    N)Ú_docstrings_listÚappend)rrr©r
úSd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/_typing/_add_docstring.pyÚ
add_newdoc s r )rc Csüg}tD]è\}}}t |¡ dd¡}| d¡}g}d}|D]Š}t d|¡}    |    r²|r²t | ¡¡}
|
dkrˆd}| |         d¡›d|
›¡nd}| |         d¡›d    |
›¡| d¡q:| |›|›¡q:d 
|¡}d
|›d |›d|›} | | ¡qd 
|¡S) zaConvert all docstrings in ``_docstrings_list`` into a single
    sphinx-legible text block.
 
    Ú
z
    Úz^(\s+)[-=]+\s*$ZExamplesrz .. rubric:: z    z.. admonition:: z
.. data:: z
    :value: ) rÚtextwrapÚdedentÚreplaceÚsplitÚreÚmatchÚpopr    ÚgroupÚjoin) Z type_list_retrrrÚsÚlinesÚ    new_linesÚindentÚlineÚmÚprevZs_blockr
r
r Ú_parse_docstringss*
 
 rZ    ArrayLikeztyping.Union[...]ag
    A `~typing.Union` representing objects that can be coerced
    into an `~numpy.ndarray`.
 
    Among others this includes the likes of:
 
    * Scalars.
    * (Nested) sequences.
    * Objects implementing the `~class.__array__` protocol.
 
    .. versionadded:: 1.20
 
    See Also
    --------
    :term:`array_like`:
        Any scalar or sequence that can be interpreted as an ndarray.
 
    Examples
    --------
    .. code-block:: python
 
        >>> import numpy as np
        >>> import numpy.typing as npt
 
        >>> def as_array(a: npt.ArrayLike) -> np.ndarray:
        ...     return np.array(a)
 
    Z    DTypeLikeaÒ
    A `~typing.Union` representing objects that can be coerced
    into a `~numpy.dtype`.
 
    Among others this includes the likes of:
 
    * :class:`type` objects.
    * Character codes or the names of :class:`type` objects.
    * Objects with the ``.dtype`` attribute.
 
    .. versionadded:: 1.20
 
    See Also
    --------
    :ref:`Specifying and constructing data types <arrays.dtypes.constructing>`
        A comprehensive overview of all objects that can be coerced
        into data types.
 
    Examples
    --------
    .. code-block:: python
 
        >>> import numpy as np
        >>> import numpy.typing as npt
 
        >>> def as_dtype(d: npt.DTypeLike) -> np.dtype:
        ...     return np.dtype(d)
 
    raì
    A :term:`generic <generic type>` version of
    `np.ndarray[Any, np.dtype[+ScalarType]] <numpy.ndarray>`.
 
    Can be used during runtime for typing arrays with a given dtype
    and unspecified shape.
 
    .. versionadded:: 1.21
 
    Examples
    --------
    .. code-block:: python
 
        >>> import numpy as np
        >>> import numpy.typing as npt
 
        >>> print(npt.NDArray)
        numpy.ndarray[typing.Any, numpy.dtype[+ScalarType]]
 
        >>> print(npt.NDArray[np.float64])
        numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]]
 
        >>> NDArrayInt = npt.NDArray[np.int_]
        >>> a: NDArrayInt = np.arange(10)
 
        >>> def func(a: npt.ArrayLike) -> npt.NDArray[Any]:
        ...     return np.array(a)
 
    ) Ú__doc__rrZ_generic_aliasrrÚstrr rÚreprZ _docstringsr
r
r
r Ú<module>s  !ÿÿ
ÿ