code: def _reduce_matrix(X_orig, dim, eigv):
      """
      Reduces the dimension of a (m × n)   matrix `X_orig` to
                            to a (m × dim) matrix `X_reduced`
      It uses only the first 100000 rows of `X_orig` to do the mapping.
      Matrix types are all `np.float32` in order to avoid unncessary copies.
      """
      if eigv is None:
          mapping_size = 100000
          X = X_orig[:mapping_size]
          X = X - X.mean(axis=0, dtype=np.float32)
          C = np.divide(
              np.matmul(X.T, X), X.shape[0] - 1, dtype=np.float32
          )
          _, U = np.linalg.eig(C)
          eigv = U[:, :dim]
  
      X_reduced = np.matmul(X_orig, eigv)
  
      return (X_reduced, eigv)
  
file_path: fastText/python/fasttext_module/fasttext/util/util.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import sys
  import shutil
  import os
  import gzip
label_desc: Use image node_id 3 for calling a global function with example usage: _reduce_matrix(X_orig, dim, eigv) and returns: X_reduced,  eigv