def update_prediction_data():
 min_daily_by_sr = _min_daily_pageviews_by_sr(NDAYS_TO_QUERY)
 if ('' in min_daily_by_sr):
  fp = DefaultSR.name.lower()
  min_daily_by_sr[fp] = (min_daily_by_sr.get(fp, 0) + min_daily_by_sr[''])
  del min_daily_by_sr['']
 filtered = {sr_name: num for (sr_name, num) in min_daily_by_sr.iteritems() if (num > 100)}
 PromoMetrics.set(MIN_DAILY_CASS_KEY, filtered)

def update_prediction_data ( ) : min_daily_by_sr = _min_daily_pageviews_by_sr ( NDAYS_TO_QUERY ) if ( '' in min_daily_by_sr ) : fp = DefaultSR . name . lower ( ) min_daily_by_sr [ fp ] = ( min_daily_by_sr . get ( fp , 0 ) + min_daily_by_sr [ '' ] ) del min_daily_by_sr [ '' ] filtered = { sr_name : num for ( sr_name , num ) in min_daily_by_sr . iteritems ( ) if ( num > 100 ) } PromoMetrics . set ( MIN_DAILY_CASS_KEY , filtered )
fetch prediction data and write it to cassandra .