code: def load_model_from_checkpoint(
      root_weights_dir, module_class=BoringModel
  ):
      trained_model = module_class.load_from_checkpoint(
          root_weights_dir
      )
      assert trained_model is not None, "loading model failed"
      return trained_model
  
file_path: pytorch-lightning/tests/tests_pytorch/helpers/utils.py
imports: import functools
  import os
  from lightning.pytorch.callbacks import ModelCheckpoint
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.loggers import TensorBoardLogger
  from tests_pytorch import _TEMP_PATH
label_desc: Use image node_id 3 for calling a global function with example usage: load_model_from_checkpoint(root_weights_dir, module_class) and returns: trained_model