Backslash escape line.value.
186142
def encode(cls, line):
        
        if not line.encoded:
            line.value = cls.listSeparator.join(backslashEscape(val)
                                                for val in line.value)
            line.encoded=True
791285
def escape_chars(text, chars):
    """"""
    text = str(text)
    chars = list(set(chars))
    if '\\' in chars:
        chars.remove('\\')
        chars.insert(0, '\\')
    for ch in chars:
        text = text.replace(ch, '\\' + ch)
    return text
407902
function escapedValue (data, info, str) {
    return he.escape(getValue(data, info, str) + '')
  }
865914
def escape(value):
    

    if isinstance(value, (tuple, list)):
        return "(" + ", ".join([escape(arg) for arg in value]) + ")"
    else:
        typ = by_python_type.get(value.__class__)
        if typ is None:
            raise InterfaceError(
                "Unsupported python input: %s (%s)" % (value, value.__class__)
            )

        return typ.to_sql(value)
593381
def map_column(self, value):
        
        if value in self.null_values:
            return r'\\N'
        else:
            return default_escape(six.text_type(value))
633125
String escapeValue(String value) {
        int start = 0;
        int pos = getNextLocation(start, value);
        if (pos == -1) {
            return value;
        }
        StringBuilder builder = new StringBuilder();
        while (pos != -1) {
            builder.append(value, start, pos);
            builder.append('\\');
            builder.append(value.charAt(pos));
            start = pos + 1;
            pos = getNextLocation(start, value);
        }
        builder.append(value, start, value.length());
        return builder.toString();
    }
784876
def escape_extension_value(val)
        escapes = {
          %r{=}  => '\=',
          %r{\n} => ' ',
          %r{\\} => '\\'
        }
        escapes.reduce(val) do |memo,replace|
          memo=memo.gsub(*replace)
        end
      end
307947
private void quote(final String val) throws IOException {
    if (val.indexOf("\"") < 0) {
      value(val, "\"");
    } else {
      value(val, "'");
    }
  }
265941
def escape(self, value):
        """"""
        value = soft_unicode(value)

        if self._engine._escape is None:  # pylint: disable=protected-access
            return value

        return self._engine._escape(value)
602295
private String escapeQuotes(String value)
   {
      StringBuilder sb = new StringBuilder();
      int length = value.length();
      char c;

      sb.append('"');
      for (int index = 0; index < length; index++)
      {
         c = value.charAt(index);
         sb.append(c);

         if (c == '"')
         {
            sb.append('"');
         }
      }
      sb.append('"');

      return (sb.toString());
   }
186847
public static String escapeEscapes(String value)
    {
        assert(value != null);
        InternalStringBuilder sb = new InternalStringBuilder(value.length());
        for (int i = 0; i < value.length(); i++) {
            char c = value.charAt(i);
            if (c == '"') {
                sb.append("&quot;");
                continue;
            }
            if (c == '\\') {
                sb.append("\\\\");
                continue;
            }
            sb.append(c);
        }
        return sb.toString();
    }
117402
function formatValue (value) {
		if (typeof value == 'string') {
			value = value.replace(NEWLINE_PATTERN, '\\n');
			value = value.replace(APOS_PATTERN, '\\\'');
			return "'" + value + "'";
		}

		return value;
	}
502667
private void escapeValueTo(final String field, final StringBuilder target) {
        if (field == null) {
            target.append(DETAILS_QUOTE_CHAR);
            target.append(DETAILS_QUOTE_CHAR);
            return;
        }
        target.append(DETAILS_QUOTE_CHAR);
        if (field.indexOf(DETAILS_ESCAPE_CHAR) == -1 && field.indexOf(DETAILS_QUOTE_CHAR) == -1) {
            target.append(field);
        } else {
            final int len = field.length();
            for (int i = 0; i < len; i++) {
                final char charAt = field.charAt(i);
                if (charAt == DETAILS_ESCAPE_CHAR || charAt == DETAILS_QUOTE_CHAR) {
                    target.append(DETAILS_ESCAPE_CHAR);
                }
                target.append(charAt);
            }
        }
        target.append(DETAILS_QUOTE_CHAR);
    }
1200211
def escape( text, newline=False ):
    """"""

    if isinstance( text, basestring ):
        if '&' in text:
            text = text.replace( '&', '&amp;' )
        if '>' in text:
            text = text.replace( '>', '&gt;' )
        if '<' in text:
            text = text.replace( '<', '&lt;' )
        if '\"' in text:
            text = text.replace( '\"', '&quot;' )
        if '\'' in text:
            text = text.replace( '\'', '&quot;' )
        if newline:
            if '\n' in text:
                text = text.replace( '\n', '<br>' )

    return text
1028919
def _escape_str(value):
        

        if isinstance(value, int):
            return "%d" % value
        value = value.replace("\\", r'\\')
        for i, j in ts3_escape.items():
            value = value.replace(i, j)
        return value
708457
def escape_string(self, string):
        """"""
        if self.quote:
            quote = self.quote
        else:
            found = QUOTE_REGEX.search(string)
            quote = STRING_QUOTES[found.group()] if found else next(iter(STRING_QUOTES))

        for match, seq in ESCAPE_SUBS.items():
            if match == quote or match not in STRING_QUOTES:
                string = string.replace(match, seq)

        return f'{quote}{string}{quote}'
1178561
def shell_escape(text, _safe=re.compile(r"^[-._,+a-zA-Z0-9]+$")):
    """"""
    if not text or _safe.match(text):
        return text

    squote = type(text)("'")
    return squote + text.replace(squote, type(text)(r"'\''")) + squote