def update(self, newdata, **kwargs):
duplicates = [k for k in set(newdata.keys()) & set(kwargs.keys())<EOL>if newdata[k] != kwargs[k]]<EOL>if len(duplicates) != <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>".<EOL>format(len(duplicates), "<STR_LIT:U+002CU+0020>".join(duplicates)))<EOL><DEDENT>for k, v in newdata.items():<EOL><INDENT>setattr(self, k, v)<EOL><DEDENT>for k, v in kwargs.items():<EOL><INDENT>setattr(self, k, v)<EOL><DEDENT>
Update Sample object with attributes from a dict.