code: def top_n(probs, n=5):
      if probs.ndim == 2:
          probs = probs[0]  # take probabilities for first image
  
      with open(IMAGENET_CLASSES_FILE, "r") as f:
          class_names = f.read().splitlines()
          class_names = np.array(class_names)
  
      max_probs_indices = probs.argsort()[-n:][::-1]
      class_probs = probs[max_probs_indices]
      top_classes = class_names[max_probs_indices]
  
      return top_classes, class_probs
  
file_path: neupy/examples/cnn/imagenet_tools.py
imports: from __future__ import division
  import os
  import requests
  from tqdm import tqdm
  import numpy
  from imageio import imread
  from skimage import transform
  from neupy.utils import asfloat
label_desc: Use image node_id 6 for calling a global function with example usage: top_n(probs, n) and returns: top_classes,  class_probs