code: def test_should_get_intents(self):
      # Given
      dataset_stream = io.StringIO(
          """
  ---
  type: intent
  name: greeting1
  utterances:
    - Hello John
  
  ---
  type: intent
  name: greeting2
  utterances:
    - Hello [name](John)
  
  ---
  type: intent
  name: greeting3
  utterances:
    - "[greeting](Hello) [name](John)"
          """
      )
  
      dataset = Dataset.from_yaml_files("en", [dataset_stream]).json
      parser = DeterministicIntentParser().fit(dataset)
  
      # When
      top_intents = parser.get_intents("Hello John")
  
      # Then
      expected_intents = [
          {
              RES_INTENT_NAME: "greeting1",
              RES_PROBA: 1.0 / (1.0 + 1.0 / 2.0 + 1.0 / 3.0),
          },
          {
              RES_INTENT_NAME: "greeting2",
              RES_PROBA: (1.0 / 2.0) / (1.0 + 1.0 / 2.0 + 1.0 / 3.0),
          },
          {
              RES_INTENT_NAME: "greeting3",
              RES_PROBA: (1.0 / 3.0) / (1.0 + 1.0 / 2.0 + 1.0 / 3.0),
          },
          {RES_INTENT_NAME: None, RES_PROBA: 0.0},
      ]
  
      def sorting_key(intent_res):
          if intent_res[RES_INTENT_NAME] is None:
              return "null"
          return intent_res[RES_INTENT_NAME]
  
      sorted_expected_intents = sorted(
          expected_intents, key=sorting_key
      )
      sorted_intents = sorted(top_intents, key=sorting_key)
      self.assertEqual(expected_intents[0], top_intents[0])
      self.assertListEqual(sorted_expected_intents, sorted_intents)
  
imports: from __future__ import unicode_literals
  import io
  from builtins import range
  from copy import deepcopy
  from checksumdir import dirhash
  from mock import patch
  from snips_nlu.common.io_utils import temp_dir
  from snips_nlu.constants import DATA, END, ENTITY, LANGUAGE_EN, RES_ENTITY, RES_INTENT, RES_INTENT_NAME, RES_PROBA, RES_SLOTS, RES_VALUE, SLOT_NAME, START, TEXT, STOP_WORDS
  from snips_nlu.dataset import Dataset
  from snips_nlu.exceptions import IntentNotFoundError, NotTrained
  from snips_nlu.intent_parser.deterministic_intent_parser import DeterministicIntentParser, _deduplicate_overlapping_slots, _get_range_shift
  from snips_nlu.pipeline.configs import DeterministicIntentParserConfig
  from snips_nlu.result import extraction_result, intent_classification_result, unresolved_slot, empty_result, parsing_result
  from snips_nlu.tests.utils import FixtureTest, TEST_PATH
label_desc: Use image node_id 14 for calling the TestDeterministicIntentParser obj's underlying member method code with example usage: obj.test_should_get_intents() and returns: intent_res, str