def extract(self, stims): stims = listify(stims) results = flatten(self.collect(stims)) return merge_results(results) if self.merge else results
def collect(self, stim): if hasattr(self, "transformer") and self.transformer is not None: if isinstance(self.transformer, Extractor): return listify(self.transformer.transform(stim)) stim = self.transformer.transform(stim) return list(chain(*[c.collect(stim) for c in self.children]))