<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _TravelTimes(self,triplist,index=0):
 """ Calculate distances and plot stops. Uses a timetable to approximate distances between stations Args: # Class Trip is defined in transitfeed.py # (Optional) Index of Triplist prefered for timetable Calculation index: 3 Returns: # One integer for each pair of stations # indicating the approximate distance """


    def DistanceInTravelTime(dep_secs, arr_secs):
      t_dist = arr_secs-dep_secs
      if t_dist<0:
        t_dist = self._DUMMY_SEPARATOR # min separation
      return t_dist

    if not triplist:
      return []

    if 0 < index < len(triplist):
      trip = triplist[index]
    else:
      trip = triplist[0]

    t_dists2 = [DistanceInTravelTime(stop[3],tail[2]) for (stop,tail)
                 in itertools.izip(trip.GetTimeStops(),trip.GetTimeStops()[1:])]
    return t_dists2