MCPcopy Create free account
hub / github.com/CiscoPSIRT/openVulnQuery / _flatten_datastructure

Function _flatten_datastructure

openVulnQuery/_library/utils.py:108–118  ·  view source on GitHub ↗
(field_list)

Source from the content-addressed store, hash-verified

106
107
108def _flatten_datastructure(field_list):
109 final_dict = {}
110 for k, v in field_list.items():
111 if isinstance(v, list):
112 if v and isinstance(v[0], dict):
113 final_dict.update(_reduce_list_dict(k, v))
114 else:
115 final_dict[k] = TAB.join(v)
116 else:
117 final_dict[k] = v.encode('utf-8').strip() if v else None
118 return final_dict
119
120
121def _reduce_list_dict(node, vals):

Callers 1

flatten_listFunction · 0.85

Calls 1

_reduce_list_dictFunction · 0.85

Tested by

no test coverage detected