MCPcopy Index your code
hub / github.com/clips/pattern / lookup

Method lookup

pattern/web/pdf/pdfparser.py:549–561  ·  view source on GitHub ↗
(d)

Source from the content-addressed store, hash-verified

547 # may raise KeyError
548 d0 = dict_value(names[cat])
549 def lookup(d):
550 if 'Limits' in d:
551 (k1,k2) = list_value(d['Limits'])
552 if key < k1 or k2 < key: return None
553 if 'Names' in d:
554 objs = list_value(d['Names'])
555 names = dict(choplist(2, objs))
556 return names[key]
557 if 'Kids' in d:
558 for c in list_value(d['Kids']):
559 v = lookup(dict_value(c))
560 if v: return v
561 raise KeyError((cat,key))
562 return lookup(d0)
563
564 def get_dest(self, name):

Callers 2

feedparser.pyFile · 0.80
_codecMethod · 0.80

Calls 3

list_valueFunction · 0.90
choplistFunction · 0.90
dict_valueFunction · 0.90

Tested by

no test coverage detected