+
    ^|i                         R t R tR tR]/tR# )a   
Handlers for IPythonDirective's @doctest pseudo-decorator.

The Sphinx extension that provides support for embedded IPython code provides
a pseudo-decorator @doctest, which treats the input/output block as a
doctest, raising a RuntimeError during doc generation if the actual output
(after running the input) does not match the expected output.

An example usage is:

.. code-block:: rst

   .. ipython::

        In [1]: x = 1

        @doctest
        In [2]: x + 2
        Out[3]: 3

One can also provide arguments to the decorator. The first argument should be
the name of a custom handler. The specification of any other arguments is
determined by the handler. For example,

.. code-block:: rst

      .. ipython::

         @doctest float
         In [154]: 0.1 + 0.2
         Out[154]: 0.3

allows the actual output ``0.30000000000000004`` to match the expected output
due to a comparison with `np.allclose`.

This module contains handlers for the @doctest pseudo-decorator. Handlers
should have the following function signature::

    handler(sphinx_shell, args, input_lines, found, submitted)

where `sphinx_shell` is the embedded Sphinx shell, `args` contains the list
of arguments that follow: '@doctest handler_name', `input_lines` contains
a list of the lines relevant to the current doctest, `found` is a string
containing the output from the IPython shell, and `submitted` is a string
containing the expected output from the IPython shell.

Handlers must be registered in the `doctests` dict at the end of this module.

c                    ^ RI p^ RI HpHp V P                  R4      '       d   V ^R p V P                  R4      '       d#   VP	                  \        V 4      \        R7      pV# VP                  \        V 4      4      pV# )a  
Simplistic converter of strings from repr to float NumPy arrays.

If the repr representation has ellipsis in it, then this will fail.

Parameters
----------
s : str
    The repr version of a NumPy array.

Examples
--------
>>> s = "array([ 0.3,  inf,  nan])"
>>> a = str_to_array(s)

N)infnanarray[)dtype)numpyr   r   
startswithr   evalfloat
atleast_1d)snpr   r   as   &    C/usr/lib/python3/dist-packages/IPython/sphinxext/custom_doctests.pystr_to_arrayr   3   sk    "  ||HaG||DHHT!WEH* H MM%(#H    c           	     X   ^ RI p\        V4      ^8X  d   RpRpM% \        V^,          4      p\        V^,          4      p \        V4      p\        V4      pVP                  V4      p	VP                  V4      p
VP                  W4      '       * pWP                  W9( ,          WJ( ,          WgR7      '       * ,          pRpT P                  pTf   RpRpMRTP                  P                  P                  pRP                  TP                   Uu. uF  pTT,           NK  	  up4      pT'       dE   R	pTP	                  YRP                  T4      \        T4      \        T4      TR
7      p\        T4      hR#   \         d    RP	                  T4      p\        T4      Thi ; i   Rp L; iu upi )z
Doctest which allow the submitted output to vary slightly from the input.

Here is how it might appear in an rst file:

.. code-block:: rst

   .. ipython::

      @doctest float
      In [1]: 0.1 + 0.2
      Out[1]: 0.3

Ngh㈵>g:0yE>zEBoth `rtol` and `atol` must be specified if either are specified: {0})rtolatolTUnavailable
zdoctest float comparison failure

Document source: {0}

Raw content: 
{1}

On input line(s):
{TAB}{2}

we found output:
{TAB}{3}

instead of the expected:
{TAB}{4}

)TABz    )r	   lenr   
IndexErrorformatr   isnanallclose	directivestatedocumentcurrent_sourcejoincontentreprRuntimeError)sphinx_shellargsinput_linesfound	submittedr   r   r   efound_isnansubmitted_isnanerrorr   r   sourcer$   lines   &&&&&            r   float_doctestr2   U   s    
4yA~	'a>Da>D7 +	U#
 hhuo((9-KK==[[|!4!*+;!<&* ! 7 7 	7 C&&I))88))I4E4EF4EDS4ZZ4EFG6 HHVdii&<d5k)_#  /1o ;  	'006t Q-Q&	'" Gs   $E2  F F'2)FF$r   N)__doc__r   r2   doctests r   r   <module>r6      s&   0d D@J ]r   