| f | class ExceptionTree: | f | class ExceptionTree: | 
            |  |  |  |  | 
            |  | def __init__(self): |  | def __init__(self): | 
            | n | self.exceptions = {} | n | self.excs = {} | 
            |  |  |  |  | 
            | t | def __call__(self, index): | t | def __call__(self, n): | 
            |  | if index in self.exceptions: |  | if n in self.excs: | 
            |  | return self.exceptions[index] |  | return self.excs[n] | 
            |  | parent_index = index // 2 |  | parent_n = n // 2 | 
            |  | parent_exception = self(parent_index) if parent_index > 0 else E |  | parent_ex = self(parent_n) if parent_n > 0 else Exception | 
            |  | xception |  |  | 
            |  | exception_class = type(f'Exception-{index}', (parent_exception,) |  | ex_class = type(f'Exception-{n}', (parent_ex,), {'n': n}) | 
            |  | , {'n': index}) |  |  | 
            |  | self.exceptions[index] = exception_class |  | self.excs[n] = ex_class | 
            |  | return exception_class |  | return ex_class |