Working on PythonEvents and QueryFunctions APIs