code: def read_vocabulary(vocab_file, threshold):
      """read vocabulary file produced by get_vocab.py, and filter according to frequency threshold."""
  
      vocabulary = set()
  
      for line in vocab_file:
          word, freq = line.split()
          freq = int(freq)
          if threshold == None or freq >= threshold:
              vocabulary.add(word)
  
      return vocabulary
  
imports: from __future__ import unicode_literals, division
  import sys
  import codecs
  import io
  import argparse
  import json
  import re
  from collections import defaultdict
  from io import open
label_desc: Use image node_id 6 for calling a global function with example usage: read_vocabulary(vocab_file, threshold) and returns: vocabulary