code: def build_stop_timetable(
      feed: "Feed", stop_id: str, dates: List[str]
  ) -> DataFrame:
      dates = feed.restrict_dates(dates)
      if not dates:
          return pd.DataFrame()
      t = pd.merge(feed.trips, feed.stop_times)
      t = t[t["stop_id"] == stop_id].copy()
      a = feed.compute_trip_activity(dates)
      frames = []
      for date in dates:
          ids = a.loc[a[date] == 1, "trip_id"]
          f = t[t["trip_id"].isin(ids)].copy()
          f["date"] = date
          frames.append(f)
      f = pd.concat(frames)
      return f.sort_values(["date", "departure_time"])