def num_fromto_generator(start, end, term):
    """A range function yields pair chunks.

    It had made for time-formatting query.
    It yields a tuple of (start, start+(term-1)) pair, until start > end.

    Parameters
    ----------
    *args: int
        end or start, end[, term]
        It works like range function.

    Yields
    -------
    tuple
        A tuple of (start, start+(term-1)) pair, until start > end.

    See Also
    --------
    ``yield``

    Examples
    --------
    >>> from unipy.utils.generator import num_fromto_generator
    >>>
    >>> query = 'BETWEEN {pre} AND {nxt};'
    >>>
    >>> q_list = [query.format(pre=item[0], nxt=item[1])
    ...           for item in num_fromto_generator(1, 100, 10)]
    >>> print(q_list[0])
    BETWEEN 1 AND 10;
    >>> print(q_list[1])
    BETWEEN 11 AND 20;

    """
    pre, nxt = start, start + term - 1
    yield pre, nxt
    while nxt < end:
        pre, nxt = nxt, nxt + term
        yield pre + 1, nxt
