[docs]definherit_docstrings(cls):""" Inherit method docstrings from parent classes. Class decorator which goes through all the methods defined on this class and if that method does not already have a docstring then looks for one on the same method in the parent class hierarchy. :param cls: The class to decorate :return: The decorated class """forname,funcingetmembers(cls,isfunction):iffunc.__doc__:continueforparentincls.__mro__[1:]:ifhasattr(parent,name):func.__doc__=getattr(parent,name).__doc__.format(cls=cls)returncls