d6abdc0d4efa8386e549a9c8bbacc52bf5c82f7e,homeassistant/util/yaml.py,,_ordered_dict,#Any#Any#,36

Before Change


    loader.flatten_mapping(node)
    nodes = loader.construct_pairs(node)
    dups = [k for k, v in Counter(k for k, _ in nodes).items() if v > 1]
    if dups:
        raise yaml.YAMLError("ERROR: duplicate keys: {}".format(dups))
    return OrderedDict(nodes)


yaml.SafeLoader.add_constructor("!include", _include_yaml)

After Change


    for (key, _), (node, _) in zip(nodes, node.value):
        line = getattr(node, "__line__", "unknown")
        if key in seen:
            fname = getattr(loader.stream, "name", "")
            raise yaml.YAMLError("ERROR: duplicate key: \"{}\""
                                 " in {} line {} and {}"
                                 .format(key, fname, seen[key], line))
        seen[key] = line
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: home-assistant/home-assistant
Commit Name: d6abdc0d4efa8386e549a9c8bbacc52bf5c82f7e
Time: 2016-04-08
Author: jaharkes@cs.cmu.edu
File Name: homeassistant/util/yaml.py
Class Name:
Method Name: _ordered_dict


Project Name: pantsbuild/pants
Commit Name: f28482ca5dd87f981de73ba8cb47def171e754f3
Time: 2016-08-09
Author: yujieproject@gmail.com
File Name: src/python/pants/backend/jvm/targets/jvm_app.py
Class Name: BundleProps
Method Name: create_bundle_props


Project Name: cornellius-gp/gpytorch
Commit Name: 4888270b264f9266a5097f620476565b17ef9f81
Time: 2019-03-11
Author: neighthan.hunt@gmail.com
File Name: gpytorch/models/exact_gp.py
Class Name: ExactGP
Method Name: set_train_data