code: def test_bow(self):
      # test list words
  
      # one bag of words
      potentialbow = [(0, 0.4)]
      result = matutils.isbow(potentialbow)
      expected = True
      self.assertEqual(expected, result)
  
      # multiple bags
      potentialbow = [(0, 4.0), (1, 2.0), (2, 5.0), (3, 8.0)]
      result = matutils.isbow(potentialbow)
      expected = True
      self.assertEqual(expected, result)
  
      # checking empty input
      potentialbow = []
      result = matutils.isbow(potentialbow)
      expected = True
      self.assertEqual(expected, result)
  
      # checking corpus; should return false
      potentialbow = [[(2, 1), (3, 1), (4, 1), (5, 1), (1, 1), (7, 1)]]
      result = matutils.isbow(potentialbow)
      expected = False
      self.assertEqual(expected, result)
  
      # not a bag of words, should return false
      potentialbow = [(1, 3, 6)]
      result = matutils.isbow(potentialbow)
      expected = False
      self.assertEqual(expected, result)
  
      # checking sparse matrix format bag of words
      potentialbow = csr_matrix([[1, 0.4], [0, 0.3], [2, 0.1]])
      result = matutils.isbow(potentialbow)
      expected = True
      self.assertEqual(expected, result)
  
      # checking np array format bag of words
      potentialbow = np.array([[1, 0.4], [0, 0.2], [2, 0.2]])
      result = matutils.isbow(potentialbow)
      expected = True
      self.assertEqual(expected, result)
  
imports: import logging
  import unittest
  from gensim import matutils
  from scipy.sparse import csr_matrix
  import numpy
  import math
  from gensim.corpora.mmcorpus import MmCorpus
  from gensim.models import ldamodel
  from gensim.test.utils import datapath, common_dictionary, common_corpus
label_desc: Use image node_id 2 for calling the TestIsBow obj's underlying member method code with example usage: obj.test_bow() without return types