08bc2add6e98feefdce36f6f094a15e3e598b1e7,src/python/pants/engine/exp/mapper.py,AddressMap,parse,#Any#Any#Any#Any#,39

Before Change


    :type parser_cls: A :class:`pants.engine.exp.parser.Parser`
    
    objects = parser_cls.parse(path, symbol_table_cls)
    objects_by_name = {}
    for obj in objects:
      if not Serializable.is_serializable(obj):
        raise UnaddressableObjectError("Parsed a non-serializable object: {!r}".format(obj))
      attributes = obj._asdict()

      name = attributes.get("name")
      if not name:
        raise UnaddressableObjectError("Parsed a non-addressable object: {!r}".format(obj))

      if name in objects_by_name:
        raise DuplicateNameError("An object already exists at {!r} with name {!r}: {!r}.  Cannot "
                                 "map {!r}".format(path, name, objects_by_name[name], obj))

      objects_by_name[name] = obj
    return cls(path, objects_by_name)

After Change


        previous = objects_by_name.get(name)
        if previous:
          previous_path, _ = previous
          raise DuplicateNameError("An object with name {name!r} is already defined in "
                                   "{previous_path!r}, will not overwrite with {obj!r} from "
                                   "{current_path!r}."
                                   .format(name=name,
                                           previous_path=previous_path,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: pantsbuild/pants
Commit Name: 08bc2add6e98feefdce36f6f094a15e3e598b1e7
Time: 2016-02-23
Author: stuhood@gmail.com
File Name: src/python/pants/engine/exp/mapper.py
Class Name: AddressMap
Method Name: parse


Project Name: theislab/scanpy
Commit Name: e0ba43f85537ba7e516de294c27947a8ad6f0abb
Time: 2018-12-27
Author: f.alex.wolf@gmx.de
File Name: scanpy/__init__.py
Class Name:
Method Name:


Project Name: ilastik/ilastik
Commit Name: 9418883d418ecccd7fe5da4dddffdc01064efb23
Time: 2014-03-26
Author: bergs@janelia.hhmi.org
File Name: ilastik/workflows/carving/splitBodyCarvingWorkflow.py
Class Name: SplitBodyCarvingWorkflow
Method Name: __init__