+
     ]iS  c                   sr    ^ RI t ^RIHt R t ! R R4      t ! R R]4      t ! R R	4      tR
 t]! 4       t	R# )i    N)_apic                   a  V 3R lpV# )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   < SV n         V # N)Z
_kwarg_doc)functext   &</usr/lib64/python3.14/site-packages/matplotlib/_docstring.py	decoratorZkwarg_doc.<locals>.decorator   s         )r   r      f r   	kwarg_docr      s    , r   c                   s0   a  ] tR t^"t o RtR tR tRtV tR# )Substitutiona  
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                s^    V'       d   V'       d   \        R 4      hT;'       g    TV n        R# )z+Only positional or keyword args are allowedN)Z	TypeErrorparams)selfZargskwargss   &*,r   __init__ZSubstitution.__init__=   s     FIJJnnfr   c                s    VP                   '       d7   \        P                  ! VP                   4      V P                  ,          Vn         V# r   )__doc__inspectcleandocr   )r   r      &&r   __call__ZSubstitution.__call__B   s/    <<<"++DLL9DKKGDLr   r   N)	__name__
__module____qualname____firstlineno__r   r   r   __static_attributes____classdictcell__Z__classdict__   @r   r   r   "   s     4%
 r   r   c                   s&   a  ] tR t^Ht o R tRtV tR# )_ArtistKwdocLoaderc                s(  a VP                  R 4      '       g   \        V4      hTR\        R 4      )  o^ RIHpHp  V3R l\        P                  ! V4       4       w  pT P                  Y! T4      4      #   \         d   p\        T4      ThRp?ii ; i)z:kwdocN)Artistkwdocc              3   sN   <"   T F  pVP                   S8X  g   K  Vx  K  	  R # 5ir   )r   )Z.0clsnames   & r   Z	<genexpr>Z1_ArtistKwdocLoader.__missing__.<locals>.<genexpr>O   s&      -#DC||t+ C#Ds   %
%)
ZendswithZKeyErrorZlenZmatplotlib.artistr    r!   r    Zrecursive_subclassesZ
ValueErrorZ
setdefault)r   Zkeyr    r!   r"   Zer#   s   &&    @r   __missing__Z_ArtistKwdocLoader.__missing__I   s    ||H%%3-?S]N#3	'-4#<#<V#D -DC sE#J//  	'3-Q&	's   "A5 5B BBr	   N)r   r   r   r   r$   r   r   r   r   r   r   r   H   s     
0 
0r   r   c                   s6   a  ] tR t^Vt o RtR tR tR tRtV t	R# )_ArtistPropertiesSubstitutiona  
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                s$    \        4       V n        R # r   )r   r   )r   s   &r   r   Z&_ArtistPropertiesSubstitution.__init__n   s    (*r   c                s>    V P                   P                  ! R/ VB  R# )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   Zupdate)r   r   s   &,r   registerZ&_ArtistPropertiesSubstitution.registerq   s     	$V$r   c                s$   VP                   '       d7   \        P                  ! VP                   4      V P                  ,          Vn         \	        V\
        4      '       d2   VP                  \        P                  8w  d   V ! VP                  4       V# r   )r   r   r   r   Z
isinstanceZtyper   Zobject)r   Zobjr   r   r   Z&_ArtistPropertiesSubstitution.__call__z   sW    ;;;!**3;;7$++ECKc4  S\\V__%D
r   r   N)
r   r   r   r   r   r   r&   r   r   r   r   r   r   r%   r%   V   s     .+% r   r%   c                r   )z;Copy a docstring from another source function (if present).c                 sN   < SP                   '       d   SP                   V n         V # r   )r   )Ztargetsourcer   r   do_copyZcopy.<locals>.do_copy   s    >>>#^^FNr   r	   )r'   r(   r
   r   copyr)      s     Nr   )
r   Z r    r   r   Zdictr   r%   r)   Zinterpdr	   r   r   <module>r*      sA     8# #L0 0) )X (
)r   