code: def visualize_main(args):
      def load_data(file_name):
          extension = os.path.splitext(file_name)[1]
          if extension == ".txt":
              data = np.loadtxt(file_name)
          elif extension == ".npy":
              data = np.load(file_name)
          else:
              raise ValueError("Can't solve file type `%s`" % extension)
          return data
  
      vectors = load_data(args.file)
      if args.label:
          labels = load_data(args.label)
      else:
          labels = None
  
      gv.init_logging(logging.WARNING)
  
      app = gap.VisualizationApplication(args.dim, [0])
      app.load(vectors=vectors, perplexity=args.perplexity)
      app.build()
      app.train()
      app.visualization(Y=labels, save_file=args.save)
  
imports: from __future__ import print_function, absolute_import
  import os
  import re
  import glob
  import yaml
  import shutil
  import logging
  import argparse
  from easydict import EasyDict
  import numpy
  import graphvite
  import graphvite.application
label_desc: Use image node_id 6 for calling a global function with example usage: visualize_main(args) and returns: data