def _validate(self, writing=False):
<EOL>if not ((len(self.index) == len(self.channel_type)) and<EOL>(len(self.channel_type) == len(self.association))):<EOL><INDENT>msg = ("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL>msg = msg.format(index=len(self.index),<EOL>channel_type=len(self.channel_type),<EOL>association=len(self.association))<EOL>self._dispatch_validation_error(msg, writing=writing)<EOL><DEDENT>if any(x not in [<NUM_LIT:0>, <NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT>] for x in self.channel_type):<EOL><INDENT>msg = ("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL>msg = msg.format(channel_type=self.channel_type)<EOL>self._dispatch_validation_error(msg, writing=writing)<EOL><DEDENT>
Verify that the box obeys the specifications.