code: def helper_with_default(
      klass,
      folder,
      shots,
      ways,
      shuffle=True,
      test_shots=None,
      seed=None,
      defaults={},
      **kwargs,
  ):
      if "num_classes_per_task" in kwargs:
          warnings.warn(
              "Both arguments `ways` and `num_classes_per_task` were "
              "set in the helper function for the number of classes per task. "
              "Ignoring the argument `ways`.",
              stacklevel=2,
          )
          ways = kwargs["num_classes_per_task"]
      if "transform" not in kwargs:
          kwargs["transform"] = defaults.get("transform", ToTensor())
      if "target_transform" not in kwargs:
          kwargs["target_transform"] = defaults.get(
              "target_transform", Categorical(ways)
          )
      if "class_augmentations" not in kwargs:
          kwargs["class_augmentations"] = defaults.get(
              "class_augmentations", None
          )
      if test_shots is None:
          test_shots = shots
      dataset = klass(folder, num_classes_per_task=ways, **kwargs)
      dataset = ClassSplitter(
          dataset,
          shuffle=shuffle,
          num_train_per_class=shots,
          num_test_per_class=test_shots,
      )
      dataset.seed(seed)
  
      return dataset
  
file_path: pytorch-meta/torchmeta/datasets/helpers.py
imports: import warnings
  from torchmeta.datasets import Omniglot, MiniImagenet, TieredImagenet, CIFARFS, FC100, CUB, DoubleMNIST, TripleMNIST, Pascal5i
  from torchmeta.transforms import Categorical, ClassSplitter, Rotation, SegmentationPairTransform
  from torchvision.transforms import Compose, Resize, CenterCrop, ToTensor
label_desc: Use image node_id 1 for calling a global function with example usage: helper_with_default(klass, folder, shots, ways, shuffle, test_shots, seed, defaults) and returns: dataset