code: def test_split_into_batches():
      data = []
      for i in range(5):
          data.append(["Unban", "mox", "opal", str(i)])
  
      data.append(
          [
              "Do",
              "n't",
              "ban",
              "Urza",
              "'s",
              "Saga",
              "that",
              "card",
              "is",
              "great",
          ]
      )
      data.append(["Ban", "Ragavan"])
  
      # small batches will put one element in each interval
      batches = utils.split_into_batches(data, 5)
      assert batches == [
          (0, 1),
          (1, 2),
          (2, 3),
          (3, 4),
          (4, 5),
          (5, 6),
          (6, 7),
      ]
  
      # this one has a batch interrupted in the middle by a large element
      batches = utils.split_into_batches(data, 8)
      assert batches == [(0, 2), (2, 4), (4, 5), (5, 6), (6, 7)]
  
      # this one has the large element at the start of its own batch
      batches = utils.split_into_batches(data[1:], 8)
      assert batches == [(0, 2), (2, 4), (4, 5), (5, 6)]
  
      # overloading the test!  assert that the key & reverse is working
      ordered, orig_idx = utils.sort_with_indices(
          data, key=len, reverse=True
      )
      assert [len(x) for x in ordered] == [10, 4, 4, 4, 4, 4, 2]
  
      # this has the large element at the start
      batches = utils.split_into_batches(ordered, 8)
      assert batches == [(0, 1), (1, 3), (3, 5), (5, 7)]
  
      # double check that unsort is working as expected
      assert data == utils.unsort(ordered, orig_idx)
  
file_path: stanza/stanza/tests/common/test_utils.py
imports: import lzma
  import os
  import tempfile
  import pytest
  import stanza
  import stanza.models.common.utils
  from stanza.tests import *
label_desc: Use image node_id 7 for calling a global function with example usage: test_split_into_batches() without return types