def deepcopy_strip(item):  
if isinstance(item, MutableMapping):<EOL><INDENT>return {k: deepcopy_strip(v) for k, v in iteritems(item)}<EOL><DEDENT>if isinstance(item, MutableSequence):<EOL><INDENT>return [deepcopy_strip(k) for k in item]<EOL><DEDENT>return item<EOL>
Make a deep copy of list and dict objects.

Intentionally do not copy attributes.  This is to discard CommentedMap and
CommentedSeq metadata which is very expensive with regular copy.deepcopy.