#NEWLINE# def do_attribute( self , node ) : #NEWLINE# #INDENT# if ( not isinstance ( valid . value , ast . Name ) ) : #NEWLINE# #INDENT# valid = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# key = self . get_attr_key ( node ) #NEWLINE# valid = ( ( key in self . context ) or ( key in self . allowed_values ) ) #NEWLINE# #UNINDENT# if ( not valid ) : #NEWLINE# #INDENT# raise SyntaxError ( ( 'invalid expression: %s' % key ) ) #NEWLINE# #UNINDENT# if ( key in self . context ) : #NEWLINE# #INDENT# result = self . context [ key ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = self . allowed_values [ key ] #NEWLINE# #UNINDENT# return result