def check_event_exists(handles, name):
    """Validate that an event exists in the metadata.

    Args:
        handles (TraceHandle): an array of babeltrace TraceHandle instance.

        name (String): the event name in which the field must exist.

    Returns:
        True if the event is found in the metadata, False otherwise.
    """
    for handle in handles.values():
        for event in handle.events:
            if event.name == name:
                return True
    return False