class_docstr: 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"
class_docstr_tok: ["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","''"]
code: def __init__(self, *args, **kwargs):
      if args and kwargs:
          raise TypeError("Only positional or keyword args are allowed")
      self.params = args or kwargs
  
file_path: catboost/contrib/python/matplotlib/py3/matplotlib/_docstring.py
imports: import inspect
  from .None import _api
label_desc: Use image node_id 1 to create a new Substitution object  with example: obj = Substitution()