rL iSpddlZddlmZdZGddZGddeZGd d Zd ZeZ y) N)_apicfd}|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|_|SN) _kwarg_doc)functexts [/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/_docstring.py decoratorzkwarg_doc..decorators )r r s` r kwarg_docrs, r ceZdZdZdZdZy) 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" c8|r |r td|xs||_y)Nz+Only positional or keyword args are allowed) TypeErrorparams)selfargskwargss r __init__zSubstitution.__init__=s FIJ Jnf r c|jr1tj|j|jz|_|Sr)__doc__inspectcleandocr)rr s r __call__zSubstitution.__call__Bs- <<"++DLL9DKKGDL r N)__name__ __module__ __qualname__rrrrr r rr"s4% r rceZdZdZy)_ArtistKwdocLoaderc|jds t||dtd ddlm}m} fdt j|D\}|j|||S#t$r}t||d}~wwxYw)Nz:kwdocr)Artistkwdocc3@K|]}|jk(r|ywr)r).0clsnames r z1_ArtistKwdocLoader.__missing__..Os$-C||t+-s) endswithKeyErrorlenmatplotlib.artistr$r%rrecursive_subclasses ValueError setdefault)rkeyr$r%r(er)s @r __missing__z_ArtistKwdocLoader.__missing__Is||H%3- ?S]N#3 '-4#<#.do_copys >>#^^FN r r)rCrDs` r copyrEs Nr ) rrrrdictr"r6rEinterpdrr r rIsA8##L 0 0))X ( )r