MCPcopy Index your code
hub / github.com/python/cpython / _lookup

Method _lookup

Lib/mailbox.py:609–620  ·  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

607 self._last_read = time.time()
608
609 def _lookup(self, key):
610 """Use TOC to return subpath for given key, or raise a KeyError."""
611 try:
612 if os.path.exists(os.path.join(self._path, self._toc[key])):
613 return self._toc[key]
614 except KeyError:
615 pass
616 self._refresh()
617 try:
618 return self._toc[key]
619 except KeyError:
620 raise KeyError('No message with key: %s' % key) from None
621
622 # This method is for backward compatibility only.
623 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