Check the end flag.
        
        If this return value is `True`, the learning is end.

        Args:
            state_key:    The key of state in `self.t`.

        Returns:
            bool
10323
def check_the_end_flag(self, state_key):
        '''
        
        '''
        # As a rule, the learning can not be stopped.
        x, y = state_key
        end_point_tuple = np.where(self.__map_arr == self.__end_point_label)
        end_point_x_arr, end_point_y_arr = end_point_tuple
        if x == end_point_x_arr[0] and y == end_point_y_arr[0]:
            return True
        else:
            return False
203998
def states_close(state0: State, state1: State,
                 tolerance: float = TOLERANCE) -> bool:
    
    return vectors_close(state0.vec, state1.vec, tolerance)
672560
def get_iss(self, key):
        
        _state = self.get_state(key)
        if not _state:
            raise KeyError(key)
        return _state['iss']
1092321
def check(self):
        """"""
        has_term = False

        if self.START_STATE not in self.states:
            raise SyntaxError('Undefined start rule')

        for state in self.states:
            for rule in self.states[state]:
                if rule is not None:
                    if rule[2] == self.TERM_STATE:
                        has_term = True
                    elif rule[2] not in self.states:
                        raise SyntaxError('Unexpected state: ' + rule[2])

        if not has_term:
            raise SyntaxError('Missed terminate state')
192634
def status(self):
        
        if isinstance(self.attrs['State'], dict):
            return self.attrs['State']['Status']
        return self.attrs['State']
139299
def is_finalized(self):
        """"""

        return self.state == self.STATES.FINALIZED or self.state == self.STATES.INSTALLED
575067
def get_state(self, key):
        
        _data = self.state_db.get(key)
        if not _data:
            raise KeyError(key)
        else:
            return State().from_json(_data)
250798
public boolean isState(Class<? extends State> state)
    {
        if (current != null)
        {
            return current.getClass().equals(state);
        }
        return false;
    }
1024203
def _check_states_enum(cls):
        """"""
        states_enum_name = cls.context.get_config('states_enum_name')
        try:
            cls.context['states_enum'] = getattr(
                cls.context.new_class, states_enum_name)
        except AttributeError:
            raise ValueError('No states enum given!')

        proper = True
        try:
            if not issubclass(cls.context.states_enum, Enum):
                proper = False
        except TypeError:
            proper = False

        if not proper:
            raise ValueError(
                'Please provide enum instance to define available states.')
890379
private boolean containsKey(final int key, final int index) {
        return (key != 0 || states[index] == FULL) && keys[index] == key;
    }
122470
def is_filter_at_key(self, key):
        

        if key in self:
            attribute_status = getattr(self, key)
            if isinstance(attribute_status, self.__class__):
                return True

        return False
208137
def check_key(self, key):
        """"""
        return _check_key(key, allow_unicode_keys=self.allow_unicode_keys,
                          key_prefix=self.key_prefix)
278827
def _check_state(self, state):
        
        if not hasattr(state, '__iter__') or isinstance(state, six.string_types):
            raise ValueError('Start state must be a non-string iterable object.')
        state_vars = {s.var for s in state}
        if not state_vars == set(self.variables):
            raise ValueError('Start state must represent a complete assignment to all variables.'
                             'Expected variables in state: {svar}, Got: {mvar}.'.format(svar=state_vars,
                                                                                        mvar=set(self.variables)))
        for var, val in state:
            if val >= self.cardinalities[var]:
                raise ValueError('Assignment {val} to {var} invalid.'.format(val=val, var=var))
        return True
1068456
def verify_state(self):
        
        if self.state == SESSION_STATE.CONNECTING:
            self.state = SESSION_STATE.OPEN

            self.conn.connectionMade(self.conn_info)
845060
def _check_key(self, key):
        
        self.setup_schema()
        if key not in self._attrs and key not in self:
            raise KeyError(key)
1179702
def end_scan(self):
        
        # TODO check states before/after
        self._set_state(self._STATE_GAP_END)
        self.api.ble_cmd_gap_end_procedure()
        self._wait_for_state(self._STATE_GAP_END)

        logger.debug('scanning completed')
        return self.scan_responses
1180324
def get_key_state(self, status, state_dict):
        
        for key, val in state_dict.items():
            if val == status:
                return key