<!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                 @   s   d Z dZddlZddlZddlZddlmZ ddlmZ ye	 W n e
k
rX   e	ZY nX 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d ZG dd dejZdS ) zpUtilities for Python proto2 tests.

This is intentionally modeled on C++ code in
//google/protobuf/test_util.*.
z#robinson@google.com (Will Robinson)    N)unittest_import_pb2)unittest_pb2c             C   s   | j jdkS )NZproto2)Z
DESCRIPTORZsyntax)message r   /usr/lib/python3.6/test_util.pyIsProto27   s    r   c             C   s  d| _ d| _d| _d| _d| _d| _d| _d| _d	| _d
| _	d| _
d| _d| _d| _d| _t| rjd| j_d| j_d| j_d| j_d| j_tjj| _tj| _t| rt j!| _"d| _#d| _$| j%j&d | j'j&d | j(j&d | j)j&d | j*j&d | j+j&d | j,j&d | j-j&d | j.j&d | j/j&d  | j0j&d! | j1j&d" | j2j&d | j3j&d# | j4j&d$ t| rd%| j5j6 _d&| j7j6 _d'| j8j6 _d(| j9j6 _d)| j:j6 _| j;j&tjj< | j=j&tj> t| r| j?j&t j@ | jAj&d* | jBj&d+ | j%j&d, | j'j&d, | j(j&d, | j)j&d, | j*j&d, | j+j&d, | j,j&d, | j-j&d, | j.j&d, | j/j&d, | j0j&d, | j1j&d, | j2j&d | j3j&d- | j4j&d. d/| j%d0< d1| j'd0< d2| j(d0< d3| j)d0< d4| j*d0< d5| j+d0< d6| j,d0< d7| j-d0< d8| j.d0< d9| j/d0< d:| j0d0< d;| j1d0< d<| j2d0< d=| j3d0< d>| j4d0< t| r`d?| j5j6 _d@| j7j6 _dA| j8j6 _dB| j9j6 _dC| j:j6 _| j;j&tjj< tjj| j;d0< | j=j&tj t| r| j?j&t j! | jAj&dD | jBj&dE t| rvdF| _CdG| _DdH| _EdI| _FdJ| _GdK| _HdL| _IdM| _JdN| _KdO| _LdP| _MdQ| _Nd<| _OdR| _PdS| _QtjjR| _StjT| _Ut jV| _WdT| _XdU| _YdV| _ZdW| j[_dX| _\dY| _]dZS )[zmSets every non-lazy field in the message to a unique value.

  Args:
    message: A TestAllTypes instance.
  e   f   g   h   i   j   k   l   m   n   o   p   T115s   116u   v   w   x   ~   124125                                    215s   216               224225r   0   0i-     i.  i/  i0  i1  i2  i3  i4  i5  i6  i7  i8  F315s   316i=  i>  i?  i@  iG  324325i  i  i  i  i  i  i  i  i  i  i  i  415s   416424425iY  iZ  603s   604N)^optional_int32optional_int64optional_uint32optional_uint64optional_sint32optional_sint64optional_fixed32optional_fixed64optional_sfixed32optional_sfixed64optional_floatoptional_doubleoptional_booloptional_stringoptional_bytesr   optionalgroupaoptional_nested_messagebboptional_foreign_messagecoptional_import_messagedoptional_public_import_messageer   TestAllTypesBAZoptional_nested_enumFOREIGN_BAZoptional_foreign_enumr   
IMPORT_BAZoptional_import_enumoptional_string_pieceoptional_cordrepeated_int32appendrepeated_int64repeated_uint32repeated_uint64repeated_sint32repeated_sint64repeated_fixed32repeated_fixed64repeated_sfixed32repeated_sfixed64repeated_floatrepeated_doublerepeated_boolrepeated_stringrepeated_bytesrepeatedgroupaddrepeated_nested_messagerepeated_foreign_messagerepeated_import_messagerepeated_lazy_messagerepeated_nested_enumBARrepeated_foreign_enumFOREIGN_BARrepeated_import_enum
IMPORT_BARrepeated_string_piecerepeated_corddefault_int32default_int64default_uint32default_uint64default_sint32default_sint64default_fixed32default_fixed64default_sfixed32default_sfixed64default_floatdefault_doubledefault_booldefault_stringdefault_bytesFOOdefault_nested_enumFOREIGN_FOOdefault_foreign_enum
IMPORT_FOOdefault_import_enumZdefault_string_pieceZdefault_cordZoneof_uint32Zoneof_nested_messageZoneof_stringZoneof_bytes)r   r   r   r   SetAllNonLazyFields;   s    





















r   c             C   s   t |  d| j_d S )N   )r   optional_lazy_messagerL   )r   r   r   r   SetAllFields   s    r   c             C   sb  | j }t}t}d||j< d||j< d||j< d||j< d||j< d||j< d||j	< d||j
< d	||j< d
||j< d||j< d||j< d||j< d||j< d||j< d||j _d||j _d||j _d||j _d||j _d||j _|jj||j< |jj||j< |j ||j!< |j"||j#< d||j$< d||j%< ||j& j'd ||j( j'd ||j) j'd ||j* j'd ||j+ j'd ||j, j'd ||j- j'd ||j. j'd ||j/ j'd  ||j0 j'd! ||j1 j'd" ||j2 j'd# ||j3 j'd ||j4 j'd$ ||j5 j'd% d&||j6 j7 _d'||j8 j7 _d(||j9 j7 _d)||j: j7 _d*||j; j7 _||j< j'|jj= ||j> j'|j? ||j@ j'|jA ||jB j'd+ ||jC j'd, ||j& j'd- ||j( j'd. ||j) j'd/ ||j* j'd0 ||j+ j'd1 ||j, j'd2 ||j- j'd3 ||j. j'd4 ||j/ j'd5 ||j0 j'd6 ||j1 j'd7 ||j2 j'd8 ||j3 j'd9 ||j4 j'd: ||j5 j'd; d<||j6 j7 _d=||j8 j7 _d>||j9 j7 _d?||j: j7 _d@||j; j7 _||j< j'|jj ||j> j'|j  ||j@ j'|j" ||jB j'dA ||jC j'dB dC||jD< dD||jE< dE||jF< dF||jG< dG||jH< dH||jI< dI||jJ< dJ||jK< dK||jL< dL||jM< dM||jN< dN||jO< d9||jP< dO||jQ< dP||jR< |jjS||jT< |jU||jV< |jW||jX< dQ||jY< dR||jZ< dS||j[< dT||j\ _dU||j]< dV||j^< dWS )XzzSets every extension in the message to a unique value.

  Args:
    message: A unittest_pb2.TestAllExtensions instance.
  r   r	   r
   r   r   r   r   r   r   r   r   r   Tr   s   116r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   s   216r)   r*   r+   r,   r-   r.   r/   i-  i.  i/  i0  i1  i2  i3  i4  i5  i6  i7  i8  Fr3   s   316i=  i>  i?  i@  iG  r4   r5   i  i  i  i  i  i  i  i  i  i  i  i  r6   s   416r7   r8   iY  iZ  r9   s   604N)_
Extensionsr   r   Zoptional_int32_extensionZoptional_int64_extensionZoptional_uint32_extensionZoptional_uint64_extensionZoptional_sint32_extensionZoptional_sint64_extensionZoptional_fixed32_extensionZoptional_fixed64_extensionZoptional_sfixed32_extensionZoptional_sfixed64_extensionZoptional_float_extensionZoptional_double_extensionZoptional_bool_extensionZoptional_string_extensionZoptional_bytes_extensionZoptionalgroup_extensionrJ   Z!optional_nested_message_extensionrL   Z"optional_foreign_message_extensionrN   Z!optional_import_message_extensionrP   Z(optional_public_import_message_extensionrR   Zoptional_lazy_message_extensionrS   rT   Zoptional_nested_enum_extensionrV   Zoptional_foreign_enum_extensionrX   Zoptional_import_enum_extensionZoptional_string_piece_extensionZoptional_cord_extensionZrepeated_int32_extensionr]   Zrepeated_int64_extensionZrepeated_uint32_extensionZrepeated_uint64_extensionZrepeated_sint32_extensionZrepeated_sint64_extensionZrepeated_fixed32_extensionZrepeated_fixed64_extensionZrepeated_sfixed32_extensionZrepeated_sfixed64_extensionZrepeated_float_extensionZrepeated_double_extensionZrepeated_bool_extensionZrepeated_string_extensionZrepeated_bytes_extensionZrepeatedgroup_extensionrm   Z!repeated_nested_message_extensionZ"repeated_foreign_message_extensionZ!repeated_import_message_extensionZrepeated_lazy_message_extensionZrepeated_nested_enum_extensionrs   Zrepeated_foreign_enum_extensionru   Zrepeated_import_enum_extensionrw   Zrepeated_string_piece_extensionZrepeated_cord_extensionZdefault_int32_extensionZdefault_int64_extensionZdefault_uint32_extensionZdefault_uint64_extensionZdefault_sint32_extensionZdefault_sint64_extensionZdefault_fixed32_extensionZdefault_fixed64_extensionZdefault_sfixed32_extensionZdefault_sfixed64_extensionZdefault_float_extensionZdefault_double_extensionZdefault_bool_extensionZdefault_string_extensionZdefault_bytes_extensionr   Zdefault_nested_enum_extensionr   Zdefault_foreign_enum_extensionr   Zdefault_import_enum_extensionZdefault_string_piece_extensionZdefault_cord_extensionZoneof_uint32_extensionZoneof_nested_message_extensionZoneof_string_extensionZoneof_bytes_extension)r   
extensionspb2Z
import_pb2r   r   r   SetAllExtensions   s    



































