class_docstr: This class inherits from the :class:`torch.utils.data.Dataset` class and in
  addition to each anchor sample, it returns a random positive and negative
  sample from the dataset. A positive sample has the same label as the
  anchor sample and a negative sample has a different label than the anchor
  sample.
  
  Args:
      dataset (:class:`torch.utils.data.Dataset`): The dataset for which the
          triple set will be created.
      transform (function, optional): A transformation that is applied on all
          original samples. In other words, this transformation is applied
          to the anchor, positive, and negative sample. Default is None.
docstr: For a given index, this sample returns the original/anchor sample from
  the dataset at that index and a corresponding positive, and negative
  sample.
  
  Args:
      index (int): The index of the anchor sample in the dataset.
  
  Returns:
      A tuple consisting of the anchor sample, a positive
      sample, and a negative sample respectively.
docstr_tok: ["For","a","given","index",",","this","sample","returns","the","original\/anchor","sample","from","the","dataset","at","that","index","and","a","corresponding","positive",",","and","negative","sample",".","Args",":","index","(","int",")",":","The","index","of","the","anchor","sample","in","the","dataset",".","Returns",":","A","tuple","consisting","of","the","anchor","sample",",","a","positive","sample",",","and","a","negative","sample","respectively","."]
code: def __getitem__(self, index):
      r"""
      For a given index, this sample returns the original/anchor sample from
      the dataset at that index and a corresponding positive, and negative
      sample.
  
      Args:
          index (int): The index of the anchor sample in the dataset.
  
      Returns:
          A tuple consisting of the anchor sample, a positive
          sample, and a negative sample respectively.
      """
      anchor_data = self.dataset[index]
      anchor_label = int(anchor_data.y.item())
  
      pos_index = random.sample(
          self.label_to_index_list[anchor_label], 1
      )[0]
      while pos_index == index:
          pos_index = random.sample(
              self.label_to_index_list[anchor_label], 1
          )[0]
  
      neg_label = random.sample(self.label_to_index_list.keys(), 1)[0]
      while neg_label == anchor_label:
          neg_label = random.sample(self.label_to_index_list.keys(), 1)[
              0
          ]
      neg_index = random.sample(self.label_to_index_list[neg_label], 1)[
          0
      ]
  
      pos_data, neg_data = (
          self.dataset[pos_index],
          self.dataset[neg_index],
      )
  
      if self.transform is not None:
          anchor_data, pos_data, neg_data = (
              self.transform(anchor_data),
              self.transform(pos_data),
              self.transform(neg_data),
          )
  
      return anchor_data, pos_data, neg_data
  
imports: import random
  import torch
  import torch.nn.functional
  from torch.utils.data import Dataset
  from torch_geometric.utils import degree
label_desc: Use image node_id 3 for calling the TripleSet obj's underlying member method code with example usage: obj.__getitem__(index) and returns: anchor_data,  pos_data,  neg_data