MCPcopy Index your code
hub / github.com/waleedka/hiddenlayer / sequence_id

Method sequence_id

hiddenlayer/graph.py:297–307  ·  view source on GitHub ↗

Make up an ID for a sequence (list) of nodes. Note: `getrandbits()` is very uninformative as a "readable" ID. Here, we build a name such that when the mouse hovers over the drawn node in Jupyter, one can figure out which original nodes make up the sequence. This is actually q

(self, sequence)

Source from the content-addressed store, hash-verified

295
296
297 def sequence_id(self, sequence):
298 """Make up an ID for a sequence (list) of nodes.
299 Note: `getrandbits()` is very uninformative as a "readable" ID. Here, we build a name
300 such that when the mouse hovers over the drawn node in Jupyter, one can figure out
301 which original nodes make up the sequence. This is actually quite useful.
302 """
303 if self.meaningful_ids:
304 # TODO: This might fail if the ID becomes too long
305 return "><".join([node.id for node in sequence])
306 else:
307 return getrandbits(64)
308
309 def build_dot(self):
310 """Generate a GraphViz Dot graph.

Callers 2

applyMethod · 0.80
applyMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected