MCPcopy Index your code
hub / github.com/ipython/ipython / hget

Method hget

IPython/external/pickleshare.py:131–148  ·  view source on GitHub ↗

hashed get

(self, hashroot, key, default=_sentinel, fast_only=True)

Source from the content-addressed store, hash-verified

129 self[hfile] = d
130
131 def hget(self, hashroot, key, default=_sentinel, fast_only=True):
132 """hashed get"""
133 hroot = self.root / hashroot
134 hfile = hroot / gethashfile(key)
135
136 d = self.get(hfile, _sentinel)
137 # print "got dict",d,"from",hfile
138 if d is _sentinel:
139 if fast_only:
140 if default is _sentinel:
141 raise KeyError(key)
142
143 return default
144
145 # slow mode ok, works even after hcompress()
146 d = self.hdict(hashroot)
147
148 return d.get(key, default)
149
150 def hdict(self, hashroot):
151 """Get all data contained in hashed category 'hashroot' as dict"""

Callers

nothing calls this directly

Calls 3

hdictMethod · 0.95
gethashfileFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected