def __iter__(self):

        # First read in some examples to get a range of values to print
        examples_read = 0
        stats_buffer = defaultdict(list)
        for feat, label in zip(open(self._input_file),
                               open(self._label_file)):
            examples_read += 1
            for ii in [x for x in feat.split() if ":" in x]:
                feature, val = ii.split(":")
                val = float(val)
                stats_buffer[feature].append(val)

            if examples_read > self._stat_buffer and \
                    all(self._stat_buffer > len(stats_buffer[x])
                        for x in stats_buffer):
                break

        print(list(list(set(stats_buffer[x]))[:10] for x in stats_buffer))

        highs = {}
        lows = {}
        for ii in stats_buffer:
            lows[ii] = percentile(stats_buffer[ii], self._low_percentile)
            highs[ii] = percentile(stats_buffer[ii], self._high_percentile)

        print(lows)
        print(highs)

        # Now actually output
        for feat, label in zip(open(self._input_file),
                               open(self._label_file)):
            fields = label.split()
            d = {}
            d["correct"] = "correct" if int(fields[0]) > 0 else "wrong"
            d["sent"] = float([x.split(":")[1] for x in fields
                               if x.startswith("sent:")][0])

            if d["sent"] > self._sent_limit:
                continue

            guess_index = fields.index("|guess") + 1
            d["guess"] = fields[guess_index]
            d["feature"] = self._name

            for ii in [x for x in feat.split() if ":" in x]:
                feature, val = ii.split(":")
                val = float(val)
                d["name"] = feature
                d["value"] = val

                if val > lows[feature] and val < highs[feature]:
                    yield d
dataset/ETHPy150Open Pinafore/qb/util/inspect_features.py/VwContReader.__iter__/swapped operands of `>`