class_docstr: Iterator for alternating between labeled and un-labled dataloaders
  for semi-supervised learning.
  
  Args:
      al_dataset (ActiveLearningDataset): dataset and pool from which to load data.
      batch_size (int):  how many samples per batch to load.
      num_steps (int): number of steps before the end of the iterator.
      p (Optional[float]): probability of selecting a labeled batch.
          If None, the batches alternate.
      shuffle (Optional[bool]): set to ``True`` to have the data reshuffled at every epoch.
      num_workers (Optional[int]): how many subprocesses to use for data loading.
      drop_last (Optional[bool]): set to ``True`` to drop the last incomplete batch.
class_docstr_tok: ["Iterator","for","alternating","between","labeled","and","un-labled","dataloaders","for","semi-supervised","learning",".","Args",":","al_dataset","(","ActiveLearningDataset",")",":","dataset","and","pool","from","which","to","load","data",".","batch_size","(","int",")",":","how","many","samples","per","batch","to","load",".","num_steps","(","int",")",":","number","of","steps","before","the","end","of","the","iterator",".","p","(","Optional","[","float","]",")",":","probability","of","selecting","a","labeled","batch",".","If","None",",","the","batches","alternate",".","shuffle","(","Optional","[","bool","]",")",":","set","to","``","True","``","to","have","the","data","reshuffled","at","every","epoch",".","num_workers","(","Optional","[","int","]",")",":","how","many","subprocesses","to","use","for","data","loading",".","drop_last","(","Optional","[","bool","]",")",":","set","to","``","True","``","to","drop","the","last","incomplete","batch","."]
code: def handle_format(self, item, idx):
      if isinstance(item, dict):
          item.update({self.IS_LABELED_TAG: idx == 0})
          return item
      else:
          return item, idx
  
file_path: baal/baal/utils/ssl_iterator.py
imports: from itertools import cycle
  from typing import Optional, Union, Dict, Sequence, Tuple
  import numpy
  from baal.active import ActiveLearningDataset
  from torch.utils.data import DataLoader
label_desc: Use image node_id 2 for calling the SemiSupervisedIterator obj's underlying member method code with example usage: obj.handle_format(item, idx) and returns: item, item,  idx