MCPcopy
hub / github.com/Python-Markdown/markdown / get_index_for_name

Method get_index_for_name

markdown/util.py:354–363  ·  view source on GitHub ↗

Return the index of the given name.

(self, name: str)

Source from the content-addressed store, hash-verified

352 return '<{}({})>'.format(self.__class__.__name__, list(self))
353
354 def get_index_for_name(self, name: str) -> int:
355 """
356 Return the index of the given name.
357 """
358 if name in self:
359 self._sort()
360 return self._priority.index(
361 [x for x in self._priority if x.name == name][0]
362 )
363 raise ValueError('No item named "{}" exists.'.format(name))
364
365 def register(self, item: _T, name: str, priority: float) -> None:
366 """

Callers 3

deregisterMethod · 0.95
testIsSortedMethod · 0.95
testGetIndexForNameMethod · 0.95

Calls 1

_sortMethod · 0.95

Tested by 2

testIsSortedMethod · 0.76
testGetIndexForNameMethod · 0.76