(self, state)
Restore the variable imputation state from the saved state
Restore the variable imputation state from the saved state
Restore the variable imputation state from the saved state
def _restore_state(self, state):
        # type: (VariableState) -> None
        """
        Restore the variable imputation state from the saved state
        """
        def check(state):
            # check if state is a proper State
            if isinstance(state, tuple) and len(state) == 2:
                m, p = state
                if isinstance(m, int) and isinstance(p, tuple) and \
                        0 <= m < len(Method):
                    return True
            return False

        for i, var in enumerate(self.varmodel):
            m = state.get(var_key(var), None)
            if check(m):
                self.varmodel.setData(self.varmodel.index(i), m, StateRole)
def _restore_state ( self , state ) : # type: (VariableState) -> None def check ( state ) : # check if state is a proper State if isinstance ( state , tuple ) and len ( state ) == 2 : m , p = state if isinstance ( m , int ) and isinstance ( p , tuple ) and 0 <= m < len ( Method ) : return True return False for i , var in enumerate ( self . varmodel ) : m = state . get ( var_key ( var ) , None ) if check ( m ) : self . varmodel . setData ( self . varmodel . index ( i ) , m , StateRole )