def print_totals_for_all_results(results):
 print('Total Metrics For All Results:')
 print(('This query returned %s rows.' % len(results.get('rows'))))
 print(('But the query matched %s total results.' % results.get('totalResults')))
 print('Here are the metric totals for the matched total results.')
 totals = results.get('totalsForAllResults')
 for (metric_name, metric_total) in totals.iteritems():
  print(('Metric Name  = %s' % metric_name))
  print(('Metric Total = %s' % metric_total))
  print()

def print_totals_for_all_results ( results ) : print ( 'Total Metrics For All Results:' ) print ( ( 'This query returned %s rows.' % len ( results . get ( 'rows' ) ) ) ) print ( ( 'But the query matched %s total results.' % results . get ( 'totalResults' ) ) ) print ( 'Here are the metric totals for the matched total results.' ) totals = results . get ( 'totalsForAllResults' ) for ( metric_name , metric_total ) in totals . iteritems ( ) : print ( ( 'Metric Name  = %s' % metric_name ) ) print ( ( 'Metric Total = %s' % metric_total ) ) print ( )
prints the total metric value for all pages the query matched .