
(*\c           @` sd  d  d l  m Z m Z m Z d  d l 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 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 d  d l m Z e j d  d	 k r d
   Z n	 d   Z d Z e e  Z d Z  e e   Z! d Z" e e"  Z# d   Z$ d   Z% d   Z& d   Z' d   Z( d   Z) d   Z* d   Z+ d   Z, d   Z, d   Z- d   Z. d   Z/ d   Z0 d   Z1 d   Z2 d d  Z4 d    Z5 d!   Z6 d"   Z7 d#   Z8 d$   Z9 d%   Z: e d&  Z; d'   Z< e d(  Z= d)   Z> e d*  Z? d+   Z@ e d,  ZA d-   ZB d.   ZC d/   ZD d0   ZE d1   ZF d2   ZG d3   ZH e d4  ZI d5   ZJ d6   ZK d7   ZL d8   ZM d9   ZN d:   ZO d;   ZP d< ZQ d=   ZR d>   ZS d?   ZT d@   ZU dA   ZV dB   ZW dC   ZX dD ZY dE ZZ dF   Z[ e\ dG k r`d  d l Z e j]   n  d S(H   i    (   t   divisiont   absolute_importt   print_function(   t
   namedtupleN(   t   update_config(   t   NumpyDocStringt   FunctionDoct   ClassDoct
   ParseError(   t   SphinxDocStringt   SphinxClassDoct   SphinxFunctionDoct   get_doc_object(   t   raises(   t   warnsi   c         C` s   |  S(   N(    (   t   s(    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   <lambda>   t    c         C` s   t  |  d  S(   Nt   unicode_escape(   t   unicode(   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyR      R   s
    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

  s   
Test generator

Yields
------
a : int
    The number of apples.
b : int
    The number of bananas.
int
    The number of unknowns.
s   
Test generator

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

Receives
--------
b : int
    The number of bananas.
c : int
    The number of oranges.

c           C` s6   t  d j d  s t  t  d j d  s2 t  d  S(   Nt	   Signatures   numpy.multivariate_normal(s
   spam=None)(   t   doct
   startswitht   AssertionErrort   endswith(    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_signature   s    c           C` s>   t  d d j d  s t  t  d d j d  s: t  d  S(   Nt   Summaryi    s   Draw valuesis   covariance.(   R   R   R   R   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_summary   s    c           C` s!   t  d d j d  s t  d  S(   Ns   Extended Summaryi    s   The multivariate normal(   R   R   R   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_extended_summary   s    c          C` s   t  t d  d k s t  g  t d D] \ }  } } |  ^ q' } t d   t | d d d g  D  sp t  t d d \ } } } | d k s t  | d	 j d
  s t  t d d	 d d d k s t  d  S(   Nt
   Parametersi   c         s` s!   |  ] \ } } | | k Vq d  S(   N(    (   t   .0t   at   b(    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pys	   <genexpr>   s    t   meant   covt   shapei   s   (N, N) ndarrayi    s   Covariance matrixis      (1+2+3)/3(   t   lenR   R   t   allt   zipR   (   t   nt   _t   namest   argt   arg_typet   desc(    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_parameters   s    &.c          C` s   t  t d  d k s t  g  t d D] \ }  } } |  ^ q' d g k sQ t  t d d \ } } } | d k sz t  | d j d  s t  d  S(   Ns   Other Parametersi   t   spami    t   parrots   A parrot off its mortal coil(   R$   R   R   R   (   R'   R(   R*   R+   R,   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_other_parameters   s
    5c          C` sQ  t  t d  d k s t  t d d \ }  } } |  d k sE t  | d k sW t  | d j d  sp t  | d j d  s t  t d d	 \ }  } } |  d
 k s t  | d k s t  | d j d  s t  | d j d  s t  t d d \ }  } } |  d
 k st  | d k s1t  d
 j |  j   sMt  d  S(   Nt   Returnsi   i    t   outt   ndarrays   The drawn samplesis   distribution.i   R   s   list of strs   This is not a reals   anonymous return values.i   t   no_description(   R$   R   R   R   R   t   joint   strip(   R*   R+   R,   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_returns   s    c          C` s   t  d }  t |   d k s" t  d d d g } x t |  |  D]t \ \ } } } \ } } } | | k sq t  | | k s t  | d
 j d  s t  | d
 j |  sA t  qA Wd  S(   Nt   Yieldsi   R   t   ints   apples.R    s   bananas.R   s	   unknowns.i    s   The number of(   R   R9   s   apples.(   R    R9   s   bananas.(   R   R9   s	   unknowns.(   t
   doc_yieldsR$   R   R&   R   R   (   t   sectiont   truthR*   R+   R,   t   arg_t	   arg_type_t   end(    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_yields   s    
	.c          C` s   t  d }  t |   d k s" t  d
 d g } x t |  |  D]t \ \ } } } \ } } } | | k sn t  | | k s t  | d j d	  s t  | d j |  s> t  q> Wd  S(   Nt   Receivesi   R    R9   s   bananas.t   cs   oranges.i    s   The number of(   R    R9   s   bananas.(   RB   R9   s   oranges.(   t   doc_sentR$   R   R&   R   R   (   R;   R<   R*   R+   R,   R=   R>   R?   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt	   test_sent   s    
	.c          C` s   d }  t  t t |   d  S(   Ns   
Test having returns and yields.

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

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

(   t   assert_raisest
   ValueErrorR   (   t   doc_text(    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_returnyield   s    c          C` s   d }  t  t t |   d  S(   Ns   
Test having returns and yields.

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

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

(   RE   RF   R   (   RG   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyRH     s    c          C` s   d }  t  t t |   d t f d     Y} d   } y t |  Wn= t k
 r } d t |  k s d t |  k s t  n Xy t |  Wn= t k
 r } d t |  k s d t |  k s t  n Xd  S(	   Nsy   
Test having a section Notes twice

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

Notes
-----
That should break...
t   Dummyc           B` s    e  Z d  Z d   Z d   Z RS(   s   
        Dummy class.

        Notes
        -----
        First note.

        Notes
        -----
        Second note.

        c         S` s   d S(   s   Spam

Spam spam.N(    (   t   selfR   R    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyR.   A  s    c         S` s   d S(   s   Cheese

No cheese.N(    (   RJ   RB   t   d(    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   hamE  s    (   t   __name__t
   __module__t   __doc__R.   RL   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyRI   4  s   	c         S` s   d S(   s   
        Dummy function.

        Notes
        -----
        First note.

        Notes
        -----
        Second note.
        N(    (   R*   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt
   dummy_funcI  R   s!   test_section_twice.<locals>.Dummys   test_docscrape.Dummys&   test_section_twice.<locals>.dummy_funcs   function dummy_func(   RE   RF   R   t   objectR
   t   strR   R   (   RG   RI   RP   t   e(    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_section_twice%  s    	c           C` sZ   t  d d j d  s t  t  d d j d  s: t  t t  d  d k sV t  d  S(   Nt   Notesi    t   Insteadis	   definite.i   (   R   R   R   R   R$   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt
   test_notese  s    c           C` s>   t  d d j d  s t  t  d d j d  s: t  d  S(   Nt
   Referencesi    s   ..is   2001.(   R   R   R   R   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_referencesk  s    c           C` s>   t  d d j d  s t  t  d d j d  s: t  d  S(   Nt   Examplesi    s   >>>is   True](   R   R   R   R   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_examplesp  s    c           C` sZ   t  d d d k s t  t t  d  d k s6 t  t t  d d  d k sV t  d  S(   Nt   indext   defaultt   randomi   t   refguide(   R   R   R$   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt
   test_indexu  s    c         C` sC   t  j d d |   }  t  j d d |   }  t  j d d |   }  |  S(   s1   Remove leading, trailing and multiple blank liness   ^\s*\nR   s   \n\s*$s   \n\s*\ns   \n\n(   t   ret   sub(   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   _strip_blank_lines{  s    c         C` s   t  j |   }  t  j |  } g  t |   j d  D] } | j   ^ q4 |  }  g  t |  j d  D] } | j   ^ qf |  } t |   t |  k s t  x; t t |  |   D]$ \ } \ } } | | k s t  q Wd  S(   Ns   
(	   t   textwrapt   dedentRc   t   splitt   rstripR$   R   t	   enumerateR&   (   R   R    t   n_linest   lt   iit   aat   bb(    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   line_by_line_compare  s    22(c           C` s   t  t t  d  d  S(   Ns

  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(   Rn   RR   R   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_str  s    kc           C` s   t  t t  d  d  S(   Ns   Test generator

Yields
------
a : int
    The number of apples.
b : int
    The number of bananas.
int
    The number of unknowns.
(   Rn   RR   R:   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_yield_str  s    c           C` s   t  t t  d  d  S(   Ns   Test generator

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

Receives
--------
b : int
    The number of bananas.
c : int
    The number of oranges.
(   Rn   RR   RC   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_receives_str  s    c           C` s^   d t  t d   k s t  d t  t d   k s< t  d t  t d   k sZ t  d  S(   NR\   s   Test idx

    s%   Test idx

    .. index :: random
    s*   Test idx

    .. index ::
        foo
    (   RR   R   R   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_no_index_in_str   s    			c          C` s#   t  t  }  t t |   d  d  S(   Ns}
  
.. 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	   t   doc_txtRn   RR   (   t
   sphinx_doc(    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_sphinx_str0  s    sc          C` s#   t  t  }  t t |   d  d  S(   Ns   Test generator

:Yields:

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

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

    int
        The number of unknowns.
(   R	   t   doc_yields_txtRn   RR   (   Rt   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_sphinx_yields_str  s    s  
    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 d  d k s t  d  S(   NR   i   (   R$   t   doc2R   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt,   test_parameters_without_extended_description  s    sB   
    my_signature(*params, **kwds)

    Return this and that.
    c          C` s]   t  t  j d  d }  |  d k s+ t  d   } t d |  } | d d k sY t  d  S(   Ns   
i    s    my_signature(\*params, \*\*kwds)c         [` s   d  S(   N(    (   R   R    t   kwargs(    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   my_func  s    t   funcR   s   my_func(a, b, \*\*kwargs)(   RR   t   doc3Rf   R   R   (   t	   signatureR{   t   fdoc(    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_escape_stars  s
    	sJ   a.conj()

    Return an array with all complex-valued elements conjugated.c           C` s   t  d g  k s t  d  S(   Ns   Extended Summary(   t   doc4R   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_empty_extended_summary  s    s   
    a.something()

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

    Warns
    -----
    SomeWarning
        If needed
    c          C` sp   t  t d  d k s t  t d d }  |  j d k s? t  |  j d k sT t  |  j d g k sl t  d  S(   Nt   Raisesi   i    R   t   LinAlgExceptions   If array is singular.(   R$   t   doc5R   t   namet   typeR,   (   t   param(    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_raises  s
    c          C` sp   t  t d  d k s t  t d d }  |  j d k s? t  |  j d k sT t  |  j d g k sl t  d  S(   Nt   Warnsi   i    R   t   SomeWarnings	   If needed(   R$   R   R   R   R   R,   (   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt
   test_warns  s
    c          C` s6  t  d  }  t |  d  d k s( t  x|  d D]\ } } x| D]\ } } | d" k r | s t t | | g    nK | d# k r | s t t | | g    n | s t t | | g    | d	 k r | d k st  n | d k s| d k r| d k st  nf | d k r:| d k st  nE | d$ k r[| d k st  n$ | d  k st t | | g    | d k r| d g k s*t  qF | d k r| d d g k s*t  qF | d k r| d d  g k s*t  qF | d% k rF | d! g k s*t t | d! g g    qF qF Wq3 Wd  S(&   Ns  
    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
    func_f1, func_g1, :meth:`func_h1`, func_j1
    func_f2, func_g2, :meth:`func_h2`, func_j2 : description of multiple
    :obj:`baz.obj_q`
    :obj:`~baz.obj_r`
    :class:`class_j`: fubar
        foobar
    s   See Alsoi
   t   func_at   func_bt   func_ct   func_ft   func_gt   func_ht   func_jt   func_ks	   baz.obj_qt   func_f1t   func_g1t   func_h1t   func_j1s
   ~baz.obj_rt   func_f2t   func_g2t   func_h2t   func_j2t   metht   objt   class_jt   classt   func_ds   some equivalent funcs
   foo.func_es   some other func overs   multiple linest   fubart   foobars   description of multiple(   R   R   R   R   R   R   R   R   s	   baz.obj_qR   R   R   R   s
   ~baz.obj_r(   R   R   R   R   (   R   R   (   R   R   R   R   (   R   R$   R   RR   t   None(   t   doc6t   funcsR,   R|   t   role(    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_see_also  s<    	  	"!$c          C` sV   d }  t  t   } t |   Wd  QXt d  } t | j  } | | k sR t  d  S(   Ns@   
    z(x,theta)

    See Also
    --------
    :func:`~foo`
    sk   :func:`~foo` is not a item name in '\n    z(x,theta)\n\n    See Also\n    --------\n    :func:`~foo`\n    '(   RE   R   R   RR   t   valueR   (   t   textt   errt   s1t   s2(    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_see_also_parse_error=  s    c          C` sq   d t  f d     Y}  |    } t t | d d  } d | k sI t  d | k s[ t  d | k sm t  d  S(   NRI   c           B` s   e  Z d  Z RS(   s   
        See Also
        --------
        func_a, func_b
        func_c : some relationship
                 goes here
        func_d
        (   RM   RN   RO   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyRI   O  s   R   R|   s   :func:`func_a`, :func:`func_b`s       some relationships   :func:`func_d`(   RQ   RR   R   R   (   RI   R   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_see_also_printN  s    	c          C` s6   t  j d  t t d d  t d  }  Wd  QXd  S(   Nt   errort   matchsE   Unexpected comma or period after function list at index 43 of line .*s   
            z(x,theta)

            See Also
            --------
            func_f2, func_g2, :meth:`func_h2`, func_j2, : description of multiple
            :class:`class_j`: fubar
                foobar
            (   t   warningst   filterwarningst   assert_warnst   WarningR   (   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt$   test_see_also_trailing_comma_warninga  s    	c       	   C` s  d }  d t  f d     Y} t j d t  [ } t j d d t  t |   t |  d k sf t  d t	 | d	 j
  k s t  Wd  QXt j d t  t } t j d d t  t |  t |  d k s t  d
 t	 | d	 j
  k sd t	 | d	 j
  k st  Wd  QXd  S(   NsS   
Test having an unknown section

Mope
----
This should be ignored and warned about
t
   BadSectionc           B` s   e  Z d  Z RS(   sb   Class with bad section.

        Nope
        ----
        This class has a nope section.
        (   RM   RN   RO   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyR   y  s   t   recordt   alwaysR   i   s   Unknown section Mopei    s7   test_docscrape.test_unknown_section.<locals>.BadSections   test_docscrape.BadSection(   RQ   R   t   catch_warningst   TrueR   t   UserWarningR   R$   R   RR   t   messageR
   (   RG   R   t   w(    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_unknown_sectionp  s    	
%
s.   

        Doc starts on second line.

        c           C` s!   t  d d j d  s t  d  S(   NR   i    s
   Doc starts(   t   doc7R   R   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_empty_first_line  s    c           C` s   t  t d   d  S(   Ns   
    Parameters
    ----------(   RR   R	   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_no_summary  s    c          C` sG   t  d  }  t |  d d t  s) t  |  d d d k sC t  d  S(   Ns   
    öäöäöäöäöåååå

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

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

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

    R   i    s   öäöäöäöäöåååå(   R	   t
   isinstanceRR   R   (   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_unicode  s    	c          C` s   t  d t  }  t d d |  } d t |  k sE t t |    t d d |  } d t |  k s{ t t |    t d d |  } t |  j d  d k s t t |    d  S(   Nt	   use_plotss|   
    Examples
    --------
    >>> import matplotlib.pyplot as plt
    >>> plt.plot([1,2,3],[4,5,6])
    >>> plt.show()
    t   configs   plot::s   
    Examples
    --------
    >>> from matplotlib import pyplot as plt
    >>> plt.plot([1,2,3],[4,5,6])
    >>> plt.show()
    s   
    Examples
    --------
    .. plot::

       import matplotlib.pyplot as plt
       plt.plot([1,2,3],[4,5,6])
       plt.show()
    i   (   t   dictR   R	   RR   R   t   count(   t   cfgR   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_plot_examples  s    $$c          C` s8   t  d t  }  t d d |  } t t |  d  d  S(   Nt   use_blockquotess   
    Parameters
    ----------
    abc : def
        ghi
    jkl
        mno

    Returns
    -------
    ABC : DEF
        GHI
    JKL
        MNO
    R   s   
    :Parameters:

        **abc** : def

            ghi

        **jkl**

            mno

    :Returns:

        **ABC** : DEF

            GHI

        JKL

            MNO
    (   R   R   R	   Rn   RR   (   R   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_use_blockquotes  s
    c       	   C` s  d t  f d     Y}  xt t f D]} | |  d t d t  } d t |  k sn t | t |  f   d t |  k s t | t |  f   d t |  k s t | t |  f   d t |  k s t | t |  f   d	 t |  k st | t |  f   | |  d t d t  } d t |  k s[t | 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 rd
 t |  k s0t t |    q# d	 t |  k s# t t |    q# Wd |  f d     Y} xt t f D]} | | d t d t d t  } d t |  k st | t |  f   d t |  k st | t |  f   d t |  k st | t |  f   d t |  k s&t | t |  f   d t |  k sPt | t |  f   | t k rd
 t |  k st t |    n$ d	 t |  k st t |    | | d t d t d t  } d t |  k st | t |  f   d t |  k st | t |  f   d t |  k sFt | t |  f   d t |  k spt | t |  f   d t |  k st | t |  f   | t k rd
 t |  k st t |    qWd	 t |  k sWt t |    qWWd  S(   NRI   c           B` sE   e  Z d  Z d   Z d   Z e d    Z d e f d     YZ RS(   s   
        Dummy class.

        c         S` s   d S(   s   Spam

Spam spam.N(    (   RJ   R   R    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyR.     s    c         S` s   d S(   s   Cheese

No cheese.N(    (   RJ   RB   RK   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyRL   
  s    c         S` s   d S(   s   Spammity indexgffffff?(    (   RJ   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   spammity  s    t	   Ignorablec           B` s   e  Z d  Z RS(   s   local class, to be ignored(   RM   RN   RO   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyR     s   (	   RM   RN   RO   R.   RL   t   propertyR   RQ   R   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyRI     s
   		R   t   show_class_memberst   MethodsR.   RL   R   s   Spammity indexs   .. autosummary::t   SubDummyc           B` s    e  Z d  Z d   Z d   Z RS(   s+   
        Subclass of Dummy class.

        c         S` s   d S(   s'   Cheese

No cheese.
Overloaded Dummy.hamN(    (   RJ   RB   RK   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyRL   .  s    c         S` s   d S(   s   Bar

No barN(    (   RJ   R   R    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   bar2  s    (   RM   RN   RO   RL   R   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyR   )  s   	t   show_inherited_class_membersR   (   RQ   R   R
   R   t   FalseRR   R   R   (   RI   t   clsR   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_class_members   sL    *********'(*****'$*****'c          C` s,   t  d  }  |  d j   d k s( t  d  S(   Ns$   
    z(x1, x2)

    z(a, theta)
    R   s   z(a, theta)(   R   R6   R   (   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_duplicate_signatureR  s    	sV  
    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(   NsZ  
    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

    (   R   R   t   class_doc_txtRn   RR   (   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_class_members_doc  s    'c          C` s9   d d d     Y}  t  |  t  } t t |  d  d  S(   Nt   Fooc           B` sb   e  Z e d     Z e d    Z e d    Z e d    Z e d    Z e d    Z RS(   c         S` s   d S(   s   Test attributeN(   R   (   RJ   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   an_attribute  s    c         S` s   d  S(   N(   R   (   RJ   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   no_docstring  s    c         S` s   d  S(   N(   R   (   RJ   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   no_docstring2  s    c         S` s   d S(   s8   This is a
            sentence. It spans multiple lines.N(   R   (   RJ   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   multiline_sentence  s    c         S` s   d S(   s   The sentence for numpy.org.N(   R   (   RJ   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   midword_period  s    c         S` s   d S(   s   This does not have a period
            so we truncate its summary to the first linebreak

            Apparently.
            N(   R   (   RJ   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt	   no_period  s    (	   RM   RN   R   R   R   R   R   R   R   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyR     s   s  
    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   Rn   RR   (   R   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_class_members_doc_sphinx  s    "5c          C` s   d d d     Y}  d } | t  t |    k s7 t  d t  t |    k sU t  d } t d t  } | t  t |  d |  k s t  d t  t |  d |  k s t  d  S(	   NR   c           B` s   e  Z d  Z e d    Z RS(   s   
        Class docstring.

        Attributes
        ----------
        an_attribute
            Another description that is not used.

        c         S` s   d S(   s   Test attributeN(   R   (   RJ   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyR     s    (   RM   RN   RO   R   R   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyR     s   	sK   :Attributes:

    :obj:`an_attribute <an_attribute>`
        Test attributes   Another descriptionsF   .. rubric:: Attributes

.. autosummary::
   :toctree:

   an_attributet   attributes_as_param_listR   (    (   RR   R
   R   R   R   (   R   t   attr_doct	   attr_doc2R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt$   test_class_attributes_as_member_list  s    $c          C` s<   t  d  t d i t j d  d 6}  t t |   d  d  S(   NR   s   {{examples}}
{{parameters}}t   templates   
    .. 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   R   t   jinja2t   TemplateRn   RR   (   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_templated_sections7  s    c          ` sW   d t  f d     Y  d d   f d     Y}  t |   } d t |  k sS t  d  S(   Nt   SpecialPropertyc           B` s)   e  Z d  d d  Z d   Z d   Z RS(   i    R   c         S` s   | |  _  | |  _ d  S(   N(   t   axisRO   (   RJ   R   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   __init__P  s    	c         S` s%   | d  k r |  S| j j |  j Sd  S(   N(   R   t   _datat   axesR   (   RJ   R   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   __get__T  s    c         S` s   | j  |  j |  d  S(   N(   t	   _set_axisR   (   RJ   R   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   __set__[  s    (   RM   RN   R   R   R   (    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyR   N  s   	RI   c           ` s   e  Z   d  d  Z RS(   R   s   test attribute(   RM   RN   t   attr(    (   R   (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyRI   ^  s   s   test attribute(    (   RQ   R   RR   R   (   RI   R   (    (   R   s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_nonstandard_propertyK  s    c          C` s2   t    }  t d d |  } t t |  d  d  S(   Ns   
    Parameters
    ----------
    param1 : int
        First parameter
    *args : tuple
        Arguments
    **kwargs : dict
        Keyword arguments
    R   s   
:Parameters:

    **param1** : int
        First parameter

    **\*args** : tuple
        Arguments

    **\*\*kwargs** : dict
        Keyword arguments
    (   R   R	   Rn   RR   (   R   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_args_and_kwargsf  s
    		c          C` sD   t  d t d t  }  t t d d |  } t t |  d d  d  S(   NR   R   s.   
A top section before

.. autoclass:: str
    R   sE   
A top section before

.. autoclass:: str

.. rubric:: Methods


    i   (   R   R   R
   RR   Rn   (   R   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   test_autoclass  s    	se  
Test xref in Parameters, Other Parameters and Returns

Parameters
----------
p1 : int
    Integer value

p2 : float, optional
    Integer value

Other Parameters
----------------
p3 : list[int]
    List of integers
p4 : :class:`pandas.DataFrame`
    A dataframe
p5 : sequence of `int`
    A sequence

Returns
-------
out : array
    Numerical return value
s  
Test xref in Parameters, Other Parameters and Returns


:Parameters:

    **p1** : :class:`python:int`
        Integer value

    **p2** : :class:`python:float`, optional
        Integer value

:Returns:

    **out** : :obj:`array <numpy.ndarray>`
        Numerical return value


:Other Parameters:

    **p3** : :class:`python:list`\[:class:`python:int`]
        List of integers

    **p4** : :class:`pandas.DataFrame`
        A dataframe

    **p5** : :obj:`python:sequence` of `int`
        A sequence
c       
   C` s   i d d 6}  t  d d  |   } t  d d  |  } t |  d d d h } t t d t d t d	 |  d
 |  } t t |  t  d  S(   Ns   :obj:`python:sequence`t   sequencet   numpydoc_xref_aliasesR   t   ofR]   t   optionalt   xref_param_typet   xref_aliasest   xref_ignore(	   R   R   R	   t   xref_doc_txtR   R   Rn   RR   t   xref_doc_txt_expected(   R   R   t   appR   R   (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt	   test_xref  s    

t   __main__(^   t
   __future__R    R   R   t   collectionsR   Ra   t   sysRd   R   R   t   numpydoc.numpydocR   t   numpydoc.docscrapeR   R   R   R   t   numpydoc.docscrape_sphinxR	   R
   R   R   t   pytestR   RE   R   R   t   version_infot   sixuRs   R   Rv   R:   t   doc_sent_txtRC   R   R   R   R-   R0   R7   R@   RD   RH   RT   RW   RY   R[   R`   Rc   R   Rn   Ro   Rp   Rq   Rr   Ru   Rw   Rx   Ry   R}   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R  RM   t   main(    (    (    s<   lib/python2.7/site-packages/numpydoc/tests/test_docscrape.pyt   <module>   s   ""	n											@					
	r				x												7				!					!	(	R	5	,	\	%				+	