code: def logdet_sinv_np_mask(X, sigma, mask):
      mask_indices = np.nonzero(mask)[0]
      # logdet
      _, logdet_np = np.linalg.slogdet(
          sigma[np.ix_(mask_indices, mask_indices)]
      )
      # sigma-inv
      sinv_np_ = np.linalg.inv(
          sigma[np.ix_(mask_indices, mask_indices)]
      )
      # sigma-inverse *
      sinvx_np_ = sinv_np_.dot(X[mask_indices, :])
  
      sinv_np = np.zeros_like(sigma)
      sinv_np[np.ix_(mask_indices, mask_indices)] = sinv_np_
      sinvx_np = np.zeros_like(X)
      sinvx_np[mask_indices, :] = sinvx_np_
  
      return logdet_np, sinv_np, sinvx_np
  
imports: import pytest
  import numpy
  from numpy.testing import assert_allclose
  from scipy.stats import norm, wishart, invgamma, invwishart
  import tensorflow
  from brainiak.matnormal.covs import CovIdentity, CovAR1, CovIsotropic, CovDiagonal, CovDiagonalGammaPrior, CovUnconstrainedCholesky, CovUnconstrainedCholeskyWishartReg, CovUnconstrainedInvCholesky, CovKroneckerFactored
label_desc: Use image node_id 2 for calling a global function with example usage: logdet_sinv_np_mask(X, sigma, mask) and returns: logdet_np,  sinv_np,  sinvx_np