bf9599809214cbc3082eb7f39c0ad3155822a2c5,src/python/twitter/pants/tasks/jvm_compile/scala/zinc_analysis.py,ZincAnalysis,split,#ZincAnalysis#Any#Any#,172

Before Change


    external_api_splits = []
    for naive_internal_apis, external_apis, split in \
      zip(naive_internal_api_splits, naive_external_api_splits, splits):
      internal_apis = defaultdict(list)
      for k, vs in naive_internal_apis.iteritems():
        if k in split:
          internal_apis[k] = vs  // Remains internal.
        else:
          external_apis[representatives[k]] = vs  // Externalized.
      internal_api_splits.append(internal_apis)

After Change


    // Split apis.

    // The splits, but expressed via class representatives of the sources (see above).
    representative_splits = [filter(None, [representatives.get(s) for s in srcs]) for srcs in splits]
    representative_to_internal_api = {}
    for src, rep in representatives.items():
      representative_to_internal_api[rep] = self.apis.internal.get(src)

    // Note that the keys in self.apis.external are classes, not sources.
    internal_api_splits = self._split_dict(self.apis.internal, splits)
    external_api_splits = self._split_dict(self.apis.external, representative_splits)

    // All externalized deps require a copy of the relevant api.
    for external, external_api in zip(external_splits, external_api_splits):
      for vs in external.values():
        for v in vs:
          if v in representative_to_internal_api:
            external_api[v] = representative_to_internal_api[v]

    apis_splits = []
    for args in zip(internal_api_splits, external_api_splits):
      apis_splits.append(APIs(args))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 7

Instances


Project Name: pantsbuild/pants
Commit Name: bf9599809214cbc3082eb7f39c0ad3155822a2c5
Time: 2014-02-12
Author: benjy@foursquare.com
File Name: src/python/twitter/pants/tasks/jvm_compile/scala/zinc_analysis.py
Class Name: ZincAnalysis
Method Name: split


Project Name: pantsbuild/pants
Commit Name: c93bab32fa8c3f6fc72c83e6d87917b29b4e017f
Time: 2015-08-31
Author: pl@foursquare.com
File Name: src/python/pants/backend/jvm/tasks/jvm_dependency_check.py
Class Name: JvmDependencyCheck
Method Name: targets_by_file


Project Name: tensorflow/datasets
Commit Name: 3be1154314111df8cd327a321fe3d68e7b661c68
Time: 2020-05-29
Author: charlespatel07@gmail.com
File Name: tensorflow_datasets/text/pg19.py
Class Name: Pg19
Method Name: _generate_examples


Project Name: markovmodel/PyEMMA
Commit Name: b69a4513d333266b032e11f9563d6bd14830aa86
Time: 2018-06-21
Author: m.scherer@fu-berlin.de
File Name: conftest.py
Class Name:
Method Name: pytest_collection_modifyitems