code: def train_iter(data_set, batch_size, tokenizer, label2id):
      i = 0
  
      while i < len(data_set):
          batch = data_set[i : i + batch_size]
          i += batch_size
          input_ids = []
          label_ids = []
  
          for x in batch:
              token_ids, label_id = map_sample(x, tokenizer, label2id)
              input_ids.append(token_ids)
              label_ids.append(label_id)
  
          yield np.array(input_ids), np.array(label_ids)
  
file_path: textflint/textflint/input/model/test_model/model_helper.py
imports: import os
  import json
  import csv
  import random
  import numpy
  import torch
label_desc: Use image node_id 4 for calling a global function with example usage: train_iter(data_set, batch_size, tokenizer, label2id) without return types