

def __init__(self, children, context):
    ch = iter(children)
    _try = next(ch)
    assert (_try.value == 'try'), _try
    self.excepts = []
    self.except_ = None
    self.finally_ = None
    self.else_ = None
    self.body = next(ch)
    for tok in ch:
        if isinstance(tok, Tuple):
            assert (self.except_ is None)
            assert (self.else_ is None)
            assert (self.finally_ is None)
            tok = tok.children
            if (len(tok) < 2):
                (_except,) = tok
                assert (_except.value == 'except'), _except
                self.except_ = next(ch)
            elif (len(tok) < 3):
                (_except, typ) = tok
                suite = next(_try)
                assert (_except.value == 'except'), _except
                self.excepts.append((typ, None, suite))
            elif (len(tok) < 5):
                (_except, typ, _as, name) = tok
                suite = next(ch)
                assert (_except.value == 'except'), _except
                assert (_as.value == 'as'), _as
                self.excepts.append((typ, name, suite))
            else:
                raise NotImplementedError(tok)
        elif (tok.value == 'else'):
            assert (self.finally_ is None)
            assert (self.else_ is None)
            assert (self.excepts or self.except_)
            self.else_ = next(ch)
        elif (tok.value == 'finally'):
            assert (self.finally_ is None)
            self.finally_ = next(ch)
        else:
            raise NotImplementedError(tok)
    super().__init__(context)

dataset/ETHPy150Open tailhook/pyzza/pyzza/parser.py Try.__init__/VarMisuse@187/214 `ch`->`_try`