<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compute_feed_time_series( feed: "Feed", trip_stats: DataFrame, dates: List[str], freq: str = "5Min" ) -> DataFrame: """ Compute some feed stats in time series form for the given dates and trip stats. Parameters feed : Feed trip_stats : DataFrame Trip stats to consider in the format output by :func:`.trips.compute_trip_stats` dates : string or list A YYYYMMDD date string or list thereof indicating the date(s) for which to compute stats freq : string Pandas frequency string specifying the frequency of the resulting time series, e.g. '5Min'; highest frequency allowable is one minute ('Min'). Returns ------- DataFrame A time series with a timestamp index across the given dates sampled at the given frequency. The maximum allowable frequency is 1 minute. The columns are - ``'num_trips'``: number of trips in service during during the time period - ``'num_trip_starts'``: number of trips with starting during the time period - ``'num_trip_ends'``: number of trips ending during the time period, ignoring the trips the end past midnight - ``'service_distance'``: distance traveled during the time period by all trips active during the time period - ``'service_duration'``: duration traveled during the time period by all trips active during the time period - ``'service_speed'``: ``service_distance/service_duration`` Exclude dates that lie outside of the Feed's date range. If all the dates given lie outside of the Feed's date range, then return an empty DataFrame with the specified columns. Notes ----- - See the notes for :func:`.routes.compute_route_time_series_base` - If all dates lie outside the Feed's date range, then return an empty DataFrame - Assume the following feed attributes are not ``None``: * Those used in :func:`.routes.compute_route_time_series` """

    rts = feed.compute_route_time_series(trip_stats, dates, freq=freq)
    if rts.empty:
        return pd.DataFrame()

    cols = [
        "num_trip_starts",
        "num_trip_ends",
        "num_trips",
        "service_distance",
        "service_duration",
        "service_speed",
    ]
    f = pd.concat(
        [rts[col].sum(axis=1, min_count=1) for col in cols], axis=1, keys=cols
    )
    f["service_speed"] = f["service_distance"] / f["service_duration"]

    return f.sort_index(axis=1)