code: def toml(uncertainty):
      
      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
docs: Converts an uncertainty node into a TOML string