def convert_dict(d, cls=AttrDict): 
for k, v in d.items():<EOL><INDENT>if isinstance(v, Mapping):<EOL><INDENT>d[k] = convert_dict(v)<EOL><DEDENT>elif isinstance(v, list):<EOL><INDENT>for i, e in enumerate(v):<EOL><INDENT>if isinstance(e, Mapping):<EOL><INDENT>v[i] = convert_dict(e)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return cls(d)<EOL>
recursively convert a normal Mapping `d` and it's values to a specified type
(defaults to AttrDict)