def run(lexicon, test_name, 
        debug = 0, trace = 0, scanner_class = Plex.Scanner):
  if debug:
    debug_file = sys.stdout
    lexicon.machine.dump(debug_file)
    print "=" * 70
  else:
    debug_file = None
  in_name = test_name + ".in"
  f = open(in_name, "rU")
  s = scanner_class(lexicon, f, in_name)
  if trace:
    s.trace = 1
  while 1:
    value, text = s.read()
    name, line, pos = s.position()
    print "%s %3d %3d %-10s %s" % (name, line, pos, value, repr(text))
    if value is None:
      break
dataset/ETHPy150Open probcomp/bayeslite/external/plex/dist/tests/Test.py/run/original