code: def pca(x, n_components=50):
      if sp.issparse(x):
          x = x.toarray()
      U, S, V = np.linalg.svd(x, full_matrices=False)
      U[:, np.sum(V, axis=1) < 0] *= -1
      x_reduced = np.dot(U, np.diag(S))
      x_reduced = x_reduced[:, np.argsort(S)[::-1]][:, :n_components]
      return x_reduced
  
file_path: openTSNE/examples/utils.py
imports: from os.path import abspath, dirname, join
  import numpy
  import scipy.sparse
label_desc: Use image node_id 3 for calling a global function with example usage: pca(x, n_components) and returns: x_reduced