#NEWLINE# def parse_event_arg( events ) : #NEWLINE# #INDENT# if isinstance ( events , int ) : #NEWLINE# #INDENT# events = ( events , ) #NEWLINE# #UNINDENT# events = event ( reduce ( operator . or_ , events ) ) #NEWLINE# selector = [ _pop , None , '' , None , '' , None ] #NEWLINE# for ( i , ev ) in ( ( 1 , _exit ) , ( 3 , _within ) , ( 5 , _enter ) ) : #NEWLINE# #INDENT# if ( ev & events ) : #NEWLINE# #INDENT# selector [ i ] = ev #NEWLINE# #UNINDENT# #UNINDENT# selector = list ( ( item for item in selector if ( item is not None ) ) ) #NEWLINE# mask = event ( selector ) #NEWLINE# return ( mask , selector )