MCPcopy Index your code
hub / github.com/dask/dask / normalize_dict

Function normalize_dict

dask/tokenize.py:116–126  ·  view source on GitHub ↗
(d)

Source from the content-addressed store, hash-verified

114
115@normalize_token.register((types.MappingProxyType, dict))
116def normalize_dict(d):
117 with tokenize_lock:
118 if id(d) in _SEEN:
119 return "__seen", _SEEN[id(d)][0]
120 _SEEN[id(d)] = len(_SEEN), d
121 try:
122 return "dict", _normalize_seq_func(
123 sorted(d.items(), key=lambda kv: str(kv[0]))
124 )
125 finally:
126 _SEEN.pop(id(d), None)
127
128
129@normalize_token.register(OrderedDict)

Callers

nothing calls this directly

Calls 3

_normalize_seq_funcFunction · 0.85
popMethod · 0.80
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…