a6add8ae090edaf8ce525d49d9fe0cf38a0a91c7,src/python/pants/backend/python/dependency_inference/module_mapper.py,,merge_first_party_module_mappings,#Any#,90

Before Change


    for mapping in all_mappings:
        for module, addresses in mapping.items():
            if module in modules_to_addresses:
                modules_with_multiple_implementations.add(module)
            else:
                modules_to_addresses[module] = addresses
    for module in modules_with_multiple_implementations:
        modules_to_addresses.pop(module)

After Change


            if module in modules_with_multiple_implementations:
                modules_with_multiple_implementations[module].update(addresses)
            elif module in modules_to_addresses:
                modules_with_multiple_implementations[module].update(
                    {*modules_to_addresses[module], *addresses}
                )
            else:
                modules_to_addresses[module] = addresses

    // Finally, remove any newly ambiguous modules from the previous step.
    for module in modules_with_multiple_implementations:
        if module in modules_to_addresses:
            modules_to_addresses.pop(module)

    return FirstPartyPythonModuleMapping(
        mapping=FrozenDict(sorted(modules_to_addresses.items())),
        ambiguous_modules=FrozenDict(
            (k, tuple(sorted(v))) for k, v in sorted(modules_with_multiple_implementations.items())
        ),
    )

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 15

Instances


Project Name: pantsbuild/pants
Commit Name: a6add8ae090edaf8ce525d49d9fe0cf38a0a91c7
Time: 2021-03-23
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/backend/python/dependency_inference/module_mapper.py
Class Name:
Method Name: merge_first_party_module_mappings


Project Name: pantsbuild/pants
Commit Name: a6add8ae090edaf8ce525d49d9fe0cf38a0a91c7
Time: 2021-03-23
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/backend/python/dependency_inference/module_mapper.py
Class Name:
Method Name: map_third_party_modules_to_addresses


Project Name: pantsbuild/pants
Commit Name: a6add8ae090edaf8ce525d49d9fe0cf38a0a91c7
Time: 2021-03-23
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/backend/python/dependency_inference/module_mapper.py
Class Name:
Method Name: merge_first_party_module_mappings


Project Name: pantsbuild/pants
Commit Name: a6add8ae090edaf8ce525d49d9fe0cf38a0a91c7
Time: 2021-03-23
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/backend/python/dependency_inference/module_mapper.py
Class Name:
Method Name: map_first_party_python_targets_to_modules