#NEWLINE# def parse_args( arglist , scheme ) : #NEWLINE# #INDENT# '\n    Parse a list of arguments into a dict\n    ' #NEWLINE# arglist = [ i for i in arglist if ( i . type != token . COMMA ) ] #NEWLINE# ret_mapping = dict ( [ ( k , None ) for k in scheme ] ) #NEWLINE# for ( i , arg ) in enumerate ( arglist ) : #NEWLINE# #INDENT# if ( ( arg . type == syms . argument ) and ( arg . children [ 1 ] . type == token . EQUAL ) ) : #NEWLINE# #INDENT# slot = arg . children [ 0 ] . value #NEWLINE# ret_mapping [ slot ] = arg . children [ 2 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# slot = scheme [ i ] #NEWLINE# ret_mapping [ slot ] = arg #NEWLINE# #UNINDENT# #UNINDENT# return ret_mapping