import itertools


def limit(entities, count=0, index=0):
    """
    Make a slice of a list of entities based on a count and index.
    """

    return itertools.islice(entities, index, index + count)