code: def escape_string(self, value):
          
          if isinstance(value, EscapedString):
              return value.formatted(self._escaper)
          return self._escaper(value)
docs: Escape the <, >, ^, and & special characters reserved by Windows.
  
          Args:
              value (str/EscapedString): String or already escaped string.
  
          Returns:
              str: The value escaped for Windows.