r   c             C   s.   d| _ d| _d| _d| jtj< d| jtj< dS )zSets every field and extension in the message to a unique value.

  Args:
    message: A unittest_pb2.TestAllExtensions message.
  r2   foog      ?   barN)my_int	my_stringmy_floatr   r   my_extension_intmy_extension_string)r   r   r   r   SetAllFieldsAndExtensionsm  s
    r   c             C   s   t j}t j}g }t j }d|_|j|j  |j  d|j|< |j|j  |j  d|_	|j|j  |j  d|j|< |j|j  |j  d|_
|j|j  |j  dj|}|| krtd|| f dS )	zEnsures that serialized is the serialization we expect for a message
  filled with SetAllFieldsAndExtensions().  (Specifically, ensures that the
  serialization is in canonical, tag-number order).
  r2   r   r   r   g      ?    zExpected %r, found %rN)r   r   r   ZTestFieldOrderingsr   r]   ZSerializeToStringZClearr   r   r   join
ValueError)Z
serializedr   r   Zexpected_stringsr   Zexpectedr   r   r   #ExpectAllFieldsAndExtensionsInOrderz  s,    


r   c             C   s
  | j |jd | j |jd | j |jd | j |jd | j |jd | j |jd | j |jd | j |jd | j |jd	 | j |jd
 | j |jd | j |jd | j |jd | j |jd | j |jd t|r
| j |jd | j |jd | j |jd | j |jd | j |jjd | j |jjd | j |jjd | j |jjd | j |jd | j |jd t|r| j |jd | j |jd | j |jd | jd|j | jd|j	 | jd|j
 | jd |j | jd!|j | jd"|j | jd#|j | jd$|j | jd%|j | jd&|j | jd'|j | jd(|j | jd)|j | jd*|j | jd+|j t|r| jd,|jj | jd-|jj | jd.|jj | jd/|jj | jd0|jj | jd1|jj | jtjj |j! | jtj"|j# t|rT| jt$j%|j& | jd2t'|j( | jd2t'|j) | jd2t'|j* | jd2t'|j+ | jd2t'|j, | jd2t'|j- | jd2t'|j. | jd2t'|j/ | jd2t'|j0 | jd2t'|j1 | jd2t'|j2 | jd2t'|j3 | jd2t'|j4 | jd2t'|j5 | jd2t'|j6 t|r~| jd2t'|j7 | jd2t'|j8 | jd2t'|j9 | jd2t'|j: | jd2t'|j; | jd2t'|j< t|r| jd2t'|j= | jd2t'|j> | jd2t'|j? | jd3|j(d4  | jd5|j)d4  | jd6|j*d4  | jd7|j+d4  | jd8|j,d4  | jd9|j-d4  | jd:|j.d4  | jd;|j/d4  | jd<|j0d4  | jd=|j1d4  | jd>|j2d4  | jd?|j3d4  | jd)|j4d4  | jd@|j5d4  | jdA|j6d4  t|rD| jdB|j7d4 j | jdC|j8d4 j | jdD|j9d4 j | jdE|j:d4 j | jdF|j@d4 j | jtjjA|j;d4  | jtjB|j<d4  t|r| jt$jC|j=d4  | jdG|j(dH  | jdI|j)dH  | jdJ|j*dH  | jdK|j+dH  | jdL|j,dH  | jdM|j-dH  | jdN|j.dH  | jdO|j/dH  | jdP|j0dH  | jdQ|j1dH  | jdR|j2dH  | jdS|j3dH  | jdT|j4dH  | jdU|j5dH  | jdV|j6dH  t|r| jdW|j7dH j | jdX|j8dH j | jdY|j9dH j | jdZ|j:dH j | jd[|j@dH j | jtjj |j;dH  | jtj"|j<dH  t|r| jt$j%|j=dH  t|
