from typing import Iterable
from typing import Any
from typing import Iterator
import itertools


def finite_cycle(times: int, iterable: Iterable[Any]) -> Iterator[Any]:
    """Return iterator cycling through a given iterable finitely-many times.

    The passed iterable is assumed to be finite.

    Arguments:
        times: integral number of times to repeat the iterable
        iterable: finite iterable to be repeated

    Returns:
        iterator repeating the passed iterable the specified number of times

    Examples:

    >>> pattern = 'hee haw'.split()
    >>> list(finite_cycle(3, pattern))
    ['hee', 'haw', 'hee', 'haw', 'hee', 'haw']

    """
    repeated = itertools.repeat(tuple(iterable), times)
    return itertools.chain.from_iterable(repeated)