code: def load_data(
      resource_name: Text, language: Optional[Text] = "en"
  ) -> "TrainingData":
      """Load training data from disk.
  
      Merges them if loaded from disk and multiple files are found.
      """
      if not os.path.exists(resource_name):
          raise ValueError(f"File '{resource_name}' does not exist.")
  
      if os.path.isfile(resource_name):
          files = [resource_name]
      else:
          files = rasa.shared.utils.io.list_files(resource_name)
  
      data_sets = [_load(f, language) for f in files]
      training_data_sets: List[TrainingData] = [
          ds for ds in data_sets if ds
      ]
      if len(training_data_sets) == 0:
          training_data = TrainingData()
      elif len(training_data_sets) == 1:
          training_data = training_data_sets[0]
      else:
          training_data = training_data_sets[0].merge(
              *training_data_sets[1:]
          )
  
      return training_data
  
file_path: rasa/rasa/shared/nlu/training_data/loading.py
imports: import json
  import logging
  import os
  import typing
  from typing import Optional, Text, Callable, Dict, Any, List
  import rasa.shared.utils.io
  from rasa.shared.nlu.training_data.formats.dialogflow import DIALOGFLOW_AGENT, DIALOGFLOW_ENTITIES, DIALOGFLOW_ENTITY_ENTRIES, DIALOGFLOW_INTENT, DIALOGFLOW_INTENT_EXAMPLES, DIALOGFLOW_PACKAGE
  from rasa.shared.nlu.training_data.training_data import TrainingData
label_desc: Use image node_id 1 for calling a global function with example usage: load_data(resource_name, language) and returns: training_data