code: def __init__(
      self, ix, procs=None, batchsize=100, subargs=None, **kwargs
  ):
      SegmentWriter.__init__(self, ix, **kwargs)
  
      self.procs = procs or cpu_count()
      self.batchsize = batchsize
      self.subargs = subargs if subargs else kwargs
      self.tasks = [
          SegmentWriter(ix, _lk=False, **self.subargs)
          for _ in xrange(self.procs)
      ]
      self.pointer = 0
      self._added_sub = False
  
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 1 to create a new SerialMpWriter object from inherited base classes: MpWriter with example: obj = SerialMpWriter(ix, procs, batchsize, subargs)