code: def shapenet_objects_dirs(datadir: str):
      """Returns a list of pathlib.Path folders, one per object."""
      taxonomy_path = Path(datadir) / "taxonomy.json"
      if not taxonomy_path.is_file():
          raise RuntimeError(
              f'Verify that "{str(datadir)}" is a valid shapenet '
              f"folder, as the taxonomy file was not found at "
              f'"{str(taxonomy_path)}"'
          )
  
      logger.info(f"gathering shapenet folders: {datadir}")
      object_folders = list()
      categories = [x for x in Path(datadir).iterdir() if x.is_dir()]
      for category in categories:
          object_folders += [
              x for x in category.iterdir() if x.is_dir()
          ]
      logging.debug(f"gathered object folders: {object_folders}")
  
      # --- remove invalid folders
      logger.debug(f"dropping problematic folders: {__shapenet_set__}")
      object_folders = [
          folder
          for folder in object_folders
          if not invalid_model(folder)
      ]
  
      # TODO: add objects w/o materials to the denylist?
      # if not os.path.exists(obj_path.replace('.obj', '.mtl')):
  
      return object_folders
  
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 2 for calling a global function with example usage: shapenet_objects_dirs(datadir) and returns: object_folders