def extract_param_list(params, prefix=''):
 key_re = re.compile(('%s\\.member\\.([0-9]+)\\.(.*)' % prefix))
 def get_param_data(params):
  for (param_name, value) in params.items():
   match = key_re.match(param_name)
   if match:
    try:
     index = int(match.group(1))
    except ValueError:
     pass
    else:
     key = match.group(2)
     (yield (index, (key, value)))
 def key_func(d):
  return d[0]
 data = sorted(get_param_data(params), key=key_func)
 members = itertools.groupby(data, key_func)
 return [dict((kv for (di, kv) in m)) for (mi, m) in members]

def extract_param_list ( params , prefix = '' ) : key_re = re . compile ( ( '%s\\.member\\.([0-9]+)\\.(.*)' % prefix ) ) def get_param_data ( params ) : for ( param_name , value ) in params . items ( ) : match = key_re . match ( param_name ) if match : try : index = int ( match . group ( 1 ) ) except ValueError : pass else : key = match . group ( 2 ) ( yield ( index , ( key , value ) ) ) def key_func ( d ) : return d [ 0 ] data = sorted ( get_param_data ( params ) , key = key_func ) members = itertools . groupby ( data , key_func ) return [ dict ( ( kv for ( di , kv ) in m ) ) for ( mi , m ) in members ]
extract a list-of-dicts based on parameters containing aws style list .