code: def test_lazy_groups_of(self):
      xs = [1, 2, 3, 4, 5, 6, 7]
      groups = util.lazy_groups_of(iter(xs), group_size=3)
      assert next(groups) == [1, 2, 3]
      assert next(groups) == [4, 5, 6]
      assert next(groups) == [7]
      with pytest.raises(StopIteration):
          _ = next(groups)
  
imports: from datetime import timedelta
  import sys
  from collections import OrderedDict
  import pytest
  import torch
  from allennlp.common import util
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.common.util import push_python_path
label_desc: Use image node_id 2 for calling the TestCommonUtils obj's underlying member method code with example usage: obj.test_lazy_groups_of() without return types