Make code more PEP8 compliant

`if len(a_set) > 0` should be `if a_set`.
Make code more PEP8 compliant

Remove useless parentheses, `if (x):` should be `if x:`.
Make code more PEP8 compliant

Add some spaces around `=` when assigning.