docs: def ichunks(iterable, chunksize, bordermode=None):
      r"""
      generates successive n-sized chunks from ``iterable``.
  
      Args:
          iterable (list): input to iterate over
          chunksize (int): size of sublist to return
          bordermode (str): None, 'cycle', or 'replicate'
  
      References:
          http://stackoverflow.com/questions/434287/iterate-over-a-list-in-chunks
  
      SeeAlso:
          util_progress.get_num_chunks
  
      CommandLine:
          python -m utool.util_iter --exec-ichunks --show
  
      Timeit:
          >>> import utool as ut
          >>> setup = ut.codeblock('''
                  from utool.util_iter import *  # NOQA
                  iterable = list(range(100))
                  chunksize = 8
                  ''')
          >>> stmt_list = [
          ...     'list(ichunks(iterable, chunksize))',
          ...     'list(ichunks_noborder(iterable, chunksize))',
          ...     'list(ichunks_list(iterable, chunksize))',
          ... ]
          >>> (passed, times, results) = ut.timeit_compare(stmt_list, setup)
  
      Example:
          >>> # ENABLE_DOCTEST
          >>> from utool.util_iter import *  # NOQA
          >>> iterable = [1, 2, 3, 4, 5, 6, 7]
          >>> chunksize = 3
          >>> genresult = ichunks(iterable, chunksize)
          >>> result = list(genresult)
          >>> print(result)
          [[1, 2, 3], [4, 5, 6], [7]]
  
      Example:
          >>> # ENABLE_DOCTEST
          >>> from utool.util_iter import *  # NOQA
          >>> iterable = (1, 2, 3, 4, 5, 6, 7)
          >>> chunksize = 3
          >>> bordermode = 'cycle'
          >>> genresult = ichunks(iterable, chunksize, bordermode)
          >>> result = list(genresult)
          >>> print(result)
          [[1, 2, 3], [4, 5, 6], [7, 1, 2]]
  
      Example:
          >>> # ENABLE_DOCTEST
          >>> from utool.util_iter import *  # NOQA
          >>> iterable = (1, 2, 3, 4, 5, 6, 7)
          >>> chunksize = 3
          >>> bordermode = 'replicate'
          >>> genresult = ichunks(iterable, chunksize, bordermode)
          >>> result = list(genresult)
          >>> print(result)
          [[1, 2, 3], [4, 5, 6], [7, 7, 7]]
      """
      if bordermode is None:
          return ichunks_noborder(iterable, chunksize)
      elif bordermode == 'cycle':
          return ichunks_cycle(iterable, chunksize)
      elif bordermode == 'replicate':
          return ichunks_replicate(iterable, chunksize)
      else:
          raise ValueError('unknown bordermode=%r' % (bordermode,))