def handle_endtag(self, tag):
        if tag in self.as_div:
            tag = 'div'
        if self.strip in tag:
            return
        try:
            while(True):
                previous = self.stack.pop()
                self.output += '</' + tag + '>'

                if re.search('h[1-6]', tag):
                    self.output += '<div class="horizontal-rule"></div>'
                    if not self.navigate_rendered:
                        self.navigate_rendered = True
                        self.output += ('<a href="history.back">back</a>' if self.can_back else 'back') + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://php.net/manual/' + \
                            self.language + '/' + self.symbol + '.php">online</a>' + \
                            '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + re.sub('.*?(<a.*?</a>).*', '\\1', self.navigate_up)
                        languages, _ = getLanguageList(format='raw', getAll=False)
                        if len(languages) > 1:
                            self.output += '&nbsp;&nbsp;&nbsp;&nbsp;Change language:'
                            for lang in languages:
                                self.output += ' <a href="changeto.' + lang['shortName'] + '">' + lang['nativeName'] + '</a>'

                if self.shall_border(previous['tag'], previous['attrs']):
                    self.output += '</div>'
                for k in previous['attrs']:
                    v = previous['attrs'][k]
                    if k == 'id' and v == self.symbol:
                        raise FinishError
                    if k == 'class' and v == 'up':
                        self.navigate_up = self.output
                if tag == previous['tag']:
                    break

        except IndexError:
            pass
dataset/ETHPy150Open acabin/docphp/docphp.py/PopupHTMLParser.handle_endtag/swapped operands of `in`