code: def __init__(self, type_list, role_list, type_role_dict, negative=3):
      self.type_list = set(type_list)
      self.role_list = set(role_list)
      self.type_role_dict = defaultdict(set)
      for key, value in type_role_dict.items():
          self.type_role_dict[key] = set(value)
      self.negative = negative
  
file_path: DeepKE/example/llm/InstructKGC/kg2instruction/convert/sampler.py
imports: import json
  import os
  from collections import defaultdict
  import random
label_desc: Use image node_id 1 to create a new Sampler object  with example: obj = Sampler(type_list, role_list, type_role_dict, negative)