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']]
  
      This recipe is from the ``itertools`` docs. This library also provides
      :func:`chunked`, which has a different implementation.
      """
      if hexversion >= 0x30C00A0:  # Python 3.12.0a0
          warnings.warn(
              (
                  "batched will be removed in a future version of "
                  "more-itertools. Use the standard library "
                  "itertools.batched function instead"
              ),
              DeprecationWarning,
          )
  
      it = iter(iterable)
      while True:
          batch = list(islice(it, n))
          if not batch:
              break
          yield batch
  
imports: import math
  import operator
  import warnings
  from collections import deque
  from collections.abc import Sized
  from functools import reduce
  from itertools import chain, combinations, compress, count, cycle, groupby, islice, product, repeat, starmap, tee, zip_longest
  from random import randrange, sample, choice
  from sys import hexversion
label_desc: Use image node_id 38 for calling a global function with example usage: batched(iterable, n) without return types