r| j |jd\ | j |jd] | j |jd^ | j |jd_ | j |jd` | j |jda | j |jdb | j |jdc | j |jdd | j |jde | j |jdf | j |jdg | j |jdh | j |jdi | j |jdj | j |jdk | j |jdl | j |jdm | jdn|jD | jdo|jE | jdp|jF | jdq|jG | jdr|jH | jds|jI | jdt|jJ | jdu|jK | jdv|jL | jdw|jM | jdx|jN | jdy|jO | jdT|jP | jdz|jQ | jd{|jR | jtjjS|jT | jtjU|jV | jt$jW|jX d|S )}zFCheck all fields for correct values have after Set*Fields() is called.r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rK   rM   rO   rJ   rL   rN   rP   rU   rW   rY   rZ   r[   r   r	   r
   r   r   r   r   r   r   r   r   r   Tr   s   116r   r   r   r   r   r      r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   s   216r)   r*   r+   r,   r-   i-  r2   i.  i/  i0  i1  i2  i3  i4  i5  i6  i7  i8  Fr3   s   316i=  i>  i?  i@  iG  rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   i  i  i  i  i  i  i  i  i  i  i  i  r6   s   416N)YZ
assertTrueZHasFieldr   rI   rK   rM   rO   ZassertEqualr:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rJ   rL   rN   rP   rQ   rR   r   r   rS   rT   rU   rV   rW   r   rX   rY   lenr\   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rn   ro   rp   rr   rt   rv   rx   ry   rq   rs   ru   rw   rz   r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )Z	test_caser   r   r   r   ExpectAllFieldsSet  sj   














r   c             C   s   d}xNt jj|rRt jjt jj|drBt jj|d| }t|dS t jj|d}qW d}t jj|d| }t jj|r~t|dS tddS )	zFFinds the given golden file and returns a file object representing it..zsrc/google/protobufzsrc/google/protobuf/testdatarbz..z'third_party/py/google/protobuf/testdatazCould not find golden files.  This test must be run from within the protobuf source package so that it can read test data files from the C++ source tree.N)ospathexistsr   openRuntimeError)filenamer   	full_pathr   r   r   
GoldenFilei  s    


r   c          	   C   s   t | 
}|j S Q R X dS )z5Finds the given golden file and returns its contents.N)r   read)r   fr   r   r   GoldenFileData  s    
r   c             C   s   | j jddg | jjddg | jjddg | jjddg | jjd	d
g | jjddg | jjddg | jjddg | j	jddg | j
jddg | jjddg | jjddg | jjddg | jjtjtjg dS )zgSets every field in the message to a unique value.

  Args:
    message: A TestPackedTypes instance.
  iY  i  iZ  i  i[  i  i\  i  i]  i  i^  i  i_  i  i`  i  ia  i  ib  i  g     @g     8@g      @g     @@TFN)Zpacked_int32extendZpacked_int64Zpacked_uint32Zpacked_uint64Zpacked_sint32Zpacked_sint64Zpacked_fixed32Zpacked_fixed64Zpacked_sfixed32Zpacked_sfixed64Zpacked_floatZpacked_doubleZpacked_boolZpacked_enumr   ru   rV   )r   r   r   r   SetAllPackedFields  s    
r   c             C   s*  | j }t}||j jddg ||j jddg ||j jddg ||j jddg ||j jd	d
g ||j jddg ||j	 jddg ||j
 jddg ||j jddg ||j jddg ||j jddg ||j jddg ||j jddg ||j jtjtjg dS )z}Sets every extension in the message to a unique value.

  Args:
    message: A unittest_pb2.TestPackedExtensions instance.
  iY  i  iZ  i  i[  i  i\  i  i]  i  i^  i  i_  i  i`  i  ia  i  ib  i  g     @g     8@g      @g     @@TFN)r   r   Zpacked_int32_extensionr   Zpacked_int64_extensionZpacked_uint32_extensionZpacked_uint64_extensionZpacked_sint32_extensionZpacked_sint64_extensionZpacked_fixed32_extensionZpacked_fixed64_extensionZpacked_sfixed32_extensionZpacked_sfixed64_extensionZpacked_float_extensionZpacked_double_extensionZpacked_bool_extensionZpacked_enum_extensionru   rV   )r   r   r   r   r   r   SetAllPackedExtensions  s"    r   c             C   s   | j jddg | jjddg | jjddg | jjddg | jjd	d
g | jjddg | jjddg | jjddg | j	jddg | j
jddg | jjddg | jjddg | jjddg | jjtjtjg dS )zvSets every field in the message to a unique value.

  Args:
    message: A unittest_pb2.TestUnpackedTypes instance.
  iY  i  iZ  i  i[  i  i\  i  i]  i  i^  i  i_  i  i`  i  ia  i  ib  i  g     @g     8@g      @g     @@TFN)Zunpacked_int32r   Zunpacked_int64Zunpacked_uint32Zunpacked_uint64Zunpacked_sint32Zunpacked_sint64Zunpacked_fixed32Zunpacked_fixed64Zunpacked_sfixed32Zunpacked_sfixed64Zunpacked_floatZunpacked_doubleZunpacked_boolZunpacked_enumr   ru   rV   )r   r   r   r   SetAllUnpackedFields  s    
r   c               @   sZ  e Zd ZdZdTd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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/d0 Zd1d2 Zd3d4 Zd5d6 Zd7d8 Zd9d: Zd;d< Z d=d> Z!d?d@ Z"dAdB Z#dCdD Z$dEdF Z%dGdH Z&dIdH Z&dJdK Z'dLdM Z(dNdO Z)dPdQ Z*dRdS Z+dS )UNonStandardIntegera  An integer object that does not subclass int.

  This is used to verify that both C++ and regular proto systems can handle
  integer others than int and long and that they handle them in predictable
  ways.

  NonStandardInteger is the minimal legal specification for a custom Integral.
  As such, it does not support 0 < x < 5 and it is not hashable.

  Note: This is added here instead of relying on numpy or a similar library
  with custom integers to limit dependencies.
  Nc             C   s0   t |tjstt |tr |j}|| _|| _d S )N)
isinstancenumbersIntegralAssertionErrorr   valerror_string_on_conversion)selfr   r   r   r   r   __init__  s
    
zNonStandardInteger.__init__c             C   s   | j rt| j t| jS )N)r   r   intr   )r   r   r   r   __long__  s    
zNonStandardInteger.__long__c             C   s   t tj| jS )N)r   operatorabsr   )r   r   r   r   __abs__  s    zNonStandardInteger.__abs__c             C   s   t tj| j|S )N)r   r   rm   r   )r   yr   r   r   __add__  s    zNonStandardInteger.__add__c             C   s   t tj| j|S )N)r   r   divr   )r   r   r   r   r   __div__  s    zNonStandardInteger.__div__c             C   s   t j| j|S )N)r   eqr   )r   r   r   r   r   __eq__  s    zNonStandardInteger.__eq__c             C   s   t tj| j|S )N)r   r   floordivr   )r   r   r   r   r   __floordiv__  s    zNonStandardInteger.__floordiv__c             C   s   t tj| j|S )N)r   r   truedivr   )r   r   r   r   r   __truediv__  s    zNonStandardInteger.__truediv__c             C   s   t tj| jS )N)r   r   invertr   )r   r   r   r   
__invert__  s    zNonStandardInteger.__invert__c             C   s   t tj| j|S )N)r   r   modr   )r   r   r   r   r   __mod__   s    zNonStandardInteger.__mod__c             C   s   t tj| j|S )N)r   r   mulr   )r   r   r   r   r   __mul__  s    zNonStandardInteger.__mul__c             C   s   t tj| jS )N)r   r   negr   )r   r   r   r   __neg__  s    zNonStandardInteger.__neg__c             C   s   t tj| jS )N)r   r   posr   )r   r   r   r   __pos__	  s    zNonStandardInteger.__pos__c             C   s   t tj| j|S )N)r   r   powr   )r   r   r   r   r   __pow__  s    zNonStandardInteger.__pow__c             C   s
   t | jS )N)r   r   )r   r   r   r   	__trunc__  s    zNonStandardInteger.__trunc__c             C   s   t tj|| jS )N)r   r   rm   r   )r   r   r   r   r   __radd__  s    zNonStandardInteger.__radd__c             C   s   t tj|| jS )N)r   r   r   r   )r   r   r   r   r   __rdiv__  s    zNonStandardInteger.__rdiv__c             C   s   t tj|| jS )N)r   r   r   r   )r   r   r   r   r   __rmod__  s    zNonStandardInteger.__rmod__c             C   s   t tj|| jS )N)r   r   r   r   )r   r   r   r   r   __rmul__  s    zNonStandardInteger.__rmul__c             C   s   t tj|| jS )N)r   r   r   r   )r   r   r   r   r   __rpow__  s    zNonStandardInteger.__rpow__c             C   s   t tj|| jS )N)r   r   r   r   )r   r   r   r   r   __rfloordiv__!  s    z NonStandardInteger.__rfloordiv__c             C   s   t tj|| jS )N)r   r   r   r   )r   r   r   r   r   __rtruediv__$  s    zNonStandardInteger.__rtruediv__c             C   s   t tj| j|S )N)r   r   lshiftr   )r   r   r   r   r   
__lshift__'  s    zNonStandardInteger.__lshift__c             C   s   t tj| j|S )N)r   r   rshiftr   )r   r   r   r   r   
__rshift__*  s    zNonStandardInteger.__rshift__c             C   s   t tj|| jS )N)r   r   r   r   )r   r   r   r   r   __rlshift__-  s    zNonStandardInteger.__rlshift__c             C   s   t tj|| jS )N)r   r   r   r   )r   r   r   r   r   __rrshift__0  s    zNonStandardInteger.__rrshift__c             C   s   t |tr|j}tj| j|S )N)r   r   r   r   le)r   r   r   r   r   __le__3  s    
zNonStandardInteger.__le__c             C   s   t |tr|j}tj| j|S )N)r   r   r   r   lt)r   r   r   r   r   __lt__8  s    
zNonStandardInteger.__lt__c             C   s   t tj| j|S )N)r   r   and_r   )r   r   r   r   r   __and__=  s    zNonStandardInteger.__and__c             C   s   t tj| j|S )N)r   r   or_r   )r   r   r   r   r   __or__@  s    zNonStandardInteger.__or__c             C   s   t tj| j|S )N)r   r   xorr   )r   r   r   r   r   __xor__C  s    zNonStandardInteger.__xor__c             C   s   t tj|| jS )N)r   r   r   r   )r   r   r   r   r   __rand__F  s    zNonStandardInteger.__rand__c             C   s   t tj|| jS )N)r   r   r   r   )r   r   r   r   r   __ror__I  s    zNonStandardInteger.__ror__c             C   s   t tj|| jS )N)r   r   r   r   )r   r   r   r   r   __rxor__L  s    zNonStandardInteger.__rxor__c             C   s   | j S )N)r   )r   r   r   r   __bool__O  s    zNonStandardInteger.__bool__c             C   s   | j S )N)r   )r   r   r   r   r   R  s    c             C   s   | S )Nr   )r   r   r   r   __ceil__U  s    zNonStandardInteger.__ceil__c             C   s   | S )Nr   )r   r   r   r   	__floor__X  s    zNonStandardInteger.__floor__c             C   s   | j rt| j t| jS )N)r   r   r   r   )r   r   r   r   __int__[  s    
zNonStandardInteger.__int__c             C   s   | S )Nr   )r   r   r   r   	__round__`  s    zNonStandardInteger.__round__c             C   s
   d| j  S )NzNonStandardInteger(%s))r   )r   r   r   r   __repr__c  s    zNonStandardInteger.__repr__)N),__name__
__module____qualname____doc__r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     sT   
r   )r   
__author__r   r   Zos.pathr   Zgoogle.protobufr   r   r   	NameErrorZlongr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>#   s4   
    R