code: def get_class_subset(dataset, class_ids):
      """
      Args:
          dataset: a torch.utils.data.Dataset
          class_ids (list, optional): List of chosen subset of class ids.
      Returns: a torch.utils.data.Dataset
          Dataset: a torch.utils.data.Dataset with only classes in class_ids
      """
      sub_indices = [
          i
          for i in range(0, len(dataset))
          if dataset[i][1] in class_ids
      ]
      return torch.utils.data.Subset(dataset, sub_indices)
  
file_path: pykale/kale/loaddata/dataset_access.py
imports: import torch
  import torch.utils.data
label_desc: Use image node_id 1 for calling a global function with example usage: get_class_subset(dataset, class_ids) and returns: torch