code: def test_should_load_from_yaml_file_using_slot_mapping(self):
      # Given
      intent = Intent.from_yaml(
          io.StringIO(
              """
  # getWeather Intent
  ---
  type: intent
  name: getWeather
  slots:
    - name: date
      entity: snips/datetime
    - name: weatherLocation
      entity: location
  utterances:
    - what is the weather in [weatherLocation](paris) ?
    - Will it rain [date] in [weatherLocation](london)?
          """
          )
      )
  
      # When
      intent_dict = intent.json
  
      # Then
      expected_intent_dict = {
          "utterances": [
              {
                  "data": [
                      {"text": "what is the weather in "},
                      {
                          "text": "paris",
                          "entity": "location",
                          "slot_name": "weatherLocation",
                      },
                      {"text": " ?"},
                  ]
              },
              {
                  "data": [
                      {"text": "Will it rain "},
                      {
                          "text": None,
                          "entity": "snips/datetime",
                          "slot_name": "date",
                      },
                      {"text": " in "},
                      {
                          "text": "london",
                          "entity": "location",
                          "slot_name": "weatherLocation",
                      },
                      {"text": "?"},
                  ]
              },
          ]
      }
      self.assertDictEqual(expected_intent_dict, intent_dict)
  
file_path: snips-nlu/snips_nlu/tests/test_intent_loading.py
imports: from __future__ import unicode_literals
  import io
  from unittest import TestCase
  from snips_nlu.dataset import Intent
  from snips_nlu.exceptions import IntentFormatError
label_desc: Use image node_id 2 for calling the TestIntentLoading obj's underlying member method code with example usage: obj.test_should_load_from_yaml_file_using_slot_mapping() without return types