def echo_class(klass, write=sys.stdout.write):
    """Echo calls to class methods and static functions"""
    for _, method in inspect.getmembers(klass, inspect.ismethod):
        # In python 3 only class methods are returned here, but in python2 instance methods are too.
        echo_instancemethod(klass, method, write)
    for _, fn in inspect.getmembers(klass, inspect.isfunction):
        if is_static_method(fn, klass):
            setattr(klass, name(fn), staticmethod(echo(fn, write)))
        else:
            # It's not a class or a static method, so it must be an instance method.
            # This should only be called in python 3, because in python 3 instance methods are considered functions.
            echo_instancemethod(klass, fn, write)
Echo calls to class methods and static functions
src/watchdog/utils/echo.py