def METHOD_NAME(
    api_client, keyword, keyword2, event, past_event
):
    event.keywords.add(keyword)
    event.save()
    past_event.keywords.add(keyword)
    past_event.keywords.add(keyword2)
    past_event.save()
    keyword.n_events = 1
    keyword2.n_events = 1
    keyword.save()
    keyword2.save()
    response = get_list(api_client, data={"has_upcoming_events": True})
    assert response.data["meta"]["count"] == 0
    Keyword.objects.has_upcoming_events_update()
    response = get_list(api_client, data={"has_upcoming_events": True})
    ids = [entry["id"] for entry in response.data["data"]]
    assert keyword.id in ids
    assert keyword2.id not in ids
    response = get_list(api_client, data={"has_upcoming_events": False})
    ids = [entry["id"] for entry in response.data["data"]]
    assert keyword.id in ids
    assert keyword2.id in ids