PATH:
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
numpy
/
_typing
/
__pycache__
/
Editing: _add_docstring.cpython-311.pyc
� � hR � �� � d Z ddlZddlZddlmZ g Zdedededdfd �Zdefd �Z eddd � � eddd� � ed e e� � d� � e� � Z dS )z=A module for creating docstrings for sphinx ``data`` domains.� N� )�NDArray�name�value�doc�returnc �@ � t � | ||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)r r r s �o/builddir/build/BUILD/cloudlinux-venv-1.0.8/venv/lib64/python3.11/site-packages/numpy/_typing/_add_docstring.py� add_newdocr s% � � ���T�5�#�.�/�/�/�/�/� c �� � g } t D �]U\ }}}t j |� � � dd� � }|� d� � }g }d}|D ]�}t j d|� � } | r�|r�t j |� � � � � } | dk r0d}|� | � d� � � d| � �� � n/d}|� | � d� � � d | � �� � |� d� � ��|� |� |� �� � ��d� |� � }d |� d|� d|� �}| � |� � ��Wd� | � � S )zaConvert all docstrings in ``_docstrings_list`` into a single sphinx-legible text block. � z � z^(\s+)[-=]+\s*$�Examplesr z.. rubric:: z z.. admonition:: z .. data:: z :value: )r �textwrap�dedent�replace�split�re�match�popr �group�join)� type_list_retr r r �s�lines� new_lines�indent�line�m�prev�s_blocks r �_parse_docstringsr% s� � � �M�,� &� &���e�S��O�C� � �(�(��x�8�8�� ���� � ��� ���� 4� 4�D���+�T�2�2�A�� 4�Y� 4���y�}�}���7�7���:�%�%��F��$�$����� � �%F�%F��%F�%F�G�G�G�G�$�F��$�$����� � �%J�%J�D�%J�%J�K�K�K�� � ��$�$�$�$�� � �F�!2�D�!2�!2�3�3�3�3��I�I�i� � ��G��G�G�U�G�G�!�G�G�����W�%�%�%�%��9�9�]�#�#�#r � 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) � 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) r a� 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__r r �_array_liker r �strr r% �repr�_docstrings� r r �<module>r. s� �� C� C� � � � � ���� � � � � � �� � 0�S� 0�� 0�3� 0�4� 0� 0� 0� 0� $�3� $� $� $� $�B � �;�+�� � � �<