L idZddlmZddlZddlmZddlmZddlmZddlmZeded ef Z erdd l m Z dd l m Zdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZ ddlm!Z"ddlm#Z$ddlm%Z&ddlm'Z(ddlm)Z*ddlm+Z,ddlm-Z.ddlm/Z0ddlm1Z2ddlm3Z4ddlm5Z6dd lm7Z8dd!l9m:Z;dd"l9mZ?dd$l9m@ZAdd%l9mBZCdd&l9mDZEdd'l9mFZGdd(l9mHZIdd)l9mJZKdd l9m7ZLe Z eZMeZNeZOeZPeZQe ZReZSeZ eZTe"ZUe$ZVe(ZWe&ZXe*ZYe,ZZe.Z[e0Z\e4Z]e6Z^e2Z_e8Z`e;Zae=Zbe?ZceAZdeCZeeGZfeKZgeEZheIZieLZjGd*d+ZkekZleljZmeljZny),zRsupplies the "preloaded" registry to resolve circular module imports at runtime. ) annotationsN)Any)Callable) TYPE_CHECKING)TypeVar_FN.)bound)dialects)orm)cursor)default) reflection)result)url) attributes)base) clsregistry)decl_api) decl_base) dependency)descriptor_props) mapperlib) properties) relationships)session)state) strategies)strategy_options)util)default_comparator)dml)elements) functions)naming)schema) selectable)sqltypes) traversalsc(eZdZdZddZddZddZy) _ModuleRegistryaRegistry of modules to load in a package init file. To avoid potential thread safety issues for imports that are deferred in a function, like https://bugs.python.org/issue38884, these modules are added to the system module cache by importing them after the packages has finished initialization. A global instance is provided under the name :attr:`.preloaded`. Use the function :func:`.preload_module` to register modules to load and :meth:`.import_prefix` to load all the modules that start with the given path. While the modules are loaded in the global module cache, it's advisable to access them using :attr:`.preloaded` to ensure that it was actually registered. Each registered module is added to the instance ``__dict__`` in the form `_`, omitting ``sqlalchemy`` from the package name. Example: ``sqlalchemy.sql.util`` becomes ``preloaded.sql_util``. c0t|_||_yN)setmodule_registryprefix)selfr/s _/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sqlalchemy/util/preloaded.py__init__z_ModuleRegistry.__init__rs"u c>|jj|dS)zAdds the specified modules to the list to load. This method can be used both as a normal function and as a decorator. No change is performed to the decorated object. c|Sr,)fns r1z0_ModuleRegistry.preload_module..}s"r3)r.update)r0depss r1preload_modulez_ModuleRegistry.preload_modulevs ##D)r3cz|jD]}|jr/|j|jdjdd}n|}|r|j |sT||j vsct |tttj|x|j |<t|<y)z\Resolve all the modules in the registry that start with the specified path. ._N) r.r/splitreplace startswith__dict__ __import__globalslocalssysmodules)r0pathmodulekeys r1 import_prefixz_ModuleRegistry.import_prefixs** JF{{ll4;;/3;;CEF--d3T]]*679fh769kk&6II c"WYs^ Jr3N)z sqlalchemy.)r:strreturnzCallable[[_FN], _FN])rIrMrNNone)__name__ __module__ __qualname____doc__r2r;rLr6r3r1r*r*^s& Jr3r*)orS __future__rrGtypingrrrrr sqlalchemyr _dialectsr _ormsqlalchemy.enginer _engine_cursorr _engine_defaultr_engine_reflectionr_engine_resultr _engine_urlsqlalchemy.ormr_orm_attributesr _orm_baser_orm_clsregistryr _orm_decl_apir_orm_decl_baser_orm_dependencyr_orm_descriptor_propsr _orm_mapperr_orm_propertiesr_orm_relationshipsr _orm_sessionr _orm_stater_orm_strategiesr_orm_strategy_optionsr _orm_utilsqlalchemy.sqlr _sql_default_comparatorr!_sql_dmlr" _sql_elementsr#_sql_functionsr$ _sql_namingr% _sql_schemar&_sql_selectabler' _sql_sqltypesr(_sql_traversals _sql_util engine_cursorengine_defaultengine_reflection engine_result engine_urlorm_clsregistryorm_baseorm_attributes orm_decl_api orm_decl_baseorm_descriptor_propsorm_dependency orm_mapperorm_propertiesorm_relationships orm_sessionorm_strategiesorm_strategy_options orm_stateorm_utilsql_default_comparatorsql_dml sql_elements sql_functions sql_namingsql_selectablesql_traversals sql_schema sql_sqltypessql_utilr*_regr;rLr6r3r1rsl#   e8CH-.0&:<B:4<0>8:<H7<B62<H0L.8:44<8<0H"M$N*"MJ&OH C$N L"M0$NJ$N*K$N0IH4G L"MJ$N$NJ LH.J.Jb$$"" r3