ef0e833dc06eee63f0baf4bcaf1a27e47ad5f1c3,pliers/extractors/microsoft.py,MicrosoftAPIFaceExtractor,_parse_response_json,#MicrosoftAPIFaceExtractor#Any#,57

Before Change


        return ExtractorResult(None, stim, self, raw=raw)

    def _parse_response_json(self, json):
        keys = []
        values = []
        for k, v in json.items():
            if k == "faceAttributes":
                k = "face"
            if isinstance(v, dict):
                subkeys, subvalues = self._parse_response_json(v)
                keys.extend(["%s_%s" % (k, s) for s in subkeys])
                values.extend(subvalues)
            elif isinstance(v, list):
                // Hard coded to this extractor
                for attr in v:
                    if k == "hairColor":
                        keys.append("%s" % attr["color"])
                    elif k == "accessories":
                        keys.append("%s_%s" % (k, attr["type"]))
                    else:
                        continue
                    values.append(attr["confidence"])
            else:
                keys.append(k)
                values.append(v)
        return keys, values

    def _to_df(self, result):

After Change


                k = "face"
            if isinstance(v, dict):
                subdata = self._parse_response_json(v)
                for sk, sv in subdata.items():
                    data_dict["%s_%s" % (k, sk)] = sv
            elif isinstance(v, list):
                // Hard coded to this extractor
                for attr in v:
                    if k == "hairColor":
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: tyarkoni/pliers
Commit Name: ef0e833dc06eee63f0baf4bcaf1a27e47ad5f1c3
Time: 2018-02-09
Author: quinten.mcnamara@gmail.com
File Name: pliers/extractors/microsoft.py
Class Name: MicrosoftAPIFaceExtractor
Method Name: _parse_response_json


Project Name: tyarkoni/pliers
Commit Name: ef0e833dc06eee63f0baf4bcaf1a27e47ad5f1c3
Time: 2018-02-09
Author: quinten.mcnamara@gmail.com
File Name: pliers/extractors/microsoft.py
Class Name: MicrosoftAPIFaceExtractor
Method Name: _parse_response_json


Project Name: scikit-multiflow/scikit-multiflow
Commit Name: 7301f860743d7b45cd1d885094bf753629b535e8
Time: 2018-06-14
Author: jacob.montiel@gmail.com
File Name: src/skmultiflow/classification/trees/hoeffding_tree.py
Class Name: HoeffdingTree
Method Name: predict_proba


Project Name: scikit-multiflow/scikit-multiflow
Commit Name: 0685dcd247e1c9b696c0d865f0851f68d1f7b66c
Time: 2018-06-18
Author: jacob.montiel@gmail.com
File Name: src/skmultiflow/classification/trees/hoeffding_tree.py
Class Name: HoeffdingTree
Method Name: predict_proba