<s> '''<STR_LIT>''' <EOL> import copy <EOL> def deepcopy_as_simple_object ( thing , memo = None ) : <EOL> '''<STR_LIT>''' <EOL> if memo is None : <EOL> memo = { } <EOL> klass = thing . __class__ <EOL> new_thing = klass . __new__ ( klass ) <EOL> memo [ id ( thing ) ] = new_thing <EOL> for ( name , subthing ) in vars ( thing ) . items ( ) : <EOL> new_thing . __dict__ [ name ] = copy . deepcopy ( subthing , memo ) <EOL> return new_thing </s>
