Fixed method for learn plugin
Refactored code for fully PEP-8 compliance