def _validate(self, writing=False):
if self.brand not in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>msg = ("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>msg = msg.format(brand=self.brand)<EOL>if writing:<EOL><INDENT>raise IOError(msg)<EOL><DEDENT>else:<EOL><INDENT>warnings.warn(msg, UserWarning)<EOL><DEDENT><DEDENT>for item in self.compatibility_list:<EOL><INDENT>if item not in self._valid_cls:<EOL><INDENT>msg = ("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL>msg = msg.format(items=self.compatibility_list,<EOL>valid_entries=self._valid_cls)<EOL>if writing:<EOL><INDENT>raise IOError(msg)<EOL><DEDENT>else:<EOL><INDENT>warnings.warn(msg, UserWarning)<EOL><DEDENT><DEDENT><DEDENT>
Validate the box before writing to file.