code: def test_should_parse(self):
      dataset_stream = io.StringIO(
          """
  ---
  type: intent
  name: intent1
  utterances:
    - "[slot1:entity1](foo) bar"
  
  ---
  type: intent
  name: intent2
  utterances:
    - foo bar [slot2:entity2](baz)
  
  ---
  type: intent
  name: intent3
  utterances:
    - foz for [slot3:entity3](baz)"""
      )
      dataset = Dataset.from_yaml_files("en", [dataset_stream]).json
      shared = self.get_shared_data(dataset)
      shared[RANDOM_STATE] = 42
      parser = ProbabilisticIntentParser(**shared)
      parser.fit(dataset)
      text = "foo bar baz"
  
      # When
      result = parser.parse(text)
  
      # Then
      expected_slots = [
          unresolved_slot((8, 11), "baz", "entity2", "slot2")
      ]
  
      self.assertEqual("intent2", result[RES_INTENT][RES_INTENT_NAME])
      self.assertEqual(expected_slots, result[RES_SLOTS])
  
imports: from __future__ import unicode_literals
  import io
  from future.utils import itervalues
  from mock import patch
  from snips_nlu.constants import RES_ENTITY, RES_INTENT, RES_INTENT_NAME, RES_SLOTS, RES_VALUE, RANDOM_STATE
  from snips_nlu.dataset import Dataset
  from snips_nlu.exceptions import IntentNotFoundError, NotTrained
  from snips_nlu.intent_classifier import IntentClassifier, LogRegIntentClassifier
  from snips_nlu.intent_parser import ProbabilisticIntentParser
  from snips_nlu.pipeline.configs import CRFSlotFillerConfig, LogRegIntentClassifierConfig, ProbabilisticIntentParserConfig
  from snips_nlu.result import unresolved_slot, intent_classification_result
  from snips_nlu.slot_filler import SlotFiller
  from snips_nlu.tests.utils import FixtureTest, MockIntentClassifier, MockSlotFiller
label_desc: Use image node_id 1 for calling the TestProbabilisticIntentParser obj's underlying member method code with example usage: obj.test_should_parse() without return types