def drop_zombies(feed):
    """
    In the given Feed, drop stops with no stop times,
    trips with no stop times, shapes with no trips,
    routes with no trips, and services with no trips, in that order.
    Return the resulting Feed.
    """
    feed = feed.copy()

    # Drop stops of location type 0 that lack stop times
    ids = feed.stop_times['stop_id'].unique()
    f = feed.stops
    cond = f['stop_id'].isin(ids)
    if 'location_type' in f.columns:
        cond |= f['location_type'] != 0
    feed.stops = f[cond].copy()

    # Drop trips with no stop times
    ids = feed.stop_times['trip_id'].unique()
    f = feed.trips
    feed.trips = f[f['trip_id'].isin(ids)]

    # Drop shapes with no trips
    ids = feed.trips['shape_id'].unique()
    f = feed.shapes
    if f is not None:
        feed.shapes = f[f['shape_id'].isin(ids)]

    # Drop routes with no trips
    ids = feed.trips['route_id'].unique()
    f = feed.routes
    feed.routes = f[f['route_id'].isin(ids)]

    # Drop services with no trips
    ids = feed.trips['service_id'].unique()
    if feed.calendar is not None:
        f = feed.calendar
        feed.calendar = f[f['service_id'].isin(ids)]
    if feed.calendar_dates is not None:
        f = feed.calendar_dates
        feed.calendar_dates = f[f['service_id'].isin(ids)]

    return feed