code: def _retrieve_word_vocabulary():
      def creator(path):
          words = _load_words(_train_url)
          vocab = {}
          index = 0
          with open(path, "w") as f:
              for word in words:
                  if word not in vocab:
                      vocab[word] = index
                      index += 1
                      f.write(word + "\n")
  
          return vocab
  
      def loader(path):
          vocab = {}
          with open(path) as f:
              for i, word in enumerate(f):
                  vocab[word.strip()] = i
          return vocab
  
      root = download.get_dataset_directory("pfnet/chainer/ptb")
      path = os.path.join(root, "vocab.txt")
      return download.cache_or_load_file(path, creator, loader)
  
file_path: chainer/chainer/datasets/ptb.py
imports: import os
  import numpy
  from chainer.dataset import download
label_desc: Use image node_id 4 for calling a global function with example usage: _retrieve_word_vocabulary() and returns: download, vocab, vocab