B
    ʾZm                 @   sF  d dl mZmZmZ d dlZd dlZd dlZd dlZd dlZd dl	m
Z
mZmZmZ d dlmZmZmZmZ d dlmZmZmZmZ dej_ejd  dkrdd Znd	d Zd
Ze
eZdZe
eZdd Z dd Z!dd Z"dd Z#dd Z$dd Z%dd Z&dd Z'dd Z(dd Z)d d! Z*d"d# Z+d$d% Z,d&d' Z-d(d) Z.d*d+ Z/d,d- Z0d.d/ Z1d0d1 Z2e
d2Z3d3d4 Z4e
d5Z5d6d7 Z6e
d8Z7d9d: Z8e
d;Z9d<d= Z:d>d? Z;d@dA Z<dBdC Z=dDdE Z>dFdG Z?e
dHZ@dIdJ ZAdKdL ZBdMdN ZCdOdP ZDdQdR ZEdSdT ZFdUdV ZGdWZHdXdY ZIdZd[ ZJd\d] ZKd^d_ ZLeMd`krBd dlNZNeNO  dS )a    )divisionabsolute_importprint_functionN)NumpyDocStringFunctionDocClassDoc
ParseError)SphinxDocStringSphinxClassDocSphinxFunctionDocget_doc_object)assert_equalassert_raisesassert_list_equalassert_true   c             C   s   | S )N )sr   r   <lib/python3.7/site-packages/numpydoc/tests/test_docscrape.py<lambda>   s    r   c             C   s
   t | dS )NZunicode_escape)Zunicode)r   r   r   r   r      s    a
    numpy.multivariate_normal(mean, cov, shape=None, spam=None)

  Draw values from a multivariate normal distribution with specified
  mean and covariance.

  The multivariate normal or Gaussian distribution is a generalisation
  of the one-dimensional normal distribution to higher dimensions.

  Parameters
  ----------
  mean : (N,) ndarray
      Mean of the N-dimensional distribution.

      .. math::

         (1+2+3)/3

  cov : (N, N) ndarray
      Covariance matrix of the distribution.
  shape : tuple of ints
      Given a shape of, for example, (m,n,k), m*n*k samples are
      generated, and packed in an m-by-n-by-k arrangement.  Because
      each sample is N-dimensional, the output shape is (m,n,k,N).

  Returns
  -------
  out : ndarray
      The drawn samples, arranged according to `shape`.  If the
      shape given is (m,n,...), then the shape of `out` is
      (m,n,...,N).

      In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
      value drawn from the distribution.
  list of str
      This is not a real return value.  It exists to test
      anonymous return values.
  no_description

  Other Parameters
  ----------------
  spam : parrot
      A parrot off its mortal coil.

  Raises
  ------
  RuntimeError
      Some error

  Warns
  -----
  RuntimeWarning
      Some warning

  Warnings
  --------
  Certain warnings apply.

  Notes
  -----
  Instead of specifying the full covariance matrix, popular
  approximations include:

    - Spherical covariance (`cov` is a multiple of the identity matrix)
    - Diagonal covariance (`cov` has non-negative elements only on the diagonal)

  This geometrical property can be seen in two dimensions by plotting
  generated data-points:

  >>> mean = [0,0]
  >>> cov = [[1,0],[0,100]] # diagonal covariance, points lie on x or y-axis

  >>> x,y = multivariate_normal(mean,cov,5000).T
  >>> plt.plot(x,y,'x'); plt.axis('equal'); plt.show()

  Note that the covariance matrix must be symmetric and non-negative
  definite.

  References
  ----------
  .. [1] A. Papoulis, "Probability, Random Variables, and Stochastic
         Processes," 3rd ed., McGraw-Hill Companies, 1991
  .. [2] R.O. Duda, P.E. Hart, and D.G. Stork, "Pattern Classification,"
         2nd ed., Wiley, 2001.

  See Also
  --------
  some, other, funcs
  otherfunc : relationship

  Examples
  --------
  >>> mean = (1,2)
  >>> cov = [[1,0],[1,0]]
  >>> x = multivariate_normal(mean,cov,(3,3))
  >>> print x.shape
  (3, 3, 2)

  The following is probably true, given that 0.6 is roughly twice the
  standard deviation:

  >>> print list( (x[0,0,:] - mean) < 0.6 )
  [True, True]

  .. index:: random
     :refguide: random;distributions, random;gauss

  z
Test generator

Yields
------
a : int
    The number of apples.
b : int
    The number of bananas.
int
    The number of unknowns.
c               C   s(   t d dstt d ds$td S )N	Signatureznumpy.multivariate_normal(z
spam=None))doc
startswithAssertionErrorendswithr   r   r   r   test_signature   s    r   c               C   s0   t d d dstt d d ds,td S )NSummaryr   zDraw valueszcovariance.)r   r   r   r   r   r   r   r   test_summary   s    r   c               C   s   t d d dstd S )NzExtended Summaryr   zThe multivariate normal)r   r   r   r   r   r   r   test_extended_summary   s    r   c              C   s~   t ttd d t dd td D dddg td d \} }}t |d	 |d
 ds^ttd d
 d d dksztd S )N
Parametersr   c             S   s   g | ]\}}}|qS r   r   ).0n_r   r   r   
<listcomp>   s    z#test_parameters.<locals>.<listcomp>ZmeanZcovshape   z(N, N) ndarrayr   zCovariance matrixr   z   (1+2+3)/3)r   lenr   r   r   )argarg_typedescr   r   r   test_parameters   s    
r+   c              C   s^   t ttd d t dd td D dg td d \} }}t |d |d dsZtd S )	NzOther Parametersr&   c             S   s   g | ]\}}}|qS r   r   )r!   r"   r#   r   r   r   r$      s    z)test_other_parameters.<locals>.<listcomp>spamr   ZparrotzA parrot off its mortal coil)r   r'   r   r   r   )r(   r)   r*   r   r   r   test_other_parameters   s
    
r-   c              C   s   t ttd d td d \} }}t | d t |d |d dsJt|d ds\ttd d	 \} }}t | d
 t |d |d dst|d dsttd d \} }}t | d t |d d| rtd S )NZReturnsr   r   outZndarrayzThe drawn samplesr   zdistribution.r&   zlist of str zThis is not a realzanonymous return values.   Zno_description)r   r'   r   r   r   r   joinstrip)r(   r)   r*   r   r   r   test_returns   s    





r3   c              C   s   t d } tt| d dddg}xZt| |D ]L\\}}}\}}}t|| t|| |d dsft|d |s,tq,W d S )NZYieldsr   )aintzapples.)br5   zbananas.)r5   r/   z	unknowns.r   zThe number of)
doc_yieldsr   r'   zipr   r   r   )Zsectiontruthr(   r)   r*   Zarg_Z	arg_type_endr   r   r   test_yields   s     

r;   c              C   s   d} t tt|  d S )Nz
Test having returns and yields.

Returns
-------
int
    The number of apples.

Yields
------
a : int
    The number of apples.
b : int
    The number of bananas.

)r   
ValueErrorr   )doc_textr   r   r   test_returnyield   s    r>   c           
   C   s   d} t tt|  G dd dt}dd }yt| W n> tk
rr } z tdt|kp^dt|k W d d }~X Y nX yt| W n> tk
r } z tdt|kpdt|k W d d }~X Y nX d S )	Nzy
Test having a section Notes twice

Notes
-----
See the next note for more information

Notes
-----
That should break...
c               @   s    e Zd ZdZdd Zdd ZdS )z!test_section_twice.<locals>.Dummyz
        Dummy class.

        Notes
        -----
        First note.

        Notes
        -----
        Second note.

        c             S   s   dS )zSpam

Spam spam.Nr   )selfr4   r6   r   r   r   r,     s    z&test_section_twice.<locals>.Dummy.spamc             S   s   dS )zCheese

No cheese.Nr   )r?   cdr   r   r   ham  s    z%test_section_twice.<locals>.Dummy.hamN)__name__
__module____qualname____doc__r,   rB   r   r   r   r   Dummy   s   rG   c             S   s   dS )z
        Dummy function.

        Notes
        -----
        First note.

        Notes
        -----
        Second note.
        Nr   )r(   r   r   r   
dummy_func  s    z&test_section_twice.<locals>.dummy_funcz!test_section_twice.<locals>.Dummyztest_docscrape.Dummyzfunction dummy_func)r   r<   r   objectr
   r   strr   )r=   rG   rH   er   r   r   test_section_twice   s     rL   c               C   sB   t d d dstt d d ds,tttt d d d S )NZNotesr   ZInsteadr   z	definite.   )r   r   r   r   r   r'   r   r   r   r   
test_notes0  s    rN   c               C   s0   t d d dstt d d ds,td S )NZ
Referencesr   z..r   z2001.)r   r   r   r   r   r   r   r   test_references6  s    rO   c               C   s0   t d d dstt d d ds,td S )NZExamplesr   z>>>r   zTrue])r   r   r   r   r   r   r   r   test_examples;  s    rP   c               C   s>   t td d d t ttd d t ttd d d d S )NindexdefaultZrandomr0   Zrefguide)r   r   r'   r   r   r   r   
test_index@  s    rS   c             C   s.   t dd| } t dd| } t dd| } | S )z1Remove leading, trailing and multiple blank linesz^\s*\nr/   z\n\s*$z\n\s*\nz\n\n)resub)r   r   r   r   _strip_blank_linesF  s    rV   c             C   sR   t | } t |}dd t| dD } dd t|dD }t| | d S )Nc             S   s   g | ]}|  qS r   )rstrip)r!   lr   r   r   r$   Q  s    z(line_by_line_compare.<locals>.<listcomp>
c             S   s   g | ]}|  qS r   )rW   )r!   rX   r   r   r   r$   R  s    )textwrapdedentrV   splitr   )r4   r6   r   r   r   line_by_line_compareN  s
    

r]   c               C   s   t ttd d S )Na
  numpy.multivariate_normal(mean, cov, shape=None, spam=None)

Draw values from a multivariate normal distribution with specified
mean and covariance.

The multivariate normal or Gaussian distribution is a generalisation
of the one-dimensional normal distribution to higher dimensions.

Parameters
----------
mean : (N,) ndarray
    Mean of the N-dimensional distribution.

    .. math::

       (1+2+3)/3
cov : (N, N) ndarray
    Covariance matrix of the distribution.
shape : tuple of ints
    Given a shape of, for example, (m,n,k), m*n*k samples are
    generated, and packed in an m-by-n-by-k arrangement.  Because
    each sample is N-dimensional, the output shape is (m,n,k,N).

Returns
-------
out : ndarray
    The drawn samples, arranged according to `shape`.  If the
    shape given is (m,n,...), then the shape of `out` is
    (m,n,...,N).

    In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
    value drawn from the distribution.
list of str
    This is not a real return value.  It exists to test
    anonymous return values.
no_description

Other Parameters
----------------
spam : parrot
    A parrot off its mortal coil.

Raises
------
RuntimeError
    Some error

Warns
-----
RuntimeWarning
    Some warning

Warnings
--------
Certain warnings apply.

See Also
--------

`some`_, `other`_, `funcs`_

`otherfunc`_
    relationship

Notes
-----
Instead of specifying the full covariance matrix, popular
approximations include:

  - Spherical covariance (`cov` is a multiple of the identity matrix)
  - Diagonal covariance (`cov` has non-negative elements only on the diagonal)

This geometrical property can be seen in two dimensions by plotting
generated data-points:

>>> mean = [0,0]
>>> cov = [[1,0],[0,100]] # diagonal covariance, points lie on x or y-axis

>>> x,y = multivariate_normal(mean,cov,5000).T
>>> plt.plot(x,y,'x'); plt.axis('equal'); plt.show()

Note that the covariance matrix must be symmetric and non-negative
definite.

References
----------
.. [1] A. Papoulis, "Probability, Random Variables, and Stochastic
       Processes," 3rd ed., McGraw-Hill Companies, 1991
.. [2] R.O. Duda, P.E. Hart, and D.G. Stork, "Pattern Classification,"
       2nd ed., Wiley, 2001.

Examples
--------
>>> mean = (1,2)
>>> cov = [[1,0],[1,0]]
>>> x = multivariate_normal(mean,cov,(3,3))
>>> print x.shape
(3, 3, 2)

The following is probably true, given that 0.6 is roughly twice the
standard deviation:

>>> print list( (x[0,0,:] - mean) < 0.6 )
[True, True]

.. index:: random
   :refguide: random;distributions, random;gauss)r]   rJ   r   r   r   r   r   test_strV  s    kr^   c               C   s   t ttd d S )NzTest generator

Yields
------
a : int
    The number of apples.
b : int
    The number of bananas.
int
    The number of unknowns.

.. index:: )r]   rJ   r7   r   r   r   r   test_yield_str  s    r_   c              C   s   t t} tt| d d S )Na
  
.. index:: random
   single: random;distributions, random;gauss

Draw values from a multivariate normal distribution with specified
mean and covariance.

The multivariate normal or Gaussian distribution is a generalisation
of the one-dimensional normal distribution to higher dimensions.

:Parameters:

    **mean** : (N,) ndarray
        Mean of the N-dimensional distribution.

        .. math::

           (1+2+3)/3

    **cov** : (N, N) ndarray
        Covariance matrix of the distribution.

    **shape** : tuple of ints
        Given a shape of, for example, (m,n,k), m*n*k samples are
        generated, and packed in an m-by-n-by-k arrangement.  Because
        each sample is N-dimensional, the output shape is (m,n,k,N).

:Returns:

    **out** : ndarray
        The drawn samples, arranged according to `shape`.  If the
        shape given is (m,n,...), then the shape of `out` is
        (m,n,...,N).

        In other words, each entry ``out[i,j,...,:]`` is an N-dimensional
        value drawn from the distribution.

    **list of str**
        This is not a real return value.  It exists to test
        anonymous return values.

    **no_description**
        ..

:Other Parameters:

    **spam** : parrot
        A parrot off its mortal coil.

:Raises:

    **RuntimeError**
        Some error

:Warns:

    **RuntimeWarning**
        Some warning

.. warning::

    Certain warnings apply.

.. seealso::

    :obj:`some`, :obj:`other`, :obj:`funcs`

    :obj:`otherfunc`
        relationship

.. rubric:: Notes

Instead of specifying the full covariance matrix, popular
approximations include:

  - Spherical covariance (`cov` is a multiple of the identity matrix)
  - Diagonal covariance (`cov` has non-negative elements only on the diagonal)

This geometrical property can be seen in two dimensions by plotting
generated data-points:

>>> mean = [0,0]
>>> cov = [[1,0],[0,100]] # diagonal covariance, points lie on x or y-axis

>>> x,y = multivariate_normal(mean,cov,5000).T
>>> plt.plot(x,y,'x'); plt.axis('equal'); plt.show()

Note that the covariance matrix must be symmetric and non-negative
definite.

.. rubric:: References

.. [1] A. Papoulis, "Probability, Random Variables, and Stochastic
       Processes," 3rd ed., McGraw-Hill Companies, 1991
.. [2] R.O. Duda, P.E. Hart, and D.G. Stork, "Pattern Classification,"
       2nd ed., Wiley, 2001.

.. only:: latex

   [1]_, [2]_

.. rubric:: Examples

>>> mean = (1,2)
>>> cov = [[1,0],[1,0]]
>>> x = multivariate_normal(mean,cov,(3,3))
>>> print x.shape
(3, 3, 2)

The following is probably true, given that 0.6 is roughly twice the
standard deviation:

>>> print list( (x[0,0,:] - mean) < 0.6 )
[True, True]
)r	   doc_txtr]   rJ   )
sphinx_docr   r   r   test_sphinx_str  s    srb   c              C   s   t t} tt| d d S )NzTest generator

:Yields:

    **a** : int
        The number of apples.

    **b** : int
        The number of bananas.

    **int**
        The number of unknowns.
)r	   doc_yields_txtr]   rJ   )ra   r   r   r   test_sphinx_yields_strP  s    rd   a  
    Returns array of indices of the maximum values of along the given axis.

    Parameters
    ----------
    a : {array_like}
        Array to look in.
    axis : {None, integer}
        If None, the index is into the flattened array, otherwise along
        the specified axisc               C   s   t ttd d d S )Nr    r0   )r   r'   doc2r   r   r   r   ,test_parameters_without_extended_descriptionn  s    rf   zB
    my_signature(*params, **kwds)

    Return this and that.
    c              C   s@   t tdd } t| d dd }t|d}t|d d d S )	NrY   r   z my_signature(\*params, \*\*kwds)c             [   s   d S )Nr   )r4   r6   kwargsr   r   r   my_func}  s    z"test_escape_stars.<locals>.my_func)funcr   zmy_func(a, b, \*\*kwargs))rJ   doc3r\   r   r   )Z	signaturerh   fdocr   r   r   test_escape_starsy  s
    

rl   zJa.conj()

    Return an array with all complex-valued elements conjugated.c               C   s   t td g  d S )NzExtended Summary)r   doc4r   r   r   r   test_empty_extended_summary  s    rn   z
    a.something()

    Raises
    ------
    LinAlgException
        If array is singular.

    Warns
    -----
    SomeWarning
        If needed
    c              C   s>   t ttd d td d \} }}t | d t |dg d S )NZRaisesr&   r   ZLinAlgExceptionzIf array is singular.)r   r'   doc5)namer#   r*   r   r   r   test_raises  s    
rq   c              C   s>   t ttd d td d \} }}t | d t |dg d S )NZWarnsr&   r   ZSomeWarningz	If needed)r   r'   ro   )rp   r#   r*   r   r   r   
test_warns  s    
rr   c              C   s   t d} t| d dkstx| d D ]\}}}|dkrB|rJtn|sJt|dkr`|dkstn@|dksp|dkr~|d	kstn"|d
kr|dkstn|d kst|dkr|dgkstq&|dkr|ddgkstq&|d
kr&|ddgks&tq&W d S )Na;  
    z(x,theta)

    See Also
    --------
    func_a, func_b, func_c
    func_d : some equivalent func
    foo.func_e : some other func over
             multiple lines
    func_f, func_g, :meth:`func_h`, func_j,
    func_k
    :obj:`baz.obj_q`
    :obj:`~baz.obj_r`
    :class:`class_j`: fubar
        foobar
    zSee Also   )
