def walk_json_dict(coll):
if isinstance(coll, dict):<EOL><INDENT>return dict((k, walk_json_dict(v)) for (k, v) in iter(coll.items()))<EOL><DEDENT>elif isinstance(coll, bytes):<EOL><INDENT>return coll.decode('<STR_LIT:ascii>')<EOL><DEDENT>elif hasattr(coll, '<STR_LIT>') and not isinstance(coll, str):<EOL><INDENT>return [walk_json_dict(seq) for seq in coll]<EOL><DEDENT>else:<EOL><INDENT>return coll<EOL><DEDENT>
Flatten a parsed SBP object into a dicts and lists, which are
compatible for JSON output.

Parameters
----------
coll : dict