code: def batch_elements(elements: List[Any], batch_size: int):
      """Combine elements into batches.
  
      Parameters
      ----------
      elements: List[Any]
          List of Elements to be combined into batches.
      batch_size: int
          Batch size in which to divide.
  
      Returns
      -------
      batch: List[Any]
          List of Lists of elements divided into batches.
  
      Examples
      --------
      >>> import deepchem as dc
      >>> # Prepare Data
      >>> inputs = [[i, i**2, i**3] for i in range(10)]
      >>> # Run
      >>> output = list(dc.utils.batch_utils.batch_elements(inputs, 3))
      >>> len(output)
      4
  
      """
      batch = []
      for s in elements:
          batch.append(s)
          if len(batch) == batch_size:
              yield batch
              batch = []
      if len(batch) > 0:
          yield batch
  
imports: import numpy
  from typing import Any, Dict, Collection, List
label_desc: Use image node_id 2 for calling a global function with example usage: batch_elements(elements, batch_size) without return types