'Return the OWWidget instance for the scheme node.'

def widget_for_node(self, node):

    state = self.__initstate_for_node[node]
    if isinstance(state, WidgetManager.Delayed):
        state = self.__materialize(state)
        return state.widget
    elif isinstance(state, WidgetManager.PartiallyInitialized):
        widget = state.partially_initialized_widget
        log.warning("WidgetManager.widget_for_node:    Accessing    a    partially    created    widget    instance.    This    is    most    likely    a    result    of    explicit    QApplication.processEvents    call    from    the    '%s.%s'    widgets    __init__.", type(widget).__module__, type(widget).__name__)
        return widget
    elif isinstance(state, WidgetManager.Materialized):
        return state.widget
    else:
        assert False
