code: def randomized_svd(
      M,
      n_components,
      n_oversamples=10,
      n_iter="auto",
      power_iteration_normalizer="auto",
      transpose="auto",
      flip_sign=True,
      random_state=0,
  ):
      """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.
  
      n_iter: int or 'auto' (default is 'auto')
          Number of power iterations. It can be used to deal with very noisy
          problems. When 'auto', it is set to 4, unless `n_components` is small
          (< .1 * min(X.shape)) `n_iter` in which case is set to 7.
          This improves precision with few components.
  
          .. versionchanged:: 0.18
  
      power_iteration_normalizer: 'auto' (default), 'QR', 'LU', 'none'
          Whether the power iterations are normalized with step-by-step
          QR factorization (the slowest but most accurate), 'none'
          (the fastest but numerically unstable when `n_iter` is large, e.g.
          typically 5 or larger), or 'LU' factorization (numerically stable
          but can lose slightly in accuracy). The 'auto' mode applies no
          normalization if `n_iter`<=2 and switches to LU otherwise.
  
          .. versionadded:: 0.18
  
      transpose: True, False or 'auto' (default)
          Whether the algorithm should be applied to M.T instead of M. The
          result should approximately be the same. The 'auto' mode will
          trigger the transposition if M.shape[1] > M.shape[0] since this
          implementation of randomized SVD tend to be a little faster in that
          case.
  
          .. versionchanged:: 0.18
  
      flip_sign: boolean, (True by default)
          The output of a singular value decomposition is only unique up to a
          permutation of the signs of the singular vectors. If `flip_sign` is
          set to `True`, the sign ambiguity is resolved by making the largest
          loadings for each component in the left singular vectors positive.
  
      random_state: RandomState or an int seed (0 by default)
          A random number generator instance to make behavior
  
      Notes
      -----
      This algorithm finds a (usually very good) approximate truncated
      singular value decomposition using randomization to speed up the
      computations. It is particularly fast on large matrices on which
      you wish to extract only a small number of components. In order to
      obtain further speed up, `n_iter` can be set <=2 (at the cost of
      loss of precision).
  
      References
      ----------
      * Finding structure with randomness: Stochastic algorithms for constructing
        approximate matrix decompositions
        Halko, et al., 2009 http://arxiv.org/abs/arXiv:0909.4061
  
      * A randomized algorithm for the decomposition of matrices
        Per-Gunnar Martinsson, Vladimir Rokhlin and Mark Tygert
  
      * An implementation of a randomized algorithm for principal component
        analysis
        A. Szlam et al. 2014
      """
      random_state = check_random_state(random_state)
      n_random = n_components + n_oversamples
      n_samples, n_features = M.shape
  
      if n_iter == "auto":
          # Checks if the number of iterations is explicitely specified
          # Adjust n_iter. 7 was found a good compromise for PCA. See #5299
          n_iter = 7 if n_components < 0.1 * min(M.shape) else 4
  
      if transpose == "auto":
          transpose = n_samples < n_features
      if transpose:
          # this implementation is a bit faster with smaller shape[1]
          M = M.T
  
      Q = randomized_range_finder(
          M, n_random, n_iter, power_iteration_normalizer, random_state
      )
  
      # project M to the (k + p) dimensional space using the basis vectors
      B = safe_sparse_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)
  
      if flip_sign:
          if not transpose:
              U, V = svd_flip(U, V)
          else:
              # In case of transpose u_based_decision=false
              # to actually flip based on u and not v.
              U, V = svd_flip(U, V, u_based_decision=False)
  
      if transpose:
          # transpose back the results according to the input convention
          return (
              V[:n_components, :].T,
              s[:n_components],
              U[:, :n_components].T,
          )
      else:
          return (
              U[:, :n_components],
              s[:n_components],
              V[:n_components, :],
          )
  
imports: from __future__ import division
  from functools import partial
  import warnings
  import numpy
  from scipy import linalg
  from scipy.sparse import issparse, csr_matrix
  from .None import check_random_state
  from .fixes import np_version
  from ._logistic_sigmoid import _log_logistic_sigmoid
  from ..externals.six.moves import xrange
  from .sparsefuncs_fast import csr_row_norms
  from .validation import check_array
  from ..exceptions import NonBLASDotWarning
label_desc: Use image node_id 11 for calling a global function with example usage: randomized_svd(M, n_components, n_oversamples, n_iter, power_iteration_normalizer, transpose, flip_sign, random_state) and returns: V,  s,  U, U,  s,  V