eaiovnaovbqoebvqoeavibavo B  f"@stdZddlZddlZddlmZGdddeZeZyddlm Z Wne k r\dZ YnXdddgZ d dZ iZ Zd d ZxJedeeeeeeeeeeeeejeeeeejej fD] Z!eee!<qWe"ed dZ!e!dk reee!<e#j ee#<e$j ee$<e%j ee%<e&j ee&<e dk r$e j ee <[[!dgfd dZ'iZ(ZddZ)e)eed<e)eee<e)eee<e)ee<e)ee<e)ee<e)ee<e)ee<e)ee<ye)eej*<Wne+k rYnXe)ee<e)eej<e)eej<e)eej <e)ee<e'fddZ,e,ee#<e'fddZ-e-ee<e'fddZ.e.ee$<e dk rt|dd}|r|d}n$t|dd}|r|}n td|t |t r|St |df|S)zlShallow copy operation on arbitrary Python objects. See the module's __doc__ string for more info. F__copy__N __reduce_ex__ __reduce__z%un(shallow)copyable object of type %s) type_copy_dispatchget issubclass TypeError_copy_immutablegetattrrr isinstancestr _reconstruct)xclscopierisscreductorrvrrrr Bs4          cCs|S)Nr)rrrrrosrCodeTypec Cs8|dkr i}t|}|||}||k r,|St|}t|}|rN|||}nyt|t}Wntk rtd}YnX|rt||}nt|dd}|r||}nxt|}|r||} n>t|dd}|r|d} n$t|dd}|r|} n t d|t | t r|}nt ||f| }||k r4|||<t |||S)ziDeep copy operation on arbitrary Python objects. See the module's __doc__ string for more info. Nr __deepcopy__r rrz"un(deep)copyable object of type %s)idrr_deepcopy_dispatchrr_deepcopy_atomicrrrrrr _keep_alive) rmemoZ_nildyrrrrrrrrr sJ                cCs|S)Nr)rr&rrrr$sr$cCs6g}||t|<|j}x|D]}||||qW|S)N)r"append)rr&r r(r)arrr_deepcopy_lists   r+cshfdd|D}y t|Stk r4YnXx,t||D]\}}||k rBt|}PqBW|}|S)Ncsg|]}|qSrr).0r*)r r&rr sz#_deepcopy_tuple..)r"KeyErrorziptuple)rr&r r(kjr)r r&r_deepcopy_tuples r3cCs>i}||t|<x(|D]\}}|||||||<qW|S)N)r"items)rr&r r(keyvaluerrr_deepcopy_dicts  r7cCst||jt|j|S)N)r__func__r __self__)rr&rrr_deepcopy_methodsr:cCs>y|t||Wn"tk r8|g|t|<YnXdS)aMKeeps a reference to the object x in the memo. Because we remember objects by their id, we have to assure that possibly temporary objects are kept alive by referencing them. We store a reference at the id of the memo, which should normally not be used unless someone tries to deepcopy the memo itself... N)r"r)r.)rr&rrrr%s r%csxdk }|r$|r$fdd|D}||} |r<| t|<|dk r|rR|}t| drh| |nbt|trt|dkr|\}} nd} |dk r| j|| dk rx | D]\} } t | | | qW|dk r|rx<|D]} | } | | qWnx|D]} | | qW|dk rt|rXxL|D]&\} } | } | } | | | <q,Wnx|D]\} } | | | <q^W| S)Nc3s|]}|VqdS)Nr)r,arg)r r&rr sz_reconstruct.. __setstate__) r"hasattrr=rr0len__dict__updater4setattrr))rr&funcargsstateZlistiterZdictiterr Zdeepr(Z slotstater5r6itemr)r r&rr sF             r)3__doc__typesweakrefcopyregr ExceptionrerrorZorg.python.corer ImportError__all__r rr'rrintfloatboolcomplexrr0bytes frozensetrangeslicepropertyBuiltinFunctionTypeEllipsisNotImplemented FunctionTypereftrlistdictset bytearrayr r#r$r AttributeErrorr+r3r7r: MethodTyper%rrrrr1s   +         8            +