ebb357210205d3ad5fef77e8d33904625fb02a24,loudml/loudml/fingerprints.py,FingerprintsModel,show,#FingerprintsModel#Any#,684

Before Change


        if show_summary == True:
            return "\n".join(["".join(["{:3}".format(cnt) for cnt in row]) for row in counts])

        grid = []
        for x in range(self.h):
            for y in range(self.w):
                cnt = counts[x,y]
                grid.append({
                    "location": (x, y),
                    "count": cnt,
                    "_fingerprint": centroids[som_model.location(x,y)].tolist(),
                })

        result["grid"] = grid
        return result

    def generate_fake_prediction(self):

After Change


            "fingerprints": fingerprints
        }
        counts = np.zeros(shape=(self.h, self.w), dtype=int)
        locations = {}
        for fingerprint in fingerprints:
            x, y = fingerprint["location"]
            counts[x,y] += 1
            l = locations.get((x,y)) or []
            l.append(fingerprint["key"])
            locations[x,y] = l

        if show_summary == True:
            l = [ [x, y, locs] for (x, y), locs in locations.items() ]
            detail = "\n".join("{},{}: {}".format(x, y, loc) for x, y, loc in sorted(l, key = operator.itemgetter(0, 1)))
            grid = "\n".join(["".join(["{:3}".format(cnt) for cnt in row]) for row in counts])
            return grid + "\n" + detail

        return result
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: regel/loudml
Commit Name: ebb357210205d3ad5fef77e8d33904625fb02a24
Time: 2019-02-10
Author: sebastien.regel@gmail.com
File Name: loudml/loudml/fingerprints.py
Class Name: FingerprintsModel
Method Name: show


Project Name: matplotlib/matplotlib
Commit Name: de813972dc709e3d10cb2dcef61489af3de7b806
Time: 2018-02-06
Author: anntzer.lee@gmail.com
File Name: doc/sphinxext/math_symbol_table.py
Class Name:
Method Name: run


Project Name: biolab/orange3
Commit Name: 67ae053940975c9de0df4fdb79c4d8a0e0d5de0e
Time: 2014-07-28
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/widgets/visualize/owscatterplotgraph.py
Class Name: OWScatterPlotGraphQt
Method Name: mouseMoved