code: def compute_transitive_deps_by_target(self, targets):
      
      # Sort from least to most dependent.
      sorted_targets = reversed(sort_targets(targets))
      transitive_deps_by_target = defaultdict(set)
      # Iterate in dep order, to accumulate the transitive deps for each target.
      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)
  
        # Need to handle the case where a java_sources target has dependencies.
        # In particular if it depends back on the original target.
        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
docs: Map from target to all the targets it depends on, transitively.