I'm messing with python and pycuda, studying codes and etc and I came across the following question: What's happening exactly on the second line? service will receive some attributes, in the first line, and until then everything okay. However in the second line service is a function ?? What role does the service play there?
service = getattr(entity, event["name"])
service(event["data"], event["tx"], event["txId"])
In pycuda I noticed something similar:
func = mod.get_function("doublify")
func(a_gpu, block=(4,4,1))
In the above code I had the impression that "func" will take on the role of "doublify" (a CUDA code snippet) and after receiving some arguments. In the first example of "service", this became obscure to me.