248fa57af17b42deec9c818eb83aa71e63d50354,osmnx/io.py,,_convert_edge_attr_types,#Any#Any#,254

Before Change


        if "grade" in data:
            data["grade"] = float(data["grade"])
        if "grade_abs" in data:
            data["grade_abs"] = float(data["grade_abs"])

        // these attributes might have a single value, or a list if edge"s
        // topology was simplified

After Change


            if attr in data:
                if data[attr].startswith("[") and data[attr].endswith("]"):
                    // if it"s a list, eval it then convert each item to float
                    data[attr] = [float(a) for a in ast.literal_eval(data[attr])]
                else:
                    data[attr] = float(data[attr])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: gboeing/osmnx
Commit Name: 248fa57af17b42deec9c818eb83aa71e63d50354
Time: 2020-06-08
Author: boeing@usc.edu
File Name: osmnx/io.py
Class Name:
Method Name: _convert_edge_attr_types


Project Name: CyberReboot/poseidon
Commit Name: d0293ba1864cf4acc055d323554128f580db2f97
Time: 2018-03-15
Author: clewis@iqt.org
File Name: api/app/data.py
Class Name: Network
Method Name: get_dataset


Project Name: cesium-ml/cesium
Commit Name: 384e8e0f8a91815568aa3d4c651c8c5e48979262
Time: 2015-12-17
Author: a.crellinquick@gmail.com
File Name: mltsp/util.py
Class Name:
Method Name: cast_model_params