Transform python kernels to pykernel