def _sharedSampling(self, numSelect, selectFrom, relativeTo):
        """ Build a shared sampling set of opponents """
        if numSelect < 1:
            return []
        # determine the player of selectFrom with the most wins against players from relativeTo (and which ones)
        tmp = {}
        for p in selectFrom:
            beaten = []
            for opp in relativeTo:
                if self._beats(p, opp) > 0:
                    beaten.append(opp)
            tmp[p] = beaten
        beatlist = [(len(p_beaten[1]), self._globalScore(p_beaten[0]), p_beaten[0]) for p_beaten in list(tmp.items())]
        shuffle(beatlist)
        beatlist.sort(key=lambda x: x[:2])
        best = beatlist[-1][2]
        unBeaten = list(set(relativeTo).difference(tmp[best]))
        otherSelect = selectFrom[:]
        otherSelect.remove(best)
        return [best] + self._sharedSampling(1 - numSelect, otherSelect, unBeaten)
dataset/ETHPy150Open pybrain/pybrain/pybrain/optimization/populationbased/coevolution/coevolution.py/Coevolution._sharedSampling/swapped operands of `-`