Beispiel #1
0
def rename(cache: TwinKeyDict, existing: str, desired: str):
    block = cache.get((existing, None))
    if block:  # pragma: no cover
        del cache[existing, None]
        block['id'] = desired
        cache[desired, block['nid']] = block
Beispiel #2
0
def get(cache: TwinKeyDict, ids: dict) -> Optional[dict]:
    return cache.get((ids.get('id'), ids.get('nid')))