<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def printNetwork(network):
 """ Given a network, print out regions sorted by phase """

  print "The network has",len(network.regions.values()),"regions"
  for p in range(network.getMaxPhase()):
    print "=== Phase",p
    for region in network.regions.values():
      if network.getPhases(region.name)[0] == p:
        print "   ",region.name