<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def Write(self, outpath):
    "Writes a .zip file in Google Transit format."
    out = zipfile.ZipFile(outpath, mode="w", compression=zipfile.ZIP_DEFLATED)
    for filename, func in [('agency.txt', self.WriteAgency),
                           ('calendar.txt', self.WriteCalendar),
                           ('calendar_dates.txt', self.WriteCalendarDates),
                           ('routes.txt', self.WriteRoutes),
                           ('trips.txt', self.WriteTrips),
                           ('stops.txt', self.WriteStations),
                           ('stop_times.txt', self.WriteStopTimes)]:
      s = cStringIO.StringIO()
      func(s)
      out.writestr(filename, s.getvalue())
    out.close()