Due to PEP8  either all return statements in a function should return an expression, or none of them should.
# Correct: def bar(x): if x < 0: return None return math.sqrt(x)
# Wrong: def foo(x): if x >= 0: return math.sqrt(x) # implicit returns None here which should be explicit def bar(x): if x < 0: return # implicit returns None here which should be explicit return math.sqrt(x)
What to do
Issues to be solved can be found here:
Fix it by adding consistent return statements.
Please split your patch into smaller parts (no more than 20 methods at once) because it is heave to review a bulk of changed lines.