#NEWLINE# def _add_class( attrs , classname ) : #NEWLINE# #INDENT# 'Adds a class to an attribute dict.' #NEWLINE# attrs [ 'class' ] = ' ' . join ( ( [ c for c in [ attrs . pop ( 'class' , '' ) , attrs . pop ( 'class_' , '' ) ] if c ] + [ attrs ] ) )