Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if service_key in self._singletons:
return self._singletons[service_key]
if context.has_cached(service_key):
return context[service_key]
target = context.target(service_key)
if target.is_generic_list():
return self.resolve_all(target.generic_parameter)
registration = target.next_impl()
if registration is None:
raise MissingDependencyException(
"Failed to resolve implementation for " + str(service_key)
)
if service_key in registration.needs.values():
self._resolve_impl(service_key, kwargs, context)
return self._build_impl(registration, kwargs, context)