Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _define(self, collection, name, first_node, last_node=None,
message='', confidence=DEFAULT_CONFIDENCE, ignore=None):
last_node = last_node or first_node
typ = collection.typ
if (ignore and ignore(self.filename, name)) or _match(
name, self.ignore_names):
self._log('Ignoring {typ} "{name}"'.format(**locals()))
else:
first_lineno = first_node.lineno
last_lineno = lines.get_last_line_number(last_node)
collection.append(
Item(name, typ, self.filename, first_lineno, last_lineno,
message=message, confidence=confidence))