class_docstr: Holds loaded intent and entity training data.
class_docstr_tok: ["Holds","loaded","intent","and","entity","training","data","."]
docstr: Loads the actual lookup table from file if there is a file specified.
  
  Checks if the specified lookup table contains a filename in
  `elements` and replaces it with actual elements from the file.
  Returns the unchanged lookup table otherwise.
  It works with JSON training data.
  
  Params:
      lookup_table: A lookup table.
  
  Returns:
      Updated lookup table where filenames are replaced with the contents of
      these files.
docstr_tok: ["Loads","the","actual","lookup","table","from","file","if","there","is","a","file","specified",".","Checks","if","the","specified","lookup","table","contains","a","filename","in","`","elements","`","and","replaces","it","with","actual","elements","from","the","file",".","Returns","the","unchanged","lookup","table","otherwise",".","It","works","with","JSON","training","data",".","Params",":","lookup_table",":","A","lookup","table",".","Returns",":","Updated","lookup","table","where","filenames","are","replaced","with","the","contents","of","these","files","."]
code: def _load_lookup_table(
      lookup_table: Dict[Text, Any]
  ) -> Dict[Text, Any]:
      """Loads the actual lookup table from file if there is a file specified.
  
      Checks if the specified lookup table contains a filename in
      `elements` and replaces it with actual elements from the file.
      Returns the unchanged lookup table otherwise.
      It works with JSON training data.
  
      Params:
          lookup_table: A lookup table.
  
      Returns:
          Updated lookup table where filenames are replaced with the contents of
          these files.
      """
      elements = lookup_table["elements"]
      potential_file = (
          elements if isinstance(elements, str) else elements[0]
      )
  
      if Path(potential_file).is_file():
          try:
              lookup_table["elements"] = rasa.shared.utils.io.read_file(
                  potential_file
              )
              return lookup_table
          except (FileNotFoundError, UnicodeDecodeError):
              return lookup_table
  
      return lookup_table
  
imports: import logging
  import os
  from pathlib import Path
  import random
  from collections import Counter, OrderedDict
  import copy
  from os.path import relpath
  from typing import Any, Dict, List, Optional, Set, Text, Tuple, Callable
  import operator
  import rasa.shared.data
  from rasa.shared.utils.common import lazy_property
  import rasa.shared.utils.io
  from rasa.shared.nlu.constants import RESPONSE, INTENT_RESPONSE_KEY, ENTITY_ATTRIBUTE_TYPE, ENTITY_ATTRIBUTE_GROUP, ENTITY_ATTRIBUTE_ROLE, NO_ENTITY_TAG, INTENT, ENTITIES, TEXT, ACTION_NAME
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.training_data import util
label_desc: Use image node_id 2 for calling the TrainingData obj's underlying member method code with example usage: obj._load_lookup_table(lookup_table) and returns: lookup_table, lookup_table, lookup_table