

def _compute_transitive_deps_by_target(self):
    'Map from target to all the targets it depends on, transitively.'
    sorted_targets = reversed(sort_targets(self.context.targets()))
    transitive_deps_by_target = defaultdict(set)
    for target in sorted_targets:
        transitive_deps = set()
        for dep in target.dependencies:
            transitive_deps.update(transitive_deps_by_target.get(dep, []))
            transitive_deps.add(dep)
        if hasattr(target, 'java_sources'):
            for java_source_target in target.java_sources:
                for transitive_dep in java_source_target.dependencies:
                    transitive_deps_by_target[java_source_target].add(transitive_dep)
        transitive_deps_by_target[target] = transitive_deps
    return transitive_deps_by_target

dataset/ETHPy150Open pantsbuild/pants/src/python/pants/backend/jvm/tasks/jvm_dependency_analyzer.py JvmDependencyAnalyzer._compute_transitive_deps_by_target/original