code: def __init__(
      self,
      in_path="./",
      tri_file=None,
      ent_file=None,
      rel_file=None,
      batch_size=None,
      nbatches=None,
      threads=8,
      sampling_mode="normal",
      bern_flag=False,
      filter_flag=True,
      neg_ent=1,
      neg_rel=0,
  ):
      base_file = os.path.abspath(
          os.path.join(os.path.dirname(__file__), "../release/Base.so")
      )
      self.lib = ctypes.cdll.LoadLibrary(base_file)
      """argtypes"""
      self.lib.sampling.argtypes = [
          ctypes.c_void_p,
          ctypes.c_void_p,
          ctypes.c_void_p,
          ctypes.c_void_p,
          ctypes.c_int64,
          ctypes.c_int64,
          ctypes.c_int64,
          ctypes.c_int64,
          ctypes.c_int64,
          ctypes.c_int64,
          ctypes.c_int64,
      ]
      self.in_path = in_path
      self.tri_file = tri_file
      self.ent_file = ent_file
      self.rel_file = rel_file
      if in_path != None:
          self.tri_file = in_path + "train2id.txt"
          self.ent_file = in_path + "entity2id.txt"
          self.rel_file = in_path + "relation2id.txt"
      """set essential parameters"""
      self.work_threads = threads
      self.nbatches = nbatches
      self.batch_size = batch_size
      self.bern = bern_flag
      self.filter = filter_flag
      self.negative_ent = neg_ent
      self.negative_rel = neg_rel
      self.sampling_mode = sampling_mode
      self.cross_sampling_flag = 0
      self.read()
  
imports: import os
  import ctypes
  import numpy
label_desc: Use image node_id 1 to create a new TrainDataLoader object from inherited base classes: object with example: obj = TrainDataLoader(in_path, tri_file, ent_file, rel_file, batch_size, nbatches, threads, sampling_mode, bern_flag, filter_flag, neg_ent, neg_rel)