§
    †Ûgý  ã                   óŠ   — d dl Z ddlmZ  G d„ d¦  «        Z G d„ de¦  «        Z G d„ d	e¦  «        Zd
„ Z e¦   «         xZZ	dS )é    Né   )Ú_apic                   ó$   — e Zd ZdZd„ Zd„ Zd„ ZdS )ÚSubstitutionaG  
    A decorator that performs %-substitution on an object's docstring.

    This decorator should be robust even if ``obj.__doc__`` is None (for
    example, if -OO was passed to the interpreter).

    Usage: construct a docstring.Substitution with a sequence or dictionary
    suitable for performing substitution; then decorate a suitable function
    with the constructed object, e.g.::

        sub_author_name = Substitution(author='Jason')

        @sub_author_name
        def some_function(x):
            "%(author)s wrote this function"

        # note that some_function.__doc__ is now "Jason wrote this function"

    One can also use positional arguments::

        sub_first_last_names = Substitution('Edgar Allen', 'Poe')

        @sub_first_last_names
        def some_function(x):
            "%s %s wrote the Raven"
    c                 ó>   — |r|rt          d¦  «        ‚|p|| _        d S )Nz+Only positional or keyword args are allowed)Ú	TypeErrorÚparams©ÚselfÚargsÚkwargss      úK/granary/edev/quantum/lib/python3.11/site-packages/matplotlib/_docstring.pyÚ__init__zSubstitution.__init__!   s1   € Øð 	K�Fð 	KÝÐIÑJÔJÐJØ�n˜fˆŒˆˆó    c                 ó`   — |j         r&t          j        |j         ¦  «        | j        z  |_         |S ©N)Ú__doc__ÚinspectÚcleandocr	   )r   Úfuncs     r   Ú__call__zSubstitution.__call__&   s-   € ØŒ<ð 	HÝ"Ô+¨D¬LÑ9Ô9¸D¼KÑGˆDŒLØˆr   c                 ó*   —  | j         j        |i |¤Ž dS )zW
        Update ``self.params`` (which must be a dict) with the supplied args.
        N)r	   Úupdater
   s      r   r   zSubstitution.update+   s$   € ð 	ˆŒÔ˜DÐ+ FÐ+Ð+Ð+Ð+Ð+r   N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   © r   r   r   r      sK   € € € € € ðð ð4%ð %ð %ð
ð ð ð
,ð ,ð ,ð ,ð ,r   r   c                   ó   — e Zd Zd„ ZdS )Ú_ArtistKwdocLoaderc                 óV  ‡— |                      d¦  «        st          |¦  «        ‚|d t          d¦  «         …         Šddlm}m} 	 ˆfd„t          j        |¦  «        D ¦   «         \  }n"# t          $ r}t          |¦  «        |‚d }~ww xY w|  	                    | ||¦  «        ¦  «        S )Nz:kwdocr   )ÚArtistÚkwdocc                 ó*   •— g | ]}|j         ‰k    ¯|‘ŒS r   )r   )Ú.0ÚclsÚnames     €r   ú
<listcomp>z2_ArtistKwdocLoader.__missing__.<locals>.<listcomp>9   s/   ø€ ð -ð -ð -˜CØ”| tÒ+Ð+ð Ø+Ð+Ð+r   )
ÚendswithÚKeyErrorÚlenÚmatplotlib.artistr!   r"   r   Úrecursive_subclassesÚ
ValueErrorÚ
setdefault)r   Úkeyr!   r"   r%   Úer&   s         @r   Ú__missing__z_ArtistKwdocLoader.__missing__3   sÕ   ø€ Ø�|Š|˜HÑ%Ô%ð 	 Ý˜3‘-”-ÐØ�?•S˜‘]”]�N�?Ô#ˆØ3Ð3Ð3Ð3Ð3Ð3Ð3Ð3ð	'ð-ð -ð -ð -¥4Ô#<¸VÑ#DÔ#Dð -ñ -ô -‰DˆCˆCøåð 	'ð 	'ð 	'Ý˜3‘-”- QÐ&øøøøð	'øøøà�Š˜s E E¨#¡J¤JÑ/Ô/Ð/s   Á"A* Á*
B	Á4BÂB	N)r   r   r   r1   r   r   r   r   r   2   s#   € € € € € ð
0ð 
0ð 
0ð 
0ð 
0r   r   c                   ó(   ‡ — e Zd ZdZd„ Zˆ fd„Zˆ xZS )Ú_ArtistPropertiesSubstitutionaÜ  
    A `.Substitution` with two additional features:

    - Substitutions of the form ``%(classname:kwdoc)s`` (ending with the
      literal ":kwdoc" suffix) trigger lookup of an Artist subclass with the
      given *classname*, and are substituted with the `.kwdoc` of that class.
    - Decorating a class triggers substitution both on the class docstring and
      on the class' ``__init__`` docstring (which is a commonly required
      pattern for Artist subclasses).
    c                 ó,   — t          ¦   «         | _        d S r   )r   r	   )r   s    r   r   z&_ArtistPropertiesSubstitution.__init__L   s   € Ý(Ñ*Ô*ˆŒˆˆr   c                 ó¾   •— t          ¦   «                              |¦  «         t          |t          ¦  «        r%|j        t
          j        k    r | |j        ¦  «         |S r   )Úsuperr   Ú
isinstanceÚtyper   Úobject)r   ÚobjÚ	__class__s     €r   r   z&_ArtistPropertiesSubstitution.__call__O   sR   ø€ Ý‰Œ×Ò˜ÑÔÐÝ�c�4Ñ Ô ð 	 S¤\µV´_Ò%DÐ%DØˆD�”ÑÔÐØˆ
r   )r   r   r   r   r   r   Ú__classcell__)r;   s   @r   r3   r3   @   sQ   ø€ € € € € ð	ð 	ð+ð +ð +ðð ð ð ð ð ð ð ð r   r3   c                 ó   ‡ — ˆ fd„}|S )z;Copy a docstring from another source function (if present).c                 ó.   •— ‰j         r‰j         | _         | S r   )r   )ÚtargetÚsources    €r   Údo_copyzcopy.<locals>.do_copyX   s   ø€ ØŒ>ð 	,Ø#œ^ˆFŒNØˆr   r   )r@   rA   s   ` r   ÚcopyrB   V   s#   ø€ ðð ð ð ð ð €Nr   )
r   Ú r   r   Údictr   r3   rB   Údedent_interpdÚinterpdr   r   r   ú<module>rG      sÅ   ðØ €€€à Ð Ð Ð Ð Ð ð),ð ),ð ),ð ),ð ),ñ ),ô ),ð ),ðX0ð 0ð 0ð 0ð 0˜ñ 0ô 0ð 0ðð ð ð ð  Lñ ô ð ð,ð ð ð 9Ð8Ñ:Ô:Ð :€���r   