code: def _match_dialog(self, query, dialogues=None):
          
          if dialogues is None:
              dialogues = self._dialogues
  
          # Try to match in the queries
          if query in dialogues:
              response = dialogues[query]
              logger.debug('Found response in queries: %s' % repr(response))
  
              return response
docs: Tries to match in dialogues
  
          :param query: message tuple
          :type query: Tuple[bytes]
          :return: response if found or None
          :rtype: Tuple[bytes] | None