code: def get_tsne_components(
      data,
      features_col=0,
      labels_col=1,
      whitten=True,
      n_components=3,
      perplexity=20,
      flatten=True,
      for_plot=True,
  ):
      features = _standardize_data(data, features_col, whitten, flatten)
      tsne = TSNE(n_components=n_components, perplexity=perplexity)
      tsne_results = tsne.fit_transform(features)
  
      if for_plot:
          comps = tsne_results.tolist()
          labels = data[labels_col]
          for i, item in enumerate(comps):
              # low, high, annotation, text, color
              label = labels[i]
              if isinstance(labels, np.ndarray):
                  label = label.item()
              item.extend((None, None, None, str(int(label)), label))
          return comps
      return tsne_results
  
imports: from sklearn.manifold import TSNE
  from sklearn.preprocessing import StandardScaler
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: get_tsne_components(data, features_col, labels_col, whitten, n_components, perplexity, flatten, for_plot) and returns: tsne_results, comps