_e[c@s$ddlZddlZddlmZddlmZddlmZddlmZddlm Z ddl m Z ddl m Z dd l m Z dd l mZdd l mZdd l mZe jZeZd dddddddddddddddddgZd e jfdYZdefd YZejd!d"kraeZneZd#efd$YZde jfd%YZyeWnek rd&ZnXde jfd'YZdefd(YZ ejd!d)kr eefZ!n efZ!e!e"fZ#de jfd*YZ$de jfd+YZ%defd,YZ&de j'fd-YZ(de(fd.YZ)de(fd/YZ*de j'fd0YZ+de+fd1YZ,de+fd2YZ-de-fd3YZ.defd4YZ/dS(5iN(terror(teoo(tbinary(tinteger(toctets(tbase(t constraint(t namedtype(tnamedval(ttag(ttagmaptIntegertBooleant BitStringt OctetStringtNulltObjectIdentifiertRealt EnumeratedtSequenceOfAndSetOfBaset SequenceOftSetOftSequenceAndSetBasetSequencetSettChoicetAnytNoValuetnoValuecBsceZdZejejejejdZe j Z e j ZejjZedZdZdZdZdZdZdZd Zd Zd Zd Zd ZdZ dZ!dZ"dZ#dZ$d4dZ&dZ'dZ(dZ)e*j+ddkrBdZ,dZ-n0dZ.dZ/dZ0dZ1ejj2Z2dZ3e*j+ddkrdZ4nd Z5d!Z6d"Z7d#Z8d$Z9d%Z:dd&Z;d'Z<d(Z=e*j+dd!d5krd*Z>nd+Z?d,Z@d-ZAd.ZBd/ZCd0ZDd1ZEd2ZFd3ZGRS(6sCreate |ASN.1| type or object. |ASN.1| objects are immutable and duck-type Python :class:`int` objects. Keyword Args ------------ value: :class:`int`, :class:`str` or |ASN.1| object Python integer or string literal or |ASN.1| class instance. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s) namedValues: :py:class:`~pyasn1.type.namedval.NamedValues` Object representing non-default symbolic aliases for numbers Raises ------ :py:class:`~pyasn1.error.PyAsn1Error` On constraint violation or bad initializer. Examples -------- .. code-block:: python class ErrorCode(Integer): ''' ASN.1 specification: ErrorCode ::= INTEGER { disk-full(1), no-disk(-1), disk-not-formatted(2) } error ErrorCode ::= disk-full ''' namedValues = NamedValues( ('disk-full', 1), ('no-disk', -1), ('disk-not-formatted', 2) ) error = ErrorCode('disk-full') icKs6d|kr|j|dS(N(R#R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __lshift__{scCs|j|j|?S(N(R#R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __rshift__~scCs|j|j|S(N(R#R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__add__scCs|j||jS(N(R#R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__radd__scCs|j|j|S(N(R#R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__sub__scCs|j||jS(N(R#R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__rsub__scCs|j|j|S(N(R#R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__mul__scCs|j||jS(N(R#R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__rmul__scCs|j|j|S(N(R#R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__mod__scCs|j||jS(N(R#R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__rmod__scCs|jt|j||S(N(R#tpowR$(R R!tmodulo((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__pow__scCs|jt||jS(N(R#R5R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__rpow__scCs|j|j|S(N(R#R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __floordiv__scCs|j||jS(N(R#R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __rfloordiv__sicCs8t|tr t|j|S|j|j|SdS(N(t isinstancetfloatRR$R#(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__div__scCs8t|tr t||jS|j||jSdS(N(R;R<RR$R#(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__rdiv__scCst|j|S(N(RR$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __truediv__scCst||jS(N(RR$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __rtruediv__scCs|jt|j|S(N(R#tdivmodR$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __divmod__scCs|jt||jS(N(R#RAR$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __rdivmod__scCs t|jS(N(tintR$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__int__scCs t|jS(N(tlongR$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__long__scCs t|jS(N(R<R$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __float__scCs|jt|jS(N(R#tabsR$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__abs__scCs t|jS(N(RDR$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __index__scCs|j|j S(N(R#R$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__pos__scCs|j|j S(N(R#R$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__neg__scCs|j|jS(N(R#R$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __invert__scCs-t|j|}|r%|j|S|SdS(N(troundR$R#(R tntr((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __round__s cCstj|jS(N(tmathtfloorR$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __floor__scCstj|jS(N(RStceilR$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__ceil__sicCs|jtj|jS(N(R#RSttruncR$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __trunc__scCs |j|kS(N(R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__lt__scCs |j|kS(N(R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__le__scCs |j|kS(N(R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__eq__scCs |j|kS(N(R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__ne__scCs |j|kS(N(R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__gt__scCs |j|kS(N(R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__ge__scCslyt|SWnWtk rgy|j|SWqhtk rctjd|tjdfqhXnXdS(Ns Can't coerce %r into integer: %si(RDt ValueErrorRtKeyErrorRt PyAsn1Errortsystexc_info(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytprettyIns  cCs4yt|j|SWntk r/t|SXdS(N(tstrRRa(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt prettyOut s cCs|jS(N(R(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytgetNamedValuessN(ii(Ht__name__t __module__t__doc__R t initTagSettTagttagClassUniversalttagFormatSimplettagSetRtConstraintsIntersectiont subtypeSpecRt NamedValuesRRRt getTypeIdttypeIdRRR%R&R'R(R)R*R+R,R-R.R/R0R1R2R3R4tNoneR7R8R9R:Rct version_infoR=R>R?R@RBRCt__hash__RERGRHRJRKRLRMRNRRRURWRYRZR[R\R]R^R_ReRgRh(((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR "st-                                                 cBsieZdZejejejejdZe j e j ddZ e jddZe jZRS(sWCreate |ASN.1| type or object. |ASN.1| objects are immutable and duck-type Python :class:`int` objects. Keyword Args ------------ value: :class:`int`, :class:`str` or |ASN.1| object Python integer or boolean or string literal or |ASN.1| class instance. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s) namedValues: :py:class:`~pyasn1.type.namedval.NamedValues` Object representing non-default symbolic aliases for numbers Raises ------ :py:class:`~pyasn1.error.PyAsn1Error` On constraint violation or bad initializer. Examples -------- .. code-block:: python class RoundResult(Boolean): ''' ASN.1 specification: RoundResult ::= BOOLEAN ok RoundResult ::= TRUE ko RoundResult ::= FALSE ''' ok = RoundResult(True) ko = RoundResult(False) iitFalsetTrue(sFalsei(sTruei(RiRjRkR RlRmRnRoRpR RrRtSingleValueConstraintRRsRRtRu(((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR s 'iit SizedIntegercBs$eZdZZdZdZRS(cCs,||_t|tj|d|_|S(Ni(t bitLengthtmaxRtleadingZeroBits(R R}((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt setBitLengthZs cCs/|jdkr(|jtj|n|jS(N(R}RvRR(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__len___sN(RiRjRvR}RRR(((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR|Ws  cBseZdZejejejejdZe j Z e j ZejjZeZZedZdZdZdZdZdZdZd Zd Zd Zd Z d Z!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)e*j+ddkr7dZ,ndZ-dZ.dZ/dZ0e1e2d dZ4e1e2d dZ5e1e2d ddZ6dZ7RS(!sCreate |ASN.1| schema or value object. |ASN.1| objects are immutable and duck-type both Python :class:`tuple` (as a tuple of bits) and :class:`int` objects. Keyword Args ------------ value: :class:`int`, :class:`str` or |ASN.1| object Python integer or string literal representing binary or hexadecimal number or sequence of integer bits or |ASN.1| object. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s) namedValues: :py:class:`~pyasn1.type.namedval.NamedValues` Object representing non-default symbolic aliases for numbers binValue: :py:class:`str` Binary string initializer to use instead of the *value*. Example: '10110011'. hexValue: :py:class:`str` Hexadecimal string initializer to use instead of the *value*. Example: 'DEADBEEF'. Raises ------ :py:class:`~pyasn1.error.PyAsn1Error` On constraint violation or bad initializer. Examples -------- .. code-block:: python class Rights(BitString): ''' ASN.1 specification: Rights ::= BIT STRING { user-read(0), user-write(1), group-read(2), group-write(3), other-read(4), other-write(5) } group1 Rights ::= { group-read, group-write } group2 Rights ::= '0011'B group3 Rights ::= '3'H ''' namedValues = NamedValues( ('user-read', 0), ('user-write', 1), ('group-read', 2), ('group-write', 3), ('other-read', 4), ('other-write', 5) ) group1 = Rights(('group-read', 'group-write')) group2 = Rights('0011') group3 = Rights(0x3) icKs|tkr|ry"|j|jddt}Wntk rGnXy"|j|jddt}Wqtk r}qXqn|tkr|jtk r|j|jdt}q|jtk r|j|jdt}qnd|kr|j|d|Bjt|jt|S(N(ReR#R|R$RR(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR-scCsR|j|}|jt|t|j>|jBjt|jt|S(N(ReR#R|RR$R(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR. scCsS|j}x:|dkrE|t|jK}||jO}|d8}q W|j|S(Ni(R$RR#(R R!t bitString((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR1s   cCs||S(N((R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR2scCs0|jt|j|>jt|j|S(N(R#R|R$RR(R tcount((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR+scCs9|jt|j|?jtdt|j|S(Ni(R#R|R$RR~R(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR,scCs|jS(N(R$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyREscCs t|jS(N(R<R$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRH"sicCs|jS(N(R$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRG&scCsttj|jS(sGet |ASN.1| value as a sequence of 8-bit integers. If |ASN.1| object length is not a multiple of 8, result will be left-padded with zeros. (RRt octs2intstasOctets(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt asNumbers)scCstj|jdt|S(sGet |ASN.1| value as a sequence of octets. If |ASN.1| object length is not a multiple of 8, result will be left-padded with zeros. R(Rtto_bytesR$R(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR1scCs|jS(s5Get |ASN.1| value as a single integer value. (R$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt asInteger9scCs5tj|jd}dt|jt||S(s4Get |ASN.1| value as a text string of bits. it0(RtbinR$R(R t binString((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR>scCsy&t|djt|d}Wn7tk r_tjd|jtjdfnX|dk rtt|t|>|Bjt|t|}n|s||}n|S(sCreate a |ASN.1| object initialized from the hex string. Parameters ---------- value: :class:`str` Text string like 'DEADBEEF' iis%s.fromHexString() error: %siN( R|RRR`RRbRiRcRdRv(tclsR!Rtprepend((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRDs & * cCsy(t|pddjt|}Wn7tk ratjd|jtjdfnX|dk rtt|t|>|Bjt|t|}n|s||}n|S(sCreate a |ASN.1| object initialized from a string of '0' and '1'. Parameters ---------- value: :class:`str` Text string like '1010111' Ris%s.fromBinaryString() error: %siN( R|RRR`RRbRiRcRdRv(RR!RR((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR]s ( * cCsttj||?jt|d|}|dk rxtt|t|>|Bjt|t|}n|s||}n|S(sCreate a |ASN.1| object initialized from a string. Parameters ---------- value: :class:`str` (Py2) or :class:`bytes` (Py3) Text string like '\\x01\\xff' (Py2) or b'\\x01\\xff' (Py3) iN(R|Rt from_bytesRRRv(RR!RRtpadding((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytfromOctetStringvs 0 c Cst|tr|Stj|r|s;tdjdS|ddkr|ddkru|j|dd!dtS|ddkr|j|dd!dtStj d|fq|j r|j rg|j d D]}|j ^q}y$g|D]}|j |^q}Wn'tk rCtj d |fnXt|}d}x |D]}|d||>O}q]Wt|j|dS|jd r|j|d dtS|jd r|j|d dtS|j|dtSnt|ttfrB|jdjg|D]} | r,dp/d^qdtSt|trjt|jt|St|trt|Stj d|fdS(Nis'is'BiRs'Hs Bad BIT STRING value notation %st,sunknown bit name(s) in %rt0xit0btt1Rs#Bad BitString initializer type '%s'(R;R|Rt isStringTypeRRRzRRRbRtisdigittsplittstripRaR~t startswithRtlisttjoinR RtintTypes( R R!Rtnamestnamet bitPositionstrightmostPositiontnumbert bitPositiontb((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyResH($   ; N(8RiRjRkR RlRmRnRoRpRRqRrRRsRRRRtRuRRRRRR\R]RZR[R^R_RRRRR-R.R1R2R+R,RERHRcRwRGRRRRt classmethodRyRvRRRRe(((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR fsP;                           cCsx|D]}|stSqWtS(N(RyRz(titerabletelement((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytalls cBsoeZdZejejejejdZe j Z e j jZeZZdZedZejddkrdZdZdZd Zd Zn-d Zd Zd ZdZdZdZddZedZ edZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,RS(sCreate |ASN.1| schema or value object. |ASN.1| objects are immutable and duck-type Python 2 :class:`str` or Python 3 :class:`bytes`. When used in Unicode context, |ASN.1| type assumes "|encoding|" serialisation. Keyword Args ------------ value: :class:`str`, :class:`bytes` or |ASN.1| object string (Python 2) or bytes (Python 3), alternatively unicode object (Python 2) or string (Python 3) representing character string to be serialised into octets (note `encoding` parameter) or |ASN.1| object. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s) encoding: :py:class:`str` Unicode codec ID to encode/decode :class:`unicode` (Python 2) or :class:`str` (Python 3) the payload when |ASN.1| object is used in text string context. binValue: :py:class:`str` Binary string initializer to use instead of the *value*. Example: '10110011'. hexValue: :py:class:`str` Hexadecimal string initializer to use instead of the *value*. Example: 'DEADBEEF'. Raises ------ :py:class:`~pyasn1.error.PyAsn1Error` On constraint violation or bad initializer. Examples -------- .. code-block:: python class Icon(OctetString): ''' ASN.1 specification: Icon ::= OCTET STRING icon1 Icon ::= '001100010011001000110011'B icon2 Icon ::= '313233'H ''' icon1 = Icon.fromBinaryString('001100010011001000110011') icon2 = Icon.fromHexString('313233') is iso-8859-1cKs|rx|tkrxy|j|jd}Wntk rAnXy|j|jd}Wqutk rqquXqxn|tkr|jtk r|j|j}q|jtk r|j|j}qnd|kr|j|ds(RgR$RRRR(R tscopeR!tnumbersR((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt prettyPrints  cCsd}d}g}xy|D]q}|r2|d8}nd}|j|d}|dkrft|}ntjd|f|||>O}qW|j|tj|S( sCreate a |ASN.1| object initialized from a string of '0' and '1'. Parameters ---------- value: :class:`str` Text string like '1010111' iiiiRRs&Non-binary OCTET STRING initializer %s(RR(tappendRDRRbRt ints2octs(R!tbitNotbyteRQtv((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRs      cCs|g}g}x=|D]5}|rB|jt||dd}q|}qW|ro|jt|ddntj|S(sCreate a |ASN.1| object initialized from the hex string. Parameters ---------- value: :class:`str` Text string like 'DEADBEEF' iRN(RRDRvRR(R!RQtpR((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRs    cCs t|jS(N(RR$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRscCs2|jtkr#|j|j|S|j|SdS(N(RRR#R$(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRscCs t|jS(N(titerR$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRscCs ||jkS(N(R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __contains__scCs|j|j|j|S(N(R#R$Re(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR-scCs|j|j||jS(N(R#ReR$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR.scCs|j|j|S(N(R#R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR1scCs||S(N((R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR2scCs t|jS(N(RDR$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyREscCs t|jS(N(R<R$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRHscCs t|jS(N(RR$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRs(-RiRjRkR RlRmRnRoRpRRqRrRRRtRuRRRRRRcRwReRRRRRRgRt staticmethodRRRRRRR-R.R1R2RERHR(((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRsD4                       cBsfeZdZejejejejdZe j e j e jdZ e jZdZRS(sCreate |ASN.1| schema or value object. |ASN.1| objects are immutable and duck-type Python :class:`str` objects (always empty). Keyword Args ------------ value: :class:`str` or :py:class:`~pyasn1.type.univ.Null` object Python empty string literal or any object that evaluates to `False` tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) Raises ------ :py:class:`~pyasn1.error.PyAsn1Error` On constraint violation or bad initializer. Examples -------- .. code-block:: python class Ack(Null): ''' ASN.1 specification: Ack ::= NULL ''' ack = Ack('') iRcCs|r |StjdS(NR(Rtstr2octs(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRe.s(RiRjRkR RlRmRnRoRpRRrRR{RRRtRuRe(((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRs  icBseZdZejejejejdZe j Z e j jZdZdZdZdZdZdZdZd Zd Zd Zd ZRS( s%Create |ASN.1| schema or value object. |ASN.1| objects are immutable and duck-type Python :class:`tuple` objects (tuple of non-negative integers). Keyword Args ------------ value: :class:`tuple`, :class:`str` or |ASN.1| object Python sequence of :class:`int` or string literal or |ASN.1| object. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s) Raises ------ :py:class:`~pyasn1.error.PyAsn1Error` On constraint violation or bad initializer. Examples -------- .. code-block:: python class ID(ObjectIdentifier): ''' ASN.1 specification: ID ::= OBJECT IDENTIFIER id-edims ID ::= { joint-iso-itu-t mhs-motif(6) edims(7) } id-bp ID ::= { id-edims 11 } ''' id_edims = ID('2.6.7') id_bp = id_edims + (11,) icCs|j|j|S(N(R#R$(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR-pscCs|j||jS(N(R#R$(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR.sscCs|jS(N(R$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytasTuplevscCs t|jS(N(RR$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR{scCs2|jtkr#|j|j|S|j|SdS(N(RRR#R$(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR~scCs t|jS(N(RR$(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRscCs ||jkS(N(R$(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRscCs|jj|S(N(R$tindex(R tsuboid((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRscCs@t|}|t|kr<|j| || kr<tSntS(svIndicate if this |ASN.1| object is a prefix of other |ASN.1| object. Parameters ---------- other: |ASN.1| object |ASN.1| object Returns ------- : :class:`bool` :class:`True` if this |ASN.1| object is a parent (e.g. prefix) of the other |ASN.1| object or :class:`False` otherwise. (RR$RzRy(R Rtl((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt isPrefixOfs  cCst|trt|Stj|rd|krctjd||jjt j dfny6tg|j dD]}|ryt |^qySWqt k rtjd||jjt j dfqXny5tg|D]}|dkrt |^q}WnCt tfk rVtjd||jjt j dfnXt|t|krs|Stjd||jjfdS(Nt-s Malformed Object ID %s at %s: %sit.isMalformed Object ID %s at %s(R;RRRRRRbRRiRcRdRRDR`t TypeErrorR(R R!tsubOidt tupleOfInts((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRes&  )6 -5*cCs&djg|D]}t|^q S(NR(RRf(R R!R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRgs(RiRjRkR RlRmRnRoRpRRqRrRRRtRuR-R.RRRRRRRReRg(((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR<s $           cBseZdZd3Zy(edZedZeefZWn!e k r]d3ZZd4ZnXe j e j e j e jdZejZejjZedZdZddZedZed Zed Zd Zd Z d Z!dZ"dZ#dZ$dZ%dZ&d3dZ'dZ(e)j*ddkrsdZ+dZ,n$dZ-dZ.dZ/dZ0dZ1e)j*ddkrdZ2ndZ3dZ4d Z5d!Z6dd"Z7d#Z8d$Z9e)j*dd!d5kr#d&Z:nd'Z;d(Z<d)Z=d*Z>d+Z?d,Z@e)j*ddkrxd-ZAnd.ZBejjCZCd/ZDd0ZEd1ZFd2ZGRS(6sZCreate |ASN.1| schema or value object. |ASN.1| objects are immutable and duck-type Python :class:`float` objects. Additionally, |ASN.1| objects behave like a :class:`tuple` in which case its elements are mantissa, base and exponent. Keyword Args ------------ value: :class:`tuple`, :class:`float` or |ASN.1| object Python sequence of :class:`int` (representing mantissa, base and exponent) or float instance or *Real* class instance. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s) Raises ------ :py:class:`~pyasn1.error.PyAsn1Error` On constraint violation or bad initializer. Examples -------- .. code-block:: python class Pi(Real): ''' ASN.1 specification: Pi ::= REAL pi Pi ::= { mantissa 314159, base 10, exponent -5 } ''' pi = Pi((314159, 10, -5)) tinfs-infi cCsM|\}}}x.|r?|ddkr?|d:}|d7}qW|||fS(Ni ii((R!tmRte((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__normalizeBase10s  cCs0t|trt|dkrt|dt s]t|dt s]t|dt rvtjd|fnt|dtr|jr|d|jkr|dS|dd krtjd|dfn|ddkr|j |}n|St|tr%|j |ddfSt|tsCt j |rt j |ryt|}Wqt k rtjd|fqXn|jr||jkr|Sd}x*t ||kr|d9}|d8}qW|j t |d|fSnt|trt|Stjd|fdS( NiiiisLame Real value syntax: %si s"Prohibited base for Real value: %ssBad real value syntax: %s(ii (R;RRt numericTypesRRRbR<t_inft_Real__normalizeBase10RRR`RDR(R R!R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRe sD!   icCs0y|jt|SWntk r+dSXdS(Ns (RgR<t OverflowError(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR3s cCs|j|jkS(sIndicate PLUS-INFINITY object value Returns ------- : :class:`bool` :class:`True` if calling object represents plus infinity or :class:`False` otherwise. (R$t_plusInf(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt isPlusInf:s cCs|j|jkS(sIndicate MINUS-INFINITY object value Returns ------- : :class:`bool` :class:`True` if calling object represents minus infinity or :class:`False` otherwise. (R$t _minusInf(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt isMinusInfGs cCs|j|jkS(N(R$R(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytisInfSscCs|jt||S(N(R#R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR-WscCs||S(N((R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR.ZscCs|jt||S(N(R#R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR1]scCs||S(N((R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR2`scCs|jt||S(N(R#R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR/cscCs|j|t|S(N(R#R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR0fscCs|jt||S(N(R#R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR3iscCs|j|t|S(N(R#R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR4lscCs|jtt|||S(N(R#R5R<(R R!R6((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR7oscCs|jt|t|S(N(R#R5R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR8rsicCs|jt||S(N(R#R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR=vscCs|j|t|S(N(R#R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR>yscCs|jt||S(N(R#R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR?|scCs|j|t|S(N(R#R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR@scCs|jt||S(N(R#R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRBscCs|j|t|S(N(R#R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRCscCstt|S(N(RDR<(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyREscCstt|S(N(RFR<(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRGscCsI|j|jkr|jSt|jdt|jd|jdSdS(Niii(R$RR<R5(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRHscCs|jtt|S(N(R#RIR<(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRJscCs|jt| S(N(R#R<(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRLscCs|jt| S(N(R#R<(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRMscCs0tt||}|r(|j|S|SdS(N(ROR<R#(R RPRQ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRRs cCs|jtjt|S(N(R#RSRTR<(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRUscCs|jtjt|S(N(R#RSRVR<(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRWsicCs|jtjt|S(N(R#RSRXR<(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRYscCst||kS(N(R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRZscCst||kS(N(R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR[scCst||kS(N(R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR\scCst||kS(N(R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR]scCst||kS(N(R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR^scCst||kS(N(R<(R R!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR_scCstt|S(N(tboolR<(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt __nonzero__scCstt|S(N(RR<(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt__bool__scCs3|j|jkr$tjdn |j|SdS(Ns Invalid infinite value operation(R$RRRb(R tidx((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRscCs|jS(N(R(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytisPlusInfinityscCs|jS(N(R(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytisMinusInfinityscCs|jS(N(R(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt isInfinitysN((ii(HRiRjRkRvt binEncBaseR<RRRR`R RlRmRnRoRpRRqRrRRRtRuRRReRtpropertyRRRR-R.R1R2R/R0R3R4R7R8RcRwR=R>R?R@RBRCRERGRHRJRLRMRRRURWRYRZR[R\R]R^R_RRRxRRRR(((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRs|&       (                                         cBsVeZdZejejejejdZe j Z e j ZejZRS(s Create |ASN.1| type or object. |ASN.1| objects are immutable and duck-type Python :class:`int` objects. Keyword Args ------------ value: :class:`int`, :class:`str` or |ASN.1| object Python integer or string literal or |ASN.1| class instance. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s) namedValues: :py:class:`~pyasn1.type.namedval.NamedValues` Object representing non-default symbolic aliases for numbers Raises ------ :py:class:`~pyasn1.error.PyAsn1Error` On constraint violation or bad initializer. Examples -------- .. code-block:: python class RadioButton(Enumerated): ''' ASN.1 specification: RadioButton ::= ENUMERATED { button1(0), button2(1), button3(2) } selected-by-default RadioButton ::= button1 ''' namedValues = NamedValues( ('button1', 0), ('button2', 1), ('button3', 2) ) selected_by_default = RadioButton('button1') i (RiRjRkR RlRmRnRoRpRRqRrR RtRuRRsR(((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRs ,  cBseZdZdZdZdZdZdZdZdZ ddd Z d Z de d Zd Zd ZeedZeeeedZedZddZddZedZRS(sCreate |ASN.1| type. |ASN.1| objects are mutable and duck-type Python :class:`list` objects. Keyword Args ------------ componentType : :py:class:`~pyasn1.type.base.PyAsn1Item` derivative A pyasn1 object representing ASN.1 type allowed within |ASN.1| type tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s) sizeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing collection size constraint Examples -------- .. code-block:: python class LotteryDraw(SequenceOf): # SetOf is similar ''' ASN.1 specification: LotteryDraw ::= SEQUENCE OF INTEGER ''' componentType = Integer() lotteryDraw = LotteryDraw() lotteryDraw.extend([123, 456, 789]) cOsh|rQxHtd|D]4\}}||kr@tjdn||dtk rZt}t|j|kr[tjdq[nX|tkr|dk r|j}q|tkrtjdqnt |t j s7|dk rt |t j r|jd|}q|tk rt |t j r|jd|}qtjd||fn}|dk r|j r|j|||stjd||fqq|j|||stjd||fqn|r"|jr"y|j||Wq"tjk rtj\}} } |d| |jjfq"Xn|tkrA|jj|n ||j|<|S(sAssign |ASN.1| type component by position. Equivalent to Python sequence item assignment operation (e.g. `[]`) or list.append() (when idx == len(self)). Parameters ---------- idx: :class:`int` Component index (zero-based). Must either refer to existing component or to N+1 component. In the latter case a new component type gets instantiated (if *componentType* is set, or given ASN.1 object is taken otherwise) and appended to the |ASN.1| sequence. Keyword Args ------------ value: :class:`object` or :py:class:`~pyasn1.type.base.PyAsn1Item` derivative A Python value to initialize |ASN.1| component with (if *componentType* is set) or ASN.1 value object to assign to |ASN.1| component. verifyConstraints: :class:`bool` If `False`, skip constraints validation matchTags: :class:`bool` If `False`, skip component tags matching matchConstraints: :class:`bool` If `False`, skip component constraints matching Returns ------- self Raises ------ IndexError: When idx > len(self) sComponent index out of rangesComponent type not definedR!s5Non-ASN.1 value %r and undefined component type at %rs-Component value is tag-incompatible: %r vs %rs%s at %sN(RRRRRRRbRvR#R;RtAsn1ItemRtstrictConstraintstisSameTypeWitht isSuperTypeOfRRrRcRdRRiR( R RR!tverifyConstraintst matchTagstmatchConstraintsRt currentValuetexTypetexValuetexTb((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRsD)       #  cCs|jdk r|jjSdS(N(RRvttagMap(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytcomponentTagMap0scCs|d7}|jjd}xft|jD]U\}}|d|7}|tkrl|jdk rl|d7}q*||j|7}q*W|S(Nis: t s(RRiRRRRRvR(R RtrepresentationRR((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR5s   cCsq|d7}d|j|jjf}|jdk rY|d|7}||jj|7}n|dd|ddS(Nis %s -> %s { R"s t}(RpRRiRRvtprettyPrintType(R RR#((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR%As  cCs2x+|jD] }|tks&|j r tSq WtS(sWIndicate that |ASN.1| object represents ASN.1 value. If *isValue* is `False` then this object represents just ASN.1 schema. If *isValue* is `True` then, in addition to its ASN.1 schema features, this object can also be used like a Python built-in object (e.g. `int`, `str`, `dict` etc.). Returns ------- : :class:`bool` :class:`False` if object represents just ASN.1 schema. :class:`True` if object represents ASN.1 schema and can be used as a normal value. Note ---- There is an important distinction between PyASN1 schema and value objects. The PyASN1 schema objects can only participate in ASN.1 schema-related operations (e.g. defining or testing the structure of the data). Most obvious uses of ASN.1 schema is to guide serialisation codecs whilst encoding/decoding serialised ASN.1 contents. The PyASN1 value objects can **additionally** participate in many operations involving regular Python objects (e.g. arithmetic, comprehension etc). (RRRRyRz(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRJsN(RiRjRkRRRRRRRRvRR RyR RRRRzRRRR!RR%R(((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR!s,"         R S cBs_eZejZejejejejdZ dZ e j Ze j ZejZRS(iN(RiRjRRkR RlRmRnttagFormatConstructedRpRvRRRqRrRRtRu(((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRls   cBs_eZejZejejejejdZ dZ e j Ze j ZejZRS(iN(RiRjRRkR RlRmRnR&RpRvRRRqRrRRtRu(((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRs   cBseZdZejZdefdYZdZdZ dZ dZ dZ dZ d Zd Zd Zd Zd ZeedZeeeedZeedZeeeedZedZddZddZdZdZdZRS(s:Create |ASN.1| type. |ASN.1| objects are mutable and duck-type Python :class:`dict` objects. Keyword Args ------------ componentType: :py:class:`~pyasn1.type.namedtype.NamedType` Object holding named ASN.1 types allowed within this collection tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s) sizeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing collection size constraint Examples -------- .. code-block:: python class Description(Sequence): # Set is similar ''' ASN.1 specification: Description ::= SEQUENCE { surname IA5String, first-name IA5String OPTIONAL, age INTEGER DEFAULT 40 } ''' componentType = NamedTypes( NamedType('surname', IA5String()), OptionalNamedType('first-name', IA5String()), DefaultedNamedType('age', Integer(40)) ) descr = Description() descr['surname'] = 'Smith' descr['first-name'] = 'John' t DynamicNamescBsVeZdZdZdZdZdZdZdZdZ dZ RS( s9Fields names/positions mapping for component-less objectscCsi|_i|_dS(N(t _keyToIdxMapt _idxToKeyMap(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRs cCs t|jS(N(RR((R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRscCs||jkp||jkS(N(R(R)(R titem((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRscs#fdttjDS(Nc3s|]}j|VqdS(N(R)(RR(R (s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pys s(RRR)(R ((R s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRscCs/y|j|SWntk r*|j|SXdS(N(R(RaR)(R R*((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRs cCs6y|j|SWn tk r1tjdnXdS(NsType position out of range(R)RaRRb(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytgetNameByPositions cCs=y|j|SWn'tk r8tjd|fnXdS(NsName %s not found(R(RaRRb(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytgetPositionByNames cCs&||jd|y|j|SWn*tjk rt tjdnXdS(Ni( RRtgetComponentByNameRRbRaRcRdRR(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRscCstj|rSy|j||Wqtjk rOttjdqXnAy|j||Wn*tjk rt tjdnXdS(Ni( RRtsetComponentByNameRRbRaRcRdRR(R RR!((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRscCs'|jr||jkS||jkSdS(N(R.RR/(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR#s  cCst|jp|jS(N(RRR/(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR)sccs6x/t|jpt|jD]}||VqWdS(N(RR.RR/(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR.s%cCs t|S(N(R(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytkeys2sccshxat|jpt|jD]A}|jrJ|j|j||fVq|j|||fVqWdS(N(RR.RR/RR(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytitems5s% cOsDx|D]\}}||||jD]s\}}|d|7}|jr|d|jj|7}n|d|jj|7}d||j |f}qBW|dd|ddS(Nis %s -> %s { R"s"%s"s%s = %s s R$( RpRRiRRRRR+R/R%(R RR#RR((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR% s + cCs|S(N((R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytsetDefaultComponents scCs|jr|jSdS(N(R.R(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytgetComponentType s cCs|jr|j|jSdS(N(R.RR(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR+ s ( RiRjRkRt NamedTypesRtobjectR'RRRRRRR2R3R7RRRRzR0R1RRRRRR%R@RAR+(((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRs<+ )           % *Y c0    cBsweZejZejejejejdZ e j Z e j Z ejZejZdZdZRS(icCs|jr|jj|SdS(N(RtgetTagMapNearPosition(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytgetComponentTagMapNearPosition s cCs$|jr|jj||S|SdS(N(RtgetPositionNearType(R RpR((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytgetComponentPositionNearType s (RiRjRRkR RlRmRnR&RpRRqRrRRRBRRtRuRERG(((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR s      cBseZejZejejejejdZ e j Z e jZe jZejZedZeeedZeeeeedZedZRS(icCs|S(N((R t innerFlag((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyt getComponent scCsT|j|jj|d|d|}|rLt|trL|jdtS|SdS(sReturns |ASN.1| type component by ASN.1 tag. Parameters ---------- tagSet : :py:class:`~pyasn1.type.tag.TagSet` Object representing ASN.1 tags to identify one of |ASN.1| object component Keyword Args ------------ default: :class:`object` If set and requested component is a schema object, return the `default` object instead of the requested component. instantiate: :class:`bool` If `True` (default), inner component will be automatically instantiated. If 'False' either existing component or the `noValue` object will be returned. Returns ------- : :py:class:`~pyasn1.type.base.PyAsn1Item` a pyasn1 object RRRHN(RRtgetPositionByTypeR;RRIRz(R RpRRRHR((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytgetComponentByType s c Cs|jj|}|r}|jj|}|jrL|j|||||S|j|}|j|||||d|Sn|j|||||SdS(sAssign |ASN.1| type component by ASN.1 tag. Parameters ---------- tagSet : :py:class:`~pyasn1.type.tag.TagSet` Object representing ASN.1 tags to identify one of |ASN.1| object component Keyword Args ------------ value: :class:`object` or :py:class:`~pyasn1.type.base.PyAsn1Item` derivative A Python value to initialize |ASN.1| component with (if *componentType* is set) or ASN.1 value object to assign to |ASN.1| component. verifyConstraints : :class:`bool` If `False`, skip constraints validation matchTags: :class:`bool` If `False`, skip component tags matching matchConstraints: :class:`bool` If `False`, skip component constraints matching innerFlag: :class:`bool` If `True`, search for matching *tagSet* recursively. Returns ------- self RHN(RRJR8RpRRtsetComponentByType( R RpR!RRRRHRR((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRL, s# cCs|jr|jjSdS(N(Rt tagMapUnique(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR!b s (RiRjRRkR RlRmRnR&RpRRBRRRqRrRRtRuRyRIRRzRKRLRR!(((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR s       $ 2cBseZdZejZejZe j Z e j e j ddZ ejZdZdZdZdZdZdZdZejdd krd Zn d Zd Zd ZdZdZ dZ!dZ"dZ#dZ$e%e&dZ'e%e&e&e&dZ(e)dZ*e)dZ+e,dZ-e,dZ.e)dZ/dZ0dZ1RS(sACreate |ASN.1| type. |ASN.1| objects are mutable and duck-type Python :class:`dict` objects. Keyword Args ------------ componentType: :py:class:`~pyasn1.type.namedtype.NamedType` Object holding named ASN.1 types allowed within this collection tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s) sizeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing collection size constraint Examples -------- .. code-block:: python class Afters(Choice): ''' ASN.1 specification: Afters ::= CHOICE { cheese [0] IA5String, dessert [1] IA5String } ''' componentType = NamedTypes( NamedType('cheese', IA5String().subtype( implicitTag=Tag(tagClassContext, tagFormatSimple, 0) ), NamedType('dessert', IA5String().subtype( implicitTag=Tag(tagClassContext, tagFormatSimple, 1) ) ) afters = Afters() afters['cheese'] = 'Mascarpone' icCs!|jr|j|j|kStS(N(Rt _currentIdxtNotImplemented(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR\ s cCs!|jr|j|j|kStS(N(RRNRO(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR] s cCs!|jr|j|j|kStS(N(RRNRO(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyRZ s cCs!|jr|j|j|kStS(N(RRNRO(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR[ s cCs!|jr|j|j|kStS(N(RRNRO(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR^ s cCs!|jr|j|j|kStS(N(RRNRO(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR_ s iicCs|jrtptS(N(RRzRy(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR scCs|jrtptS(N(RRzRy(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR scCs|jdk rdpdS(Nii(RNRv(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR scCs-|jdkrtS||j|jjkS(N(RNRvRyRtgetName(R R((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR sccs1|jdkrtn|j|jjVdS(N(RNRvt StopIterationRRP(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR s ccs%|jdk r!|j|jVndS(N(RNRvR(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR sccs+|jdk r'|j|jjVndS(N(RNRvRRP(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR2 sccs8|jdk r4|j|jj||jfVndS(N(RNRvRRP(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR3 scCs%|jdkr!tjdndS(NsComponent not chosen(RNRvRRb(R ((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pytverifySizeSpec scCsy|j}Wntjk r&nlXt|trB|j}n |j}t|tjr||j ||j d|n|j ||j dS(NR ( RIRRbR;RteffectiveTagSetRpRRRLR#(R RR t componentRp((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR s  cCsNtj}|jdks'|j|krCtj||d|d|S|j|S(NRR(RRkRNRvRR(R RRRRk((s2/tmp/pip-install-KP2Jbq/pyasn1/pyasn1/type/univ.pyR s  cCsZ|j}tj||||||||_|dk rV||krVt|j|sl       ; a  20  CL#'~1