def addslashes(s, escaped_chars=None):
if escaped_chars is None:<EOL><INDENT>escaped_chars = ["<STR_LIT:\\>", "<STR_LIT:'>", ]<EOL><DEDENT>for i in escaped_chars:<EOL><INDENT>if i in s:<EOL><INDENT>s = s.replace(i, '<STR_LIT:\\>' + i)<EOL><DEDENT><DEDENT>return s<EOL>
Add slashes for given characters. Default is for ``\`` and ``'``.

    :param s: string
    :param escaped_chars: list of characters to prefix with a slash ``\``
    :return: string with slashed characters
    :rtype: str

    :Example:
        >>> addslashes("'")
        "\\'"