o
    ?i~                     @   s  d dl Z d dlZd dlmZmZ d dlmZ d dlmZm	Z	 d dl
mZ d dlmZmZmZmZmZmZmZmZmZ d dlmZ dd	lmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z% dd
l&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ee6e7e8ee9e:f Z;eG dd dZ<eG dd de<Z=G dd deZ>G dd de>Z?G dd de?Z@G dd deZAG dd de?ZBdS )    N)ABCabstractmethod)defaultdict)	dataclassfield)Enum)	AnyDictIteratorListOptionalSetTupleTypeUnion)ParserRuleContext   )_DEFAULT_MARKER_NoneType	ValueKind
_get_value_is_interpolation_is_missing_value_is_specialformat_and_raiseget_value_kindis_union_annotationis_valid_value_annotation	split_keytype_str)	ConfigKeyErrorConfigTypeErrorInterpolationKeyErrorInterpolationResolutionError InterpolationToMissingValueErrorInterpolationValidationErrorMissingMandatoryValueUnsupportedInterpolationTypeValidationError)OmegaConfGrammarParser)parse)GrammarVisitorc                   @   s   e Zd ZU eee ef ed< eee ef ed< eed< eed< dZe	e
eef  ed< dZeed< ed	d
 dZe
eef ed< dddZedeee ef fddZdS )Metadataref_typeobject_typeoptionalkeyNflagsF
flags_rootc                   C   s   t tS N)r   dict r5   r5   K/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/omegaconf/base.py<lambda>A   s    zMetadata.<lambda>)default_factoryresolver_cachereturnc                 C   s   | j d u r
i | _ d S d S r3   )r1   selfr5   r5   r6   __post_init__C   s   

zMetadata.__post_init__c                 C   s   | j rt| j S | jS )z<Compute `type_hint` from `self.optional` and `self.ref_type`)r/   r   r-   r;   r5   r5   r6   	type_hintG   s   
zMetadata.type_hintr:   N)__name__
__module____qualname__r   r   r   __annotations__boolr1   r   r	   strr2   r   r9   r=   propertyr>   r5   r5   r5   r6   r,   ,   s   
 
 r,   c                   @   s0   e Zd ZU dZeed< dZeed< dddZdS )ContainerMetadataNkey_typeelement_typer:   c                 C   sp   | j d u rt| _ | jtu st| jtsJ | jd ur,t| js,tdt| jdd d| j	d u r6i | _	d S d S )NzUnsupported value type: 'T)include_module_name')
r-   r   rH   
isinstancetyperI   r   r(   r   r1   r;   r5   r5   r6   r=   X   s   




zContainerMetadata.__post_init__r?   )r@   rA   rB   rH   r   rC   rI   r=   r5   r5   r5   r6   rG   S   s   
 rG   c                   @   s  e Zd ZU eed< ed ed< eeeee f  ed< ded defddZ	d	eee
f fd
dZdeee
f d	dfddZded d	dfddZdVddZd	ed fddZd	ed fddZdeee ef deeee  ee f d	d fddZded	ee fddZded	ee fd d!Zded	ee fd"d#Z		dWd$e
d%e
d&ed'ee d(e
d	dfd)d*Zed$eeeef  d	efd+d,ZdXd-d.Z	/	dYd0ed1eee  d	ed  fd2d3Z	dZd0ed1eee  d	ed  fd4d5Z d[d6d7Z!d	efd8d9Z"d	efd:d;Z#ed<e
d	efd=d>Z$ed<e
d	efd?d@Z%ed	efdAdBZ&ed	e
fdCdDZ'edZd%e
deeeef  d	dfdEdFZ(ed	efdGdHZ)ed	efdIdJZ*d	e
fdKdLZ+d$e
d	dfdMdNZ,d	efdOdPZ-dQed	dfdRdSZ.d	efdTdUZ/dS )\Node	_metadataBox_parent_flags_cacheparentmetadatac                 C   s"   || j d< || j d< d | j d< d S )NrO   rQ   rR   __dict__r<   rS   rT   r5   r5   r6   __init__l   s   

zNode.__init__r:   c                 C   s   t  | j}|d= |S NrR   )copyrV   r<   
state_dictr5   r5   r6   __getstate__q   s   zNode.__getstate__r\   Nc                 C   s   | j | d | j d< d S rY   )rV   updater[   r5   r5   r6   __setstate__w   s   zNode.__setstate__c                 C   s,   |d u st |tsJ || jd< |   d S NrQ   )rL   rP   rV   _invalidate_flags_cacher<   rS   r5   r5   r6   _set_parent{   s   
zNode._set_parentc                 C   s   d | j d< d S rY   rU   r;   r5   r5   r6   ra         zNode._invalidate_flags_cachec                 C   s$   | j d }|d u st|tsJ |S r`   )rV   rL   rP   rb   r5   r5   r6   _get_parent   s   
zNode._get_parent	Containerc                 C   sh   | j d }|du st|tsJ t|tr'|j d }|du s%t|ts%J |S |du s2t|ts2J |S )z{
        Like _get_parent, but returns the grandparent
        in the case where `self` is wrapped by a UnionNode.
        rQ   N)rV   rL   rP   	UnionNoderf   )r<   rS   grandparentr5   r5   r6   _get_parent_container   s   


zNode._get_parent_containerr1   valuesc                 C   s   t |tr|g}|d u st |tr|g}t|dkr t|| }t|t|kr,tdt|D ].\}}|| }|d u rP| jjd usDJ || jjv rO| jj|= q0| jjd usXJ || jj|< q0|   | S )Nr   z3Inconsistent lengths of input flag names and values)	rL   rE   rD   len
ValueError	enumeraterO   r1   ra   )r<   r1   rj   idxflagvaluer5   r5   r6   	_set_flag   s&   

zNode._set_flagro   c                 C   s   | j jdusJ | j j|S )zc
        :param flag: flag to inspect
        :return: the state of the flag on this node.
        N)rO   r1   get)r<   ro   r5   r5   r6   _get_node_flag   s   zNode._get_node_flagc                 C   s`   | j d }|d u ri  }| j d< ||t}|tu r#| |}|||< |d u s.t|ts.J |S rY   )rV   rr   r   _get_flag_no_cacherL   rD   )r<   ro   cacheretr5   r5   r6   	_get_flag   s   

zNode._get_flagc                 C   sZ   | j j}|dus
J ||v r|| dur|| S |  rdS |  }|du r(dS ||S )z
        Returns True if this config node flag is set
        A flag is set if node.set_flag(True) was called
        or one if it's parents is flag is set
        :return:
        N)rO   r1   _is_flags_rootre   rw   )r<   ro   r1   rS   r5   r5   r6   rt      s   
zNode._get_flag_no_cacher0   rp   causemsgtype_overridec                 C   s(   t | |||d u rt|n|||d J )N)noder0   rp   rz   ry   r{   )r   rE   )r<   r0   rp   ry   rz   r{   r5   r5   r6   _format_and_raise   s   zNode._format_and_raisec                 C      d S r3   r5   r<   r0   r5   r5   r6   _get_full_key      zNode._get_full_keyc                 C   s   | j dd}|d usJ |S )NT)throw_on_resolution_failure_dereference_node_impl)r<   r|   r5   r5   r6   _dereference_node   s   zNode._dereference_nodeFr   memoc                 C   s   | j ||dS )Nr   r   r   )r<   r   r   r5   r5   r6   _maybe_dereference_node   s   zNode._maybe_dereference_nodec                 C   s^   |   s| S |  }|d u r|rtdd S |d usJ |  }|j||| tt| ||dS )Nz8Cannot resolve interpolation for a node without a parent)rS   r0   rp   
parse_treer   r   )r   ri   r#   _key&_resolve_interpolation_from_parse_treer*   r   )r<   r   r   rS   r0   r5   r5   r6   r     s&   
zNode._dereference_node_implc                 C   s   |   }|d u rt| tsJ | S |d urt|tsJ |  d ur7|  }|d ur/t|ts1J |  d us"|d ur@t|tsBJ |S r3   )re   rL   rf   rP   )r<   rootr5   r5   r6   	_get_root  s   zNode._get_rootc                 C   s   t | S )zY
        Check if the node's value is `???` (does *not* resolve interpolations).
        )r   r;   r5   r5   r6   _is_missing*  s   zNode._is_missingc                 C   s   |   du S )zZ
        Check if the node's value is `None` (does *not* resolve interpolations).
        N)_valuer;   r5   r5   r6   _is_none0  s   zNode._is_noneotherc                 C   r~   r3   r5   r<   r   r5   r5   r6   __eq__6  r   zNode.__eq__c                 C   r~   r3   r5   r   r5   r5   r6   __ne__:  r   zNode.__ne__c                 C   r~   r3   r5   r;   r5   r5   r6   __hash__>  r   zNode.__hash__c                 C   r~   r3   r5   r;   r5   r5   r6   r   B  r   zNode._valuec                 C   r~   r3   r5   )r<   rp   r1   r5   r5   r6   
_set_valueF  r   zNode._set_valuec                 C   r~   r3   r5   r;   r5   r5   r6   _is_optionalJ  r   zNode._is_optionalc                 C   r~   r3   r5   r;   r5   r5   r6   r   N  r   zNode._is_interpolationc                 C      | j jS r3   rO   r0   r;   r5   r5   r6   r   R     z	Node._keyc                 C   s   || j _d S r3   r   r   r5   r5   r6   _set_keyU     zNode._set_keyc                 C   r   r3   )rO   r2   r;   r5   r5   r6   rx   X  r   zNode._is_flags_rootr2   c                 C   s$   | j j|kr|| j _|   d S d S r3   )rO   r2   ra   )r<   r2   r5   r5   r6   _set_flags_root[  s   zNode._set_flags_rootc                 C   s   | j jtuS r3   )rO   r-   r   r;   r5   r5   r6   _has_ref_type`  r   zNode._has_ref_typer?   NN)r:   rN   )FNr3   )r:   rf   )0r@   rA   rB   r,   rC   r   r	   rE   rD   rX   r   r]   r_   rc   ra   re   ri   r   r   rq   rs   rw   rt   	Exceptionr}   r   DictKeyTypeintr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rx   r   r   r5   r5   r5   r6   rN   f   s   
 


 





&rN   c                       sP   e Zd ZU dZeed< ded  def fddZdefdd	Z	dddZ
  ZS )rP   z
    Base class for nodes that can contain other nodes.
    Concrete subclasses include DictConfig, ListConfig, and UnionNode.
    _contentrS   rT   c                    s   t  j||d d | jd< d S )NrS   rT   r   )superrX   rV   rW   	__class__r5   r6   rX   l  s   zBox.__init__r:   c                 C   s
   t | S r3   )rZ   deepcopyr;   r5   r5   r6   __copy__p  s   
zBox.__copy__Nc                 C   s  ddl m} ddlm} t| |r=| jd }t|tr9| jd  D ]\}}|d ur/||  t|t	r8|
  q"d S d S t| |rj| jd }t|trf| jd D ]}|d ur\||  t|t	re|
  qQd S d S t| tr| jd }t|tr||  t|t	r|
  d S d S d S d S )Nr   
DictConfig
ListConfigr   )
dictconfigr   
listconfigr   rL   rV   r4   itemsrc   rP   
_re_parentlistrg   rN   )r<   r   r   contentr   rp   itemr5   r5   r6   r   t  sB   














zBox._re_parentr?   )r@   rA   rB   __doc__r   rC   r   r,   rX   r   r   __classcell__r5   r5   r   r6   rP   d  s   
 rP   c                   @   s  e Zd ZU dZeed< e				d<dedededed	ed
e	e
e ee
e  f fddZe				d<dedededed	ed
e	e
e ee
e  f fddZeded
dfddZededed
dfddZed
ee fddZeded
efddZded
ed ef fddZ	d=dededede
ee  d
ee
d  e
e e
e f f
dd Zd!e
d  dd"ded#ejdede
ee  d
e
d" fd$d%Zd!e
d  dd"ded&eded
e
d" fd'd(Zd)ed*ed
dfd+d,Zd-ede
ee  d
d"fd.d/Zded)ed0ed1eed2f d3eed2f d
efd4d5Z 	d=d!e
d  dededede
ee  d
e
e fd6d7Z!		d>d#e"d)ede
ee  de
e d
ef
d8d9Z#d?d:d;Z$dS )@rf   z%
    Container tagging interface
    rO   TFr0   validate_accessvalidate_keythrow_on_missing_valuethrow_on_missing_keyr:   c                 C   r~   r3   r5   r<   r0   r   r   r   r   r5   r5   r6   
_get_child     	zContainer._get_childc                 C   r~   r3   r5   r   r5   r5   r6   	_get_node  r   zContainer._get_nodeNc                 C   r~   r3   r5   r   r5   r5   r6   __delitem__  r   zContainer.__delitem__rp   c                 C   r~   r3   r5   )r<   r0   rp   r5   r5   r6   __setitem__  r   zContainer.__setitem__c                 C   r~   r3   r5   r;   r5   r5   r6   __iter__  r   zContainer.__iter__key_or_indexc                 C   r~   r3   r5   )r<   r   r5   r5   r6   __getitem__  r   zContainer.__getitem__c                 C   s|   |}| ds|  |fS | }| dsJ 	 |d usJ |dd  }| ds-	 ||fS | }|d u r=td| dq)N.Tr   zError resolving key 'rK   )
startswithr   ri   r    )r<   r0   origr   r5   r5   r6   _resolve_key_and_root  s   

zContainer._resolve_key_and_rootthrow_on_missingr   r   c              	   C   s  ddl m} |dkr| d| fS t|}| }tt|d D ]L}|du r% nE|| }	|||	||d\}
}t|
tr?|
j||d}
|
durgt|
tsgd	|d|d  }||d  }t
d	| d
| d| d|
}q|du rpdS |d }|||||d\}}|du r||dfS |durt|}||v rtd|| z|j|||||d}W |dur|| n|dur|| w w |||fS )zA
        Select a value using dot separated key sequence
        r   )_select_one N)cr0   r   throw_on_type_errorr   r   r   zError trying to access z: node `z.` is not a container and thus cannot contain ``)NNNz Recursive interpolation detected)rS   r0   rp   r   r   )	omegaconfr   r   rangerk   rL   rN   r   rf   joinr!   idr#   add_maybe_resolve_interpolationremove)r<   r0   r   r   r   r   splitr   ikrv   _
parent_key	child_keylast_keyrp   vidr5   r5   r6   _select_impl  sx   








zContainer._select_implrS   rN   r   c                 C   sF   z| j ||||d}W n ty   |r Y dS w | j|||||dS )a  
        Resolve an interpolation.

        This happens in two steps:
            1. The parse tree is visited, which outputs either a `Node` (e.g.,
               for node interpolations "${foo}"), a string (e.g., for string
               interpolations "hello ${name}", or any other arbitrary value
               (e.g., or custom interpolations "${foo:bar}").
            2. This output is potentially validated and converted when the node
               being resolved (`value`) is typed.

        If an error occurs in one of the above steps, an `InterpolationResolutionError`
        (or a subclass of it) is raised, *unless* `throw_on_resolution_failure` is set
        to `False` (in which case the return value is `None`).

        :param parent: Parent of the node being resolved.
        :param value: Node being resolved.
        :param key: The associated key in the parent.
        :param parse_tree: The parse tree as obtained from `grammar_parser.parse()`.
        :param throw_on_resolution_failure: If `False`, then exceptions raised during
            the resolution of the interpolation are silenced, and instead `None` is
            returned.

        :return: A `Node` that contains the interpolation result. This may be an existing
            node in the config (in the case of a node interpolation "${foo}"), or a new
            node that is created to wrap the interpolated value. It is `None` if and only if
            `throw_on_resolution_failure` is `False` and an error occurs during resolution.
        )r   r|   r0   r   N)rS   rp   r0   resolvedr   )resolve_parse_treer#   *_validate_and_convert_interpolation_result)r<   rS   rp   r0   r   r   r   r   r5   r5   r6   r   !  s    &
z0Container._resolve_interpolation_from_parse_treer   c                 C   s   ddl m}m}m} t|t }	t||rWt||sWt|}
z||
}W n% tyJ } z|r?| j	||
|d| d| t
d W Y d }~d S d }~ww t|t|
krWd}	|}|	r`||||dS t|tsgJ |S )Nr   )AnyNodeInterpolationResultNode	ValueNodez#While dereferencing interpolation 'z': )r0   rp   ry   rz   r{   T)rp   r0   rS   )nodesr   r   r   rL   rN   r   validate_and_convertr(   r}   r%   rM   )r<   rS   rp   r0   r   r   r   r   r   	must_wrap	res_value
conv_valueer5   r5   r6   r   X  s2   z4Container._validate_and_convert_interpolation_resultr|   targetc                 C   s4   |}|d ur||u rt d| }|d usd S d S )Nz%Interpolation to parent node detected)r#   re   )r<   r|   r   rS   r5   r5   r6   %_validate_not_dereferencing_to_parent  s   z/Container._validate_not_dereferencing_to_parent	inter_keyc              
   C   s   z	|  |\}}W n ty# } ztd| t d d}~ww z|j|dd|d\}}}W n tyL } ztd| t d d}~ww |du sU|du r]td| d| j	| |d	 |S )
