ó
(*ż\c           @   s_  d  d l  Z  e  j d  Z e  j d  Z e  j d  Z e  j d  Z e  j d  Z e  j d  Z e  j d  Z e	 d	  Z
 i d
 d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d  d! 6d" d# 6d$ d% 6d& d' 6d( d) 6d* d+ 6d, d- 6d, d. 6d, d/ 6d0 d1 6d0 d2 6d3 d4 6d5 d6 6d5 d7 6d8 d9 6d: d; 6d< d= 6Z d>   Z d S(?   i˙˙˙˙Ns'   ^[~\.]?[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*$s   (\s*[\[\]\(\)\{\}]\s*|,\s+)s
   [\]\)\}]\ws	   (``.+?``)s   (:\w+:`.+?(?<!\\)`)s   (`.+?`)s   (\s+or\s+|\s+\|\s+|,\s+|\s+)s   [](){}s   :data:`python:None`t   Nones)   :ref:`bool <python:bltin-boolean-values>`t   boolt   booleans   :data:`python:True`t   Trues   :data:`python:False`t   Falses   :class:`python:list`t   lists   :class:`python:tuple`t   tuples   :class:`python:str`t   strt   strings   :class:`python:dict`t   dicts   :class:`python:float`t   floats   :class:`python:int`t   ints   :func:`python:callable`t   callables   :term:`python:iterable`t   iterables   :term:`python:sequence`t   sequences(   :func:`python:contextlib.contextmanager`t   contextmanagers%   :func:`python:collections.namedtuple`t
   namedtuples   :term:`python:generator`t	   generators   numpy.ndarrayt   arrayt   ndarrays
   np.ndarrays   :term:`numpy:array_like`s
   array-liket
   array_likes$   :ref:`scalar <numpy:arrays.scalars>`t   scalars   numpy.random.RandomStatet   RandomStates   np.random.RandomStates   :data:`numpy.inf`s   np.infs   :data:`numpy.nan`s   np.nans   :mod:`numpy`t   numpyc            s  |    k r&   |  |  } } | }  n
 |  } } t  j |  rp |  k rp | | k re d | | f Sd | Sn     f d   } d |  k r | |  t  Sd |  k r´ | |  t  Sd |  k rÍ | |  t  St d   |  D  rt j |   rö |  S| |  t  S| |  t	  S(   sŚ  Enclose str in a :obj: role.

    Parameters
    ----------
    param_type : str
        text
    xref_aliases : dict
        Mapping used to resolve common abbreviations and aliases
        to fully qualified names that can be cross-referenced.
    xref_ignore : set
        Words not to cross-reference.

    Returns
    -------
    out : str
        Text with parts that may be wrapped in a
        ``:obj:`` role.
    s   :obj:`%s <%s>`s	   :obj:`%s`c   	         sí   g  } | j  |   } t |  } | d k ré xŹ t |  D] \ } } | j |  re | j |  q: t |     } | rË | d d k rË | | d k  rË | | d d } | d k rË | d 7} qË n  | j |  q: Wd j |  S|  S(   s   
        Split string using the regex pattern,
        apply main function to the parts that do not match the pattern,
        combine the results
        i   i˙˙˙˙t   `i    s   ([{s   \t    (   t   splitt   lent	   enumeratet   matcht   appendt	   make_xreft   join(	   t   st   patternt   resultst   tokenst   nt   it   tokt   rest	   next_char(   t   xref_aliasest   xref_ignore(    s,   lib/python2.7/site-packages/numpydoc/xref.pyt   _split_and_apply_re   s     &s   ``s   :`R   c         s   s   |  ] } | t  k Vq d  S(   N(   t   CONTAINER_CHARS(   t   .0t   c(    (    s,   lib/python2.7/site-packages/numpydoc/xref.pys	   <genexpr>ą   s    (
   t   QUALIFIED_NAME_RER   t   DOUBLE_QUOTE_SPLIT_REt   ROLE_SPLIT_REt   SINGLE_QUOTE_SPLIT_REt   anyt   CONTAINER_SPLIT_REJECT_REt   searcht   CONTAINER_SPLIT_REt   TEXT_SPLIT_RE(   t
   param_typeR*   R+   t   linkt   titleR,   (    (   R*   R+   s,   lib/python2.7/site-packages/numpydoc/xref.pyR   a   s(    	
%(   t   ret   compileR0   R7   R5   R1   R2   R3   R8   t   setR-   t   DEFAULT_LINKSR   (    (    (    s,   lib/python2.7/site-packages/numpydoc/xref.pyt   <module>   s\   							
