code: def dimreduce_visualization(data, mode="pca"):
      if mode == "tsne":
          tsne = TSNE(n_components=2)
          d_data = tsne.fit_transform(data)
      else:
          pca = PCA(n_components=2)
          d_data = pca.fit_transform(data)
      return d_data
  
file_path: contextual-ai/xai/graphs/utils.py
imports: from sklearn.decomposition import PCA
  from sklearn.manifold import TSNE
  from xai import constants
label_desc: Use image node_id 4 for calling a global function with example usage: dimreduce_visualization(data, mode) and returns: d_data