code: def read(filename, w2i):
      stop_symbol = w2i["</s>"]
      with open(filename, "r") as fh:
          for line in fh:
              sent = [w2i[x] for x in line.strip().split()]
              sent.append(stop_symbol)
              yield sent
  
file_path: dynet/examples/rnnlm/lstmlm-auto.py
imports: from __future__ import print_function
  from collections import defaultdict
  import math
  import random
  import time
  import dynet
label_desc: Use image node_id 2 for calling a global function with example usage: read(filename, w2i) without return types