def calc_intents(self, query):
if self.must_train:<EOL><INDENT>self.train()<EOL><DEDENT>intents = {} if self.train_thread and self.train_thread.is_alive() else {<EOL>i.name: i for i in self.intents.calc_intents(query, self.entities)<EOL>}<EOL>sent = tokenize(query)<EOL>for perfect_match in self.padaos.calc_intents(query):<EOL><INDENT>name = perfect_match['<STR_LIT:name>']<EOL>intents[name] = MatchData(name, sent, matches=perfect_match['<STR_LIT>'], conf=<NUM_LIT:1.0>)<EOL><DEDENT>return list(intents.values())<EOL>
Tests all the intents against the query and returns
data on how well each one matched against the query

Args:
    query (str): Input sentence to test against intents
Returns:
    list<MatchData>: List of intent matches
See calc_intent() for a description of the returned MatchData