code: def dumps(obj, **kwargs):
      
  
      t = type(obj)
      if obj is True:
          return u'true'
      elif obj is False:
          return u'false'
      elif obj == None:
          return u'null'
      elif t == type('') or t == type(u''):
          single = "'" in obj
          double = '"' in obj
          if single and double:
              return json.dumps(obj)
          elif single:
              return '"' + obj + '"'
          else:
              return "'" + obj + "'"
      elif t is float or t is int:
          return str(obj)
      elif t is dict:
          return u'{' + u','.join([
              _dumpkey(k) + u':' + dumps(v) for k, v in obj.items()
          ]) + '}'
      elif t is list:
          return u'[' + ','.join([dumps(el) for el in obj]) + u']'
      else:  # pragma: no cover
          return u''
docs: Serialize ``obj`` to a JSON5-formatted ``str``.