def _firstIdAndInstanceOfClass(container, class_):
    """Return the ID and instance of the first object of class `class_` within `container`. If there is none, return (None, None)."""
    for id in container.objectIds():
        if isinstance(container[id], class_):
            return id, container[id]
    return None, None
