code: def _batched(iterable, n):
      """Batch data into lists of length *n*. The last batch may be shorter.
  
      >>> list(batched('ABCDEFG', 3))
      [('A', 'B', 'C'), ('D', 'E', 'F'), ('G',)]
  
      On Python 3.12 and above, this is an alias for :func:`itertools.batched`.
      """
      if n < 1:
          raise ValueError("n must be at least one")
      it = iter(iterable)
      while True:
          batch = tuple(islice(it, n))
          if not batch:
              break
          yield batch
  
imports: import math
  import operator
  from collections import deque
  from collections.abc import Sized
  from functools import partial, reduce
  from itertools import chain, combinations, compress, count, cycle, groupby, islice, product, repeat, starmap, tee, zip_longest
  from random import randrange, sample, choice
label_desc: Use image node_id 38 for calling a global function with example usage: _batched(iterable, n) without return types