Python Using Function From A Graph