<commit_before>#!/usr/bin/python

import transitfeed
import osm
import sys
from tripgraph import *

def load_gtfs(tripgraph, sched):
    stops = sched.GetStopList()
    for stop in stops:
      tripgraph.add_tripstop(str("gtfs" + stop.stop_id), "gtfs", stop.stop_lat, 
                        stop.stop_lon)
      
    trips = sched.GetTripList()
    for trip in trips:
      interpolated_stops = trip.GetTimeInterpolatedStops()
      prevstop = None
      prevsecs = 0
      for (secs, stoptime, is_timepoint) in interpolated_stops:
        stop = stoptime.stop
        if prevstop:
          # stupid side-effect of google's transit feed python script being broken
          if int(secs) < int(prevsecs):
            print "WARNING: Negative edge in gtfs. This probably means you "
            "need to a more recent version of the google transit feed "
            "package (see README)"
                                                                                          secs, prevsecs, prevstop.stop_id, stop.stop_id)
          #print "Adding triphop %s %s %s->%s" % (trip.trip_id, trip.trip_headsign, prevstop.stop_id, stop.stop_id)
          tripgraph.add_triphop(prevsecs, secs, str("gtfs"+prevstop.stop_id),
                                str("gtfs"+stop.stop_id), int(trip.route_id), 
                                str(trip.service_id))        
        prevstop = stop
        prevsecs = secs<commit_msg>Fix broken comment.<commit_after>#!/usr/bin/python

import transitfeed
import osm
import sys
from tripgraph import *

def load_gtfs(tripgraph, sched):
    stops = sched.GetStopList()
    for stop in stops:
      tripgraph.add_tripstop(str("gtfs" + stop.stop_id), "gtfs", stop.stop_lat, 
                        stop.stop_lon)
      
    trips = sched.GetTripList()
    for trip in trips:
      interpolated_stops = trip.GetTimeInterpolatedStops()
      prevstop = None
      prevsecs = 0
      for (secs, stoptime, is_timepoint) in interpolated_stops:
        stop = stoptime.stop
        if prevstop:
          # stupid side-effect of google's transit feed python script being broken
          if int(secs) < int(prevsecs):
            print "WARNING: Negative edge in gtfs. This probably means you "
            "need a more recent version of the google transit feed " 
            "package (see README)"

          #print "Adding triphop %s %s %s->%s" % (trip.trip_id, trip.trip_headsign, prevstop.stop_id, stop.stop_id)
          tripgraph.add_triphop(prevsecs, secs, str("gtfs"+prevstop.stop_id),
                                str("gtfs"+stop.stop_id), int(trip.route_id), 
                                str(trip.service_id))        
        prevstop = stop
        prevsecs = secs
{'fraction_non_alphanumeric': 0.0903059343899742, 'fraction_numerical': 0.0007371913011426465, 'mean_word_length': 2.0055370985603544, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2430854', 'n_tokens_mistral': 839, 'n_tokens_neox': 806, 'n_words': 210}