Fixed imports based on pyflakes output.
Remove unused import.
Fix duplicate method name.
Assign to the variable in the outer scope.
Various fixes based on pyflakes.
Fix parameters of default process_flag.
Less clumsy implementation of has_edge_id.