def _chunks(itera, size):
    """Yield successive same-sized chunks from `itera`.

    Parameters
    ----------
    itera : iterable
        This is the iterable we will return chunks of.
    size : int
        The size of the chunks.

    Yields
    ------
    out : object like `itera`
        The successive same-sized chunks from `itera`-

    Notes
    -----
    We are here using `range` rather than `xrange`. This is just to ease
    the transition from python2 to python3. Note that this will probably
    lead to some inefficiencies for python2 execution. The code is based
    on one question at Stackoverflow [chunks]_.

    References
    ----------
    .. [chunks] Stackoverflow, "How do you split ...",
       http://stackoverflow.com/a/312464
    """
    for i in range(0, len(itera), size):
        yield itera[i:i + size]
