b176e0bd89a243e36cc4db02735aaf896c3ca4a2,networkml/featurizers/features.py,Features,get_columns,#Features#Any#Any#,17

Before Change


    def get_columns(self, fields, rows):
        new_rows = []
        for row in rows:
            new_row = {}
            for field in fields:
                if field in row and row[field]:
                    new_row[field] = row[field]
            new_rows.append(new_row)
        return new_rows

After Change



    def get_columns(self, fields, rows):
        // Terse but efficient.
        new_rows = [{field: row[field] for field in fields if row.get(field, None)} for row in rows]
        return new_rows
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 13

Instances


Project Name: CyberReboot/NetworkML
Commit Name: b176e0bd89a243e36cc4db02735aaf896c3ca4a2
Time: 2020-01-30
Author: josh@vandervecken.com
File Name: networkml/featurizers/features.py
Class Name: Features
Method Name: get_columns


Project Name: deepmipt/DeepPavlov
Commit Name: 3e6d5a72b03f7a17bdaf5967e337db077c89df41
Time: 2018-01-22
Author: arkhipov@yahoo.com
File Name: deeppavlov/models/ner/ner.py
Class Name: NER
Method Name: __init__


Project Name: masa-su/pixyz
Commit Name: 7d1e5bd8a27554079e87379529b38ca536b3766e
Time: 2018-07-09
Author: masa@weblab.t.u-tokyo.ac.jp
File Name: Tars/distributions/distribution_models.py
Class Name: DistributionModel
Method Name: _set_dist