Zfunc_aZfunc_bZfunc_cZfunc_fZfunc_gfunc_hZfunc_jZfunc_kz	baz.obj_qz
~baz.obj_rrt   methz	baz.obj_qz
~baz.obj_robjZclass_jclassZfunc_dzsome equivalent funcz
foo.func_ezsome other func overzmultiple linesZfubarZfoobar)r   r'   r   )Zdoc6ri   r*   roler   r   r   test_see_also  s(    
ry   c           	   C   s8   d} t t}t|  W d Q R X ttdt|j d S )Nz@
    z(x,theta)

    See Also
    --------
    :func:`~foo`
    zk:func:`~foo` is not a item name in '\n    z(x,theta)\n\n    See Also\n    --------\n    :func:`~foo`\n    ')r   r   r   r   rJ   Z	exception)texterrr   r   r   test_see_also_parse_error  s    
r|   c              C   sN   G dd dt } |  }tt|dd}d|ks2td|ks>td|ksJtd S )Nc               @   s   e Zd ZdZdS )z"test_see_also_print.<locals>.Dummyz
        See Also
        --------
        func_a, func_b
        func_c : some relationship
                 goes here
        func_d
        N)rC   rD   rE   rF   r   r   r   r   rG     s   rG   ri   )rx   z:func:`func_a`, :func:`func_b`z    some relationshipz:func:`func_d`)rI   rJ   r   r   )rG   rv   r   r   r   r   test_see_also_print  s    r}   c           	   C   s   d} G dd dt }tjdd4}t|  t|dks:tdt|d jksPtW d Q R X tjddF}t| t|dkstt	d	t|d jkpd
