code: def write_and_convert(self, text):
          '''
          Write the given text to our wrapped stream, stripping any ANSI
          sequences from the text, and optionally converting them into win32
          calls.
          '''
          cursor = 0
          for match in self.ANSI_RE.finditer(text):
              start, end = match.span()
              self.write_plain_text(text, cursor, start)
              self.convert_ansi(*match.groups())
              cursor = end
          self.write_plain_text(text, cursor, len(text)f write_and_convert(self, text):
          '''
          Write the given text to our wrapped stream, stripping any ANSI
          sequences from the text, and optionally converting them into win32
          calls.
          '''
          cursor = 0
          for match in self.ANSI_RE.finditer(text):
              start, end = match.span()
              self.write_plain_text(text, cursor, start)
              self.convert_ansi(*match.groups())
              cursor = end
          self.write_plain_text(text, cursor, len(text))
docs: Write the given text to our wrapped stream, stripping any ANSI
          sequences from the text, and optionally converting them into win32
          calls.