def quoted_string_literal(s, d):
    """
    SOQL requires single quotes to be escaped.
    http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_quotedstringescapes.htm
    """
    try:
        return "'%s'" % (s.replace("\\", "\\\\").replace("'", "\\'"),)
    except __HOLE__ as e:
        raise NotImplementedError("Cannot quote %r objects: %r" % (type(s), s))
dataset/ETHPy150Open django-salesforce/django-salesforce/salesforce/backend/query.py/quoted_string_literal