def dumps(o, preserve=False):
retval = "<STR_LIT>"<EOL>addtoretval, sections = _dump_sections(o, "<STR_LIT>")<EOL>retval += addtoretval<EOL>while sections != {}:<EOL><INDENT>newsections = {}<EOL>for section in sections:<EOL><INDENT>addtoretval, addtosections = _dump_sections(sections[section],<EOL>section, preserve)<EOL>if addtoretval or (not addtoretval and not addtosections):<EOL><INDENT>if retval and retval[-<NUM_LIT:2>:] != "<STR_LIT>":<EOL><INDENT>retval += "<STR_LIT:\n>"<EOL><DEDENT>retval += "<STR_LIT:[>" + section + "<STR_LIT>"<EOL>if addtoretval:<EOL><INDENT>retval += addtoretval<EOL><DEDENT><DEDENT>for s in addtosections:<EOL><INDENT>newsections[section + "<STR_LIT:.>" + s] = addtosections[s]<EOL><DEDENT><DEDENT>sections = newsections<EOL><DEDENT>return retval<EOL>
Stringifies input dict as toml

    Args:
        o: Object to dump into toml

        preserve: Boolean parameter. If true, preserve inline tables.

    Returns:
        String containing the toml corresponding to dict