code: def serialize(self, items):
          
          r = StringIO()
          for key, value in items.items():
              if isinstance(value, list):
                  # handle special case of lists
                  value = "["+", ".join(map(str, value))+"]"
              r.write("%s = %s\n" % (key, value))
          return r.getvalue()
docs: Does the inverse of config parsing by taking parsed values and
          converting them back to a string representing config file contents.