z0A node interpolation is of the form `${foo.bar}`z.ConfigKeyError while resolving interpolation:    NT)r   r   r   z5MissingMandatoryValue while resolving interpolation: zInterpolation key 'z' not found)r|   r   )
r   r    r"   with_tracebacksysexc_infor   r&   r$   r   )r<   r   r   	root_nodeexcrS   r   rp   r5   r5   r6   _resolve_node_interpolation  s:   z%Container._resolve_node_interpolation
inter_type
inter_args.inter_args_strc           	      C   sD   ddl m} ||}|d ur|  }||| |||S td| )Nr   )	OmegaConfzUnsupported interpolation type )r   r   _get_resolverr   r'   )	r<   r0   r|   r   r   r   r   resolverr   r5   r5   r6   _evaluate_custom_resolver  s   
z#Container._evaluate_custom_resolverc                 C   sJ   t |}|tjkr|S tt|}| j||||||d ur |dS t dS )N)rS   rp   r0   r   r   r   )r   r   INTERPOLATIONr*   r   r   set)r<   rS   r0   rp   r   r   
value_kindr   r5   r5   r6   r     s   

z&Container._maybe_resolve_interpolationc           	   
      s   dt dttt  dtd ffdd}dt dttd	f d
tt d	f dtf fdd}t|||d}z||W S  tyA     t	y_ } ztt
|j d| t d d}~ww )z
        Resolve a given parse tree into its value.

        We make no assumption here on the type of the tree's root, so that the
        return value may be of any type.
        r   r   r:   rN   c                    s    j | |dS )Nr   r   )r   r   r;   r5   r6   node_interpolation_callback  s   zAContainer.resolve_parse_tree.<locals>.node_interpolation_callbacknameargs.args_strc                    s   j  | ||dS )N)r0   r|   r   r   r   )r   )r  r  r  r0   r|   r<   r5   r6   resolver_interpolation_callback  s   zEContainer.resolve_parse_tree.<locals>.resolver_interpolation_callback)r   r  r   z' raised while resolving interpolation: r   N)rE   r   r   r   r   r   r+   visitr#   r   rM   r@   r   r   r   )	r<   r   r|   r   r0   r   r  visitorr   r5   r  r6   r     sB   


zContainer.resolve_parse_treec                 C   s   ddl m} ddlm} | jd d urTd | jd< t| |r9| jd }t|tr5| jd  D ]}|  q.d S d S t| |rV| jd }t|t	rX| jd D ]}|  qMd S d S d S d S )Nr   r   r   rR   r   )
r   r   r   r   rV   rL   r4   rj   ra   r   )r<   r   r   r   rp   r   r5   r5   r6   ra     s(   








z!Container._invalidate_flags_cache)TTFFr3   r   r?   )%r@   rA   rB   r   rG   rC   r   r   rD   r   r   rN   r   r   r   r   r   r
   r   r   rE   r   r   r   r   r   r)   ConfigValueContextr   r   r   r   r   r   r   r   ra   r5   r5   r5   r6   rf     s  
 



N

7
+	








-rf   c                   @   s   e Zd ZdZdZdZdS )SCModer   r      N)r@   rA   rB   DICTDICT_CONFIGINSTANTIATEr5   r5   r5   r6   r	    s    r	  c                       sj  e Zd ZU dZee ed< eede	f ed< 			d*de
de
ded	e
d
ee ddf fddZd	eeeef  de	fddZde
defddZde
defddZdefddZdeede	f fddZd+de
deee	ef  ddfddZ	d+de
deee	ef  ddfddZdefdd Zdefd!d"Zde	fd#d$Zde	fd%d&Zd'eee
f dd fd(d)Z  ZS ),rg   a  
    This class handles Union type hints. The `_content` attribute is either a
    child node that is compatible with the given Union ref_type, or it is a
    special value (None or MISSING or interpolation).

    Much of the logic for e.g. value assignment and type validation is
    delegated to the child node. As such, UnionNode functions as a
    "pass-through" node. User apps and downstream libraries should not need to
    know about UnionNode (assuming they only use OmegaConf's public API).
    rQ   Nr   Tr   r-   is_optionalr0   rS   r:   c              
      s   z4t |sd| dd }t|t|ttfstdt j|t|d ||ddidd | 	| W d S  t
yR } ztd ||t||d	 W Y d }~d S d }~ww )
Nz"UnionNode got unexpected ref_type z. Please file a bugz3 report at https://github.com/omry/omegaconf/issuesz&Parent type is not omegaconf.ContainerconvertF)r-   r.   r/   r0   r1   r   )r|   r0   rp   rz   ry   )r   AssertionErrorrL   rf   r   r!   r   rX   r,   r   r   r   rE   )r<   r   r-   r  r0   rS   rz   exr   r5   r6   rX   .  s0   

$zUnionNode.__init__c                 C   s:   |   }|d u r| jjd u rdS t| jjS || jjS )Nr   )re   rO   r0   rE   r   )r<   r0   rS   r5   r5   r6   r   M  s   zUnionNode._get_full_keyr   c                 C   sZ   | j d }t|tr||}nt|tr||}n||}t|tttfs+J |S Nr   )rV   rL   rN   r   rD   rM   NotImplemented)r<   r   r   rv   r5   r5   r6   r   W  s   



zUnionNode.__eq__c                 C   s   |  |}|tu rtS | S r3   )r   r  )r<   r   xr5   r5   r6   r   b  s   
zUnionNode.__ne__c                 C      t | jd S r  )hashrV   r;   r5   r5   r6   r   h  rd   zUnionNode.__hash__c                 C   s"   | j d }t|tttfsJ |S r  )rV   rL   rN   r   rE   )r<   r   r5   r5   r6   r   k  s   
zUnionNode._valuerp   r1   c              
   C   sX   | j d }| j d }z	| || W d S  ty+ } z|| j d< || j d< |d }~ww )Nr   rO   )rV   _set_value_implr   )r<   rp   r1   previous_contentprevious_metadatar   r5   r5   r6   r   p  s   



zUnionNode._set_valuec              	   C   s   ddl m} | jj}| jj}t|}t|r8t|tt	fsJ |d u r1| 
 s1tdt| d|| jd< d S t|trFtdt| |jD ]}z|||dd | d| jd< W  d S  tyd   Y qIw td	t| d)
Nr   )
_node_wrapz/Value '$VALUE' is incompatible with type hint 'rK   r   z:Cannot assign container '$VALUE' of type '$VALUE_TYPE' to F)rp   r-   r  r0   rS   zEValue '$VALUE' of type '$VALUE_TYPE' is incompatible with type hint ')omegaconf.omegaconfr  rO   r-   r>   r   r   rL   rE   r   r   r(   r   rV   rf   __args__)r<   rp   r1   r  r-   r>   candidate_ref_typer5   r5   r6   r  z  s@   

zUnionNode._set_value_implc                 C   s   | j d jdu S )NrO   T)rV   r/   r;   r5   r5   r6   r     s   zUnionNode._is_optionalc                 C   r  r  )r   rV   r;   r5   r5   r6   r     rd   zUnionNode._is_interpolationc                 C   r  r  )rE   rV   r;   r5   r5   r6   __str__  rd   zUnionNode.__str__c                 C   r  r  )reprrV   r;   r5   r5   r6   __repr__  rd   zUnionNode.__repr__r   c              	   C   s   t t| }| j D ]\}}|dvrtj||d|j|< q| jd }t|trM|jd }zd |jd< tj||d}||jd< W ||jd< n||jd< w |}||jd< | jd |jd< |S )N)r   rQ   )r   r   rQ   )	object__new__rM   rV   r   rZ   r   rL   rN   )r<   r   resr0   rp   src_content
old_parentcontent_copyr5   r5   r6   __deepcopy__  s"   




zUnionNode.__deepcopy__)TNNr3   )r@   rA   rB   r   r   rf   rC   r   rN   rE   r   rD   rP   rX   r   r   r   r   r   r   r   r	   r   r  r   r   r  r   r'  r   r5   r5   r   r6   rg     sN   
 
$
'"rg   )CrZ   r   abcr   r   collectionsr   dataclassesr   r   enumr   typingr   r	   r
   r   r   r   r   r   r   antlr4r   _utilsr   r   r   r   r   r   r   r   r   r   r   r   r   errorsr    r!   r"   r#   r$   r%   r&   r'   r(   "grammar.gen.OmegaConfGrammarParserr)   grammar_parserr*   grammar_visitorr+   rE   bytesr   floatrD   r   r,   rG   rN   rP   rf   r	  rg   r5   r5   r5   r6   <module>   s6    ,<,& 0   