def _json_clean(d):
result = {}<EOL>compkeys = {}<EOL>for k, v in d.items():<EOL><INDENT>if not isinstance(k, tuple):<EOL><INDENT>result[k] = v<EOL><DEDENT>else:<EOL><INDENT>key = "<STR_LIT>".format(id(k))<EOL>result[key] = v<EOL>compkeys[key] = k<EOL><DEDENT><DEDENT>return (result, compkeys)<EOL>
Cleans the specified python `dict` by converting any tuple keys to
    strings so that they can be serialized by JSON.

    Args:
        d (dict): python dictionary to clean up.

    Returns:
        dict: cleaned-up dictionary.