code: def save_matrix(fname, x):
      n, d = x.shape
      fout = io.open(fname, "w", encoding="utf-8")
      fout.write("%d %d\n" % (n, d))
      for i in range(n):
          fout.write(
              " ".join(map(lambda a: "%.4f" % a, x[i, :])) + "\n"
          )
      fout.close()
  
file_path: fastText/alignment/utils.py
imports: import io
  import numpy
  import collections
label_desc: Use image node_id 4 for calling a global function with example usage: save_matrix(fname, x) without return types