Ejemplo n.º 1
0
 def extract(self, stims):
     stims = listify(stims)
     results = flatten(self.collect(stims))
     return merge_results(results) if self.merge else results
Ejemplo n.º 2
0
 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]))