code: def testOneSequence(self):
      sequence0 = [7, 12, 12, 16]
  
      identity = lambda x: int(x)
  
      expectedValues = [(7, [7]), (12, [12, 12]), (16, [16])]
      i = 0
      for data in groupby2(sequence0, identity):
          self.assertEqual(data[0], expectedValues[i][0])
          for j in xrange(1, len(data)):
              temp = list(data[j]) if data[j] else data[j]
              self.assertEqual(temp, expectedValues[i][j])
          i += 1
  
file_path: nupic-legacy/tests/unit/nupic/support/group_by_test.py
imports: import unittest
  from nupic.support.group_by import groupby2
label_desc: Use image node_id 1 for calling the GroupByTest obj's underlying member method code with example usage: obj.testOneSequence() without return types