code: def stack_numpy_dict_list(
      dict_list: List[Dict[str, np.ndarray]]
  ) -> Dict[str, np.ndarray]:
      """Stack list of dictionaries holding numpy arrays as values.
  
      :param dict_list: A list of identical dictionaries to be stacked, e.g. [{a: 1}, {a: 2}]
      :return: The list entries as a stacked dictionary, e.g. {a : [1, 2]}
      """
      list_dict = defaultdict(list)
      for d in dict_list:
          for k, v in d.items():
              list_dict[k].append(v)
  
      stacked_dict = dict()
      for k in list_dict.keys():
          stacked_dict[k] = np.stack(list_dict[k])
  
      return stacked_dict
  
file_path: maze/maze/train/utils/train_utils.py
imports: from collections import defaultdict
  from typing import List, Dict, Iterable, Union
  import numpy
  import torch
  from maze.core.env.structured_env import ActorID
label_desc: Use image node_id 1 for calling a global function with example usage: stack_numpy_dict_list(dict_list) and returns: stacked_dict