def count_exceptions(self, exception=Exception):
return ExceptionCounter(self, exception)<EOL>
Count exceptions in a block of code or function.

        Can be used as a function decorator or context manager.
        Increments the counter when an exception of the given
        type is raised up out of the code.