class_docstr: Test ImageDataset class.
docstr: Test iterating batches of an ImageDataset.
docstr_tok: ["Test","iterating","batches","of","an","ImageDataset","."]
code: def test_iterbatches(self):
      """Test iterating batches of an ImageDataset."""
  
      path = os.path.join(os.path.dirname(__file__), "images")
      files = [os.path.join(path, f) for f in os.listdir(path)]
      ds = dc.data.ImageDataset(files, np.random.random(10))
      X = ds.X
      iterated_ids = set()
      for x, y, w, ids in ds.iterbatches(2, epochs=2):
          np.testing.assert_array_equal([2, 28, 28], x.shape)
          np.testing.assert_array_equal([2], y.shape)
          np.testing.assert_array_equal([2], w.shape)
          np.testing.assert_array_equal([2], ids.shape)
          for i in (0, 1):
              assert ids[i] in files
              if len(iterated_ids) < 10:
                  assert ids[i] not in iterated_ids
                  iterated_ids.add(ids[i])
              else:
                  assert ids[i] in iterated_ids
              index = files.index(ids[i])
              np.testing.assert_array_equal(x[i], X[index])
      assert len(iterated_ids) == 10
  
file_path: deepchem/deepchem/data/tests/test_image_dataset.py
imports: import unittest
  import numpy
  import deepchem
  import os
label_desc: Use image node_id 3 for calling the TestImageDataset obj's underlying member method code with example usage: obj.test_iterbatches() without return types