def _get_entities(event_idx, timex_idx):
    """Return an index of all entities indexed on the event or timex id."""
    entity_idx = {}
    for elist in event_idx['open'].values() + timex_idx['open'].values():
        entity = elist[0]
        identifier = 'tid' if  entity.name == 'TIMEX3' else 'eiid'
        entity_idx[entity.attrs[identifier]] = entity
    return entity_idx