mirror of
https://github.com/ARM-software/devlib.git
synced 2025-09-23 12:21:54 +01:00
target: Open the possiblity for optimizing multi-source push/pulls
This commit is contained in:
committed by
Marc Bonnici
parent
173df18f29
commit
477e82c444
@@ -971,3 +971,16 @@ class InitCheckpoint(metaclass=InitCheckpointMeta):
|
||||
Inherit from this class to set the :class:`InitCheckpointMeta` metaclass.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def groupby_value(dct):
|
||||
"""
|
||||
Process the input dict such that all keys sharing the same values are
|
||||
grouped in a tuple, used as key in the returned dict.
|
||||
"""
|
||||
key = itemgetter(1)
|
||||
items = sorted(dct.items(), key=key)
|
||||
return {
|
||||
tuple(map(itemgetter(0), _items)): v
|
||||
for v, _items in groupby(items, key=key)
|
||||
}
|
||||
|
Reference in New Issue
Block a user