code: def randomized_range_finder(
      A,
      size,
      n_iter,
      power_iteration_normalizer="auto",
      random_state=None,
  ):
      """Computes an orthonormal matrix whose range approximates the range of A.
  
      Parameters
      ----------
      A: 2D array
          The input data matrix
  
      size: integer
          Size of the return array
  
      n_iter: integer
          Number of power iterations used to stabilize the result
  
      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
  
      random_state: RandomState or an int seed (0 by default)
          A random number generator instance
  
      Returns
      -------
      Q: 2D array
          A (size x size) projection matrix, the range of which
          approximates well the range of the input matrix A.
  
      Notes
      -----
  
      Follows Algorithm 4.3 of
      Finding structure with randomness: Stochastic algorithms for constructing
      approximate matrix decompositions
      Halko, et al., 2009 (arXiv:909) http://arxiv.org/pdf/0909.4061
  
      An implementation of a randomized algorithm for principal component
      analysis
      A. Szlam et al. 2014
      """
      random_state = check_random_state(random_state)
  
      # Generating normal random vectors with shape: (A.shape[1], size)
      Q = random_state.normal(size=(A.shape[1], size))
  
      # Deal with "auto" mode
      if power_iteration_normalizer == "auto":
          if n_iter <= 2:
              power_iteration_normalizer = "none"
          else:
              power_iteration_normalizer = "LU"
  
      # Perform power iterations with Q to further 'imprint' the top
      # singular vectors of A in Q
      for i in range(n_iter):
          if power_iteration_normalizer == "none":
              Q = safe_sparse_dot(A, Q)
              Q = safe_sparse_dot(A.T, Q)
          elif power_iteration_normalizer == "LU":
              Q, _ = linalg.lu(safe_sparse_dot(A, Q), permute_l=True)
              Q, _ = linalg.lu(safe_sparse_dot(A.T, Q), permute_l=True)
          elif power_iteration_normalizer == "QR":
              Q, _ = linalg.qr(safe_sparse_dot(A, Q), mode="economic")
              Q, _ = linalg.qr(safe_sparse_dot(A.T, Q), mode="economic")
  
      # Sample the range of A using by linear projection of Q
      # Extract an orthonormal basis
      Q, _ = linalg.qr(safe_sparse_dot(A, Q), mode="economic")
      return Q
  
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 10 for calling a global function with example usage: randomized_range_finder(A, size, n_iter, power_iteration_normalizer, random_state) and returns: Q