code: def parfor(collection, functor, num_processes, manifest_path):
      # --- launches jobs in parallel
      dataset_properties = list()
      with tqdm.tqdm(total=len(collection)) as pbar:
          with multiprocessing.Pool(
              num_processes, maxtasksperchild=1
          ) as pool:
              for counter, properties in enumerate(
                  pool.imap_unordered(functor, collection)
              ):
                  logger.debug(f"Processed {counter}/{len(collection)}")
                  dataset_properties.append(properties)
                  pbar.update(1)
  
      # --- writes cumulative properties to the manifest
      invalid_manifest = any(
          [properties is None for properties in dataset_properties]
      )
      if invalid_manifest:
          logger.error(
              f"Cannot compile manifest from invalid properties"
          )
          logger.debug(f"properties dump: \n {dataset_properties}")
      else:
          logger.info(
              f"Dumping aggregated information to {manifest_path}"
          )
          with open(manifest_path, "w") as fp:
              json.dump(
                  dataset_properties, fp, indent=4, sort_keys=True
              )
  
imports: import argparse
  from pathlib import Path
  import multiprocessing
  import logging
  import sys
  import tqdm
  import json
  from datetime import datetime
  from shapenet_denylist import invalid_model
  from shapenet_denylist import __shapenet_set__
  from convert import stage0
  from convert import stage1
  from convert import stage2
  from convert import stage3
  from convert import stage4
  from convert import stage5
  from convert import stage6
label_desc: Use image node_id 3 for calling a global function with example usage: parfor(collection, functor, num_processes, manifest_path) without return types