def _non_dominated_front_fast(iterable, key=lambda x: x, allowequality=True):
    """Return a subset of items from iterable which are not dominated by any
    other item in iterable.

    Faster version.
    """
    items = list(iterable)
    keys = dict((i, key(i)) for i in items)
    dim = len(list(keys.values())[0])
    dominations = {}
    for i in items:
        for j in items:
            good = True
            if allowequality:
                for k in range(dim):
                    if keys[j][k] >= keys[i][k]:
                        good = False
                        break
            else:
                for k in range(dim):
                    if keys[i][k] > keys[j][k]:
                        good = False
                        break
            if good:
                dominations[(i, j)] = None
    res = set()
    items = set(items)
    for i in items:
        res.add(i)
        for j in list(res):
            if i is j:
                continue
            if (j, i) in dominations:
                res.remove(i)
                break
            elif (i, j) in dominations:
                res.remove(j)
    return res
dataset/ETHPy150Open pybrain/pybrain/pybrain/tools/nondominated.py/_non_dominated_front_fast/swapped operands of `>=`