MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / match

Method match

aura/analyzers/python/nodes.py:976–1011  ·  view source on GitHub ↗
(self, other: Call, ctx)

Source from the content-addressed store, hash-verified

974 return signature.bind(*self.args, **kw)
975
976 def match(self, other: Call, ctx) -> bool:
977 if type(other) != Call:
978 return False
979 if self.cached_full_name != other.cached_full_name:
980 return False
981
982 for x in other.args:
983 if (type(x) == Constant and type(x.value) == type(...)) or type(x) == type(...):
984 is_wildcard = True
985 break
986 else:
987 is_wildcard = False
988
989 if (not is_wildcard) and len(self.args) != len(other.args):
990 return False
991 else:
992 for idx, arg in enumerate(other.args):
993 if len(self.args) < idx:
994 if not ctx.match(arg, self.args[idx]):
995 return False
996
997 for other_kwarg in other.kwargs.keys():
998 if other_kwarg not in self.kwargs:
999 return False
1000
1001 for name, val in self.kwargs.items():
1002 if name not in other.kwargs:
1003 if is_wildcard:
1004 continue
1005 else:
1006 return False
1007
1008 if not ctx.match(val, other.kwargs[name]):
1009 return False
1010
1011 return True
1012
1013
1014@dataclass

Callers 10

find_encoding_py2Function · 0.45
node_StringMethod · 0.45
analyzeFunction · 0.45
analyzeFunction · 0.45
is_sqlFunction · 0.45
node_VarMethod · 0.45
node_StringMethod · 0.45
node_CompareMethod · 0.45
_visit_nodeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected