FormDiagram.is_leaf

FormDiagram.is_leaf(key)[source]

Verify if a node is a leaf.

Parameters:

key (hashable) – The identifier of the node.

Returns:

bool – True or False.

Notes

A node is a leaf if it has only one neighbor.