def unthe(self, text, pattern):
        """Moves pattern in the path format string or strips it

        text -- text to handle
        pattern -- regexp pattern (case ignore is already on)
        strip -- if True, pattern will be removed
        """
        if text:
            r = re.compile(pattern, flags=re.IGNORECASE)
            try:
                t = r.findall(text)[0]
            except __HOLE__:
                return text
            else:
                r = re.sub(r, '', text).strip()
                if self.config['strip']:
                    return r
                else:
                    fmt = self.config['format'].get(unicode)
                    return fmt.format(r, t.strip()).strip()
        else:
            return u''
dataset/ETHPy150Open beetbox/beets/beetsplug/the.py/ThePlugin.unthe