def validate(self, other):
if other is None:<EOL><INDENT>return<EOL><DEDENT>if other.table_type != self.table_type:<EOL><INDENT>raise TypeError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>other=other.table_type, self=self.table_type))<EOL><DEDENT>for c in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>sv = getattr(self, c, None)<EOL>ov = getattr(other, c, None)<EOL>if sv != ov:<EOL><INDENT>for i, sax in enumerate(sv):<EOL><INDENT>oax = ov[i]<EOL>if sax != oax:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>c=c, sax=sax, oax=oax))<EOL><DEDENT><DEDENT>raise Exception(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(c=c, sv=sv, ov=ov))<EOL><DEDENT><DEDENT>
validate against an existing table