MCPcopy Index your code
hub / github.com/python/cpython / _check_args_match

Method _check_args_match

Doc/tools/extensions/audit_events.py:52–69  ·  view source on GitHub ↗
(self, name: str, args: list[str])

Source from the content-addressed store, hash-verified

50 self.sources.setdefault(name, set()).add(source)
51
52 def _check_args_match(self, name: str, args: list[str]) -> None:
53 current_args = self.events[name]
54 msg = (
55 f"Mismatched arguments for audit-event {name}: "
56 f"{current_args!r} != {args!r}"
57 )
58 if current_args == args:
59 return
60 if len(current_args) != len(args):
61 logger.warning(msg)
62 return
63 for a1, a2 in zip(current_args, args, strict=False):
64 if a1 == a2:
65 continue
66 if any(a1 in s and a2 in s for s in _SYNONYMS):
67 continue
68 logger.warning(msg)
69 return
70
71 def id_for(self, name) -> str:
72 source_count = len(self.sources.get(name, set()))

Callers 1

add_eventMethod · 0.95

Calls 2

anyFunction · 0.50
warningMethod · 0.45

Tested by

no test coverage detected