From http://tech.pro/tutorial/1554/four-tricks-for-comprehensions-in-python#nested_loops