MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / query

Method query

graphify/_minhash.py:101–107  ·  view source on GitHub ↗
(self, minhash: MinHash)

Source from the content-addressed store, hash-verified

99 table.setdefault(band, []).append(key)
100
101 def query(self, minhash: MinHash) -> list[str]:
102 hv = minhash.hashvalues
103 candidates: set[str] = set()
104 for i, table in enumerate(self._tables):
105 band = hv[i * self.r : (i + 1) * self.r].tobytes()
106 candidates.update(table.get(band, []))
107 return list(candidates)

Calls 2

updateMethod · 0.80
getMethod · 0.45