def flow_stats_to_list(flowstats):
 stats = []
 for stat in flowstats:
  s = {}
  stats.append(s)
  for (k, v) in fields_of(stat).iteritems():
   if (k == 'length'):
    continue
   if k.startswith('pad'):
    continue
   if (k == 'match'):
    v = match_to_dict(v)
   elif (k == 'actions'):
    v = [action_to_dict(a) for a in v]
   s[k] = v
 return stats

def flow_stats_to_list ( flowstats ) : stats = [ ] for stat in flowstats : s = { } stats . append ( s ) for ( k , v ) in fields_of ( stat ) . iteritems ( ) : if ( k == 'length' ) : continue if k . startswith ( 'pad' ) : continue if ( k == 'match' ) : v = match_to_dict ( v ) elif ( k == 'actions' ) : v = [ action_to_dict ( a ) for a in v ] s [ k ] = v return stats
takes a list of flow stats .