#NEWLINE# def render_tags( title , tags ) : #NEWLINE# #INDENT# if tags : #NEWLINE# #INDENT# counts = [ tag [ 'count' ] for tag in tags ] #NEWLINE# ( mincount , maxcount ) = ( min ( counts ) , max ( counts ) ) #NEWLINE# for tag in tags : #NEWLINE# #INDENT# if ( maxcount > mincount ) : #NEWLINE# #INDENT# tag [ 'size' ] = ( MIN_TAG_SIZE + ( ( ( MAX_TAG_SIZE - MIN_TAG_SIZE ) * ( tag [ 'count' ] - mincount ) ) / ( maxcount - mincount ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# tag [ 'size' ] = MIN_TAG_SIZE #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return render_template ( 'tags.jinja2' , tags = tags , title = title , max_tag_size = MAX_TAG_SIZE )