<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def dumps(cfg):
    '''Serialize ``cfg`` into a libconfig-formatted ``str``

    ``cfg`` must be a ``dict`` with ``str`` keys and libconf-supported values
    (numbers, strings, booleans, possibly nested dicts, lists, and tuples).

    Returns the formatted string.
    '''

    str_file = io.StringIO()
    dump(cfg, str_file)
    return str_file.getvalue()