def METHOD_NAME(self, value, is_path=False):
    value = EscapedString.promote(value)
    value = value.expanduser()
    result = ''
    for is_literal, txt in value.strings:
        if is_literal:
            txt = pipes.quote(txt)
            if not txt.startswith("'"):
                txt = "'%s'" % txt
        else:
            if is_path:
                txt = self.normalize_paths(txt)
            txt = txt.replace('"', '"\\""')
            txt = txt.replace('!', '\\!')
            txt = '"%s"' % txt
        result += txt
    return result