MCPcopy Create free account
hub / github.com/data61/MP-SPDZ / add_node

Method add_node

Compiler/graph.py:44–53  ·  view source on GitHub ↗
(self, i, **attr)

Source from the content-addressed store, hash-verified

42 return i >= 0 and i < self.n
43
44 def add_node(self, i, **attr):
45 if i >= self.n:
46 raise CompilerError('Cannot add node %d to graph of size %d' % (i, self.n))
47 node = self.nodes[i]
48
49 for a,value in list(attr.items()):
50 if a in self.default_attributes:
51 node[self.attribute_pos[a]] = value
52 else:
53 raise CompilerError('Invalid attribute %s for graph node' % a)
54
55 def set_attr(self, i, attr, value):
56 if attr in self.default_attributes:

Callers 2

dependency_graphMethod · 0.95
else_thenFunction · 0.45

Calls 1

CompilerErrorClass · 0.85

Tested by

no test coverage detected