+
    iS                     r    ^ 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# )    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V n         V # N)
_kwarg_doc)functexts   &u/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/matplotlib/_docstring.py	decoratorkwarg_doc.<locals>.decorator   s         )r	   r   s   f r
   	kwarg_docr      s    , r   c                   0   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                ^    V'       d   V'       d   \        R 4      hT;'       g    TV n        R# )z+Only positional or keyword args are allowedN)	TypeErrorparams)selfargskwargss   &*,r
   __init__Substitution.__init__=   s     FIJJnnfr   c                    VP                   '       d7   \        P                  ! VP                   4      V P                  ,          Vn         V# r   )__doc__inspectcleandocr   )r   r   s   &&r
   __call__Substitution.__call__B   s/    <<<"++DLL9DKKGDLr   r   N)	__name__
__module____qualname____firstlineno__r   r   r   __static_attributes____classdictcell____classdict__s   @r
   r   r   "   s     4%
 r   r   c                   &   a  ] tR t^Ht o R tRtV tR# )_ArtistKwdocLoaderc                (  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   N   <"   T F  pVP                   S8X  g   K  Vx  K  	  R # 5ir   )r!   ).0clsnames   & r
   	<genexpr>1_ArtistKwdocLoader.__missing__.<locals>.<genexpr>O   s&      -#DC||t+ C#Ds   %
%)
endswithKeyErrorlenmatplotlib.artistr,   r-   r   recursive_subclasses
ValueError
setdefault)r   keyr,   r-   r0   er1   s   &&    @r
   __missing___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'   s   @r
   r*   r*   H   s     
0 
0r   r*   c                   6   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                $    \        4       V n        R # r   )r*   r   )r   s   &r
   r   &_ArtistPropertiesSubstitution.__init__n   s    (*r   c                >    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   update)r   r   s   &,r
   register&_ArtistPropertiesSubstitution.registerq   s     	$V$r   c                $   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   
isinstancetyper   object)r   objs   &&r
   r   &_ArtistPropertiesSubstitution.__call__z   sW    ;;;!**3;;7$++ECKc4  S\\V__%D
r   r    N)
r!   r"   r#   r$   r   r   rE   r   r%   r&   r'   s   @r
   r@   r@   V   s     .+% r   r@   c                   a  V 3R lpV# )z;Copy a docstring from another source function (if present).c                 N   < SP                   '       d   SP                   V n         V # r   )r   )targetsources   &r
   do_copycopy.<locals>.do_copy   s    >>>#^^FNr   r   )rP   rQ   s   f r
   copyrS      s     Nr   )
r    r   r   r   dictr*   r@   rS   interpdr   r   r
   <module>rW      sA     8# #L0 0) )X (
)r   