Python: How to pass function with two parameters as an argument