          if self._args.batch_mode:
              logger.info("Batch mode selected processing: %s", self._input_locations)
          for job_no, location in enumerate(self._input_locations):
              if self._args.batch_mode:
                  logger.info("Processing job %s of %s: '%s'", job_no + 1, len(inputs), location)
                  arguments = Namespace(**self._args.__dict__)
                  arguments.input_dir = location
                  arguments.output_dir = self._output_for_input(location)
              else:
                  arguments = self._args
 
</s> remove         inputs = self._input_locations
 </s> add  </s> remove             extract.process()
 </s> add             if len(self._input_locations) > 1:
                # TODO - Running this in a process is hideously hacky. However, there is a memory
                # leak in some instances when running in batch mode. Many days have been spent
                # trying to track this down to no avail (most likely coming from C-code.) Running
                # the extract job inside a process prevents the memory leak in testing. This should
                # be replaced if/when the memory leak is found
                proc = Process(target=extract.process)
                proc.start()
                proc.join()
            else:
                extract.process() </s> remove         logger.debug("Setting thread")
 </s> add         logger.trace("Setting thread")  # type:ignore[attr-defined]
                logger.info("Processing job %s of %s: '%s'",
                            job_no + 1, len(self._input_locations), location)
          if self._args.batch_mode:
              logger.info("Batch mode selected processing: %s", self._input_locations)
          for job_no, location in enumerate(self._input_locations):
              if self._args.batch_mode:
                logger.info("Processing job %s of %s: '%s'",
                            job_no + 1, len(self._input_locations), location)
                  arguments = Namespace(**self._args.__dict__)
                  arguments.input_dir = location
                  arguments.output_dir = self._output_for_input(location)
              else:
                  arguments = self._args
keep keep keep keep replace keep keep keep keep keep
 Bugfix: Patch extract memory leak in batch mode 
scripts/extract.py