t|d jk W d Q R X d S )NzS
Test having an unknown section

Mope
----
This should be ignored and warned about
c               @   s   e Zd ZdZdS )z(test_unknown_section.<locals>.BadSectionzbClass with bad section.

        Nope
        ----
        This class has a nope section.
        N)rC   rD   rE   rF   r   r   r   r   
BadSection  s   r~   T)recordr&   zUnknown section Moper   z7test_docscrape.test_unknown_section.<locals>.BadSectionztest_docscrape.BadSection)
rI   warningscatch_warningsr   r'   r   rJ   messager
   r   )r=   r~   wr   r   r   test_unknown_section  s    	 r   z.

        Doc starts on second line.

        c               C   s   t d d dstd S )Nr   r   z
Doc starts)doc7r   r   r   r   r   r   test_empty_first_line"  s    r   c               C   s   t td d S )Nz
    Parameters
    ----------)rJ   r	   r   r   r   r   test_no_summary&  s    r   c              C   s6   t d} t| d d tst| d d dks2td S )Nu   
    öäöäöäöäöåååå

    öäöäöäööäååå

    Parameters
    ----------
    ååå : äää
        ööö

    Returns
    -------
    ååå : ööö
        äää

    r   r   u   öäöäöäöäöåååå)r	   
isinstancerJ   r   )r   r   r   r   test_unicode,  s    r   c              C   s   t dd} td| d}dt|ks.tt|td| d}dt|ksRtt|td| d}t|ddks|tt|d S )	NT)Z	use_plotsz|
    Examples
    --------
    >>> import matplotlib.pyplot as plt
    >>> plt.plot([1,2,3],[4,5,6])
    >>> plt.show()
    )configzplot::z
    Examples
    --------
    >>> from matplotlib import pyplot as plt
    >>> plt.plot([1,2,3],[4,5,6])
    >>> plt.show()
    z
    Examples
    --------
    .. plot::

       import matplotlib.pyplot as plt
       plt.plot([1,2,3],[4,5,6])
       plt.show()
    r&   )dictr	   rJ   r   count)cfgr   r   r   r   test_plot_examplesA  s    



