added the python script and increase the robustness of the KL methods
update the python script
Merge pull request #2386 from yorkerlin/develop

added the python script for KL methods