Function `calculate` has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. https://codeclimate.com/github/harens/checkdigit/checkdigit/luhn.py#issue_5fc23e4529cddf0001000020