code: def exec_funcs_with_kwargs(func_dict, func_key, input_tensor, kwargs):
      assert (
          func_key in func_dict
      ), f"{func_key} is not in the function_dict."
      funcs_to_exec = func_dict[func_key]
      if isinstance(funcs_to_exec, list):
          for f in funcs_to_exec:
              f_kwargs = build_kwargs_for_function(f, kwargs)
              input_tensor = exec_func_with_kwargs(
                  f, f_kwargs, input_tensor, kwargs
              )
      else:
          f_kwargs = build_kwargs_for_function(funcs_to_exec, kwargs)
          input_tensor = exec_func_with_kwargs(
              funcs_to_exec, f_kwargs, input_tensor, kwargs
          )
  
      return input_tensor
  
file_path: ColossalAI/colossalai/legacy/pipeline/utils.py
imports: import heapq
  import inspect
  from collections import OrderedDict
  from typing import List
  import torch
  from colossalai.legacy.nn.layer.utils import CheckpointModule
  from colossalai.logging import get_dist_logger
label_desc: Use image node_id 10 for calling a global function with example usage: exec_funcs_with_kwargs(func_dict, func_key, input_tensor, kwargs) and returns: input_tensor