MCPcopy Create free account
hub / github.com/apple/foundationdb / get_key

Method get_key

tests/python_tests/python_correctness.py:54–73  ·  view source on GitHub ↗
(self, key_selector)

Source from the content-addressed store, hash-verified

52 return None
53
54 def get_key(self, key_selector):
55 sorted_keys = list(sorted(self.store.keys()))
56 for index, key in enumerate(sorted_keys):
57 if key >= key_selector.key:
58 index += key_selector.offset
59 if (
60 key == key_selector.key and not key_selector.or_equal
61 ) or key != key_selector.key:
62 index -= 1
63
64 if index < 0 or index >= len(sorted_keys):
65 return ""
66 else:
67 return sorted_keys[index]
68
69 index = len(sorted_keys) + key_selector.offset - 1
70 if index < 0 or index >= len(sorted_keys):
71 return ""
72 else:
73 return sorted_keys[index]
74
75 def get_range(self, begin, end, limit=None):
76 values = []

Callers 6

getMethod · 0.95
get_rangeMethod · 0.95
clearMethod · 0.95
correctness_get_keyMethod · 0.45
run_get_keyMethod · 0.45

Calls 1

sortedFunction · 0.85

Tested by

no test coverage detected