def jsonify(o, max_depth=-<NUM_LIT:1>, parse_enums=PARSE_KEEP):
if max_depth == <NUM_LIT:0>:<EOL><INDENT>return o<EOL><DEDENT>max_depth -= <NUM_LIT:1><EOL>if isinstance(o, dict):<EOL><INDENT>keyattrs = getattr(o.__class__, '<STR_LIT>', {})<EOL>def _getter(key, value):<EOL><INDENT>key = keyattrs.get(key, key)<EOL>other = getattr(o, key, value)<EOL>if callable(other):<EOL><INDENT>other = value<EOL><DEDENT>if isinstance(key, Enum):  <EOL><INDENT>key = key.name<EOL><DEDENT>return key, jsonify(other, max_depth=max_depth, parse_enums=parse_enums)<EOL><DEDENT>return dict(_getter(key, value) for key, value in six.iteritems(o))<EOL><DEDENT>elif isinstance(o, list):<EOL><INDENT>return [jsonify(x, max_depth=max_depth, parse_enums=parse_enums) for x in o]<EOL><DEDENT>elif isinstance(o, tuple):<EOL><INDENT>return (jsonify(x, max_depth=max_depth, parse_enums=parse_enums) for x in o)<EOL><DEDENT>elif isinstance(o, Enum):<EOL><INDENT>o = _parse_enum(o, parse_enums=parse_enums)<EOL><DEDENT>return o<EOL>
Walks through object o, and attempts to get the property instead of the key, if available.
This means that for our VDev objects we can easily get a dict of all the 'parsed' values.