MCPcopy Create free account
hub / github.com/catboost/catboost / iterkeys

Function iterkeys

library/python/resource/__init__.py:7–18  ·  view source on GitHub ↗
(prefix="", strip_prefix=False)

Source from the content-addressed store, hash-verified

5
6
7def iterkeys(prefix="", strip_prefix=False):
8 decode = lambda s: s # noqa: E731
9 if isinstance(prefix, six.text_type):
10 prefix = prefix.encode("utf-8")
11 decode = lambda s: s.decode("utf-8") # noqa: E731
12
13 for i in six.moves.range(count()):
14 key = key_by_index(i)
15 if key.startswith(prefix):
16 if strip_prefix:
17 key = key[len(prefix) :]
18 yield decode(key)
19
20
21def itervalues(prefix=b""):

Callers 2

itervaluesFunction · 0.85
iteritemsFunction · 0.85

Calls 6

isinstanceFunction · 0.85
lenFunction · 0.85
countFunction · 0.50
encodeMethod · 0.45
decodeMethod · 0.45
rangeMethod · 0.45

Tested by

no test coverage detected