r   c              C   s(   t dd} td| d}tt|d d S )NT)Zuse_blockquotesz
    Parameters
    ----------
    abc : def
        ghi
    jkl
        mno

    Returns
    -------
    ABC : DEF
        GHI
    JKL
        MNO
    )r   z
    :Parameters:

        **abc** : def

            ghi

        **jkl**

            mno

    :Returns:

        **ABC** : DEF

            GHI

        **JKL**

            MNO
    )r   r	   r]   rJ   )r   r   r   r   r   test_use_blockquotesb  s
    

r   c              C   s  G dd dt } xvttfD ]h}|| tddd}dt|ksPt|t|fdt|kslt|t|fdt|kst|t|fd	t|kst|t|fd
t|kst|t|f|| tddd}dt|kst|t|fdt|kst|t|fdt|ks*t|t|fd	t|ksHt|t|f|tkrndt|kstt|qd
t|kstt|qW G dd d| }xttfD ]}||tdddd}dt|kst|t|fdt|kst|t|fdt|kst|t|fdt|ks8t|t|fd	t|ksVt|t|f|tkr|dt|kstt|nd
t|kstt|||tdddd}dt|kst|t|fdt|kst|t|fdt|kst|t|fdt|ks"t|t|fd	t|ks@t|t|f|tkrfdt|kstt|nd
t|kstt|qW d S )Nc               @   s<   e Zd ZdZdd Zdd Zedd ZG dd	 d	eZ	d
S )z!test_class_members.<locals>.Dummyz
        Dummy class.

        c             S   s   dS )zSpam

