NL i dZddlmZddlmZddlmZddlmZm Z ddl m Z ddl m Z mZGdd Zd d ZeeefZy ) z'Intermediate representation of modules.) annotations)JsonDict)ClassIR)FuncDeclFuncIR) DeserMaps)RTypedeserialize_typecNeZdZdZ ddZddZeddZy) ModuleIRz(Intermediate representation of a module.ct||_|j|_||_||_||_||_y)N)fullnamecopyimports functionsclasses final_namestype_var_names)selfrrrrrrs X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/mypyc/ir/module_ir.py__init__zModuleIR.__init__s8! ||~ " &-c L|j|j|jDcgc]}|jc}|jDcgc]}|jc}|j Dcgc]\}}||jfc}}dScc}wcc}wcc}}w)N)rrrrr)rrr serializerr)rfckts rrzModuleIR.serialize"sy ||15@A!++-@/3||t|d|d|dDcgc]$}|jtj|&c}|dDcgc]}t j ||c}|dDcgc]\}}|t ||fc}}gScc}wcc}wcc}}w)Nrrrrr)r rrget_id_from_jsonr deserializer )clsdatactxrrrrs rr!zModuleIR.deserialize+s   OBF{BS TQS]]844Q7 8 T26y/ BQW C ( B7;M7J Ktq!a!!S) * K     U B Ks)B B.BN)rstrr list[str]rz list[FuncIR]rz list[ClassIR]rzlist[tuple[str, RType]]rr&returnNone)r'r)r#rr$rr'r )__name__ __module__ __qualname____doc__rr classmethodr!rrr r sg2--- -  - - -"- -&   rr c |jD]c}|dD]Y}t|d|d}|j|jvsJd|jz||j|j<[e|jD]}|dD]{}t j ||}|j j|jvsJd|j jz||j|j j<}|jDcic]\}}|tj ||c}}Scc}}w)aGDeserialize a collection of modules. The modules can contain dependencies on each other. Arguments: data: A dict containing the modules to deserialize. ctx: The deserialization maps to use and to populate. They are populated with information from the deserialized modules and as a precondition must have been populated by deserializing any dependencies of the modules being deserialized (outside of dependencies between the modules themselves). Returns a map containing the deserialized modules. rname module_namezClass %s already in maprzMethod %s already in map) valuesrrrrr!declidritemsr ) r#r$modr"irmethodfuncrvs rdeserialize_modulesr;7s4{{}*y> *CVc-&89B;;ckk1 Z3Lr{{3Z Z1')CKK $ **{{}/+& /F%%fc2D99<rDs<-"!%-"3( ( V FJ h  r