def _extract_dependencies_by_root(cls, result):
    """
    Only extracts the transitive dependencies for the given coursier resolve.
    Note the "dependencies" field is already transitive.

    Example:
    {
      "conflict_resolution": {},
      "dependencies": [
        {
          "coord": "a",
          "dependencies": ["b", "c"]
          "file": ...
        },
        {
          "coord": "b",
          "dependencies": []
          "file": ...
        },
        {
          "coord": "c",
          "dependencies": []
          "file": ...
        }
      ]
    }

    Should return { "a": ["b", "c"], "b": [], "c": [] }

    :param result: coursier result like the example.
    :return: a simplified view with the top artifact as the roots.
    """
    flat_result = defaultdict(list)

    for artifact in result['dependencies']:
      flat_result[artifact['coord']].extend(artifact['dependencies'])

    return flat_result
def _extract_dependencies_by_root ( cls , result ) : flat_result = defaultdict ( list ) for artifact in result [ 'dependencies' ] : flat_result [ artifact [ 'coord' ] ] . extend ( artifact [ 'dependencies' ] ) return flat_result
Only extracts the transitive dependencies for the given coursier resolve.
    Note the "dependencies" field is already transitive.

    Example:
    {
      "conflict_resolution": {},
      "dependencies": [
        {
          "coord": "a",
          "dependencies": ["b", "c"]
          "file": ...
        },
        {
          "coord": "b",
          "dependencies": []
          "file": ...
        },
        {
          "coord": "c",
          "dependencies": []
          "file": ...
        }
      ]
    }

    Should return { "a": ["b", "c"], "b": [], "c": [] }

    :param result: coursier result like the example.
    :return: a simplified view with the top artifact as the roots.