Spam spam.Nr   )r?   r4   r6   r   r   r   r,     s    z&test_class_members.<locals>.Dummy.spamc             S   s   dS )zCheese

No cheese.Nr   )r?   r@   rA   r   r   r   rB     s    z%test_class_members.<locals>.Dummy.hamc             S   s   dS )zSpammity indexgffffff?r   )r?   r   r   r   spammity  s    z*test_class_members.<locals>.Dummy.spammityc               @   s   e Zd ZdZdS )z+test_class_members.<locals>.Dummy.Ignorablezlocal class, to be ignoredN)rC   rD   rE   rF   r   r   r   r   	Ignorable  s   r   N)
rC   rD   rE   rF   r,   rB   propertyr   rI   r   r   r   r   r   rG     s
   rG   F)show_class_members)r   ZMethodsr,   rB   r   zSpammity indexTz.. autosummary::c               @   s    e Zd ZdZdd Zdd ZdS )z$test_class_members.<locals>.SubDummyz+
        Subclass of Dummy class.

        c             S   s   dS )z'Cheese

No cheese.
Overloaded Dummy.hamNr   )r?   r@   rA   r   r   r   rB     s    z(test_class_members.<locals>.SubDummy.hamc             S   s   dS )zBar

No barNr   )r?   r4   r6   r   r   r   bar  s    z(test_class_members.<locals>.SubDummy.barN)rC   rD   rE   rF   rB   r   r   r   r   r   SubDummy  s   r   )r   Zshow_inherited_class_membersr   )rI   r   r
   r   rJ   r   )rG   clsr   r   r   r   r   test_class_members  sL    


