def _sort_footnotes(self, text):
        """Because _do_links is not applied to the text in text flow order, footnotes are not generated in proper order, we have to sort them before _add_footnotes.
        """
        _footnote_tag_re = re.compile(r'''<sup class="footnote-ref" id="fnref-(.+)"><a href="#fn-\1">(\d+)</a></sup>''')
        self.footnote_ids = []
        def _repl(match):
            id = match.group(1)
            num = match.group(2)
            if self.footnotes in id:
                self.footnote_ids.append(id)
                return match.string[match.start(0):match.start(2)] + str(len(self.footnote_ids)) + match.string[match.end(2):match.end(0)]
            else:
                return match.string[match.start():match.end()]
        return _footnote_tag_re.sub(_repl, text)
dataset/ETHPy150Open an0/Letterpress/code/markdown2/lib/markdown2.py/Markdown._sort_footnotes/swapped operands of `in`