MCPcopy
hub / github.com/keystone-engine/keypatch / find_idx_by_value

Method find_idx_by_value

keypatch.py:845–853  ·  view source on GitHub ↗
(self, dictionary, value, default=None)

Source from the content-addressed store, hash-verified

843 return val
844
845 def find_idx_by_value(self, dictionary, value, default=None):
846 (keys, values) = self.dict_to_ordered_list(dictionary)
847
848 try:
849 idx = values.index(value)
850 except:
851 idx = default
852
853 return idx
854
855 def get_arch_by_idx(self, idx):
856 return self.get_value_by_idx(self.arch_lists, idx)

Callers 2

find_arch_idxMethod · 0.95
find_syntax_idxMethod · 0.95

Calls 1

dict_to_ordered_listMethod · 0.95

Tested by

no test coverage detected