Refactor: python: Fix pylint warnings in get_patterns and getitem.
- get_patterns should return a default value if given a key it doesn't understand, just like getitem does.
- Instead of the if/elif/else chain, these can just be ifs followed by an unconditional return. pylint likes this style better for whatever reason.