code: def _purify_col(mat, marg, densities, j):
      # Purify such that column j has mean 0.
      try:
          _mean = np.average(mat[:, j], weights=densities[:, j])
          marg[j] += _mean
          mat[:, j] -= _mean
      except ZeroDivisionError:  # pragma: no cover
          pass
      return mat, marg
  
imports: import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: _purify_col(mat, marg, densities, j) and returns: mat,  marg