baecce5a6fbe4576ca8348a93dc56f07e7ba84f6,niftynet/contrib/csv_reader/csv_reader.py,CSVReader,_parse_csv,#CSVReader#Any#Any#,72

Before Change


                "The first column of the csv should be called "subject_id" and there should be at least 2 columns"
            )
        df.index = df["subject_id"]
        assert set(df.index) == set(self.subject_ids)
        df = df.loc[self.subject_ids]
        if to_ohe and len(df.columns[1:])==1:
            _dims = len(list(df[df.columns[1]].unique()))
            _indexable_output = self.to_ohe(df["label"].values, _dims)

After Change


            _dims = len(list(df[1].unique()))
            _indexable_output = self.to_ohe(df[1].values, _dims)
            return df, _indexable_output, _dims
        elif not to_ohe and len(df.columns==1):
            _dims = 1
            _indexable_output = self.to_categorical(df[1].values, df[1].unique())
            return df, _indexable_output, _dims
        elif not to_ohe:
            _dims = len(df.columns)
            _indexable_output = list(df.values)
            return df, _indexable_output, _dims
        else:
            tf.logging.fatal("Unrecognised input format for {}".format(path_to_csv))

    @staticmethod
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: NifTK/NiftyNet
Commit Name: baecce5a6fbe4576ca8348a93dc56f07e7ba84f6
Time: 2019-06-05
Author: ucabtmv@ucl.ac.uk
File Name: niftynet/contrib/csv_reader/csv_reader.py
Class Name: CSVReader
Method Name: _parse_csv


Project Name: neuroailab/tnn
Commit Name: bc3ecfd2f455f0b98b334c94285c1810899a3da7
Time: 2017-07-05
Author: anayebi@stanford.edu
File Name: tnn/cell.py
Class Name:
Method Name: crop_func


Project Name: cornellius-gp/gpytorch
Commit Name: f7b10102a3a0b08272634347ff3a65efd3df18ce
Time: 2019-04-04
Author: gpleiss@gmail.com
File Name: test/functions/test_inv_matmul.py
Class Name: TestInvMatmulNonBatch
Method Name: test_inv_matmul_vec