code: def _process_file(self, filename, doc_count):
      # This method processes a "job file" written out by the parent task. A
      # job file is a series of pickled (code, arguments) tuples. Currently
      # the only command codes is 0=add_document
  
      writer = self.writer
      tempstorage = writer.temp_storage()
  
      load = pickle.load
      with tempstorage.open_file(filename).raw_file() as f:
          for _ in xrange(doc_count):
              # Load the next pickled tuple from the file
              code, args = load(f)
              assert code == 0
              writer.add_document(**args)
      # Remove the job file
      tempstorage.delete_file(filename)
  
imports: from __future__ import with_statement
  from multiprocessing import Process, Queue, cpu_count
  from whoosh.compat import queue, xrange, pickle
  from whoosh.codec import base
  from whoosh.writing import SegmentWriter
  from whoosh.externalsort import imerge
  from whoosh.util import random_name
label_desc: Use image node_id 3 for calling the SubWriterTask obj's underlying member method code with example usage: obj._process_file(filename, doc_count) without return types