#NEWLINE# def dict_lists2strings( d ) : #NEWLINE# #INDENT# 'Convert lists in a dict to joined strings.\n\n    :param d: The dict to convert.\n    :returns: The converted dict.' #NEWLINE# for ( k , v ) in d . items ( ) : #NEWLINE# #INDENT# if ( isinstance ( v , list ) and all ( [ isinstance ( e , basestring ) for e in v ] ) ) : #NEWLINE# #INDENT# d [ k ] = ' ' . join ( v ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( v , dict ) : #NEWLINE# #INDENT# d [ k ] = dict_lists2strings ( v ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return d