#NEWLINE# def _toggle_enabled( module , request , toggle_or_toggle_name ) : #NEWLINE# #INDENT# if isinstance ( toggle_or_toggle_name , basestring ) : #NEWLINE# #INDENT# toggle = getattr ( module , toggle_or_toggle_name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# toggle = toggle_or_toggle_name #NEWLINE# #UNINDENT# return ( ( hasattr ( request , 'user' ) and toggle . enabled ( request . user . username ) ) or ( hasattr ( request , 'domain' ) and toggle . enabled ( request . domain ) ) )