MCPcopy Create free account
hub / github.com/THUDM/GLM / rindex

Function rindex

blocklm_utils.py:12–18  ·  view source on GitHub ↗
(lst, val, start=None)

Source from the content-addressed store, hash-verified

10
11
12def rindex(lst, val, start=None):
13 if start is None:
14 start = len(lst) - 1
15 for i in range(start, -1, -1):
16 if lst[i] == val:
17 return i
18 return -1
19
20
21def index_in_list(lst, val, start=None):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected