Ë
    ´2Úiý  ã                   óp   — 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	y)é    Né   )Ú_apic                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)Ú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                 ó8   — |r|rt        d«      ‚|xs || _        y )Nz+Only positional or keyword args are allowed)Ú	TypeErrorÚparams©ÚselfÚargsÚkwargss      úL/var/www/html/acx/venv/lib/python3.12/site-packages/matplotlib/_docstring.pyÚ__init__zSubstitution.__init__!   s   € Ù‘FÜÐIÓJÐJØ’n˜fˆ�ó    c                 ó€   — |j                   r1t        j                  |j                   «      | j                  z  |_         |S ©N)Ú__doc__ÚinspectÚcleandocr	   )r   Úfuncs     r   Ú__call__zSubstitution.__call__&   s-   € Ø�<Š<Ü"×+Ñ+¨D¯L©LÓ9¸D¿K¹KÑGˆDŒLØˆr   c                 ó<   —  | j                   j                  |i |¤Ž y)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      s   „ ñò4%ò
ó
,r   r   c                   ó   — e Zd Zd„ Zy)Ú_ArtistKwdocLoaderc                 óF  — |j                  d«      st        |«      ‚|d t        d«        }ddlm}m} 	 t        j                  |«      D �cg c]  }|j                  |k(  r|‘Œ c}\  }| j                  | ||«      «      S c c}w # t        $ r}t        |«      |‚d }~ww xY w)Nz:kwdocr   )ÚArtistÚkwdoc)ÚendswithÚKeyErrorÚlenÚmatplotlib.artistr!   r"   r   Úrecursive_subclassesr   Ú
ValueErrorÚ
setdefault)r   ÚkeyÚnamer!   r"   ÚclsÚes          r   Ú__missing__z_ArtistKwdocLoader.__missing__3   sš   € Ø�|‰|˜HÔ%Ü˜3“-ÐØ�?”S˜“]�NÐ#ˆß3ð	'Ü#'×#<Ñ#<¸VÓ#Dö -˜CØ—|‘| tÒ+ò ò -‰DˆCð �‰˜s¡E¨#£JÓ/Ð/ùò	-øäò 	'Ü˜3“- QÐ&ûð	'ús)   µB ÁBÁ$B ÂB Â	B ÂBÂB N)r   r   r   r.   r   r   r   r   r   2   s   „ ó
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        «       | _        y r   )r   r	   )r   s    r   r   z&_ArtistPropertiesSubstitution.__init__L   s   € Ü(Ó*ˆ�r   c                 ó¤   •— t         ‰| �  |«       t        |t        «      r/|j                  t
        j                  k7  r | |j                  «       |S r   )Úsuperr   Ú
isinstanceÚtyper   Úobject)r   ÚobjÚ	__class__s     €r   r   z&_ArtistPropertiesSubstitution.__call__O   s:   ø€ Ü‰Ñ˜ÔÜ�cœ4Ô  S§\¡\´V·_±_Ò%DÙ�—‘ÔØˆ
r   )r   r   r   r   r   r   Ú__classcell__)r8   s   @r   r0   r0   @   s   ø„ ñ	ò+÷ð r   r0   c                 ó   ‡ — ˆ fd„}|S )z;Copy a docstring from another source function (if present).c                 óB   •— ‰j                   r‰j                   | _         | S r   )r   )ÚtargetÚsources    €r   Údo_copyzcopy.<locals>.do_copyX   s   ø€ Ø�>Š>Ø#Ÿ^™^ˆFŒNØˆr   r   )r=   r>   s   ` r   Úcopyr?   V   s   ø€ ôð €Nr   )
r   Ú r   r   Údictr   r0   r?   Údedent_interpdÚinterpdr   r   r   ú<module>rD      sB   ðÛ å ÷),ñ ),ôX0˜ô 0ô Lô ò,ñ 9Ó:Ð :€‘r   