code: def batch_line_generator(fname, batch_size):
      """Returns generator for jsonl file with batched lines"""
      res = []
      batch_id = 0
      for line in open(fname, "r"):
          line = line.strip()
          if len(line) < 3:
              d = ""
          elif line[len(line) - 1] == ",":
              d = line[: len(line) - 1]
          else:
              d = line
          res.append(d)
          if len(res) >= batch_size:
              yield batch_id, res
              batch_id += 1
              res = []
      yield batch_id, res
  
file_path: H2O/h2o_hf/helm/scripts/fact_completion/utils.py
imports: import os
  import json
  from typing import Iterator, Dict, List
  import pandas
  from pathlib import Path
label_desc: Use image node_id 2 for calling a global function with example usage: batch_line_generator(fname, batch_size) without return types