MCPcopy Index your code
hub / github.com/RustPython/RustPython / _lookup

Method _lookup

Lib/mailbox.py:602–613  ·  view source on GitHub ↗

Use TOC to return subpath for given key, or raise a KeyError.

(self, key)

Source from the content-addressed store, hash-verified

600 self._last_read = time.time()
601
602 def _lookup(self, key):
603 """Use TOC to return subpath for given key, or raise a KeyError."""
604 try:
605 if os.path.exists(os.path.join(self._path, self._toc[key])):
606 return self._toc[key]
607 except KeyError:
608 pass
609 self._refresh()
610 try:
611 return self._toc[key]
612 except KeyError:
613 raise KeyError('No message with key: %s' % key) from None
614
615 # This method is for backward compatibility only.
616 def next(self):

Callers 15

removeMethod · 0.95
__setitem__Method · 0.95
get_messageMethod · 0.95
get_bytesMethod · 0.95
get_fileMethod · 0.95
get_infoMethod · 0.95
set_infoMethod · 0.95
iterkeysMethod · 0.95
get_messageMethod · 0.45
get_bytesMethod · 0.45
get_fileMethod · 0.45
get_messageMethod · 0.45

Calls 3

_refreshMethod · 0.95
existsMethod · 0.45
joinMethod · 0.45

Tested by 3

test_lookupMethod · 0.36
check_infoMethod · 0.36
test_file_permissionsMethod · 0.36