```python
colors = dict((node.node_id, node.color) for node in graph.values())
```

Ideally, we want to use dict comprehension. But Python 2.6 does not support it.