Python Dynamically Create Function Google