
    i
                     2    S SK Jr  S SKJr   " S S\5      rg)   )	NodeMixin)_reprc                   (    \ rS rSrSrSS jrS rSrg)Node   u  
A simple tree node with a `name` and any `kwargs`.

Args:
    name: A name or any other object this node can reference to as identifier.

Keyword Args:
    parent: Reference to parent node.
    children: Iterable with child nodes.
    *: Any other given attribute is just stored as object attribute.

Other than :any:`AnyNode` this class has at least the `name` attribute,
to distinguish between different instances.

The `parent` attribute refers the parent node:

>>> from anytree import Node, RenderTree
>>> root = Node("root")
>>> s0 = Node("sub0", parent=root)
>>> s0b = Node("sub0B", parent=s0, foo=4, bar=109)
>>> s0a = Node("sub0A", parent=s0)
>>> s1 = Node("sub1", parent=root)
>>> s1a = Node("sub1A", parent=s1)
>>> s1b = Node("sub1B", parent=s1, bar=8)
>>> s1c = Node("sub1C", parent=s1)
>>> s1ca = Node("sub1Ca", parent=s1c)

>>> print(RenderTree(root))
Node('/root')
├── Node('/root/sub0')
│   ├── Node('/root/sub0/sub0B', bar=109, foo=4)
│   └── Node('/root/sub0/sub0A')
└── Node('/root/sub1')
    ├── Node('/root/sub1/sub1A')
    ├── Node('/root/sub1/sub1B', bar=8)
    └── Node('/root/sub1/sub1C')
        └── Node('/root/sub1/sub1C/sub1Ca')

The same tree can be constructed by using the `children` attribute:

>>> root = Node("root", children=[
...     Node("sub0", children=[
...         Node("sub0B", bar=109, foo=4),
...         Node("sub0A", children=None),
...     ]),
...     Node("sub1", children=[
...         Node("sub1A"),
...         Node("sub1B", bar=8, children=[]),
...         Node("sub1C", children=[
...             Node("sub1Ca"),
...         ]),
...     ]),
... ])

>>> print(RenderTree(root))
Node('/root')
├── Node('/root/sub0')
│   ├── Node('/root/sub0/sub0B', bar=109, foo=4)
│   └── Node('/root/sub0/sub0A')
└── Node('/root/sub1')
    ├── Node('/root/sub1/sub1A')
    ├── Node('/root/sub1/sub1B', bar=8)
    └── Node('/root/sub1/sub1C')
        └── Node('/root/sub1/sub1C/sub1Ca')
Nc                 n    U R                   R                  U5        Xl        X l        U(       a  X0l        g g )N)__dict__updatenameparentchildren)selfr   r   r   kwargss        >/app/mltbenv/lib/python3.13/site-packages/anytree/node/node.py__init__Node.__init__H   s+    V$	$M     c                     SR                  U R                  R                  S/U R                   Vs/ s H  n[	        UR
                  5      PM     sn-   5      5      /n[        XS/S9$ s  snf )Nz{!r} r   )argsnameblacklist)format	separatorjoinpathstrr   r   )r   noder   s      r   __repr__Node.__repr__O   s^    dnn112$UYU^U^9_U^T#dii.U^9_2_`abTVH== :`s   A))r   r   r   )NN)__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes__ r   r   r   r      s    @D%>r   r   N)	nodemixinr   utilr   r   r&   r   r   <module>r)      s      L>9 L>r   