Kernel Function Python Example