MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / _remove_a_key

Function _remove_a_key

camel/toolkits/function_tool.py:35–42  ·  view source on GitHub ↗

r"""Remove a key from a dictionary recursively.

(d: Dict, remove_key: Any)

Source from the content-addressed store, hash-verified

33
34
35def _remove_a_key(d: Dict, remove_key: Any) -> None:
36 r"""Remove a key from a dictionary recursively."""
37 if isinstance(d, dict):
38 for key in list(d.keys()):
39 if key == remove_key:
40 del d[key]
41 else:
42 _remove_a_key(d[key], remove_key)
43
44
45def _remove_title_recursively(data, parent_key=None):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected