9f67a534bce1063693d7716df11311e7584b6786,libraries/python/classification_compare.py,OutputCompare,getData,#OutputCompare#Any#,47

Before Change


    def getData(self, filename):
        with open(filename, "r") as f:
            content = f.read()
            batches = content.strip().split("\n")
        data = [[float(item) for item in batch.strip().split(",")]
                for batch in batches]
        return data

After Change


            line = f.readline().strip()
            dims_list = [int(dim.strip()) for dim in line.split(",")]
            line = f.readline().strip()
            content_list = [float(entry.strip()) for entry in line.split(",")]
        dims = np.asarray(dims_list)
        content = np.asarray(content_list)
        data = np.reshape(content, dims)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: facebook/FAI-PEP
Commit Name: 9f67a534bce1063693d7716df11311e7584b6786
Time: 2018-12-11
Author: feisun@fb.com
File Name: libraries/python/classification_compare.py
Class Name: OutputCompare
Method Name: getData


Project Name: matplotlib/matplotlib
Commit Name: 0b92b4f5530fee68432f13075a1ddc866748f9d1
Time: 2020-11-20
Author: anntzer.lee@gmail.com
File Name: examples/showcase/firefox.py
Class Name:
Method Name: svg_parse


Project Name: interactiveaudiolab/nussl
Commit Name: 441a175deaa5812c086cdb8a3939d51d39f5a7ae
Time: 2020-01-26
Author: prem@u.northwestern.edu
File Name: nussl/deep/train/trainer.py
Class Name: Trainer
Method Name: setup_loss