human
Complete this python program:
def encode_basestring(s):
assistant
#Here is the Python code you requested.

    """Return a JSON representation of a Python string
    """
    def replace(match):
        return ESCAPE_DCT[match.group(0)]
    return (('"' + ESCAPE.sub(replace, s)) + '"')