r   c              C   s    t d} | d  dkstd S )Nz$
    z(x1, x2)

    z(a, theta)
    r   zz(a, theta))r   r2   r   )r   r   r   r   test_duplicate_signature  s    r   aV  
    Foo

    Parameters
    ----------
    f : callable ``f(t, y, *f_args)``
        Aaa.
    jac : callable ``jac(t, y, *jac_args)``

        Bbb.

    Attributes
    ----------
    t : float
        Current time.
    y : ndarray
        Current variable values.

        * hello
        * world
    an_attribute : float
        The docstring is printed instead
    no_docstring : str
        But a description
    no_docstring2 : str
    multiline_sentence
    midword_period
    no_period

    Methods
    -------
    a
    b
    c

    Examples
    --------
    For usage examples, see `ode`.
c              C   s   t d t} tt| d d S )Naj  
    Foo

    Parameters
    ----------
    f : callable ``f(t, y, *f_args)``
        Aaa.
    jac : callable ``jac(t, y, *jac_args)``
        Bbb.

    Examples
    --------
    For usage examples, see `ode`.

    Attributes
    ----------
    t : float
        Current time.
    y : ndarray
        Current variable values.

        * hello
        * world
    an_attribute : float
        The docstring is printed instead
    no_docstring : str
        But a description
    no_docstring2 : str
    multiline_sentence
    midword_period
    no_period

    Methods
    -------
    a
    b
    c

    .. index::

    )r   class_doc_txtr]   rJ   )r   r   r   r   test_class_members_doc  s    
)r   c              C   s*   G dd d} t | t}tt|d d S )Nc               @   sT   e Zd Zedd Zedd Zedd Zedd Zed	d
 Zedd Z	dS )z*test_class_members_doc_sphinx.<locals>.Fooc             S   s   dS )zTest attributeNr   )r?   r   r   r   an_attributeD  s    z7test_class_members_doc_sphinx.<locals>.Foo.an_attributec             S   s   d S )Nr   )r?   r   r   r   no_docstringI  s    z7test_class_members_doc_sphinx.<locals>.Foo.no_docstringc             S   s   d S )Nr   )r?   r   r   r   no_docstring2M  s    z8test_class_members_doc_sphinx.<locals>.Foo.no_docstring2c             S   s   dS )z8This is a
            sentence. It spans multiple lines.Nr   )r?   r   r   r   multiline_sentenceQ  s    z=test_class_members_doc_sphinx.<locals>.Foo.multiline_sentencec             S   s   dS )zThe sentence for numpy.org.Nr   )r?   r   r   r   midword_periodW  s    z9test_class_members_doc_sphinx.<locals>.Foo.midword_periodc             S   s   dS )zThis does not have a period
            so we truncate its summary to the first linebreak

            Apparently.
            Nr   )r?   r   r   r   	no_period\  s    z4test_class_members_doc_sphinx.<locals>.Foo.no_periodN)
