code: def test_should_parse_top_intents(self):
      # Given
      dataset_stream = io.StringIO(
          """
  ---
  type: intent
  name: intent1
  utterances:
    - meeting [time:snips/datetime](today)
  
  ---
  type: intent
  name: intent2
  utterances:
    - meeting tomorrow
    
  ---
  type: intent
  name: intent3
  utterances:
    - "[event_type](call) [time:snips/datetime](at 9pm)"
  
  ---
  type: entity
  name: event_type
  values:
    - meeting
    - feedback session"""
      )
      dataset = Dataset.from_yaml_files("en", [dataset_stream]).json
      parser = DeterministicIntentParser().fit(dataset)
      text = "meeting tomorrow"
  
      # When
      results = parser.parse(text, top_n=3)
  
      # Then
      time_slot = {
          "entity": "snips/datetime",
          "range": {"end": 16, "start": 8},
          "slotName": "time",
          "value": "tomorrow",
      }
      event_slot = {
          "entity": "event_type",
          "range": {"end": 7, "start": 0},
          "slotName": "event_type",
          "value": "meeting",
      }
      weight_intent_1 = 1.0 / 2.0
      weight_intent_2 = 1.0
      weight_intent_3 = 1.0 / 3.0
      total_weight = weight_intent_1 + weight_intent_2 + weight_intent_3
      proba_intent2 = weight_intent_2 / total_weight
      proba_intent1 = weight_intent_1 / total_weight
      proba_intent3 = weight_intent_3 / total_weight
      expected_results = [
          extraction_result(
              intent_classification_result(
                  intent_name="intent2", probability=proba_intent2
              ),
              slots=[],
          ),
          extraction_result(
              intent_classification_result(
                  intent_name="intent1", probability=proba_intent1
              ),
              slots=[time_slot],
          ),
          extraction_result(
              intent_classification_result(
                  intent_name="intent3", probability=proba_intent3
              ),
              slots=[event_slot, time_slot],
          ),
      ]
      self.assertEqual(expected_results, results)
  
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 4 for calling the TestDeterministicIntentParser obj's underlying member method code with example usage: obj.test_should_parse_top_intents() without return types