

def escape(x):
    '\n    Shell escape the given string\n\n    Implementation borrowed from now-deprecated commands.mkarg() in the stdlib\n    '
    if ("'" not in x):
        return (("'" + x) + "'")
    s = '"'
    for c in x:
        if (c in '\\$"`'):
            s = (s + '\\')
        s = (s + c)
    s = (s + '"')
    return s

dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/python/_shellcomp.py escape/original