code: def test_uir_iter(self):
      train_set = Dataset.from_uir(self.triplet_data)
  
      users = [
          batch_users for batch_users, _, _ in train_set.uir_iter()
      ]
      self.assertSequenceEqual(users, range(10))
  
      items = [
          batch_items for _, batch_items, _ in train_set.uir_iter()
      ]
      self.assertSequenceEqual(items, range(10))
  
      ratings = [
          batch_ratings for _, _, batch_ratings in train_set.uir_iter()
      ]
      self.assertListEqual(ratings, [4, 4, 4, 4, 3, 4, 4, 5, 3, 4])
  
      ratings = [
          batch_ratings
          for _, _, batch_ratings in train_set.uir_iter(binary=True)
      ]
      self.assertListEqual(ratings, [1] * 10)
  
      ratings = [
          batch_ratings
          for _, _, batch_ratings in train_set.uir_iter(
              batch_size=5, num_zeros=1
          )
      ]
      self.assertListEqual(
          ratings[0].tolist(), [4, 4, 4, 4, 3, 0, 0, 0, 0, 0]
      )
      self.assertListEqual(
          ratings[1].tolist(), [4, 4, 5, 3, 4, 0, 0, 0, 0, 0]
      )
  
imports: import unittest
  import numpy
  import numpy.testing
  from cornac.data import BasketDataset, Dataset, SequentialDataset, Reader
label_desc: Use image node_id 6 for calling the TestDataset obj's underlying member method code with example usage: obj.test_uir_iter() without return types