code: def test_predict_topk(self):
      if self.model is None:
          return
  
      # Arrange
      sf = self.sf
      model = self.model
      k = 2
  
      # Act & Assert
      if self.has_predict_topk:
          # Act & Assert
          output_type = "rank"
          bp = model.predict_topk(sf, output_type, k)
          lp = model.predict_topk(list(sf), output_type, k)
          dp = model.predict_topk(sf[0], output_type, k)
          sf_new = sf[0].copy()
          sf_new["new_column"] = 1
          dp_new = model.predict_topk(sf_new, output_type, k)
  
          self.assertEqual(len(dp), 2)
          self.assertEqual(list(bp), list(lp))
          self.assertEqual(bp[0], dp[0])
          self.assertEqual(bp[0], dp_new[0])
          self.assertEqual(lp[0], dp[0])
          self.assertEqual(bp[1], dp[1])
          self.assertEqual(lp[1], dp[1])
  
          # Act & Assert
          output_type = "probability"
          bp = model.predict_topk(sf, output_type, k)
          lp = model.predict_topk(list(sf), output_type, k)
          dp = model.predict_topk(sf[0], output_type, k)
          dp_new = model.predict_topk(sf_new, output_type, k)
  
          self.assertEqual(len(dp), 2)
          self.assertEqual(list(bp), list(lp))
          self.assertEqual(bp[0], dp[0])
          self.assertEqual(bp[0], dp_new[0])
          self.assertEqual(lp[0], dp[0])
          self.assertEqual(bp[1], dp[1])
          self.assertEqual(lp[1], dp[1])
  
          # Act & Assert
          output_type = "margin"
          bp = model.predict_topk(sf, output_type, k)
          lp = model.predict_topk(list(sf), output_type, k)
          dp = model.predict_topk(sf[0], output_type, k)
          dp_new = model.predict_topk(sf_new, output_type, k)
  
          self.assertEqual(len(dp), 2)
          self.assertEqual(list(bp), list(lp))
          self.assertEqual(bp[0], dp[0])
          self.assertEqual(bp[0], dp_new[0])
          self.assertEqual(lp[0], dp[0])
          self.assertEqual(bp[1], dp[1])
          self.assertEqual(lp[1], dp[1])
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import unittest
  import turicreate
  import uuid
  from turicreate.toolkits import evaluation
  from turicreate.toolkits._main import ToolkitError
  import shutil
  import numpy
label_desc: Use image node_id 4 for calling the FastPathPredictionTest obj's underlying member method code with example usage: obj.test_predict_topk() without return types