code: def test_get_entity_scopes(self):
      # Given
      dataset_stream = io.StringIO(
          """
  ---
  type: intent
  name: intent1
  utterances:
    - meeting [schedule_time:snips/datetime](today)
  
  ---
  type: intent
  name: intent2
  utterances:
    - hello world
  
  ---
  type: intent
  name: intent3
  utterances:
    - what will be the weather [weather_time:snips/datetime](tomorrow)
    
  ---
  type: intent
  name: intent4
  utterances:
    - find a flight for [city](Paris) [flight_time:snips/datetime](tomorrow)"""
      )
      dataset = Dataset.from_yaml_files("en", [dataset_stream]).json
  
      # When
      entity_scopes = _get_entity_scopes(dataset)
  
      # Then
      expected_scopes = [
          {
              "entity_scope": {
                  "builtin": ["snips/datetime"],
                  "custom": [],
              },
              "intent_group": ["intent1", "intent3"],
          },
          {
              "entity_scope": {"builtin": [], "custom": []},
              "intent_group": ["intent2"],
          },
          {
              "entity_scope": {
                  "builtin": ["snips/datetime"],
                  "custom": ["city"],
              },
              "intent_group": ["intent4"],
          },
      ]
  
      def sort_key(group_scope):
          return " ".join(group_scope["intent_group"])
  
      self.assertListEqual(
          sorted(expected_scopes, key=sort_key),
          sorted(entity_scopes, key=sort_key),
      )
  
imports: from __future__ import unicode_literals
  import io
  from copy import deepcopy
  from mock import patch
  from snips_nlu_utils import hash_str
  from snips_nlu.constants import DATA, ENTITY, RES_ENTITY, RES_INTENT, RES_INTENT_NAME, RES_PROBA, RES_SLOTS, RES_VALUE, SLOT_NAME, TEXT, STOP_WORDS
  from snips_nlu.dataset import Dataset
  from snips_nlu.entity_parser import BuiltinEntityParser
  from snips_nlu.exceptions import IntentNotFoundError, NotTrained
  from snips_nlu.intent_parser import LookupIntentParser
  from snips_nlu.intent_parser.lookup_intent_parser import _get_entity_scopes
  from snips_nlu.pipeline.configs import LookupIntentParserConfig
  from snips_nlu.result import empty_result, extraction_result, intent_classification_result, unresolved_slot, parsing_result
  from snips_nlu.tests.utils import FixtureTest, TEST_PATH, EntityParserMock
label_desc: Use image node_id 28 for calling the TestLookupIntentParser obj's underlying member method code with example usage: obj.test_get_entity_scopes() and returns: str