ff XddlmZddlmZmZddlmZmZddlm Z m Z d dZ d dZ dZ d S) wraps)PMappmap)PSetpset)PVectorpvectorTct|}|tusrBt|tr-t fd|DS|t usr7t|tr"fd}tt||S|tur"fd}tt||S|turt|S|S)a} Recursively convert simple Python containers into pyrsistent versions of those containers. - list is converted to pvector, recursively - dict is converted to pmap, recursively on values (but not keys) - set is converted to pset, but not recursively - tuple is converted to tuple, recursively. If strict == True (default): - freeze is called on elements of pvectors - freeze is called on values of pmaps Sets and dict keys are not recursively frozen because they do not contain mutable data by convention. The main exception to this rule is that dict keys and set elements are often instances of mutable objects that support hash-by-id, which this function can't convert anyway. >>> freeze(set([1, 2])) pset([1, 2]) >>> freeze([1, {'a': 3}]) pvector([1, pmap({'a': 3})]) >>> freeze((1, [])) (1, pvector([])) c8i|]\}}|t|Sfreeze.0kvstricts s/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pyrsistent/_helpers.py zfreeze..#s)@@@daQq&))@@@c$t|SNrxrs rzfreeze..%6!V#4#4rc$t|Srrrs rrzfreeze..(rr) typedict isinstancerritemslistr r maptuplesetr)ortypcurried_freezes ` rrrs6 q''C d{{v{*Q"5"5{@@@@aggii@@@AAA d{{v{*Q"8"8{4444s>1--... e||4444S++,,, czzAww Hrct|}t|ts r+|tur"fd}tt ||St|t s r)|t ur fd|DS|tur"fd}tt ||St|trt|S|S)a? Recursively convert pyrsistent containers into simple Python containers. - pvector is converted to list, recursively - pmap is converted to dict, recursively on values (but not keys) - pset is converted to set, but not recursively - tuple is converted to tuple, recursively. If strict == True (the default): - thaw is called on elements of lists - thaw is called on values in dicts >>> from pyrsistent import s, m, v >>> thaw(s(1, 2)) {1, 2} >>> thaw(v(1, m(a=3))) [1, {'a': 3}] >>> thaw((1, v())) (1, []) c$t|Srthawrs rrzthaw..Harc8i|]\}}|t|Sr r,rs rrzthaw..Ks'999tq!46??999rc$t|Srr,rs rrzthaw..Mr.r) rr!r r#r$rr r"r%rr&)r'rr( curried_thaws ` rr-r-0s, q''C!W*&*SD[[0000 C a(()))!T:v:#++9999qwwyy9999 e||0000 Sq))***!T1vv Hrc<tfd}|S)a  Convenience decorator to isolate mutation to within the decorated function (with respect to the input arguments). All arguments to the decorated function will be frozen so that they are guaranteed not to change. The return value is also frozen. c td|Ditd|DS)Nc,g|]}t|Sr r)res r z+mutant..inner_f.._s3336!99333rc34K|]}t|VdSrr)ritems r z*mutant..inner_f.._s(;d;dTF4LL;d;d;d;d;d;dr)rr r")argskwargsfns rinner_fzmutant..inner_f]sSbb33d333et;d;dU[UaUaUcUc;d;d;d7d7deefffrr)r<r=s` rmutantr>Us: 2YYggggYg NrN)T) functoolsrpyrsistent._pmaprrpyrsistent._psetrrpyrsistent._pvectorr r rr-r>r rrrCs''''''''''''''''00000000' ' ' ' T" " " " J     r