class_docstr: Random iterable dataset used to generate batches for recommender systems
  (RecSys). Currently produces unweighted sparse features only. TODO: Add
  weighted sparse features.
  
  Args:
      keys (List[str]): List of feature names for sparse features.
      batch_size (int): batch size.
      hash_size (Optional[int]): Max sparse id value. All sparse IDs will be taken
          modulo this value.
      hash_sizes (Optional[List[int]]): Max sparse id value per feature in keys. Each
          sparse ID will be taken modulo the corresponding value from this argument. Note, if this is used, hash_size will be ignored.
      ids_per_feature (int): Number of IDs per sparse feature.
      ids_per_features (int): Number of IDs per sparse feature in each key. Note, if this is used, ids_per_feature will be ignored.
      num_dense (int): Number of dense features.
      manual_seed (int): Seed for deterministic behavior.
      num_batches: (Optional[int]): Num batches to generate before raising StopIteration
      num_generated_batches int: Num batches to cache. If num_batches > num_generated batches, then we will cycle to the first generated batch.
                                 If this value is negative, batches will be generated on the fly.
      min_ids_per_feature (int): Minimum number of IDs per features.
  
  Example::
  
      dataset = RandomRecDataset(
          keys=["feat1", "feat2"],
          batch_size=16,
          hash_size=100_000,
          ids_per_feature=1,
          num_dense=13,
      ),
      example = next(iter(dataset))
class_docstr_tok: ["Random","iterable","dataset","used","to","generate","batches","for","recommender","systems","(","RecSys",")",".","Currently","produces","unweighted","sparse","features","only",".","TODO",":","Add","weighted","sparse","features",".","Args",":","keys","(","List","[","str","]",")",":","List","of","feature","names","for","sparse","features",".","batch_size","(","int",")",":","batch","size",".","hash_size","(","Optional","[","int","]",")",":","Max","sparse","id","value",".","All","sparse","IDs","will","be","taken","modulo","this","value",".","hash_sizes","(","Optional","[","List","[","int","]","]",")",":","Max","sparse","id","value","per","feature","in","keys",".","Each","sparse","ID","will","be","taken","modulo","the","corresponding","value","from","this","argument",".","Note",",","if","this","is","used",",","hash_size","will","be","ignored",".","ids_per_feature","(","int",")",":","Number","of","IDs","per","sparse","feature",".","ids_per_features","(","int",")",":","Number","of","IDs","per","sparse","feature","in","each","key",".","Note",",","if","this","is","used",",","ids_per_feature","will","be","ignored",".","num_dense","(","int",")",":","Number","of","dense","features",".","manual_seed","(","int",")",":","Seed","for","deterministic","behavior",".","num_batches",":","(","Optional","[","int","]",")",":","Num","batches","to","generate","before","raising","StopIteration","num_generated_batches","int",":","Num","batches","to","cache",".","If","num_batches",">","num_generated","batches",",","then","we","will","cycle","to","the","first","generated","batch",".","If","this","value","is","negative",",","batches","will","be","generated","on","the","fly",".","min_ids_per_feature","(","int",")",":","Minimum","number","of","IDs","per","features",".","Example",":",":","dataset","=","RandomRecDataset","(","keys=","[","``","feat1","''",",","``","feat2","''","]",",","batch_size=16",",","hash_size=100_000",",","ids_per_feature=1",",","num_dense=13",",",")",",","example","=","next","(","iter","(","dataset",")",")"]
code: def __iter__(self) -> Iterator[Batch]:
      return itertools.islice(
          iter(self.batch_generator), self.num_batches
      )
  
file_path: torchrec/torchrec/datasets/random.py
imports: import itertools
  import sys
  from typing import cast, Iterator, List, Optional
  import torch
  from torch.utils.data.dataset import IterableDataset
  from torchrec.datasets.utils import Batch
  from torchrec.sparse.jagged_tensor import KeyedJaggedTensor
label_desc: Use image node_id 2 for calling the RandomRecDataset obj's underlying member method code with example usage: obj.__iter__() and returns: itertools