def to_json(thing):
try:<EOL><INDENT>return json.dumps(thing)<EOL><DEDENT>except TypeError:<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT>
parse to JSON

        >>> data = {}
        >>> to_json(data)
        '{}'
        >>> data = None
        >>> to_json(data)
        'null'
        >>> data = object()
        >>> to_json(data)
        ''
        >>> data = {"format": "json"}
        >>> to_json(data)
        '{"format": "json"}'
        >>> data = 1
        >>> to_json(data)
        '1'