copy_attributes function

Copy attributes from one object to another