code: def load_data():
      """Load training and validation data."""
      if not FLAGS.data_dir:
          print(
              "FLAGS.data_dir containing train.txt and test.txt was not specified, "
              "using a substitute dataset from the tensorflow_datasets module."
          )
          train_dataset = tfds.load(
              name="lm1b/subwords8k",
              split=tfds.Split.TRAIN,
              batch_size=NB_TRAIN,
              shuffle_files=True,
          )
          test_dataset = tfds.load(
              name="lm1b/subwords8k",
              split=tfds.Split.TEST,
              batch_size=10000,
          )
          train_data = next(iter(tfds.as_numpy(train_dataset)))
          test_data = next(iter(tfds.as_numpy(test_dataset)))
          train_data = train_data["text"].flatten()
          test_data = test_data["text"].flatten()
      else:
          train_fpath = os.path.join(FLAGS.data_dir, "train.txt")
          test_fpath = os.path.join(FLAGS.data_dir, "test.txt")
          train_txt = open(train_fpath).read().split()
          test_txt = open(test_fpath).read().split()
          keys = sorted(set(train_txt))
          remap = {k: i for i, k in enumerate(keys)}
          train_data = np.array(
              [remap[x] for x in train_txt], dtype=np.uint8
          )
          test_data = np.array(
              [remap[x] for x in test_txt], dtype=np.uint8
          )
  
      return train_data, test_data
  
file_path: privacy/tutorials/lm_dpsgd_tutorial.py
imports: import os
  from absl import app
  from absl import flags
  from absl import logging
  import dp_accounting
  import numpy
  import tensorflow
  from tensorflow import estimator
  from tensorflow.compat.v1 import estimator
  import tensorflow_datasets
  from tensorflow_privacy.privacy.optimizers import dp_optimizer
label_desc: Use image node_id 2 for calling a global function with example usage: load_data() and returns: train_data,  test_data