<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def limit_inference(iterator, size):
 """Limit inference amount. Limit inference amount to help with performance issues with exponentially exploding possible results. :param iterator: Inference generator to limit :type iterator: Iterator(NodeNG) :param size: Maximum mount of nodes yielded plus an Uninferable at the end if limit reached :type size: int :yields: A possibly modified generator :rtype param: Iterable """

    yield from islice(iterator, size)
    has_more = next(iterator, False)
    if has_more is not False:
        yield Uninferable
        return