def __iter__(self):
        """
        Create a DenseDesignMatrix for each dataset subset and apply any
        preprocessing to the child datasets.
        """
        for data_subsets in self.get_data_subsets():
            datasets = {}
            for label, data in data_subsets.items():
                X, y = data
                datasets[label] = DenseDesignMatrix(X=X, y=y)

            # preprocessing
            if self.preprocessor is not None:
                self.preprocessor.apply(datasets['train'],
                                        can_fit=self.fit_preprocessor)
                for label, dataset in datasets.items():
                    if label == 'train':
                        continue
                    self.preprocessor.apply(dataset, can_fit=False)

            # which_set
            if self.which_set is not None:
                for label, dataset in list(datasets.items()):
                    if self.which_set not in label:
                        del datasets[label]
                        del data_subsets[label]
                if not len(datasets):
                    raise ValueError("No matching dataset(s) for " +
                                     "{}".format(self.which_set))

            if not self.return_dict:
                # data_subsets is an OrderedDict to maintain label order
                datasets = list(datasets[label]
                                for label in data_subsets.keys())
                if len(datasets) == 1:
                    datasets, = datasets
            yield datasets
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/cross_validation/dataset_iterators.py/DatasetCV.__iter__/swapped operands of `not in`