def multidict_to_dict(multidict):
 if config.AUTO_COLLAPSE_MULTI_KEYS:
  d = dict(multidict.lists())
  for (key, value) in d.items():
   if (len(value) == 1):
    d[key] = value[0]
  return d
 else:
  return multidict.to_dict()

def multidict_to_dict ( multidict ) : if config . AUTO_COLLAPSE_MULTI_KEYS : d = dict ( multidict . lists ( ) ) for ( key , value ) in d . items ( ) : if ( len ( value ) == 1 ) : d [ key ] = value [ 0 ] return d else : return multidict . to_dict ( )
convert a multidict containing form data into a regular dict .