code: def remove_small(sigma_xx, sigma_xy, sigma_yx, sigma_yy, epsilon):
      """Takes covariance between X, Y, and removes values of small magnitude.
  
      Args:
                sigma_xx: 2d numpy array, variance matrix for x
                sigma_xy: 2d numpy array, crossvariance matrix for x,y
                sigma_yx: 2d numpy array, crossvariance matrixy for x,y,
                          (conjugate) transpose of sigma_xy
                sigma_yy: 2d numpy array, variance matrix for y
                epsilon : cutoff value for norm below which directions are thrown
                           away
  
      Returns:
                sigma_xx_crop: 2d array with low x norm directions removed
                sigma_xy_crop: 2d array with low x and y norm directions removed
                sigma_yx_crop: 2d array with low x and y norm directiosn removed
                sigma_yy_crop: 2d array with low y norm directions removed
                x_idxs: indexes of sigma_xx that were removed
                y_idxs: indexes of sigma_yy that were removed
      """
  
      x_diag = np.abs(np.diagonal(sigma_xx))
      y_diag = np.abs(np.diagonal(sigma_yy))
      x_idxs = x_diag >= epsilon
      y_idxs = y_diag >= epsilon
  
      sigma_xx_crop = sigma_xx[x_idxs][:, x_idxs]
      sigma_xy_crop = sigma_xy[x_idxs][:, y_idxs]
      sigma_yx_crop = sigma_yx[y_idxs][:, x_idxs]
      sigma_yy_crop = sigma_yy[y_idxs][:, y_idxs]
  
      return (
          sigma_xx_crop,
          sigma_xy_crop,
          sigma_yx_crop,
          sigma_yy_crop,
          x_idxs,
          y_idxs,
      )
  
file_path: ecco/src/ecco/svcca_lib/cca_core.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: remove_small(sigma_xx, sigma_xy, sigma_yx, sigma_yy, epsilon) and returns: sigma_xx_crop,  sigma_xy_crop,  sigma_yx_crop,  sigma_yy_crop,  x_idxs,  y_idxs