code: def convert_ie(
      sample: int,
      task: str,
      schema_num: int,
      neg_sampler,
      converter,
  ):
      if sample == -1:  # 从4种指令和4种输出格式(共16种)中随机采样其中一种
          rand1 = random.randint(0, 19)
          rand2 = random.randint(0, 3)
      else:  # 使用sample指定的指令和数据格式
          rand1 = sample
          rand2 = sample
      if task == "EE":
          sinstruct = split_by_num(
              schema_num,
              task,
              converter,
              rand1,
              rand2,
              neg_sampler.type_role_dict,
          )
      elif task == "EEA":
          sinstruct = split_by_num(
              schema_num,
              task,
              converter,
              rand1,
              rand2,
              neg_sampler.type_role_dict,
              "",
          )
      elif task == "EET":
          sinstruct = split_by_num(
              schema_num,
              task,
              converter,
              rand1,
              rand2,
              list(neg_sampler.type_list),
          )
      elif task == "RE":
          sinstruct = split_by_num(
              schema_num,
              task,
              converter,
              rand1,
              rand2,
              list(neg_sampler.role_list),
          )
      elif task == "NER":
          sinstruct = split_by_num(
              schema_num,
              task,
              converter,
              rand1,
              rand2,
              list(neg_sampler.type_list),
          )
      else:
          raise KeyError
      return sinstruct
  
file_path: DeepKE/example/llm/InstructKGC/kg2instruction/convert_test.py
imports: import sys
  import argparse
  import json
  import os
  import random
  from typing import Dict
  from convert.sampler import Sampler
  from convert.converter import NERConverter, REConverter, EEAConverter, EETConverter, EEConverter
  from utils import stable_hash
label_desc: Use image node_id 2 for calling a global function with example usage: convert_ie(sample, task, schema_num, neg_sampler, converter) and returns: sinstruct