code: def threshold_absolute(W, thr, copy=True):
      '''
      This function thresholds the connectivity matrix by absolute weight
      magnitude. All weights below the given threshold, and all weights
      on the main diagonal (self-self connections) are set to 0.
  
      If copy is not set, this function will *modify W in place.*
  
      Parameters
      ----------
      W : np.ndarray
          weighted connectivity matrix
      thr : float
          absolute weight threshold
      copy : bool
          if True, returns a copy of the matrix. Otherwise, modifies the matrix
          in place. Default value=True.
  
      Returns
      -------
      W : np.ndarray
          thresholded connectivity matrix
      '''
      if copy:
          W = W.copy()
      np.fill_diagonal(W, 0)  # clear diagonal
      W[W < thr] = 0  # apply threshold
      return f threshold_absolute(W, thr, copy=True):
      '''
      This function thresholds the connectivity matrix by absolute weight
      magnitude. All weights below the given threshold, and all weights
      on the main diagonal (self-self connections) are set to 0.
  
      If copy is not set, this function will *modify W in place.*
  
      Parameters
      ----------
      W : np.ndarray
          weighted connectivity matrix
      thr : float
          absolute weight threshold
      copy : bool
          if True, returns a copy of the matrix. Otherwise, modifies the matrix
          in place. Default value=True.
  
      Returns
      -------
      W : np.ndarray
          thresholded connectivity matrix
      '''
      if copy:
          W = W.copy()
      np.fill_diagonal(W, 0)  # clear diagonal
      W[W < thr] = 0  # apply threshold
      return W
docs: This function thresholds the connectivity matrix by absolute weight
      magnitude. All weights below the given threshold, and all weights
      on the main diagonal (self-self connections) are set to 0.
  
      If copy is not set, this function will *modify W in place.*
  
      Parameters
      ----------
      W : np.ndarray
          weighted connectivity matrix
      thr : float
          absolute weight threshold
      copy : bool
          if True, returns a copy of the matrix. Otherwise, modifies the matrix
          in place. Default value=True.
  
      Returns
      -------
      W : np.ndarray
          thresholded connectivity matrix