o  i@sXdZddlmZddlZddlZddlZddlZeZiZ ddgZ ddZ ddZ dS)zI This module is written for configurable workflow, not currently in use. ) annotationsNalias resolve_namecsfdd}|S)z Stores the decorated function or class in the global aliases table under the given names and as the `__aliases__` member of the decorated object. This new member will contain all alias names declared for that object. c sPD]}t |t|<Wdn1swYqt|ddt|_|S)N __aliases__) alias_lock GlobalAliasesgetattrtupler)objnnamesrU/home/dell461/cl/sdc2/last_ska_mid/HISourceFinder-master-l/src/monai/utils/aliases.py_outer"s zalias.._outerr)rrrr rrs  c st t}Wdn1swYtvr!|dur!t|durcdvrcdd\}}z t|}t||d}WntyS}z t d|d|d}~ww|durct d|d|d|durfddt t j D}t|d krt|dkrttdfd d |D}t|dkrd d|D}d |dd} t | t |}t|d }|durt dd|S)a Search for the declaration (function or class) with the given name. This will first search the list of aliases to see if it was declared with this aliased name, then search treating `name` as a fully qualified name, then search the loaded modules for one having a declaration with the given name. If no declaration is found, raise ValueError. Raises: ValueError: When the module is not found. ValueError: When the module does not have the specified member. ValueError: When multiple modules with the declaration name are found. ValueError: When no module with the specified member is found. N.zModule z not found.z does not have member csg|] }t|dr|qS)N)r .0mnamerr Vz resolve_name..rcsh|] }tt|qSr)inspect getmoduler rrrr Zrzresolve_name..cSsg|]}|jqSr)__name__rrrrr]szMultiple modules (z) with declaration name z found, resolution is ambiguous.zNo module with member z found.)rrgetAssertionErrorrsplit importlib import_moduler ModuleNotFoundError ValueErrorlistsysmodulesvalueslensetfilter) rr modnameZdeclnamemod not_found_errmodsZ foundmodsmodnamesmsgrrrr/s<     ) __doc__ __future__rr!rr& threadingRLockrr__all__rrrrrrs