MCPcopy Index your code
hub / github.com/idank/explainshell / _result_index

Method _result_index

explainshell/matcher.py:928–936  ·  view source on GitHub ↗

return a mapping of `MatchResult`s to their index among all matches, sorted by the start position of the `MatchResult`

(self)

Source from the content-addressed store, hash-verified

926 self.groups[0].results.sort(key=lambda mr: mr.start)
927
928 def _result_index(self):
929 """return a mapping of `MatchResult`s to their index among all
930 matches, sorted by the start position of the `MatchResult`"""
931 d = {}
932 i = 0
933 for result in sorted(self.all_matches, key=lambda mr: mr.start):
934 d[result] = i
935 i += 1
936 return d
937
938 def _merge_adjacent(self, matches):
939 merged = []

Callers 1

_merge_adjacentMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected