()
return dict(pkg_to_dist)
Return a mapping of top-level packages to their
    distributions.

    >>> import collections.abc
    >>> pkgs = packages_distributions()
    >>> all(isinstance(dist, collections.abc.Sequence) for dist in pkgs.values())
    True
Return a mapping of top-level packages to their
    distributions.
Return a mapping of top - level packages to their distributions .
def packages_distributions() -> Mapping[str, List[str]]:
    """
    Return a mapping of top-level packages to their
    distributions.

    >>> import collections.abc
    >>> pkgs = packages_distributions()
    >>> all(isinstance(dist, collections.abc.Sequence) for dist in pkgs.values())
    True
    """
    pkg_to_dist = collections.defaultdict(list)
    for dist in distributions():
        for pkg in (dist.read_text('top_level.txt') or '').split():
            pkg_to_dist[pkg].append(dist.metadata['Name'])
    return dict(pkg_to_dist)
def packages_distributions ( ) -> Mapping [ str , List [ str ] ] : pkg_to_dist = collections . defaultdict ( list ) for dist in distributions ( ) : for pkg in ( dist . read_text ( 'top_level.txt' ) or '' ) . split ( ) : pkg_to_dist [ pkg ] . append ( dist . metadata [ 'Name' ] ) return dict ( pkg_to_dist )