def METHOD_NAME(
    occupancies: Dict[str, Tuple[Entity, Entity]], occupancy: Entity, position: Entity
) -> None:
    """Maintains a dict of (occupancy, position) tuples,
    keeping only the preferred occupancy for each position"""
    if position.id is None:
        raise Exception("Position id is unexpectedly None")
    seen = occupancies.get(position.id, None)
    if seen is None:
        occupancies[position.id] = (occupancy, position)
    else:
        seen_status = seen[0].get("status")[0]
        other_status = occupancy.get("status")[0]
        if PREFERENCE[other_status] > PREFERENCE[seen_status]:
            occupancies[position.id] = (occupancy, position)