code: def _stripslashes(s):
    '''Removes trailing and leading backslashes from string'''
    r = re.sub(r"\\(n|r)", "\n", s)
    r = re.sub(r"\\", "", r)
    return f _stripslashes(s):
    '''Removes trailing and leading backslashes from string'''
    r = re.sub(r"\\(n|r)", "\n", s)
    r = re.sub(r"\\", "", r)
    return r
docs: Removes trailing and leading backslashes from string