def svd_timing(X, n_comps, n_iter, n_oversamples, power_iteration_normalizer='auto', method=None):
 print '... running SVD ...'
 if (method is not 'fbpca'):
  gc.collect()
  t0 = time()
  (U, mu, V) = randomized_svd(X, n_comps, n_oversamples, n_iter, power_iteration_normalizer, random_state=random_state, transpose=False)
  call_time = (time() - t0)
 else:
  gc.collect()
  t0 = time()
  (U, mu, V) = fbpca.pca(X, n_comps, raw=True, n_iter=n_iter, l=(n_oversamples + n_comps))
  call_time = (time() - t0)
 return (U, mu, V, call_time)

def svd_timing ( X , n_comps , n_iter , n_oversamples , power_iteration_normalizer = 'auto' , method = None ) : print '... running SVD ...' if ( method is not 'fbpca' ) : gc . collect ( ) t0 = time ( ) ( U , mu , V ) = randomized_svd ( X , n_comps , n_oversamples , n_iter , power_iteration_normalizer , random_state = random_state , transpose = False ) call_time = ( time ( ) - t0 ) else : gc . collect ( ) t0 = time ( ) ( U , mu , V ) = fbpca . pca ( X , n_comps , raw = True , n_iter = n_iter , l = ( n_oversamples + n_comps ) ) call_time = ( time ( ) - t0 ) return ( U , mu , V , call_time )
measure time for decomposition .