<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def slot_schedule_difference(old_schedule, new_schedule):
 """Compute the difference between two schedules from a slot perspective Parameters old_schedule : list or tuple of :py:class:`resources.ScheduledItem` objects new_schedule : list or tuple of :py:class:`resources.ScheduledItem` objects Returns ------- list A list of :py:class:`resources.ChangedSlotScheduledItem` objects Example ------- ['venue_1', 'venue_2', 'venue_3', 'venue_4'] """

    old = {item.slot: item for item in old_schedule}
    new = {item.slot: item for item in new_schedule}

    common_slots = set(old.keys()).intersection(new.keys())
    added_slots = new.keys() - old.keys()
    removed_slots = old.keys() - new.keys()

    changed = [
        ChangedSlotScheduledItem(
            old[slot].slot, old[slot].event, new[slot].event)
        for slot in common_slots
        if old[slot].event != new[slot].event
    ]
    added = [
        ChangedSlotScheduledItem(new[slot].slot, None, new[slot].event)
        for slot in added_slots
    ]
    removed = [
        ChangedSlotScheduledItem(old[slot].slot, old[slot].event, None)
        for slot in removed_slots
    ]
    return sorted(
        changed + added + removed,
        key=lambda item: (item.slot.venue, item.slot.starts_at)
    )