code: def split_by_num(
      schema_num, task, converter, rand1, rand2, schema1, schema2=""
  ):
      if schema_num <= 0:
          if task == "EE":
              sinstruct, _ = converter.convert(
                  [], rand1, rand2, s_schema1=schema1
              )
          elif task == "EEA":
              sinstruct, _ = converter.convert(
                  [], rand1, rand2, s_schema1=schema1, s_schema2=schema2
              )
          elif task == "EET":
              sinstruct, _ = converter.convert(
                  [], rand1, rand2, s_schema1=schema1
              )
          elif task == "RE":
              sinstruct, _ = converter.convert(
                  [], rand1, rand2, s_schema1=schema1
              )
          elif task == "NER":
              sinstruct, _ = converter.convert(
                  [], rand1, rand2, s_schema1=schema1
              )
          else:
              raise KeyError
          sinstruct = [
              sinstruct,
          ]
      else:
          sinstruct = []
          if task == "EE" or task == "EEA":
              schema_key = list(schema1.keys())
              for i in range(0, len(schema1), schema_num):
                  tmp_schema = {}
                  tmp_key = schema_key[i : i + schema_num]
                  for key in tmp_key:
                      tmp_schema[key] = schema1[key]
                  sin, _ = converter.convert(
                      [], rand1, rand2, s_schema1=tmp_schema
                  )
                  sinstruct.append(sin)
          else:
              for i in range(0, len(schema1), schema_num):
                  tmp_schema = schema1[i : i + schema_num]
                  sin, _ = converter.convert(
                      [], rand1, rand2, s_schema1=tmp_schema
                  )
                  sinstruct.append(sin)
      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 1 for calling a global function with example usage: split_by_num(schema_num, task, converter, rand1, rand2, schema1, schema2) and returns: sinstruct