<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def toml(uncertainty):
 """ Converts an uncertainty node into a TOML string """

    text = uncertainty.text.strip()
    if not text.startswith('['):  # a bare GSIM name was passed
        text = '[%s]' % text
    for k, v in uncertainty.attrib.items():
        try:
            v = ast.literal_eval(v)
        except ValueError:
            v = repr(v)
        text += '\n%s = %s' % (k, v)
    return text