code: def compute_ccas(
      sigma_xx, sigma_xy, sigma_yx, sigma_yy, epsilon, verbose=True
  ):
      """Main cca computation function, takes in variances and crossvariances.
  
      This function takes in the covariances and cross covariances of X, Y,
      preprocesses them (removing small magnitudes) and outputs the raw results of
      the cca computation, including cca directions in a rotated space, and the
      cca correlation coefficient values.
  
      Args:
                sigma_xx: 2d numpy array, (num_neurons_x, num_neurons_x)
                          variance matrix for x
                sigma_xy: 2d numpy array, (num_neurons_x, num_neurons_y)
                          crossvariance matrix for x,y
                sigma_yx: 2d numpy array, (num_neurons_y, num_neurons_x)
                          crossvariance matrix for x,y (conj) transpose of sigma_xy
                sigma_yy: 2d numpy array, (num_neurons_y, num_neurons_y)
                          variance matrix for y
                epsilon:  small float to help with stabilizing computations
                verbose:  boolean on whether to print intermediate outputs
  
      Returns:
                [ux, sx, vx]: [numpy 2d array, numpy 1d array, numpy 2d array]
                              ux and vx are (conj) transposes of each other, being
                              the canonical directions in the X subspace.
                              sx is the set of canonical correlation coefficients-
                              how well corresponding directions in vx, Vy correlate
                              with each other.
                [uy, sy, vy]: Same as above, but for Y space
                invsqrt_xx:   Inverse square root of sigma_xx to transform canonical
                              directions back to original space
                invsqrt_yy:   Same as above but for sigma_yy
                x_idxs:       The indexes of the input sigma_xx that were pruned
                              by remove_small
                y_idxs:       Same as above but for sigma_yy
      """
  
      (
          sigma_xx,
          sigma_xy,
          sigma_yx,
          sigma_yy,
          x_idxs,
          y_idxs,
      ) = remove_small(sigma_xx, sigma_xy, sigma_yx, sigma_yy, epsilon)
  
      numx = sigma_xx.shape[0]
      numy = sigma_yy.shape[0]
  
      if numx == 0 or numy == 0:
          return (
              [0, 0, 0],
              [0, 0, 0],
              np.zeros_like(sigma_xx),
              np.zeros_like(sigma_yy),
              x_idxs,
              y_idxs,
          )
  
      if verbose:
          print("adding eps to diagonal and taking inverse")
      sigma_xx += epsilon * np.eye(numx)
      sigma_yy += epsilon * np.eye(numy)
      inv_xx = np.linalg.pinv(sigma_xx)
      inv_yy = np.linalg.pinv(sigma_yy)
  
      if verbose:
          print("taking square root")
      invsqrt_xx = positivedef_matrix_sqrt(inv_xx)
      invsqrt_yy = positivedef_matrix_sqrt(inv_yy)
  
      if verbose:
          print("dot products...")
      arr = np.dot(invsqrt_xx, np.dot(sigma_xy, invsqrt_yy))
  
      if verbose:
          print("trying to take final svd")
      u, s, v = np.linalg.svd(arr)
  
      if verbose:
          print("computed everything!")
  
      return [u, np.abs(s), v], invsqrt_xx, invsqrt_yy, 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 3 for calling a global function with example usage: compute_ccas(sigma_xx, sigma_xy, sigma_yx, sigma_yy, epsilon, verbose) and returns: list,  invsqrt_xx,  invsqrt_yy,  x_idxs,  y_idxs, list,  list,  np,  np,  x_idxs,  y_idxs