code: def task_class_load(
      pkg_path,
      task_list,
      base_class,
      filter_str="",
      other_base_class=None,
  ):
      modules = module_loader(pkg_path, filter_str)
      task_class_map = {}
      for module in modules:
          task = module.__name__.split(".")[-1].split("_")[0]
          task_class = None
          assert task.upper() in task_list
  
          for attr in dir(module):
              reference = getattr(module, attr)
              name = type(reference).__name__
              if type(reference).__name__ not in [
                  "classobj",
                  "ABCMeta",
              ]:
                  continue
              if (
                  (
                      issubclass(reference, base_class)
                      or issubclass(reference, other_base_class)
                  )
                  and reference != base_class
                  and reference != other_base_class
              ):
                  task_class = reference
                  break
  
          if task_class is None:
              raise ImportError(
                  "Not find task config in {0}, "
                  "plz insure your implementation class extend base Class.".format(
                      module.name
                  )
              )
          task_class_map[task.upper()] = task_class
  
      return task_class_map
  
imports: import json
  import os
  import pkgutil
  import importlib
  import tarfile
  from tempfile import NamedTemporaryFile
  import time
  import pandas
  import torch
  import glob
  from .None import device
  from .install import download_if_needed
label_desc: Use image node_id 2 for calling a global function with example usage: task_class_load(pkg_path, task_list, base_class, filter_str, other_base_class) and returns: task_class_map