code: def __corrupt_tail(self, h, r, num_max=1):
      tmp = torch.randint(
          low=0, high=self.ent_total, size=(num_max,)
      ).numpy()
      if not self.filter_flag:
          return tmp
      mask = np.in1d(
          tmp, self.t_of_hr[(h, r)], assume_unique=True, invert=True
      )
      neg = tmp[mask]
      return neg
  
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 7 for calling the PyTorchTrainDataset obj's underlying member method code with example usage: obj.__corrupt_tail(h, r, num_max) and returns: neg, tmp