def dumps(obj, **kwargs):
t = type(obj)<EOL>if obj is True:<EOL><INDENT>return u'<STR_LIT:true>'<EOL><DEDENT>elif obj is False:<EOL><INDENT>return u'<STR_LIT:false>'<EOL><DEDENT>elif obj == None:<EOL><INDENT>return u'<STR_LIT:null>'<EOL><DEDENT>elif t == type('<STR_LIT>') or t == type(u'<STR_LIT>'):<EOL><INDENT>single = "<STR_LIT:'>" in obj<EOL>double = '<STR_LIT:">' in obj<EOL>if single and double:<EOL><INDENT>return json.dumps(obj)<EOL><DEDENT>elif single:<EOL><INDENT>return '<STR_LIT:">' + obj + '<STR_LIT:">'<EOL><DEDENT>else:<EOL><INDENT>return "<STR_LIT:'>" + obj + "<STR_LIT:'>"<EOL><DEDENT><DEDENT>elif t is float or t is int:<EOL><INDENT>return str(obj)<EOL><DEDENT>elif t is dict:<EOL><INDENT>return u'<STR_LIT:{>' + u'<STR_LIT:U+002C>'.join([<EOL>_dumpkey(k) + u'<STR_LIT::>' + dumps(v) for k, v in obj.items()<EOL>]) + '<STR_LIT:}>'<EOL><DEDENT>elif t is list:<EOL><INDENT>return u'<STR_LIT:[>' + '<STR_LIT:U+002C>'.join([dumps(el) for el in obj]) + u'<STR_LIT:]>'<EOL><DEDENT>else:  <EOL><INDENT>return u'<STR_LIT>'<EOL><DEDENT>
Serialize ``obj`` to a JSON5-formatted ``str``.