Fix undefined variable
pylint fix: do not assign to variable that is not used
Add utility function import, use imported utility function
Idiomatic python: return comparison directly
Idiomatic python: initialize variables with default values
Use r on regular expression; do not use [] as default value
Do not escape quotes (use single-quoted string)
Idiomatic python: search in tuple
Idiomatic python: generate dictionary in one step
Idiomatic python: initialize variables with default
Idiomatic python: short-circuit loop with or-falsey
Idiomatic python: change if-stmt to eliminate early return
Idiomatic python: use multi-part comparison on variable
Idiomatic python: use list comprehensions
Idiomatic python: use dict function that limited to values (keys not needed)
Idiomatic python: Return function result directly (no temporary variable)
Idiomatic python: flatten loops with list comprehension and set
pylint: add methods and variables to suppress pylint warnings/errors