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


        with open(filename, "r") as f:
            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: 4

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: chartbeat-labs/textacy
Commit Name: f23541796338735f8cc0ff6aa1f99e2cc87095c5
Time: 2018-01-01
Author: burton@chartbeat.com
File Name: textacy/io/csv.py
Class Name:
Method Name: read_csv


Project Name: geekcomputers/Python
Commit Name: 791e09b24641b6d372ba08c59b6b801440c767b2
Time: 2019-08-14
Author: 35282147+Hong199@users.noreply.github.com
File Name: fileinfo.py
Class Name:
Method Name: