Ë
    ¨ehS  ã                   óp   — d dl Z ddlmZ d„ Z G d„ d«      Z G d„ de«      Z G d	„ d
«      Zd„ Z e«       Z	y)é    Né   )Ú_apic                 ó   ‡ — ˆ fd„}|S )aà  
    Decorator for defining the kwdoc documentation of artist properties.

    This decorator can be applied to artist property setter methods.
    The given text is stored in a private attribute ``_kwarg_doc`` on
    the method.  It is used to overwrite auto-generated documentation
    in the *kwdoc list* for artists. The kwdoc list is used to document
    ``**kwargs`` when they are properties of an artist. See e.g. the
    ``**kwargs`` section in `.Axes.text`.

    The text should contain the supported types, as well as the default
    value if applicable, e.g.:

        @_docstring.kwarg_doc("bool, default: :rc:`text.usetex`")
        def set_usetex(self, usetex):

    See Also
    --------
    matplotlib.artist.kwdoc

    c                 ó   •— ‰| _         | S ©N)Ú
_kwarg_doc)ÚfuncÚtexts    €úS/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/matplotlib/_docstring.pyÚ	decoratorzkwarg_doc.<locals>.decorator   s   ø€ ØˆŒØˆó    © )r
   r   s   ` r   Ú	kwarg_docr      s   ø€ ô,ð Ðr   c                   ó   — e 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      r   Ú__init__zSubstitution.__init__=   s   € Ù‘FÜÐIÓJÐJØ’n˜fˆ�r   c                 ó€   — |j                   r1t        j                  |j                   «      | j                  z  |_         |S r   )Ú__doc__ÚinspectÚcleandocr   )r   r	   s     r   Ú__call__zSubstitution.__call__B   s-   € Ø�<Š<Ü"×+Ñ+¨D¯L©LÓ9¸D¿K¹KÑGˆDŒLØˆ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                 ó  ‡— |j                  d«      st        |«      ‚|d t        d«        Šddlm}m} 	 ˆfd„t        j                  |«      D «       \  }| j                  | ||«      «      S # t        $ r}t        |«      |‚d }~ww xY w)Nz:kwdocr   )ÚArtistÚkwdocc              3   ó@   •K  — | ]  }|j                   ‰k(  r|–— Œ y ­wr   )r   )Ú.0ÚclsÚnames     €r   ú	<genexpr>z1_ArtistKwdocLoader.__missing__.<locals>.<genexpr>O   s$   øè ø€ ò -˜CØ—|‘| tÒ+ô ñ -ùs   ƒ)
ÚendswithÚKeyErrorÚlenÚmatplotlib.artistr$   r%   r   Úrecursive_subclassesÚ
ValueErrorÚ
setdefault)r   Úkeyr$   r%   r(   Úer)   s         @r   Ú__missing__z_ArtistKwdocLoader.__missing__I   sƒ   ø€ Ø�|‰|˜HÔ%Ü˜3“-ÐØ�?”S˜“]�NÐ#ˆß3ð	'ó-¤4×#<Ñ#<¸VÓ#Dô -‰DˆCð �‰˜s¡E¨#£JÓ/Ð/øô ò 	'Ü˜3“- QÐ&ûð	'ús   ¶ A. Á.	BÁ7BÂBN)r   r   r    r4   r   r   r   r"   r"   H   s   „ ó
0r   r"   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)Ú_ArtistPropertiesSubstitutionaQ  
    A class to substitute formatted placeholders in docstrings.

    This is realized in a single instance ``_docstring.interpd``.

    Use `~._ArtistPropertiesSubstition.register` to define placeholders and
    their substitution, e.g. ``_docstring.interpd.register(name="some value")``.

    Use this as a decorator to apply the substitution::

        @_docstring.interpd
        def some_func():
            '''Replace %(name)s.'''

    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).

    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.
    c                 ó"   — t        «       | _        y r   )r"   r   )r   s    r   r   z&_ArtistPropertiesSubstitution.__init__n   s   € Ü(Ó*ˆ�r   c                 ó<   —  | j                   j                  di |¤Ž y)zÀ
        Register substitutions.

        ``_docstring.interpd.register(name="some value")`` makes "name" available
        as a named parameter that will be replaced by "some value".
        Nr   )r   Úupdate)r   r   s     r   Úregisterz&_ArtistPropertiesSubstitution.registerq   s   € ð 	ˆ�‰×ÑÑ$˜VÓ$r   c                 óþ   — |j                   r1t        j                  |j                   «      | j                  z  |_         t	        |t
        «      r/|j                  t        j                  k7  r | |j                  «       |S r   )r   r   r   r   Ú
isinstanceÚtyper   Úobject)r   Úobjs     r   r   z&_ArtistPropertiesSubstitution.__call__z   sR   € Ø�;Š;Ü!×*Ñ*¨3¯;©;Ó7¸$¿+¹+ÑEˆCŒKÜ�cœ4Ô  S§\¡\´V·_±_Ò%DÙ�—‘ÔØˆ
r   N)r   r   r    r   r   r:   r   r   r   r   r6   r6   V   s   „ ñò.+ò%ór   r6   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_copy„   s   ø€ Ø�>Š>Ø#Ÿ^™^ˆFŒNØˆr   r   )rC   rD   s   ` r   ÚcopyrE   ‚   s   ø€ ôð €Nr   )
r   Ú r   r   r   Údictr"   r6   rE   Úinterpdr   r   r   ú<module>rI      sA   ðÛ å ò÷8#ñ #ôL0˜ô 0÷)ñ )òXñ (Ó
)�r   