class_docstr: A common dataset object shared by most of NeMo multimodal models.
code: def _get_webdataset_and_epoch(self):
      train_info = self.wdinfo
      chunk_size = train_info["chunk_size"]
      shards_train_list = train_info["tar_files"]
      shards_train_list = [
          os.path.join(self.local_root_path, x)
          for x in shards_train_list
      ]
      epoch = 0
  
      if not self.infinite_sampler:
          logging.info(f"Initiating Webdataset Random Sampler..")
          assert (
              self.filterings is None
          ), "Webdataset Random Sampler should not be used with filters. Switch to infinite sampler"
          shards_train_list = WDSUrlsRandomSampler(
              urls=shards_train_list,
              total_urls=len(shards_train_list),
              chunk_size=chunk_size,
              consumed_samples=self.consumed_samples,
              data_parallel_rank=parallel_state.get_data_parallel_rank(),
              data_parallel_size=parallel_state.get_data_parallel_world_size(),
              num_workers=self.dataset_cfg.get("num_workers") or 1,
              drop_last=True,
              data_sharding=self.dataset_cfg.train.get(
                  "data_sharding", True
              ),
          )
          epoch = shards_train_list.epoch
  
      if self.use_boto3:
          train_dataset = WebDatasetS3(
              shards_train_list,
              handler=warn_and_continue,
              resampled=self.infinite_sampler or False,
              load_from_object_store=self.use_boto3,
              s3_client=self.s3,
              s3_bucket_name=self.bucket,
          )
      else:
          train_dataset = WebDataset(
              shards_train_list,
              handler=warn_and_continue,
              resampled=self.infinite_sampler or False,
          )
  
      return train_dataset, epoch
  
imports: import io
  import itertools
  import json
  import os
  import pickle
  import random
  import re
  from typing import Callable, List, Union
  import boto3
  import torch.distributed
  from botocore.config import Config
  from PIL import Image
  from nemo.collections.multimodal.data.common.data_samplers import SharedEpoch, WDSUrlsRandomSampler
  from nemo.collections.multimodal.data.common.webdataset_s3 import WebDataset
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults
  from nemo.core.classes import IterableDataset
  from nemo.utils import logging
label_desc: Use image node_id 2 for calling the WebDatasetCommon obj's underlying member method code with example usage: obj._get_webdataset_and_epoch() and returns: train_dataset,  epoch