def batch_iterable(iterable, count):
    """
    Yield batches of `count` items from the given iterable.

    >>> for x in batch([1, 2, 3, 4, 5, 6, 7], 3):
    >>>   print(x)
    [1, 2, 3]
    [4, 5, 6]
    [7]

    :param iterable: An iterable
    :type iterable: Iterable
    :param count: Number of items per batch. If <= 0, nothing is yielded.
    :type count: int
    :return: Iterable of lists of items
    :rtype: Iterable[list[object]]
    """
    if count <= 0:
        return
    current_batch = []
    for item in iterable:
        if len(current_batch) == count:
            yield current_batch
            current_batch = []
        current_batch.append(item)
    if current_batch:
        yield current_batch
Yield batches of `count` items from the given iterable.

    >>> for x in batch([1, 2, 3, 4, 5, 6, 7], 3):
    >>>   print(x)
    [1, 2, 3]
    [4, 5, 6]
    [7]

    :param iterable: An iterable
    :type iterable: Iterable
    :param count: Number of items per batch. If <= 0, nothing is yielded.
    :type count: int
    :return: Iterable of lists of items
    :rtype: Iterable[list[object]]