code: def print_result(self, predict):
      predict = np.squeeze(predict)
      if predict.ndim == 1:
          top_indices = predict.argsort()[-5:][::-1]
          if predict.shape[0] == 1001 or predict.shape[0] == 1000:
              if predict.shape[0] == 1000:
                  offset = 0
              else:
                  offset = 1
  
              import os
  
              if os.path.exists(self.args.label):
                  with open(self.args.label, "r") as f:
                      labels = [l.rstrip() for l in f]
  
                  for i in top_indices:
                      print(labels[i - offset], i, predict[i])
  
              else:
                  for i in top_indices:
                      print(i, predict[i])
  
          self.result = [(i, predict[i]) for i in top_indices]
  
      else:
          self.result = predict
          print(self.result)
  
file_path: MMdnn/mmdnn/conversion/examples/imagenet_test.py
imports: from __future__ import absolute_import
  import argparse
  import numpy
  from six import text_type
  from PIL import Image
label_desc: Use image node_id 8 for calling the TestKit obj's underlying member method code with example usage: obj.print_result(predict) without return types