#NEWLINE# def access( self , namespace , state_tag ) : #NEWLINE# #INDENT# 'Returns accessor for given namespace and state tag.' #NEWLINE# state_key = ( '%s/%s' % ( namespace , state_tag . tag ) ) #NEWLINE# if ( state_key not in self . accessed ) : #NEWLINE# #INDENT# if isinstance ( state_tag , trigger . ListStateTag ) : #NEWLINE# #INDENT# self . accessed [ state_key ] = WindmillBagAccessor ( self . reader , state_key ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( state_tag , trigger . ValueStateTag ) : #NEWLINE# #INDENT# self . accessed [ state_key ] = WindmillValueAccessor ( self . reader , state_key ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( state_tag , trigger . CombiningValueStateTag ) : #NEWLINE# #INDENT# self . accessed [ self ] = WindmillCombiningValueAccessor ( self . reader , state_key , state_tag . combine_fn ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( state_tag , trigger . WatermarkHoldStateTag ) : #NEWLINE# #INDENT# self . accessed [ state_key ] = WindmillWatermarkHoldAccessor ( self . reader , state_key , state_tag . output_time_fn_impl ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'Invalid state tag.' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return self . accessed [ state_key ]