code: def batch_iterator(
      batch_size: int, *args
  ) -> Generator[List[Any], None, None]:
      assert len(args) > 0 and all(
          len(a) == len(args[0]) for a in args
      ), "Batched iteration must have inputs of all the same size."
      n_batches = len(args[0]) // batch_size + int(
          len(args[0]) % batch_size != 0
      )
      for b in range(n_batches):
          yield [
              arg[b * batch_size : (b + 1) * batch_size] for arg in args
          ]
  
imports: import numpy
  import paddle
  import math
  from copy import deepcopy
  from itertools import product
  from typing import Any, Dict, Generator, ItemsView, List, Tuple
label_desc: Use image node_id 3 for calling a global function with example usage: batch_iterator(batch_size) without return types