def flip(self):
        """ Convert Markdown to the opposite style of the first text link"""
        try:
            first_match = re.search(self.match_links, self.text).group(0)
            if first_match is None or first_match == []:
                formd_md = self.text
            elif '(' and ')' in first_match:
                formd_md = self.ref_md()
            else:
                formd_md = self.inline_md()
        except AttributeError:
            formd_md = self.text
        return formd_md
dataset/ETHPy150Open drbunsen/formd/src/formd.py/ForMd.flip/original