def split_string(self, string):
        """ Yields substrings for which the same escape code applies.
        """
        self.actions = []
        start = 0

        for match in ANSI_PATTERN.finditer(string):
            raw = string[start:match.start()]
            substring = SPECIAL_PATTERN.sub(self._replace_special, raw)
            if substring or self.actions:
                yield substring
            start = match.end()

            self.actions = []
            groups = [x for x in match.groups() if x is not None]
            params = [ param for param in groups[1].split(';') if param ]
            if groups[0].startswith('['):
                # Case 1: CSI code.
                try:
                    params = list(map(int, params))
                except __HOLE__:
                    # Silently discard badly formed codes.
                    pass
                else:
                    self.set_csi_code(groups[2], params)

            elif groups[0].startswith(']'):
                # Case 2: OSC code.
                self.set_osc_code(params)

        raw = string[start:]
        substring = SPECIAL_PATTERN.sub(self._replace_special, raw)
        if substring or self.actions:
            yield substring
dataset/ETHPy150Open ipython/ipython-py3k/IPython/frontend/qt/console/ansi_code_processor.py/AnsiCodeProcessor.split_string