code: def proc_dataset(
      path, outpath, vocab_path=None, vocab_size=None, use_lower=False
  ):
      token_count = 0
      counts = collections.Counter()
      with io.open(outpath, "w", encoding="utf-8") as f:
          for words in read_file(path, use_lower):
              line = " ".join(words)
              f.write(line)
              f.write("\n")
              if vocab_path:
                  for word in words:
                      counts[word] += 1
              token_count += len(words)
      print("number of tokens: %d" % token_count)
  
      if vocab_path and vocab_size:
          vocab = [word for (word, _) in counts.most_common(vocab_size)]
          with io.open(vocab_path, "w", encoding="utf-8") as f:
              for word in vocab:
                  f.write(word)
                  f.write("\n")
  
file_path: chainer/examples/seq2seq/wmt_preprocess.py
imports: from __future__ import unicode_literals
  import argparse
  import collections
  import io
  import re
  import progressbar
label_desc: Use image node_id 4 for calling a global function with example usage: proc_dataset(path, outpath, vocab_path, vocab_size, use_lower) without return types