code: def strip_escape(string='', encoding="utf-8"):  # pylint: disable=redefined-outer-name
      
      matches = []
      try:
          if hasattr(string, "decode"):
              string = string.decode(encoding)
      except Exception: # pylint: disable=broad-except
          # Tried to decode something that is not decodeable in the specified encoding. Let's just
          # move on.
          pass
      try:
          for match in ansi_eng.finditer(string):
              matches.append(match)
      except TypeError as error:
          raise TypeError("Unable to strip escape characters from data {}: {}".format(
              string, error))
      matches.reverse()
      for match in matches:
          start = match.start()
          end = match.end()
          string = string[0:start] + string[end:]
      return string
docs: Strip escape characters from string.
  
      :param string: string to work on
      :param encoding: string name of the encoding used.
      :return: stripped string