code: def load_class(dotted_path):
      """Loads and returns a class definition provided a dotted path
      specification the last part of the dotted path is the class name
      and there is at least one module name preceding the class name.
  
      Notes:
      You will need to ensure that the module you are trying to load
      exists in the Python path.
  
      Examples:
      - module.name.ClassName    # Provided module.name is in the Python path.
      - module.ClassName         # Provided module is in the Python path.
  
      What won't work:
      - ClassName
      - modle.name.ClassName     # Typo in module name.
      - module.name.ClasNam      # Typo in classname.
      """
      dotted_path_split = dotted_path.split(".")
      if len(dotted_path_split) > 1:
          klass_name = dotted_path_split[-1]
          module_name = ".".join(dotted_path_split[:-1])
  
          module = load_module(module_name)
          if has_attribute(module, klass_name):
              klass = getattr(module, klass_name)
              return klass
              # Finally create and return an instance of the class
              # return klass(*args, **kwargs)
          else:
              raise AttributeError(
                  "Module %s does not have class attribute %s"
                  % (module_name, klass_name)
              )
      else:
          raise ValueError(
              "Dotted module path %s must contain a module name and a classname"
              % dotted_path
          )
  
file_path: wandb/wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/__init__.py
imports: import os
  import sys
  import threading
  from wandb_watchdog.utils import platform
  from wandb_watchdog.utils.compat import Event
label_desc: Use image node_id 3 for calling a global function with example usage: load_class(dotted_path) and returns: klass