def METHOD_NAME(events: Events, event_key: str, event: AnyEvent) -> None:
    key = event_key
    # Search for an empty slot
    index = 0
    while key in events:
        # Ignore duplicate event
        if event == events[key]:
            return
        key = f"{event_key}_{index}"
        index += 1
    events[key] = event