MNT: use generators and refactor
MNT: use generators and refactor

- `items` and `dict([...])` create each a new `list` for each node
- `d[k]` slightly faster and Python version-agnostic
- define `omit` once outside loop as set for quick membership test

necozay/tulip-control,necozay/tulip-control,necozay/tulip-control,necozay/tulip-control,tulip-control/tulip-control,tulip-control/tulip-control,tulip-control/tulip-control,tulip-control/tulip-control,necozay/tulip-control