de6d474bd667cc040856792cce62148691fbabda,pliers/extractors/api.py,ClarifaiAPIExtractor,_extract,#ClarifaiAPIExtractor#Any#,163

Before Change



    def _extract(self, stim):
        with stim.get_filename() as filename:
            with open(filename, "rb") as f:
                tags = self.tagger.tag_images(f, select_classes=self.select_classes)

        tagged = tags["results"][0]["result"]["tag"]
        return ExtractorResult([tagged["probs"]], stim, self,
                               features=tagged["classes"])

After Change


            self.select_classes = ",".join(select_classes)

    def _extract(self, stim):
        stims = listify(stim)

        with ExitStack() as stack:
            files = [stack.enter_context(s.get_filename()) for s in stims]
            fps = [stack.enter_context(open(f, "rb")) for f in files]
            tags = self.tagger.tag_images(fps, select_classes=self.select_classes)

        extracted = []
        for i, res in enumerate(tags["results"]):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: tyarkoni/pliers
Commit Name: de6d474bd667cc040856792cce62148691fbabda
Time: 2017-05-08
Author: quinten.mcnamara@gmail.com
File Name: pliers/extractors/api.py
Class Name: ClarifaiAPIExtractor
Method Name: _extract


Project Name: markovmodel/PyEMMA
Commit Name: 83afa41b90bf670e905ff44f013665242c350f51
Time: 2017-08-28
Author: m.scherer@fu-berlin.de
File Name: pyemma/_base/estimator.py
Class Name:
Method Name: estimate_param_scan


Project Name: tensorflow/datasets
Commit Name: 1e84cededb34347e5fd3a169b824020606f36d6c
Time: 2019-01-28
Author: epot@google.com
File Name: tensorflow_datasets/core/dataset_utils.py
Class Name:
Method Name: dataset_as_numpy