ffxddlmZmZmZmZddlmZmZmZm Z m Z m Z ddl m Z mZGddeZGdde eeZGd d e jZd S) ) CheckedType_restore_pickleInvariantExceptionstore_invariants) set_fields check_typeis_field_ignore_extra_complaintPFIELD_NO_INITIAL serializecheck_global_invariants)PMappmapceZdZfdZxZS) _PRecordMetac|t||dt||ddtd|dD|d<t d|dD|d<d |d <t t |||||S) N_precord_fields)name_precord_invariants __invariant__c3.K|]\}}|j |VdSN) mandatory).0rfields s/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pyrsistent/_precord.py z'_PRecordMeta.__new__..s-ZZu%/ZZZZZZZ_precord_mandatory_fieldsc3JK|]\}}|jtu||jfVdSr)initialr )rkrs rrz'_PRecordMeta.__new__..s<}}5V[Vck|V|V|!U]#V|V|V|V|}}r_precord_initial_values __slots__)rrsetitemsdictsuperr__new__)mcsrbasesdct __class__s rr)z_PRecordMeta.__new__ s3$56666e%:OLLL ZZ,=(>(D(D(F(FZZZ Z Z '( }}C8I4J4P4P4R4R}}} } } %&K\3''//T5#FFFr)__name__ __module__ __qualname__r) __classcell__r-s@rrrsA G G G G G G G G Grrc^eZdZdZfdZfdZdZdZed dZ d Z d d Z xZ S) PRecordau A PRecord is a PMap with a fixed set of specified fields. Records are declared as python classes inheriting from PRecord. Because it is a PMap it has full support for all Mapping methods such as iteration and element access using subscript notation. More documentation and examples of PRecord usage is available at https://github.com/tobgu/pyrsistent c @d|vr:d|vr6tt|||d|dS|dd}|dd}|}|jrEt d|jD}||t|tt|j ||}|D] \}}|||< | S) N _precord_size_precord_buckets_factory_fields _ignore_extraFc3VK|]$\}}|t|r |n|fV%dSr)callablerr!vs rrz"PRecord.__new__..-s\"S"S&*a$%Xa[[&?aaccca"@"S"S"S"S"S"Sr)pre_sizer8r9) r(r4r)popr"r'r&update_PRecordEvolverrlenr persistent) clskwargsfactory_fields ignore_extrainitial_valueser!r=r-s rr)zPRecord.__new__!sG f $ $);v)E)E#&&..sF?4KVTfMghh h$5t<<zz/599   & *!"S"S.1.I.O.O.Q.Q"S"S"SSSN  ! !& ) ) ) Cs33F/G/G!H!H!HZhyE F F F"((**  DAqAaDD||~~rc|r5tt||d|dS||S)a Set a field in the record. This set function differs slightly from that in the PMap class. First of all it accepts key-value pairs. Second it accepts multiple key-value pairs to perform one, atomic, update of multiple fields. r)r(r4r%rA)selfargsrFr-s rr%z PRecord.set7sG  >$''++DGT!W== ={{6"""rc,t|j|S)z4 Returns an evolver of this object. )rBr-rMs revolverzPRecord.evolverEst~t444rcd|jjdd|DS)Nz{0}({1})z, c3bK|]*\}}d|t|V+dS)z{0}={1}N)formatreprr<s rrz#PRecord.__repr__..Ms<*a*aDAq9+;+;AtAww+G+G*a*a*a*a*a*ar)rTr-r.joinr&rPs r__repr__zPRecord.__repr__KsO  !8!%*a*aTXT^T^T`T`*a*a*a!a!acc crNFcht|rS|rfd|jD|d||dS)a< Factory method. Will create a new PRecord of the current type and assign the values specified in kwargs. :param ignore_extra: A boolean which when set to True will ignore any keys which appear in kwargs that are not in the set of fields on the PRecord. c*i|]}|v||Sr#r#)rr!rFs r z"PRecord.create..\s$OOOq1;;a;;;rr?r#) isinstancer)rErFr8rHs ` rcreatezPRecord.createOs_ fc " " M  POOOOC,?OOOFsY?,YYRXYYYrc<t|jt|ffSr)rr-r'rPs r __reduce__zPRecord.__reduce__`sd ===rcbtfdDS)z Serialize the current PRecord using custom serializer functions for fields where such have been supplied. c3dK|]*\}}|tj|j|fV+dSr)r r serializer)rr!r=rTrMs rrz$PRecord.serialize..isFkkVZVWYZQ $"6q"9"DfaPPQkkkkkkr)r'r&)rMrTs``rr zPRecord.serializeds9 kkkkk^b^h^h^j^jkkkkkkrNFr) r.r/r0__doc__r)r%rQrW classmethodr\r^r r1r2s@rr4r4s, # # # # #555 cccZZZ[Z >>>llllllllrr4) metaclassc>eZdZdZdfd ZdZfdZfdZxZS) rB)_destination_cls_invariant_error_codes_missing_fieldsr8r9NFctt||||_g|_g|_||_||_dSr)r(rB__init__rgrhrir8r9)rMrE original_pmapr8r9r-s rrkz_PRecordEvolver.__init__osO ot$$--m<<< #&(#!.*rc2|||dSr)r%)rMkeyoriginal_values r __setitem__z_PRecordEvolver.__setitem__ws n%%%%%rc|jj|}|r|j ||jvr t t ||jr|||j}n||}nE#t$r6}|xj |j z c_ |xj |j z c_ |cYd}~Sd}~wwxYw|}t|j|||||\}}|s|j |t!t"|||St'd||jj)N)rHz/'{0}' is not among the specified fields for {1})rgrgetr8r r4r9factoryrrhinvariant_errorsrimissing_fieldsr invariantappendr(rBr%AttributeErrorrTr.) rMrnrorvaluerJis_ok error_coder-s rr%z_PRecordEvolver.setzsy%599#>>  @#+u8L/L/L 6wtGYZZ> % n4K] ^ ^ % n = =)   //13EE//((A,<<((KKKKKK ' t,eS% @ @ @ % 6 6 E: ?+22:>>>$//33C?? ? !R!Y!YZ]_c_t_}!~!~ sA B C +B>8C>Cc D|j|}tt|}|st |s|j|j}n|}jrP|xj tfdjt| z Dz c_ |j s|j r5tt|j t|j dt|j|S)N)r7r6c3NK|]}dj|V dS)z{0}.{1}N)rTr.)rfrEs rrz-_PRecordEvolver.persistent..sN*c*cPQ)*:*:3<*K*K*c*c*c*c*c*crzField invariant failed)rgis_dirtyr(rBrDr[_buckets_sizerritupler%keysrhrr r)rMrpmresultrEr-s @rrDz_PRecordEvolver.persistentsE#==?? ?D ) ) 4 4 6 6  :b#.. S"+RXNNNFFF  ( c  E*c*c*c*c.1.KcRXR]R]R_R_N`N`.`*c*c*c%c%c c   & ?$*> ?$U4+F%G%GtOcIdId%=?? ? (?@@@ rrb) r.r/r0r$rkrpr%rDr1r2s@rrBrBlsuI++++++&&&@@@@@4rrBN)pyrsistent._checked_typesrrrrpyrsistent._field_commonrrr r r r pyrsistent._pmapr rtyperr4_EvolverrBr#rrrsAhhhhhhhhhhhh('''''''GGGGG4GGG"PlPlPlPlPldK<PlPlPlPlf;;;;;dm;;;;;r