class_docstr: Image Classification Dataset.
  
  
  This base class can be used to represent any image classification dataset which is stored in a way that meets the
  expectations of `torchvision.datasets.ImageFolder`. New image classification datasets can be derived from this
  similar to ImageNetDataset (imagenet.py) or Places365Dataset (places365.py) and overwrite the data transformations
  as needed. This dataset also supports sampling a random subset of the training set to be used for training. The
  subset size is determined by the arguments `dataset.num_samples_per_category` and `dataset.percentage_of_samples`
  in the input `opts`. Only one of these two should be specified. When `dataset.percentage_of_samples` is specified,
  data is sampled from all classes according to this percentage such that the distribution of classes does not change.
   The randomness in sampling is controlled by the `dataset.sample_selection_random_seed` in the input `opts`.
  
  Args:
      opts: An argparse.Namespace instance.
class_docstr_tok: ["Image","Classification","Dataset",".","This","base","class","can","be","used","to","represent","any","image","classification","dataset","which","is","stored","in","a","way","that","meets","the","expectations","of","`","torchvision.datasets.ImageFolder","`",".","New","image","classification","datasets","can","be","derived","from","this","similar","to","ImageNetDataset","(","imagenet.py",")","or","Places365Dataset","(","places365.py",")","and","overwrite","the","data","transformations","as","needed",".","This","dataset","also","supports","sampling","a","random","subset","of","the","training","set","to","be","used","for","training",".","The","subset","size","is","determined","by","the","arguments","`","dataset.num_samples_per_category","`","and","`","dataset.percentage_of_samples","`","in","the","input","`","opts","`",".","Only","one","of","these","two","should","be","specified",".","When","`","dataset.percentage_of_samples","`","is","specified",",","data","is","sampled","from","all","classes","according","to","this","percentage","such","that","the","distribution","of","classes","does","not","change",".","The","randomness","in","sampling","is","controlled","by","the","`","dataset.sample_selection_random_seed","`","in","the","input","`","opts","`",".","Args",":","opts",":","An","argparse.Namespace","instance","."]
docstr: Returns the number of classes in classification dataset along with super-class arguments.
docstr_tok: ["Returns","the","number","of","classes","in","classification","dataset","along","with","super-class","arguments","."]
code: def share_dataset_arguments(self) -> Dict[str, Any]:
      """Returns the number of classes in classification dataset along with super-class arguments."""
      share_dataset_specific_opts: Dict[
          str, Any
      ] = super().share_dataset_arguments()
      share_dataset_specific_opts[
          "model.classification.n_classes"
      ] = self.n_classes
      return share_dataset_specific_opts
  
imports: import argparse
  from typing import Any, Dict, Tuple, Union
  import torch
  from torchvision.datasets import ImageFolder
  from data.datasets.dataset_base import BaseImageDataset
  from data.datasets.utils.common import select_samples_by_category
  from data.transforms import image_pil
  from data.transforms.common import Compose
  from utils import logger
  from utils.ddp_utils import is_master
label_desc: Use image node_id 7 for calling the BaseImageClassificationDataset obj's underlying member method code with example usage: obj.share_dataset_arguments() and returns: share_dataset_specific_opts