def escape_double_quotes(text):
    return re.sub(r'\\("|\')', r'\\\\\1', text).replace('\"', '\\\"')
Escape double quotes, and escaped double quotes, in the specified text.
dataset/ETHPy150Open ARM-software/workload-automation/wlauto/utils/misc.py/escape_double_quotes