MCPcopy Create free account
hub / github.com/DeepGraphLearning/graphvite / assert_in

Function assert_in

python/graphvite/util.py:54–66  ·  view source on GitHub ↗
(candidates, **kwargs)

Source from the content-addressed store, hash-verified

52
53
54def assert_in(candidates, **kwargs):
55
56 def readable_list(iterable):
57 iterable = ["`%s`" % x for x in iterable]
58 s = ", ".join(iterable[:-1])
59 if s:
60 s += " and "
61 s += iterable[-1]
62 return s
63
64 for key, value in kwargs.items():
65 assert value in candidates, \
66 "Unknown %s `%s`, candidates are %s" % (key, value, readable_list(candidates))
67
68
69class chdir(object):

Callers 3

load_global_configFunction · 0.85
entity_predictionMethod · 0.85
link_predictionMethod · 0.85

Calls 1

readable_listFunction · 0.85

Tested by

no test coverage detected