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