Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _recursize_dereference(kernel, d):
if isinstance(d, dict):
return {k: _recursize_dereference(kernel, v) for k, v in d.items()}
elif isinstance(d, list):
return [_recursize_dereference(kernel, i) for i in d]
elif isinstance(d, ObjRef):
return _reference_map.resolve_reference(kernel, d)
elif isinstance(d, EnumRef):
return _recursize_dereference(kernel, d.ref)(d.member)
else:
return d