MCPcopy Create free account
hub / github.com/ActiveState/code / contains

Method contains

recipes/Python/577898_23_Tree/recipe-577898.py:197–202  ·  view source on GitHub ↗

Check if node contains a given value

(self, a)

Source from the content-addressed store, hash-verified

195 return self
196
197 def contains(self, a):
198 """ Check if node contains a given value """
199 if self.valcnt is not 0:
200 if (self.values[0] > a or self.values[self.valcnt - 1] < a) or a not in self.values:
201 return None
202 return self.values[self.values.index(a)]
203
204 def chooseChild(self, a):
205 """ Choose where to go according to the value a """

Callers 6

removeValueMethod · 0.95
getItemMethod · 0.95
__findMethod · 0.45
containsMethod · 0.45
insertValueMethod · 0.45
removeValueMethod · 0.45

Calls 1

indexMethod · 0.45

Tested by

no test coverage detected