MCPcopy
hub / github.com/celery/celery / valency_of

Method valency_of

celery/utils/graph.py:85–93  ·  view source on GitHub ↗

Return the valency (degree) of a vertex in the graph.

(self, obj)

Source from the content-addressed store, hash-verified

83 return [t[0] for t in graph._khan62()]
84
85 def valency_of(self, obj):
86 """Return the valency (degree) of a vertex in the graph."""
87 try:
88 l = [len(self[obj])]
89 except KeyError:
90 return 0
91 for node in self[obj]:
92 l.append(self.valency_of(node))
93 return sum(l)
94
95 def update(self, it):
96 """Update graph with data from a list of ``(obj, deps)`` tuples."""

Callers 2

repr_nodeMethod · 0.95

Calls

no outgoing calls

Tested by 1