@_try_catch<EOL>def as_json(data, **kwargs):
if '<STR_LIT>' not in kwargs:<EOL><INDENT>kwargs['<STR_LIT>'] = False<EOL><DEDENT>if '<STR_LIT>' not in kwargs:<EOL><INDENT>kwargs['<STR_LIT>'] = False<EOL><DEDENT>data = json.dumps(data, **kwargs)<EOL>return data<EOL>
Writes data as json.

    :param dict data: data to convert to json
    :param kwargs kwargs: kwargs for json dumps
    :return: json string
    :rtype: str