def _dict_to_stanza(key, stanza):
 ret = ''
 for skey in stanza:
  if (stanza[skey] is True):
   stanza[skey] = ''
  ret += '    {0} {1}\n'.format(skey, stanza[skey])
 return '{0} {{\n{1}}}'.format(key, ret)

def _dict_to_stanza ( key , stanza ) : ret = '' for skey in stanza : if ( stanza [ skey ] is True ) : stanza [ skey ] = '' ret += '    {0} {1}\n' . format ( skey , stanza [ skey ] ) return '{0} {{\n{1}}}' . format ( key , ret )
convert a dict to a multi-line stanza .