code: def test_init_with_generator(self):
      def data_generator():
          yield [(0, 1)]
          yield [(1, 1)]
  
      gen_tmp_fname = self.tmp_fname + ".generator"
      corpus = ShardedCorpus(gen_tmp_fname, data_generator(), dim=2)
  
      self.assertEqual(2, len(corpus))
      self.assertEqual(1, corpus[0][0])
  
imports: import os
  import unittest
  import random
  import shutil
  import numpy
  from scipy import sparse
  from gensim.utils import is_corpus, mock_data
  from gensim.corpora.sharded_corpus import ShardedCorpus
label_desc: Use image node_id 13 for calling the TestShardedCorpus obj's underlying member method code with example usage: obj.test_init_with_generator() without return types