def _check_name(self, node_type, name, node, confidence=interfaces.HIGH):
def _should_exempt_from_invalid_name(node):<EOL><INDENT>if node_type == "<STR_LIT>":<EOL><INDENT>inferred = utils.safe_infer(node)<EOL>if isinstance(inferred, astroid.ClassDef):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>return False<EOL><DEDENT>if utils.is_inside_except(node):<EOL><INDENT>clobbering, _ = utils.clobber_in_except(node)<EOL>if clobbering:<EOL><INDENT>return<EOL><DEDENT><DEDENT>if name in self.config.good_names:<EOL><INDENT>return<EOL><DEDENT>if name in self.config.bad_names:<EOL><INDENT>self.stats["<STR_LIT>" + node_type] += <NUM_LIT:1><EOL>self.add_message("<STR_LIT>", node=node, args=name)<EOL>return<EOL><DEDENT>regexp = self._name_regexps[node_type]<EOL>match = regexp.match(name)<EOL>if _is_multi_naming_match(match, node_type, confidence):<EOL><INDENT>name_group = self._find_name_group(node_type)<EOL>bad_name_group = self._bad_names.setdefault(name_group, {})<EOL>warnings = bad_name_group.setdefault(match.lastgroup, [])<EOL>warnings.append((node, node_type, name, confidence))<EOL><DEDENT>if match is None and not _should_exempt_from_invalid_name(node):<EOL><INDENT>self._raise_name_warning(node, node_type, name, confidence)<EOL><DEDENT>
check for a name using the type's regexp