def create_stop_times(self, data, **kwargs):
        count = 0
        for row in data:
            if count % 1000 == 0:
                print 'Checkpoint %d' + count
            count += 1

            try:
                trip_id = int(row['trip_id'])
                stop_id = int(row['stop_id'])
            except ValueError:
                print 'WARNING: Could not parse the ids of scheduled stop %s' % row
                continue

            try:
                route_id = self.trip_mapping[trip_id]['route_id']
                schedule_id = self.trip_mapping[trip_id]['schedule_id']
                direction = self.trip_mapping[trip_id]['direction']
                headsign = self.trip_mapping[trip_id]['headsign']
                block = self.trip_mapping[trip_id]['block']
            except (AttributeError, KeyError):
                print 'WARNING: Trip not mapped for stop %s' % row
                continue

            try:
                seq = int(row['stop_sequence'])
            except ValueError:
                seq = 0

            try:
                dist = float(row['shape_dist_traveled'])
            except ValueError:
                dist = 0.0

            # Arrival
            parts = row['arrival_time'].split(':')
            time = (int(parts[0]) * 3600) + (int(parts[1]) * 60) + int(parts[2])

            try:
                ScheduledStop(route_id=route_id,
                              schedule_id=schedule_id,
                              trip_id=trip_id,
                              stop_id=stop_id,
                              arrival=time,
                              location=self.stop_locations[stop_id],
                              shape_distance=dist,
                              pickup_type=row['pickup_type'],
                              dropoff_type=row['drop_off_type'],
                              direction=direction,
                              headsign=headsign,
                              sequence=seq).save()
            except:
                print 'ScheduledStop exists'
                continue
dataset/ETHPy150Open shaunduncan/breezeminder/breezeminder/management/commands/import_marta_data.py/ImportMartaData.create_stop_times/operator `%` -> `+`