MCPcopy Create free account
hub / github.com/Bairong-Xdynamics/MistakeNotebookLearning / quick_rej

Method quick_rej

examples/utils/sql_eval.py:121–128  ·  view source on GitHub ↗

Quick comparison using unordered rows

(self, result1: List[Tuple], result2: List[Tuple], order_matters: bool)

Source from the content-addressed store, hash-verified

119 return tuple(sorted(row, key=lambda x: str(x) + str(type(x))))
120
121 def quick_rej(self, result1: List[Tuple], result2: List[Tuple], order_matters: bool) -> bool:
122 """Quick comparison using unordered rows"""
123 s1 = [self.unorder_row(row) for row in result1]
124 s2 = [self.unorder_row(row) for row in result2]
125 if order_matters:
126 return s1 == s2
127 else:
128 return set(s1) == set(s2)
129
130 def multiset_eq(self, l1: List, l2: List) -> bool:
131 """Check if two lists contain same elements with same frequencies"""

Callers 1

result_eqMethod · 0.95

Calls 1

unorder_rowMethod · 0.95

Tested by

no test coverage detected