MCPcopy
hub / github.com/lutzroeder/netron / setdefault

Method setdefault

source/python.js:50–57  ·  view source on GitHub ↗
(key, defaultValue)

Source from the content-addressed store, hash-verified

48 return super.has(key) ? super.get(key) : defaultValue;
49 }
50 setdefault(key, defaultValue) {
51 if (this.has(key)) {
52 return this.get(key);
53 }
54 const value = defaultValue || null;
55 this.set(key, value);
56 return value;
57 }
58 pop(key) {
59 if (this.__contains__(key)) {
60 const v = this.__getitem__(key);

Callers 4

_find_attributeFunction · 0.80
parse_functionsFunction · 0.80
constructorMethod · 0.80

Calls 3

hasMethod · 0.45
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected