<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
†Üäh°Q  ã               @   sÆ   d Z dZddlZddlZejd dk r`G dd„ deƒZG dd„ deƒZejjeƒ ejjeƒ nejZG d	d
„ d
eƒZ	G dd„ de	ƒZ
ejje	ƒ G dd„ de	ƒZG dd„ deƒZG dd„ deƒZdS )aè  Contains container classes to represent different protocol buffer types.

This file defines container classes which represent categories of protocol
buffer field types which need extra maintenance. Currently these categories
are:
  - Repeated scalar fields - These are all repeated fields which aren't
    composite (e.g. they are of simple types like int32, string, etc).
  - Repeated composite fields - Repeated fields which are composite. This
    includes groups and nested messages.
zpetar@google.com (Petar Petrov)é    Né   c               @   sf   e Zd Zf Zddd„Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Z	dd„ Z
dd„ ZdZdd„ Zdd„ ZdS )ÚMappingNc             C   s"   y| | S  t k
r   |S X d S )N)ÚKeyError)ÚselfÚkeyÚdefault© r   ú /usr/lib/python3.6/containers.pyÚgetG   s    zMapping.getc             C   s*   y| |  W n t k
r    dS X dS d S )NFT)r   )r   r   r   r   r	   Ú__contains__M   s
    zMapping.__contains__c             C   s   t | ƒS )N)Úiter)r   r   r   r	   ÚiterkeysU   s    zMapping.iterkeysc             c   s   x| D ]}| | V  qW d S )Nr   )r   r   r   r   r	   Ú
itervaluesX   s    
zMapping.itervaluesc             c   s    x| D ]}|| | fV  qW d S )Nr   )r   r   r   r   r	   Ú	iteritems\   s    
zMapping.iteritemsc             C   s   t | ƒS )N)Úlist)r   r   r   r	   Úkeys`   s    zMapping.keysc                s   ‡ fdd„ˆ D ƒS )Nc                s   g | ]}|ˆ | f‘qS r   r   )Ú.0r   )r   r   r	   ú
<listcomp>d   s    z!Mapping.items.<locals>.<listcomp>r   )r   r   )r   r	   Úitemsc   s    zMapping.itemsc                s   ‡ fdd„ˆ D ƒS )Nc                s   g | ]}ˆ | ‘qS r   r   )r   r   )r   r   r	   r   g   s    z"Mapping.values.<locals>.<listcomp>r   )r   r   )r   r	   Úvaluesf   s    zMapping.valuesc             C   s0   t |tjƒstS tt| jƒ ƒƒtt|jƒ ƒƒkS )N)Ú
isinstanceÚcollectionsr   ÚNotImplementedÚdictr   r   )r   Úotherr   r   r	   Ú__eq__l   s    zMapping.__eq__c             C   s
   | |k S )Nr   )r   r   r   r   r	   Ú__ne__q   s    zMapping.__ne__)N)Ú__name__Ú
__module__Ú__qualname__Ú	__slots__r
   r   r   r   r   r   r   r   Ú__hash__r   r   r   r   r   r	   r   D   s   
r   c               @   sD   e Zd Zf Zeƒ Zefdd„Zdd„ Zdd„ Zdd„ Z	dd
d„Z
d	S )ÚMutableMappingc             C   s<   y| | }W n  t k
r,   || jkr(‚ |S X | |= |S d S )N)r   Ú_MutableMapping__marker)r   r   r   Úvaluer   r   r	   Úpopy   s    
zMutableMapping.popc             C   s@   yt t| ƒƒ}W n tk
r(   t‚Y nX | | }| |= ||fS )N)Únextr   ÚStopIterationr   )r   r   r$   r   r   r	   Úpopitem„   s    
zMutableMapping.popitemc             C   s,   yx| j ƒ  qW W n tk
r&   Y nX d S )N)r(   r   )r   r   r   r	   Úclear   s
    zMutableMapping.clearc              O   sà   t | ƒdkr tdjt | ƒƒƒ‚n| s,tdƒ‚| d }t | ƒdkrH| d nf }t|tƒrrxb|D ]}|| ||< q\W nHt|dƒr x<t|jƒ ƒD ]}|| ||< qŠW nx|D ]\}}|||< q¦W x t|jƒ ƒD ]\}}|||< qÈW d S )Né   z8update() takes at most 2 positional arguments ({} given)z,update() takes at least 1 argument (0 given)r   é   r   )	ÚlenÚ	TypeErrorÚformatr   r   Úhasattrr   r   r   )ÚargsÚkwdsr   r   r   r$   r   r   r	   Úupdate”   s"    


zMutableMapping.updateNc             C   s*   y| | S  t k
r$   || |< Y nX |S )N)r   )r   r   r   r   r   r	   Ú
setdefault©   s
    zMutableMapping.setdefault)N)r   r   r   r    Úobjectr#   r%   r(   r)   r2   r3   r   r   r   r	   r"   t   s   	r"   c               @   sP   e Zd ZdZddgZdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Z	dd„ Z
dd„ ZdS )ÚBaseContainerzBase container class.Ú_message_listenerÚ_valuesc             C   s   || _ g | _dS )z¹
    Args:
      message_listener: A MessageListener implementation.
        The RepeatedScalarFieldContainer will call this object's
        Modified() method when it is modified.
    N)r6   r7   )r   Úmessage_listenerr   r   r	   Ú__init__À   s    zBaseContainer.__init__c             C   s
   | j | S )z$Retrieves item by the specified key.)r7   )r   r   r   r   r	   Ú__getitem__Ê   s    zBaseContainer.__getitem__c             C   s
   t | jƒS )z0Returns the number of elements in the container.)r,   r7   )r   r   r   r	   Ú__len__Î   s    zBaseContainer.__len__c             C   s
   | |k S )z3Checks if another instance isn't equal to this one.r   )r   r   r   r   r	   r   Ò   s    zBaseContainer.__ne__c             C   s   t dƒ‚d S )Nzunhashable object)r-   )r   r   r   r	   r!   ×   s    zBaseContainer.__hash__c             C   s
   t | jƒS )N)Úreprr7   )r   r   r   r	   Ú__repr__Ú   s    zBaseContainer.__repr__c             O   s(   d|kr|j dƒ|d< | jj||Ž d S )NZsort_functionZcmp)r%   r7   Úsort)r   r0   Úkwargsr   r   r	   r>   Ý   s    zBaseContainer.sortN)r   r   r   Ú__doc__r    r9   r:   r;   r   r!   r=   r>   r   r   r   r	   r5   ¹   s   
r5   c                   sˆ   e Zd ZdZdgZ‡ fdd„Zdd„ Zdd„ Zd	d
„ Zdd„ Z	dd„ Z
ddd„Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Z‡  ZS ) ÚRepeatedScalarFieldContainerzGSimple, type-checked, list-like container for holding repeated scalars.Ú_type_checkerc                s   t t| ƒj|ƒ || _dS )a,  
    Args:
      message_listener: A MessageListener implementation.
        The RepeatedScalarFieldContainer will call this object's
        Modified() method when it is modified.
      type_checker: A type_checkers.ValueChecker instance to run on elements
        inserted into this container.
    N)ÚsuperrA   r9   rB   )r   r8   Ztype_checker)Ú	__class__r   r	   r9   í   s    	z%RepeatedScalarFieldContainer.__init__c             C   s*   | j j| jj|ƒƒ | jjs&| jjƒ  dS )z6Appends an item to the list. Similar to list.append().N)r7   ÚappendrB   Ú
CheckValuer6   ÚdirtyÚModified)r   r$   r   r   r	   rE   ù   s    z#RepeatedScalarFieldContainer.appendc             C   s,   | j j|| jj|ƒƒ | jjs(| jjƒ  dS )zEInserts the item at the specified position. Similar to list.insert().N)r7   ÚinsertrB   rF   r6   rG   rH   )r   r   r$   r   r   r	   rI   ÿ   s    z#RepeatedScalarFieldContainer.insertc                sh   |dkrdS yt |ƒ}W n tk
r6   |s0dS ‚ Y nX ‡ fdd„|D ƒ}|rZˆ jj|ƒ ˆ jjƒ  dS )zBExtends by appending the given iterable. Similar to list.extend().Nc                s   g | ]}ˆ j j|ƒ‘qS r   )rB   rF   )r   Úelem)r   r   r	   r     s    z7RepeatedScalarFieldContainer.extend.<locals>.<listcomp>)r   r-   r7   Úextendr6   rH   )r   Úelem_seqZelem_seq_iterÚ
new_valuesr   )r   r	   rK     s    z#RepeatedScalarFieldContainer.extendc             C   s   | j j|j ƒ | jjƒ  dS )z‰Appends the contents of another repeated field of the same type to this
    one. We do not check the types of the individual fields.
    N)r7   rK   r6   rH   )r   r   r   r   r	   Ú	MergeFrom  s    z&RepeatedScalarFieldContainer.MergeFromc             C   s   | j j|ƒ | jjƒ  dS )z8Removes an item from the list. Similar to list.remove().N)r7   Úremover6   rH   )r   rJ   r   r   r	   rO     s    z#RepeatedScalarFieldContainer.remover+   c             C   s   | j | }| j|ƒ |S )zDRemoves and returns an item at a given index. Similar to list.pop().)r7   Ú__delitem__)r   r   r$   r   r   r	   r%   $  s    

z RepeatedScalarFieldContainer.popc             C   sP   t |tƒr0|jdk	rtdƒ‚| j|j|j|ƒ n| jj|ƒ| j	|< | j
jƒ  dS )z(Sets the item on the specified position.NzExtended slices not supported)r   ÚsliceÚstepÚ
ValueErrorÚ__setslice__ÚstartÚstoprB   rF   r7   r6   rH   )r   r   r$   r   r   r	   Ú__setitem__*  s    

z(RepeatedScalarFieldContainer.__setitem__c             C   s   | j ||… S )zARetrieves the subset of items from between the specified indices.)r7   )r   rU   rV   r   r   r	   Ú__getslice__4  s    z)RepeatedScalarFieldContainer.__getslice__c             C   s@   g }x|D ]}|j | jj|ƒƒ q
W || j||…< | jjƒ  dS )z<Sets the subset of items from between the specified indices.N)rE   rB   rF   r7   r6   rH   )r   rU   rV   r   rM   r$   r   r   r	   rT   8  s
    
z)RepeatedScalarFieldContainer.__setslice__c             C   s   | j |= | jjƒ  dS )z+Deletes the item at the specified position.N)r7   r6   rH   )r   r   r   r   r	   rP   @  s    z(RepeatedScalarFieldContainer.__delitem__c             C   s   | j ||…= | jjƒ  dS )z?Deletes the subset of items from between the specified indices.N)r7   r6   rH   )r   rU   rV   r   r   r	   Ú__delslice__E  s    z)RepeatedScalarFieldContainer.__delslice__c             C   s.   | |krdS t || jƒr$|j| jkS || jkS )z/Compares the current instance with another one.T)r   rD   r7   )r   r   r   r   r	   r   J  s
    z#RepeatedScalarFieldContainer.__eq__éÿÿÿÿ)rZ   )r   r   r   r@   r    r9   rE   rI   rK   rN   rO   r%   rW   rX   rT   rP   rY   r   Ú__classcell__r   r   )rD   r	   rA   æ   s   

rA   c                   sp   e Zd ZdZdgZ‡ fdd„Zdd„ Zdd„ Zd	d
„ Zdd„ Z	ddd„Z
dd„ Zdd„ Zdd„ Zdd„ Z‡  ZS )ÚRepeatedCompositeFieldContainerzBSimple, list-like container for holding repeated composite fields.Ú_message_descriptorc                s   t t| ƒj|ƒ || _dS )a‰  
    Note that we pass in a descriptor instead of the generated directly,
    since at the time we construct a _RepeatedCompositeFieldContainer we
    haven't yet necessarily initialized the type that will be contained in the
    container.

    Args:
      message_listener: A MessageListener implementation.
        The RepeatedCompositeFieldContainer will call this object's
        Modified() method when it is modified.
      message_descriptor: A Descriptor instance describing the protocol type
        that should be present in this container.  We'll use the
        _concrete_class field of this descriptor when the client calls add().
    N)rC   r\   r9   r]   )r   r8   Úmessage_descriptor)rD   r   r	   r9   ^  s    z(RepeatedCompositeFieldContainer.__init__c             K   s<   | j jf |Ž}|j| jƒ | jj|ƒ | jjs8| jjƒ  |S )z{Adds a new element at the end of the list and returns it. Keyword
    arguments may be used to initialize the element.
    )r]   Ú_concrete_classÚ_SetListenerr6   r7   rE   rG   rH   )r   r?   Únew_elementr   r   r	   Úaddp  s    
z#RepeatedCompositeFieldContainer.addc             C   sR   | j j}| j}| j}x0|D ](}|ƒ }|j|ƒ |j|ƒ |j|ƒ qW |jƒ  dS )z{Extends by appending the given sequence of elements of the same type
    as this one, copying each individual message.
    N)r]   r_   r6   r7   r`   rN   rE   rH   )r   rL   Zmessage_classZlistenerr   Úmessagera   r   r   r	   rK   {  s    


z&RepeatedCompositeFieldContainer.extendc             C   s   | j |jƒ dS )zvAppends the contents of another repeated field of the same type to this
    one, copying each individual message.
    N)rK   r7   )r   r   r   r   r	   rN   ‰  s    z)RepeatedCompositeFieldContainer.MergeFromc             C   s   | j j|ƒ | jjƒ  dS )z8Removes an item from the list. Similar to list.remove().N)r7   rO   r6   rH   )r   rJ   r   r   r	   rO     s    z&RepeatedCompositeFieldContainer.remover+   c             C   s   | j | }| j|ƒ |S )zDRemoves and returns an item at a given index. Similar to list.pop().)r7   rP   )r   r   r$   r   r   r	   r%   ”  s    

z#RepeatedCompositeFieldContainer.popc             C   s   | j ||… S )zARetrieves the subset of items from between the specified indices.)r7   )r   rU   rV   r   r   r	   rX   š  s    z,RepeatedCompositeFieldContainer.__getslice__c             C   s   | j |= | jjƒ  dS )z+Deletes the item at the specified position.N)r7   r6   rH   )r   r   r   r   r	   rP   ž  s    z+RepeatedCompositeFieldContainer.__delitem__c             C   s   | j ||…= | jjƒ  dS )z?Deletes the subset of items from between the specified indices.N)r7   r6   rH   )r   rU   rV   r   r   r	   rY   £  s    z,RepeatedCompositeFieldContainer.__delslice__c             C   s,   | |krdS t || jƒs tdƒ‚| j|jkS )z/Compares the current instance with another one.TzSCan only compare repeated composite fields against other repeated composite fields.)r   rD   r-   r7   )r   r   r   r   r	   r   ¨  s
    z&RepeatedCompositeFieldContainer.__eq__rZ   )rZ   )r   r   r   r@   r    r9   rb   rK   rN   rO   r%   rX   rP   rY   r   r[   r   r   )rD   r	   r\   W  s   
r\   c               @   sˆ   e Zd ZdZdddddgZdd„ Zd	d
„ Zdd„ Zd"dd„Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zd d!„ ZdS )#Ú	ScalarMapzGSimple, type-checked, dict-like container for holding repeated scalars.Ú_key_checkerÚ_value_checkerr7   r6   Ú_entry_descriptorc             C   s"   || _ || _|| _|| _i | _dS )aÓ  
    Args:
      message_listener: A MessageListener implementation.
        The ScalarMap will call this object's Modified() method when it
        is modified.
      key_checker: A type_checkers.ValueChecker instance to run on keys
        inserted into this container.
      value_checker: A type_checkers.ValueChecker instance to run on values
        inserted into this container.
      entry_descriptor: The MessageDescriptor of a map entry: key and value.
    N)r6   re   rf   rg   r7   )r   r8   Úkey_checkerZvalue_checkerÚentry_descriptorr   r   r	   r9   º  s
    zScalarMap.__init__c             C   sD   y
| j | S  tk
r>   | jj|ƒ}| jjƒ }|| j |< |S X d S )N)r7   r   re   rF   rf   ZDefaultValue)r   r   Úvalr   r   r	   r:   Í  s    


zScalarMap.__getitem__c             C   s   | j j|ƒ || jkS )N)re   rF   r7   )r   Úitemr   r   r	   r   Ö  s    zScalarMap.__contains__Nc             C   s   || kr| | S |S d S )Nr   )r   r   r   r   r   r	   r
   ß  s    zScalarMap.getc             C   s0   | j j|ƒ}| jj|ƒ}|| j|< | jjƒ  d S )N)re   rF   rf   r7   r6   rH   )r   r   r$   Zchecked_keyZchecked_valuer   r   r	   rW   å  s    
zScalarMap.__setitem__c             C   s   | j |= | jjƒ  d S )N)r7   r6   rH   )r   r   r   r   r	   rP   ë  s    zScalarMap.__delitem__c             C   s
   t | jƒS )N)r,   r7   )r   r   r   r	   r;   ï  s    zScalarMap.__len__c             C   s
   t | jƒS )N)r   r7   )r   r   r   r	   Ú__iter__ò  s    zScalarMap.__iter__c             C   s
   t | jƒS )N)r<   r7   )r   r   r   r	   r=   õ  s    zScalarMap.__repr__c             C   s   | j j|j ƒ | jjƒ  d S )N)r7   r2   r6   rH   )r   r   r   r   r	   rN   ø  s    zScalarMap.MergeFromc             C   s   | j }|jƒ | _ d |d < d S )N)r7   Úcopy)r   Úoriginalr   r   r	   ÚInvalidateIteratorsü  s    
zScalarMap.InvalidateIteratorsc             C   s   | j jƒ  | jjƒ  d S )N)r7   r)   r6   rH   )r   r   r   r	   r)     s    
zScalarMap.clearc             C   s   | j jS )N)rg   r_   )r   r   r   r	   ÚGetEntryClass  s    zScalarMap.GetEntryClass)N)r   r   r   r@   r    r9   r:   r   r
   rW   rP   r;   rl   r=   rN   ro   r)   rp   r   r   r   r	   rd   ²  s    		
rd   c               @   s   e Zd ZdZdddddgZdd„ Zd	d
„ Zdd„ Zd$dd„Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zd d!„ Zd"d#„ ZdS )%Ú
MessageMapzESimple, type-checked, dict-like container for with submessage values.re   r7   r6   r]   rg   c             C   s"   || _ || _|| _|| _i | _dS )aÓ  
    Args:
      message_listener: A MessageListener implementation.
        The ScalarMap will call this object's Modified() method when it
        is modified.
      key_checker: A type_checkers.ValueChecker instance to run on keys
        inserted into this container.
      value_checker: A type_checkers.ValueChecker instance to run on values
        inserted into this container.
      entry_descriptor: The MessageDescriptor of a map entry: key and value.
    N)r6   r]   re   rg   r7   )r   r8   r^   rh   ri   r   r   r	   r9     s
    zMessageMap.__init__c             C   sZ   y
| j | S  tk
rT   | jj|ƒ}| jjƒ }|j| jƒ || j |< | jjƒ  |S X d S )N)	r7   r   re   rF   r]   r_   r`   r6   rH   )r   r   ra   r   r   r	   r:   '  s    



zMessageMap.__getitem__c             C   s   | | S )aa  get_or_create() is an alias for getitem (ie. map[key]).

    Args:
      key: The key to get or create in the map.

    This is useful in cases where you want to be explicit that the call is
    mutating the map.  This can avoid lint errors for statements like this
    that otherwise would appear to be pointless statements:

      msg.my_map[key]
    r   )r   r   r   r   r	   Úget_or_create3  s    zMessageMap.get_or_createNc             C   s   || kr| | S |S d S )Nr   )r   r   r   r   r   r	   r
   D  s    zMessageMap.getc             C   s
   || j kS )N)r7   )r   rk   r   r   r	   r   J  s    zMessageMap.__contains__c             C   s   t dƒ‚d S )Nz5May not set values directly, call my_map[key].foo = 5)rS   )r   r   r$   r   r   r	   rW   M  s    zMessageMap.__setitem__c             C   s   | j |= | jjƒ  d S )N)r7   r6   rH   )r   r   r   r   r	   rP   P  s    zMessageMap.__delitem__c             C   s
   t | jƒS )N)r,   r7   )r   r   r   r	   r;   T  s    zMessageMap.__len__c             C   s
   t | jƒS )N)r   r7   )r   r   r   r	   rl   W  s    zMessageMap.__iter__c             C   s
   t | jƒS )N)r<   r7   )r   r   r   r	   r=   Z  s    zMessageMap.__repr__c             C   s2   x,|D ]$}|| kr| |= | | j || ƒ qW d S )N)ZCopyFrom)r   r   r   r   r   r	   rN   ]  s    
zMessageMap.MergeFromc             C   s   | j }|jƒ | _ d |d < d S )N)r7   rm   )r   rn   r   r   r	   ro   g  s    
zMessageMap.InvalidateIteratorsc             C   s   | j jƒ  | jjƒ  d S )N)r7   r)   r6   rH   )r   r   r   r	   r)   o  s    
zMessageMap.clearc             C   s   | j jS )N)rg   r_   )r   r   r   r	   rp   s  s    zMessageMap.GetEntryClass)N)r   r   r   r@   r    r9   r:   rr   r
   r   rW   rP   r;   rl   r=   rN   ro   r)   rp   r   r   r   r	   rq     s"   

rq   )r@   Ú
__author__r   ÚsysÚversion_infor4   r   r"   Úregisterr5   rA   ÚMutableSequencer\   rd   rq   r   r   r   r	   Ú<module>(   s   0<-n[Z