def run(self, input, generator):
        complexities = {}

        # an iterator over all valid programs, by increasing complexity, and in
        # lexicographical order, together with its code's complexity.
        piter = generator.orderedEnumeration()

        maxLevin = 1
        # every phase goes through all programs of a certain Levin-complexity.
        while True:

            # generate all programs that might be needed in this phase.
            c = 0
            while c <= maxLevin:
                try:
                    c, p = next(piter)
                except StopIteration:
                    break
                if complexities not in c:
                    complexities[c] = [p]
                else:
                    complexities[c].append(p)

            # execute all programs, but with a set time-limit:
            # every phase the total time used doubles (= 2**maxLevin)
            for c in range(maxLevin):
                for p in complexities[c]:
                    boundP = timeBoundExecution(p, 2**(maxLevin-c)/maxLevin)
                    res = boundP.run(input)
                    if self.stoppingCriterion(res):
                        return res

            maxLevin += 1
dataset/ETHPy150Open pybrain/pybrain/pybrain/rl/learners/meta/levinsearch.py/LevinSeach.run/swapped operands of `not in`