rC   rD   rE   r   r   r   r   r   r   r   r   r   r   r   FooC  s   r   a  
    Foo

    :Parameters:

        **f** : callable ``f(t, y, *f_args)``
            Aaa.

        **jac** : callable ``jac(t, y, *jac_args)``
            Bbb.

    .. rubric:: Examples

    For usage examples, see `ode`.

    :Attributes:

        **t** : float
            Current time.

        **y** : ndarray
            Current variable values.

            * hello
            * world

        :obj:`an_attribute <an_attribute>` : float
            Test attribute

        **no_docstring** : str
            But a description

        **no_docstring2** : str
            ..

        :obj:`multiline_sentence <multiline_sentence>`
            This is a sentence.

        :obj:`midword_period <midword_period>`
            The sentence for numpy.org.

        :obj:`no_period <no_period>`
            This does not have a period

    .. rubric:: Methods

    =====  ==========
    **a**
    **b**
    **c**
    =====  ==========

    )r
   r   r]   rJ   )r   r   r   r   r   test_class_members_doc_sphinxB  s    "
5r   c              C   s*   t d tdtdid} tt| d d S )Ntemplatez{{examples}}
{{parameters}})r   z
    .. rubric:: Examples

    For usage examples, see `ode`.

    :Parameters:

        **f** : callable ``f(t, y, *f_args)``
            Aaa.

        **jac** : callable ``jac(t, y, *jac_args)``
            Bbb.

    )r
   r   jinja2ZTemplater]   rJ   )r   r   r   r   test_templated_sections  s    r   c                 s>   G dd dt  G  fddd} t| }dt|ks:td S )Nc               @   s&   e Zd Zd
