src/pybel/utils.py
def multidict(pairs: typing.Iterable[Tuple[X, Y]]) -> Mapping[X, List[Y]]:
    """Accumulate a multidict from a list of pairs."""
    rv = defaultdict(list)
    for key, value in pairs:
        rv[key].append(value)
    return dict(rv)
Accumulate a multidict from a list of pairs.
Accumulate a multidict from a list of pairs.
Accumulate a multidict from a list of pairs .
def multidict(pairs: typing.Iterable[Tuple[X, Y]]) -> Mapping[X, List[Y]]:
    rv = defaultdict(list)
    for key, value in pairs:
        rv[key].append(value)
    return dict(rv)
def multidict ( pairs : typing . Iterable [ Tuple [ X , Y ] ] ) -> Mapping [ X , List [ Y ] ] : rv = defaultdict ( list ) for key , value in pairs : rv [ key ] . append ( value ) return dict ( rv )
Accumulate a multidict from a list of pairs.
Accumulate a multidict from a list of pairs .
"""Accumulate a multidict from a list of pairs."""
pairs
typing.Iterable[Tuple[X, Y]]