code: def randomized_svd(M, n_components, n_oversamples=10):
      """
      Computes a truncated randomized SVD.
  
      Parameters
      ----------
      M: ndarray or sparse matrix
          Matrix to decompose
  
      n_components: int
          Number of singular values and vectors to extract.
  
      n_oversamples: int (default is 10)
          Additional number of random vectors to sample the range of M so as
          to ensure proper conditioning. The total number of random vectors
          used to find the range of M is n_components + n_oversamples. Smaller
          number can improve speed but can negatively impact the quality of
          approximation of singular vectors and singular values.
  
      Notes
      -----
      scikit-learn implementation
      """
      n_random = n_components + n_oversamples
      n_samples, n_features = M.shape
      n_iter = 7 if n_components < 0.1 * min(M.shape) else 4
  
      Q = randomized_range_finder(M, n_random, n_iter)
      # project M to the (k + p) dimensional space
      # using the basis vectors
      B = np.dot(Q.T, M)
  
      # compute the SVD on the thin matrix: (k + p) wide
      Uhat, s, V = linalg.svd(B, full_matrices=False)
      del B
  
      U = np.dot(Q, Uhat)
      U, V = svd_flip(U, V)
  
      return U[:, :n_components], s[:n_components], V[:n_components, :]
  
imports: import numpy
  from scipy import linalg
label_desc: Use image node_id 3 for calling a global function with example usage: randomized_svd(M, n_components, n_oversamples) and returns: U,  s,  V