This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def unpack_dict(d, keys=None, passed=None, filterNone=True): | |
""" | |
Unpack nested dictionary with _ separted keys | |
:param dict d: nested dictionary to unpack | |
:param list keys: sequence of access keys | |
:param dict passed: dict to update with flattened keys | |
:param bool filterNone: filter out keys where value is None | |
:return: flattened dict | |
:rtype: dict |