
    qjf                        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ddddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d+d+d,d,d-d.d.d/d0d1d2Zd3 Zy)4    Nz'^[~\.]?[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*$z(\s*[\[\]\(\)\{\}]\s*|,\s+)z
[\]\)\}]\wz	(``.+?``)z(:\w+:`.+?(?<!\\)`)z(`.+?`)z(\s+or\s+|\s+\|\s+|,\s+|\s+)z[](){}Nonez:data:`python:None`boolz):ref:`bool <python:bltin-boolean-values>`booleanTruez:data:`python:True`Falsez:data:`python:False`listz:class:`python:list`tuplez:class:`python:tuple`strz:class:`python:str`stringdictz:class:`python:dict`floatz:class:`python:float`intz:class:`python:int`callablez:func:`python:callable`iterablez:term:`python:iterable`sequencez:term:`python:sequence`contextmanagerz(:func:`python:contextlib.contextmanager`
namedtuplez%:func:`python:collections.namedtuple`z:term:`python:generator`znumpy.ndarrayz:term:`numpy:array_like`z$:ref:`scalar <numpy:arrays.scalars>`znumpy.random.RandomStatez:data:`numpy.inf`z:data:`numpy.nan`z:mod:`numpy`)	generatorarrayndarrayz
np.ndarrayz
array-like
array_likescalarRandomStateznp.random.RandomStateznp.infznp.nannumpyc                    }d}t        t              r.j                         dk(  rd}t               }nt	        d       | v r
|    | }}|} n| x}}t
        j                  |      r||vr||k7  r	d| d| dS |rd| dS |S fd	}d
| v r || t              S d| v r || t              S d| v r || t              S t        d | D              r$t        j                  |       r| S  || t              S  || t              S )a  Parse and apply appropriate sphinx role(s) to `param_type`.

    The :obj: role is the default.

    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 or "all"
        A set containing words not to cross-reference. Instead of a set, the
        string 'all' can be given to ignore all unrecognized terms.
        Unrecognized terms include those that are not in `xref_aliases` and
        are not already wrapped in a reST role.

    Returns
    -------
    out : str
        Text with fully-qualified names and terms that may be wrapped in a
        ``:obj:`` role.
    TallFz(xref_ignore must be a set or 'all', got z:obj:`z <z>``c                 d   g }|j                  |       }t        |      }|dkD  rt        |      D ]l  \  }}|j                  |      r|j	                  |       )t        |	
      }|r$|d   dk(  r||dz
  k  r||dz      d   }|dv r|dz  }|j	                  |       n dj                  |      S | S )z
        Split string using the regex pattern,
        apply main function to the parts that do not match the pattern,
        combine the results
           r   r   z([{\ )splitlen	enumeratematchappend	make_xrefjoin)spatternresultstokensnitokres	next_charxref_aliasesxref_ignores            -lib/python3.12/site-packages/numpydoc/xref.py_split_and_apply_rez&make_xref.<locals>._split_and_apply_re   s     q!Kq5#F+ (3==%NN3'#C{CC s2w#~!a!e)$*1q5M!$4	$-4KCNN3'( 777##    z``z:`c              3   ,   K   | ]  }|t         v   y w)N)CONTAINER_CHARS).0cs     r5   	<genexpr>zmake_xref.<locals>.<genexpr>   s     
4A1
4s   )
isinstancer
   lowerset	TypeErrorQUALIFIED_NAME_REr&   DOUBLE_QUOTE_SPLIT_REROLE_SPLIT_RESINGLE_QUOTE_SPLIT_REanyCONTAINER_SPLIT_REJECT_REsearchCONTAINER_SPLIT_RETEXT_SPLIT_RE)
param_typer3   r4   
ignore_setwrap_unknownlinktitler6   s    ``     r5   r(   r(   a   sD   0 JL+s#%' LJF{mTUU\!":.
e
!!ut$Z)?5=E7"TF"--D6##H z":/DEE z":}== j":/DEE 
4
44$++J7":/ABB z=99r7   )recompilerA   rH   rF   rB   rC   rD   rI   r?   r9   DEFAULT_LINKSr(    r7   r5   <module>rS      s   	  BJJ	   RZZ #  'BJJ   #

   


 #

 
 

#
 h- 
!  7  :	 
 !  #  "  $  
   #  "  $  
   )  )   )! " @# $ 9% & ,!,,4-7!!? Fd:r7   