MCPcopy
hub / github.com/owtf/owtf / deep_update

Function deep_update

owtf/utils/http.py:34–49  ·  view source on GitHub ↗

Update a nested dictionary or similar mapping. Modify ``source`` in place. :type source: collections.Mapping :type overrides: collections.Mapping :rtype: collections.Mapping

(source, overrides)

Source from the content-addressed store, hash-verified

32
33
34def deep_update(source, overrides):
35 """Update a nested dictionary or similar mapping.
36
37 Modify ``source`` in place.
38
39 :type source: collections.Mapping
40 :type overrides: collections.Mapping
41 :rtype: collections.Mapping
42 """
43 for key, value in overrides.items():
44 if isinstance(value, collections.Mapping) and value:
45 returned = deep_update(source.get(key, {}), value)
46 source[key] = returned
47 else:
48 source[key] = overrides[key]
49 return source
50
51
52def extract_method(wrapped_method):

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected