Λ
    ΰ^j­  γ                   σ2    d dl mZ d dlmZ  G d de«      Zy)ι   )Ϊ	NodeMixin©Ϊ_reprc                   σ    e Zd ZdZddZd Zy)ΪAnyNodeu^  
    A generic tree node with any `kwargs`.

    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:`Node` this class has no default identifier.
    It is up to the user to use other attributes for identification.

    The `parent` attribute refers the parent node:

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

    >>> root
    AnyNode(id='root')
    >>> s0
    AnyNode(id='sub0')
    >>> print(RenderTree(root))
    AnyNode(id='root')
    βββ AnyNode(id='sub0')
    β   βββ AnyNode(bar=109, foo=4, id='sub0B')
    β   βββ AnyNode(id='sub0A')
    βββ AnyNode(id='sub1')
        βββ AnyNode(id='sub1A')
        βββ AnyNode(bar=8, id='sub1B')
        βββ AnyNode(id='sub1C')
            βββ AnyNode(id='sub1Ca')

    >>> print(RenderTree(root))
    AnyNode(id='root')
    βββ AnyNode(id='sub0')
    β   βββ AnyNode(bar=109, foo=4, id='sub0B')
    β   βββ AnyNode(id='sub0A')
    βββ AnyNode(id='sub1')
        βββ AnyNode(id='sub1A')
        βββ AnyNode(bar=8, id='sub1B')
        βββ AnyNode(id='sub1C')
            βββ AnyNode(id='sub1Ca')

    Node attributes can be added, modified and deleted the pythonic way:

    >>> root.new = 'a new attribute'
    >>> s0b
    AnyNode(bar=109, foo=4, id='sub0B')
    >>> s0b.bar = 110  # modified
    >>> s0b
    AnyNode(bar=110, foo=4, id='sub0B')
    >>> del s1b.bar
    >>> print(RenderTree(root))
    AnyNode(id='root', new='a new attribute')
    βββ AnyNode(id='sub0')
    β   βββ AnyNode(bar=110, foo=4, id='sub0B')
    β   βββ AnyNode(id='sub0A')
    βββ AnyNode(id='sub1')
        βββ AnyNode(id='sub1A')
        βββ AnyNode(id='sub1B')
        βββ AnyNode(id='sub1C')
            βββ AnyNode(id='sub1Ca')

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

    >>> root = AnyNode(id="root", children=[
    ...     AnyNode(id="sub0", children=[
    ...         AnyNode(id="sub0B", foo=4, bar=109),
    ...         AnyNode(id="sub0A"),
    ...     ]),
    ...     AnyNode(id="sub1", children=[
    ...         AnyNode(id="sub1A"),
    ...         AnyNode(id="sub1B", bar=8),
    ...         AnyNode(id="sub1C", children=[
    ...             AnyNode(id="sub1Ca"),
    ...         ]),
    ...     ]),
    ... ])
    Nc                 σ\    | j                   j                  |«       || _        |r|| _        y y ©N)Ϊ__dict__ΪupdateΪparentΪchildren)Ϊselfr   r   Ϊkwargss       ϊM/opt/ringagent/.cad-venv/lib/python3.12/site-packages/anytree/node/anynode.pyΪ__init__zAnyNode.__init__]   s*    ΨΧΡVΤ$ΨΩΨ$DMπ σ    c                 σ    t        | «      S r	   r   )r   s    r   Ϊ__repr__zAnyNode.__repr__c   s    άT{Πr   )NN)Ϊ__name__Ϊ
__module__Ϊ__qualname__Ϊ__doc__r   r   © r   r   r   r      s    ρUσn%σr   r   N)Ϊ	nodemixinr   Ϊutilr   r   r   r   r   ϊ<module>r      s   πέ  έ τ_iυ _r   