Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_namespace_injectables(
dependency_name: str, registry_type: RegistryType, namespace: str
) -> Set[Injectable]:
if len(InjectionContainer.NAMESPACES) == 0:
logging.warning(
"Injection Container is empty. Make sure 'load_injection_container'"
" is being called before any injections are made."
)
injection_namespace = InjectionContainer.NAMESPACES.get(namespace)
if not injection_namespace:
return set()
registry = (
injection_namespace.class_registry
if registry_type is RegistryType.CLASS
else injection_namespace.qualifier_registry
)
injectables = registry.get(dependency_name)
return injectables