def parse_params(params, ignore_keys=None):
 parsed = {}
 for key in params:
  if (ignore_keys and (key in ignore_keys)):
   continue
  value = params.getall(key)
  if (not value):
   value = ''
  if (len(value) == 1):
   value = value[0]
  parsed[key] = value
 return parsed

def parse_params ( params , ignore_keys = None ) : parsed = { } for key in params : if ( ignore_keys and ( key in ignore_keys ) ) : continue value = params . getall ( key ) if ( not value ) : value = '' if ( len ( value ) == 1 ) : value = value [ 0 ] parsed [ key ] = value return parsed
takes a dict and returns it with some values standardised .