MCPcopy Create free account
hub / github.com/alibaba/GraphScope / __contains__

Method __contains__

python/graphscope/nx/classes/cache.py:193–207  ·  view source on GitHub ↗
(self, key)

Source from the content-addressed store, hash-verified

191
192 @clear_mutation_cache
193 def __contains__(self, key):
194 if self.enable_iter_cache:
195 if len(self.node_id_cache) == 0 and self.futures["node_id"] is not None:
196 self.iter_pre_gid = self.iter_gid
197 self.iter_gid, node_size, self.node_id_cache = self.futures[
198 "node_id"
199 ].result()
200 self.futures["node_id"] = None
201 if self.iter_gid != self.iter_pre_gid:
202 self._async_fetch_node_id_cache(self.iter_gid)
203
204 if not self.id2i and self.node_id_cache:
205 # initialize the id to index hash map
206 self.id2i = {k: v for v, k in enumerate(self.node_id_cache)}
207 return key in self.id2i
208
209 @clear_mutation_cache
210 def __len__(self):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected