from typing import Iterable
from typing import Tuple
from typing import Any


def head_tail(iterable: Iterable) -> Tuple[Any, Iterable]:
    """
    Split the ``iterable`` into the first and the rest of the elements.

    Examples
    --------
    >>> head, tail = head_tail(map(np.square, [1, 2, 3]))
    >>> head, list(tail)
    1, [4, 9]
    """
    iterable = iter(iterable)
    return next(iterable), iterable