code: def __init__(
      self,
      head,
      tail,
      rel,
      ent_total,
      rel_total,
      sampling_mode="normal",
      bern_flag=False,
      filter_flag=True,
      neg_ent=1,
      neg_rel=0,
  ):
      # triples
      self.head = head
      self.tail = tail
      self.rel = rel
      # total numbers of entities, relations, and triples
      self.rel_total = rel_total
      self.ent_total = ent_total
      self.tri_total = len(head)
      # the sampling mode
      self.sampling_mode = sampling_mode
      # the number of negative examples
      self.neg_ent = neg_ent
      self.neg_rel = neg_rel
      self.bern_flag = bern_flag
      self.filter_flag = filter_flag
      if self.sampling_mode == "normal":
          self.cross_sampling_flag = None
      else:
          self.cross_sampling_flag = 0
      self.__count_htr()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import random
  import numpy
  import torch
  from torch.utils.data import Dataset, DataLoader
label_desc: Use image node_id 1 to create a new PyTorchTrainDataset object from inherited base classes: Dataset with example: obj = PyTorchTrainDataset(head, tail, rel, ent_total, rel_total, sampling_mode, bern_flag, filter_flag, neg_ent, neg_rel)