code: def mask_img_stack(images, mask):
      """Masking stacked images by a given mask
  
      Args:
          images (list): Input image data, where each sample in shape (n_phases, dim1, dim2).
          mask (array-like): mask, shape (dim1, dim2).
      Returns:
          list: masked images, each sample in the list in shape (n_phases, dim1, dim2).
      """
      n_samples = len(images)
      for i in range(n_samples):
          n_phases = images[i].shape[0]
          for j in range(n_phases):
              images[i][j, ...] = np.multiply(images[i][j, ...], mask)
  
      return images
  
file_path: pykale/kale/prepdata/image_transform.py
imports: import logging
  import numpy
  import torchvision.transforms
  from skimage.transform import estimate_transform, rescale, warp
label_desc: Use image node_id 4 for calling a global function with example usage: mask_img_stack(images, mask) and returns: images