MCPcopy
hub / github.com/pallets/werkzeug / setdefault

Method setdefault

examples/cupoftee/db.py:48–54  ·  view source on GitHub ↗
(self, key, factory)

Source from the content-addressed store, hash-verified

46 return key in self._local
47
48 def setdefault(self, key, factory):
49 with self._lock:
50 try:
51 rv = self._load_key(key)
52 except KeyError:
53 self._local[key] = rv = factory()
54 return rv
55
56 def sync(self):
57 with self._lock:

Callers 10

openMethod · 0.45
test_basic_interfaceMethod · 0.45
requestMethod · 0.45
test_get_hostFunction · 0.45
test_proxy_fixFunction · 0.45
__init__Method · 0.45
page_indexFunction · 0.45

Calls 1

_load_keyMethod · 0.95

Tested by 8

openMethod · 0.36
test_basic_interfaceMethod · 0.36
requestMethod · 0.36
test_get_hostFunction · 0.36
test_proxy_fixFunction · 0.36