def _shallow_copy(self, obj=None, obj_type=None, **kwargs):
if obj is None:<EOL><INDENT>obj = self._selected_obj.copy()<EOL><DEDENT>if obj_type is None:<EOL><INDENT>obj_type = self._constructor<EOL><DEDENT>if isinstance(obj, obj_type):<EOL><INDENT>obj = obj.obj<EOL><DEDENT>for attr in self._attributes:<EOL><INDENT>if attr not in kwargs:<EOL><INDENT>kwargs[attr] = getattr(self, attr)<EOL><DEDENT><DEDENT>return obj_type(obj, **kwargs)<EOL>
return a new object with the replacement attributes