code: def _apply_masks(X, masks):
      maskedX = []
      for i in range(len(X)):
          maskedX.append(masks[i].T @ X[i] @ masks[i])
      return maskedX
  
imports: from copy import deepcopy
  import numpy
  import warnings
  from .ajd import ajd_pham
  from .base import sqrtm, invsqrtm, logm, expm, powm
  from .distance import distance_riemann
  from .geodesic import geodesic_riemann
  from .utils import check_weights
label_desc: Use image node_id 17 for calling a global function with example usage: _apply_masks(X, masks) and returns: maskedX