#NEWLINE# def linq( name , z = True , swap = False ) : #NEWLINE# #INDENT# def x( l , f , * args ) : #NEWLINE# #INDENT# ( pseudo_type , args ) = ( args [ ( - 1 ) ] , list ( args [ : ( - 1 ) ] ) ) #NEWLINE# if ( args and swap ) : #NEWLINE# #INDENT# ( f , args [ 0 ] ) = ( args [ 0 ] , f ) #NEWLINE# #UNINDENT# cs = method_call ( l , name , ( [ f ] + args ) , pseudo_type ) #NEWLINE# if z : #NEWLINE# #INDENT# cs . pseudo_type = 'CSharpEnumerable' #NEWLINE# return method_call ( cs , 'ToList' , [ ] , pseudo_type ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return cs #NEWLINE# #UNINDENT# #UNINDENT# return x