code: def init_pool(self):
          
  
          # initialize the pool if needed
          if self.pool is None:
              if self.nproc > 1:
                  self.pool = mp.Pool(processes=self.nproc)
              else:
                  self.pool = None
          else:
              print('pool already initialized?')
docs: Initialize multiprocessing pool if necessary.