MCPcopy Index your code
hub / github.com/nodejs/node / Freeze

Function Freeze

deps/v8/tools/testrunner/local/utils.py:225–235  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

223
224
225def Freeze(obj):
226 if isinstance(obj, dict):
227 return FrozenDict((k, Freeze(v)) for k, v in list(obj.items()))
228 elif isinstance(obj, set):
229 return frozenset(obj)
230 elif isinstance(obj, list):
231 return tuple(Freeze(item) for item in obj)
232 else:
233 # Make sure object is hashable.
234 hash(obj)
235 return obj

Callers 2

ReadStatusFileFunction · 0.90
test_freezeMethod · 0.90

Calls 4

FrozenDictClass · 0.85
listFunction · 0.50
hashFunction · 0.50
itemsMethod · 0.45

Tested by 1

test_freezeMethod · 0.72