MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / filter_dict

Function filter_dict

bmtools/tools/wolframalpha/api.py:44–50  ·  view source on GitHub ↗
(d, blacklist)

Source from the content-addressed store, hash-verified

42 blacklist = ["@scanner", "@id", "@position", "@error", "@numsubpods", "@width", "@height", "@type", "@themes","@colorinvertable", "expressiontypes"]
43
44 def filter_dict(d, blacklist):
45 if isinstance(d, dict):
46 return {k: filter_dict(v, blacklist) for k, v in d.items() if k not in blacklist}
47 elif isinstance(d, list):
48 return [filter_dict(i, blacklist) for i in d]
49 else:
50 return d
51
52 for ret in rets:
53 ret = filter_dict(ret, blacklist=blacklist)

Callers 1

getWolframAlphaResultsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected