def _prep_stats_dict(values):
 stats = []
 d = values.get('stats', {})
 for (k, v) in d.iteritems():
  stat = models.ComputeNodeStat()
  stat['key'] = k
  stat['value'] = v
  stats.append(stat)
 values['stats'] = stats

def _prep_stats_dict ( values ) : stats = [ ] d = values . get ( 'stats' , { } ) for ( k , v ) in d . iteritems ( ) : stat = models . ComputeNodeStat ( ) stat [ 'key' ] = k stat [ 'value' ] = v stats . append ( stat ) values [ 'stats' ] = stats
make list of computenodestats .