def merge_infos(info1, info2):
 for (key, value) in six.iteritems(info2):
  if ((key in info1) and key.startswith('stats')):
   if key.startswith('stats.timers'):
    info1[key] += value
   elif key.startswith('stats.gauges'):
    info1[key] = value
   else:
    info1[key] += value
  else:
   info1[key] = value

def merge_infos ( info1 , info2 ) : for ( key , value ) in six . iteritems ( info2 ) : if ( ( key in info1 ) and key . startswith ( 'stats' ) ) : if key . startswith ( 'stats.timers' ) : info1 [ key ] += value elif key . startswith ( 'stats.gauges' ) : info1 [ key ] = value else : info1 [ key ] += value else : info1 [ key ] = value
we often need to aggregate together multiple infos .