Bring `None` comparisons in line with PEP 8: "Comparisons to singletons like None should always be done with `is` or `is not`, never the equality operators." Also, satisfy "FutureWarning: comparison to `None` will result in an elementwise object comparison in the future."
As of the date of this commit, there is no way to get an arbitrary element of an iterable like a set without modifying it (for example, as in `set.pop()`). The `peek()` function is more readable than writing next(iter(S)) whenever an arbitrary element of an iterable is required.
This algorithm is based on a node connectivity approximation that only guarantees a lower bound for node connectivity. Even though some tests only fail sporadically in Travis, and we cannot reproduce them, it's better to just remove the problematic tests based on random graphs. Those tests were designed for the exact implementation of the algorithm in `connectivity/kcomponents.py`.