def wrap_argument(text):
    if not any(x in text for x in [' ', '"', "'", '\\']):
        return text
    else:
        return '"%s"' % (text.replace('\\', r'\\').replace('"', r'\"'), )
Wrap command argument in quotes and escape when this contains special characters.
dataset/ETHPy150Open jonathanslenders/pymux/pymux/commands/utils.py/wrap_argument