def METHOD_NAME(activity: Activity.Activity) -> None:
    with self.__pending_activities_lock:
        if activity in self.__pending_append_activities:
            self.__pending_append_activities.remove(activity)
        else:
            self.__pending_finished_activities.append(activity)