#NEWLINE# def set_processed_counts( self , shards_processed ) : #NEWLINE# #INDENT# 'Updates a chart url to display processed count for each shard.\n\n    Args:\n      shards_processed: list of integers with number of processed entities in\n        each shard\n    ' #NEWLINE# chart = google_chart_api . BarChart ( shards_processed ) #NEWLINE# shard_count = len ( shards_processed ) #NEWLINE# if shards_processed : #NEWLINE# #INDENT# stride_length = max ( 1 , ( shard_count / 16 ) ) #NEWLINE# chart . bottom . labels = [ ] #NEWLINE# for x in xrange ( shard_count ) : #NEWLINE# #INDENT# if ( ( ( x % stride_length ) == 0 ) or ( x == ( shard_count - 1 ) ) ) : #NEWLINE# #INDENT# chart . bottom . labels . append ( x ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# chart . bottom . labels . append ( '' ) #NEWLINE# #UNINDENT# #UNINDENT# chart . left . labels = [ '0' , str ( max ( shards_processed ) ) ] #NEWLINE# chart . left . min = 0 #NEWLINE# #UNINDENT# self . chart_width = min ( 700 , max ( 300 , ( shard_count * 20 ) ) ) #NEWLINE# self . chart_url = chart . display . Url ( self . chart_width , 200 )