mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
refactoring
This commit is contained in:
@@ -57,6 +57,10 @@ def sorted_kvs(dct: Dict[_DictKeyT, _DictValueT]) -> List[Tuple[_DictKeyT, _Dict
|
||||
return sorted(dct.items(), key=operator.itemgetter(0))
|
||||
|
||||
|
||||
def swapped_kvs(dct: Dict[_DictKeyT, _DictValueT]) -> Dict[_DictValueT, _DictKeyT]:
|
||||
return {value: key for (key, value) in dct.items()}
|
||||
|
||||
|
||||
# =====
|
||||
def clear_queue(q: multiprocessing.queues.Queue) -> None: # pylint: disable=invalid-name
|
||||
for _ in range(q.qsize()):
|
||||
|
||||
Reference in New Issue
Block a user