def flatten_applications(series):
 for row in series:
  if ('data' in row):
   new = {}
   for (app, versions) in row['data'].items():
    app = amo.APP_GUIDS.get(app)
    if (not app):
     continue
    appname = unicode(app.pretty)
    for (ver, count) in versions.items():
     key = ' '.join([appname, ver])
     new[key] = count
   row['data'] = new
  (yield row)

def flatten_applications ( series ) : for row in series : if ( 'data' in row ) : new = { } for ( app , versions ) in row [ 'data' ] . items ( ) : app = amo . APP_GUIDS . get ( app ) if ( not app ) : continue appname = unicode ( app . pretty ) for ( ver , count ) in versions . items ( ) : key = ' ' . join ( [ appname , ver ] ) new [ key ] = count row [ 'data' ] = new ( yield row )
convert app guids to pretty names .