human
Complete this python program:
def _iterModels(modelIDs):
assistant
#Here is the Python code you requested.

    """Creates an iterator that returns ModelInfo elements for the given modelIDs
    WARNING:      The order of ModelInfo elements returned by the iterator
    may not match the order of the given modelIDs
    Parameters:
    modelIDs:       A sequence of model identifiers (e.g., as returned by
    _HyperSearchJob.queryModelIDs()).
    retval:         Iterator that returns ModelInfo elements for the given
    modelIDs (NOTE:possibly in a different order)
    """
    class ModelInfoIterator(object, ):
        'ModelInfo    iterator    implementation    class\n                '
        __CACHE_LIMIT = 1000
        debug = False
        def __init__(self, modelIDs):
            '\n                        Parameters:\n                        ----------------------------------------------------------------------\n                        modelIDs:                    a    sequence    of    Nupic    model    identifiers    for    which    this\n                                                                                iterator    will    return    _NupicModelInfo    instances.\n                                                                                NOTE:    The    returned    instances    are    NOT    guaranteed    to    be    in\n                                                                                the    same    order    as    the    IDs    in    modelIDs    sequence.\n                        retval:                            nothing\n                        '
            self.__modelIDs = tuple(modelIDs)
            if self.debug:
                _emit(Verbosity.DEBUG, ('MODELITERATOR:    __init__;    numModelIDs=%s' % len(self.__modelIDs)))
            self.__nextIndex = 0
            self.__modelCache = collections.deque()
            return
        def __iter__(self):
            'Iterator    Protocol    function\n\n                        Parameters:\n                        ----------------------------------------------------------------------\n                        retval:                                    self\n                        '
            return self
        def next(self):
            'Iterator    Protocol    function\n\n                        Parameters:\n                        ----------------------------------------------------------------------\n                        retval:                            A    _NupicModelInfo    instance    or    raises    StopIteration    to\n                                              ...