MCPcopy Index your code
hub / github.com/google-deepmind/alphageometry / neighbors

Method neighbors

geometry.py:89–108  ·  view source on GitHub ↗

Neighbors of this node in the proof state graph.

(
      self, oftype: Type[Node], return_set: bool = False, do_rep: bool = True
  )

Source from the content-addressed store, hash-verified

87 return rep, self.why_equal([rep], None)
88
89 def neighbors(
90 self, oftype: Type[Node], return_set: bool = False, do_rep: bool = True
91 ) -> list[Node]:
92 """Neighbors of this node in the proof state graph."""
93 if do_rep:
94 rep = self.rep()
95 else:
96 rep = self
97 result = set()
98
99 for n in rep.edge_graph:
100 if oftype is None or oftype and isinstance(n, oftype):
101 if do_rep:
102 result.add(n.rep())
103 else:
104 result.add(n)
105
106 if return_set:
107 return result
108 return list(result)
109
110 def merge_edge_graph(
111 self, new_edge_graph: dict[Node, dict[Node, list[Node]]]

Callers 15

why_meMethod · 0.80
get_lines_thru_allMethod · 0.80
_get_lineMethod · 0.80
_get_line_allMethod · 0.80
_get_linesMethod · 0.80
add_collMethod · 0.80
check_collMethod · 0.80
get_circles_thru_allMethod · 0.80
_get_circlesMethod · 0.80
add_cyclicMethod · 0.80

Calls 2

repMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected