code: def _CreateRouteTripsFolder(self, parent, route, style_id=None, schedule=None):
      
      if not route.trips:
        return None
      trips = list(route.trips)
      trips.sort(key=lambda x: x.trip_id)
      trips_folder = self._CreateFolder(parent, 'Trips', visible=False)
      for trip in trips:
        if (self.date_filter and
            not trip.service_period.IsActiveOn(self.date_filter)):
          continue
  
        if trip.trip_headsign:
          description = 'Headsign: %s' % trip.trip_headsign
        else:
          description = None
  
        coordinate_list = []
        for secs, stoptime, tp in trip.GetTimeInterpolatedStops():
          if self.altitude_per_sec > 0:
            coordinate_list.append((stoptime.stop.stop_lon, stoptime.stop.stop_lat,
                                    (secs - 3600 * 4) * self.altitude_per_sec))
          else:
            coordinate_list.append((stoptime.stop.stop_lon,
                                    stoptime.stop.stop_lat))
        placemark = self._CreatePlacemark(trips_folder,
                                          trip.trip_id,
                                          style_id=style_id,
                                          visible=False,
                                          description=description)
        self._CreateLineString(placemark, coordinate_list)
      return trips_folder
docs: Create a KML Folder containing all the trips in the route.
  
      The folder contains a placemark for each of these trips. If there are no
      trips in the route, no folder is created and None is returned.
  
      Args:
        parent: The parent ElementTree.Element instance.
        route: The transitfeed.Route instance.
        style_id: A style id string for the placemarks or None.
  
      Returns:
        The Folder ElementTree.Element instance or None.