template python code from N.N.