code: def n_wise(x: List[Any], size: int = 2) -> Iterable:
      """Iterates over an iterator and returns n-wise samples from it.
  
      Args:
          x (list): Values to be iterated over.
          size: Amount of samples per iteration.
  
      Returns:
          (Iterable): N-wise samples from the iterator.
  
      """
  
      iterator = iter(x)
  
      return iter(lambda: tuple(islice(iterator, size)), ())
  
file_path: opytimizer/opytimizer/math/general.py
imports: from itertools import islice
  from typing import Any, Iterable, List, Optional
  import numpy
  import opytimizer.math.random
label_desc: Use image node_id 3 for calling a global function with example usage: n_wise(x, size) and returns: iter