Return the matches of the given state

        |methcoro|

        Args:
            state: see :class:`MatchState`

        Raises:
            APIException
13989
async def get_matches(self, state: MatchState = MatchState.all_):
        
        matches = await self.connection('GET',
                                        'tournaments/{}/matches'.format(self._tournament_id),
                                        state=state.value,
                                        participant_id=self._id)
        # return [await self._tournament.get_match(m['match']['id']) for m in matches] 3.6 only...
        ms = []
        for m in matches:
            ms.append(await self._tournament.get_match(m['match']['id']))
        return ms
118158
def index(self, state, code=None, error=None):
        
        error = None
        if code:
            try:
                auth_token = self.fetch_token(code, state)
            except MissingTokenError:
                error = self._fmt_failure(
                    'Missing access token parameter.</br>Please check that '
                    'you are using the correct client_secret')
            except MismatchingStateError:
                error = self._fmt_failure('CSRF Warning! Mismatching state')
        else:
            error = self._fmt_failure('Unknown error while authenticating')
        # Use a thread to shutdown cherrypy so we can return HTML first
        self._shutdown_cherrypy()
        return error if error else self.success_html % (auth_token)
995869
def matches(self, event):
        '''
        
        '''
        ret = []
        self._matches(event, set(), ret)
        return tuple(r[0] for r in ret)
773248
def get_state(self):
        
        D = {}
        for key in self._state_props:
            D[key] = getattr(self, key)
        return D
1043348
def get_state(self, **kwargs):
        ''''''
        dbdata = self.dbdata
        if 'state' not in dbdata or kwargs:
            dbdata['state'] = ModelState(self, **kwargs)
        return dbdata['state']
376946
def _validate_states(states, topology):
    ''''''
    states = states or []
    if isinstance(states, dict):
        for x in states:
            assert x in topology.node
    else:
        assert len(states) <= len(topology)
    return states
207015
def matchers(self):
        """"""
        # To remove python_matches we now have to override it as it's now a property in the superclass.
        return [
            self.file_matches,
            self.magic_matches,
            self.python_func_kw_matches,
            self.dict_key_matches,
        ]
575067
def get_state(self, key):
        
        _data = self.state_db.get(key)
        if not _data:
            raise KeyError(key)
        else:
            return State().from_json(_data)
446485
def _get_state(self, **kwargs):
        '''
        

        '''

        return self.describe(fields=dict(state=True), **kwargs)["state"]
574647
def match(self, s):
      
      self.matches = self.re.search(s)
      return self.matches
1371820
def state_dict(self) -> Dict[str, Any]:
        
        return {key: value for key, value in self.__dict__.items() if key != 'optimizer'}
169060
def complete(self, text, state):
        
        if text != self.text:
            self.matches = self.completelist(text)
            self.text = text
        try:
            return self.matches[state]
        except IndexError:
            return None
1055925
def available_state(self, state: State) -> Tuple[State, ...]:
        
        result = []
        for gene in self.genes:
            result.extend(self.available_state_for_gene(gene, state))
        if len(result) > 1 and state in result:
            result.remove(state)
        return tuple(result)
1027262
def complete(self, text, state):
        
        if self.use_main_ns:
            self.namespace = __main__.__dict__

        if not text.strip():
            if state == 0:
                if _readline_available:
                    readline.insert_text('\t')
                    readline.redisplay()
                    return ''
                else:
                    return '\t'
            else:
                return None

        if state == 0:
            if "." in text:
                self.matches = self.attr_matches(text)
            else:
                self.matches = self.global_matches(text)
        try:
            return self.matches[state]
        except IndexError:
            return None
881630
def load_state(self, state):
        
        state_data = state[self.name]
        if isinstance(state_data["resp_args"]["name_id_policy"], str):
            state_data["resp_args"]["name_id_policy"] = name_id_policy_from_string(
                state_data["resp_args"]["name_id_policy"])
        return state_data
996788
def all(cls, state=None, include_deactivated=False):
        
        if state and state not in validators.VALID_STATES:
            raise exceptions.ValidationError('Invalid "state"')
        elif state:
            organisations = yield views.organisations.get(key=state,
                                                          include_docs=True)
        elif include_deactivated:
            organisations = yield views.organisations.get(include_docs=True)
        else:
            organisations = yield views.active_organisations.get(include_docs=True)

        raise Return([cls(**org['doc']) for org in organisations['rows']])
764317
def matchesWithMatchers(self, event):
        '''
        
        '''
        ret = []
        self._matches(event, set(), ret)
        return tuple(ret)