ddZdd Zdd Zd	S )z2test_nonstandard_property.<locals>.SpecialPropertyr   r/   c             S   s   || _ || _d S )N)axisrF   )r?   r   r   r   r   r   __init__  s    z;test_nonstandard_property.<locals>.SpecialProperty.__init__c             S   s   |d kr| S |j j| j S d S )N)_dataZaxesr   )r?   rv   typer   r   r   __get__  s    z:test_nonstandard_property.<locals>.SpecialProperty.__get__c             S   s   | | j| d S )N)Z	_set_axisr   )r?   rv   valuer   r   r   __set__  s    z:test_nonstandard_property.<locals>.SpecialProperty.__set__N)r   r/   )rC   rD   rE   r   r   r   r   r   r   r   SpecialProperty  s   
r   c                   s   e Zd Z ddZdS )z(test_nonstandard_property.<locals>.Dummyztest attribute)r   N)rC   rD   rE   attrr   )r   r   r   rG     s   rG   ztest attribute)rI   r   rJ   r   )rG   r   r   )r   r   test_nonstandard_property  s    r   __main__)PZ
__future__r   r   r   rT   sysrZ   r   r   Znumpydoc.docscraper   r   r   r   Znumpydoc.docscrape_sphinxr	   r
   r   r   Z
nose.toolsr   r   r   r   __self__ZmaxDiffversion_infoZsixur`   r   rc   r7   r   r   r   r+   r-   r3   r;   r>   rL   rN   rO   rP   rS   rV   r]   r^   r_   rb   rd   re   rf   rj   rl   rm   rn   ro   rq   rr   ry   r|   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rC   Znoserunr   r   r   r   <module>   s   
n
@rx	-!(R5.\
