code: def get_PennTreeBank(data_dir=None):
      if data_dir is None:
          data_dir = get_dataset_path("ptb_data")
      if not os.path.isfile(os.path.join(data_dir, "ptb.train.txt")):
          download(TRAIN_URL, data_dir)
          download(VALID_URL, data_dir)
          download(TEST_URL, data_dir)
      word_to_id = tfreader._build_vocab(
          os.path.join(data_dir, "ptb.train.txt")
      )
      data3 = [
          np.asarray(
              tfreader._file_to_word_ids(
                  os.path.join(data_dir, fname), word_to_id
              )
          )
          for fname in [
              "ptb.train.txt",
              "ptb.valid.txt",
              "ptb.test.txt",
          ]
      ]
      return data3, word_to_id
  
file_path: tensorpack/examples/PennTreebank/PTB-LSTM.py
imports: import argparse
  import numpy
  import os
  import tensorflow
  from tensorpack import *
  from tensorpack.tfutils import gradproc, optimizer, summary
  from tensorpack.utils import logger
  from tensorpack.utils.argtools import memoized_ignoreargs
  from tensorpack.utils.fs import download, get_dataset_path
  import reader
  from reader import ptb_producer
label_desc: Use image node_id 1 for calling a global function with example usage: get_PennTreeBank(data_dir) and returns: data3,  word_to_id