Resolve a single provider.
@param {?} provider
@return {?}
484733
function resolveReflectiveFactory(provider) {
    var /** @type {?} */ factoryFn;
    var /** @type {?} */ resolvedDeps;
    if (provider.useClass) {
        var /** @type {?} */ useClass = resolveForwardRef(provider.useClass);
        factoryFn = reflector.factory(useClass);
        resolvedDeps = _dependenciesFor(useClass);
    }
    else if (provider.useExisting) {
        factoryFn = function (aliasInstance) { return aliasInstance; };
        resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];
    }
    else if (provider.useFactory) {
        factoryFn = provider.useFactory;
        resolvedDeps = constructDependencies(provider.useFactory, provider.deps);
    }
    else {
        factoryFn = function () { return provider.useValue; };
        resolvedDeps = _EMPTY_LIST;
    }
    return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);
}
639175
protected function fromProvider($provider)
    {
        $provider = IOC::resolve($provider);
        $module = $provider->create();
        $this->add($provider->getName(), $module);
        return $module;
    }
436114
def get_provider(self, provider_name='default'):
        """"""
        try:
            if self._providers is None:
                self._providers = self._initialize_providers()
            return self._providers[provider_name]
        except KeyError:
            raise AssertionError(f'No Provider registered with name {provider_name}')
881818
function Provider() {
            var _this = this;
            this._providers = [];
            this._exports = [];
            /**
             * Parse Provider name from path
             *
             * @test BootProviderTest
             *
             * @param providerPath
             * @returns {*}
             */
            this.parseNameFromPath = function (providerPath) {
                var fileName = providerPath
                    .split(/[\\/]+/)
                    .pop()
                    .replace(/\.[^/.]+$/, "");
                return fileName;
            };
            /**
             * Initializing Provider object by path
             *
             * @param providerPath
             */
            this.initProvider = function (providerPath, providerName) {
                if (!providerName) {
                    providerName = _this.parseNameFromPath(providerPath);
                }
                var providerSource = require(providerPath);
                var providerObject;
                // TODO
                // Non case sensitive provider key find
                for (var indexSource in providerSource) {
                    // Convert index to lower case
                    var lowerSource = indexSource.toLowerCase();
                    if (indexSource.toLowerCase() === lowerSource) {
                        providerObject = providerSource[indexSource];
                        break;
                    }
                }
                if (!providerObject) {
                    throw new Error("Provider object problem: " + providerPath);
                }
                _this.initProviderObject(providerObject, providerName);
            };
            /**
             * Initializing Provider object by required object
             *
             * @param providesObject
             */
            this.initProviderObject = function (providerObject, providerName) {
                //
                debug("Initializing Provider object: %s", providerName);
                var val = {
                    source: null,
                    instance: null,
                    booted: false,
                    bootedFiles: false,
                    loadedFiles: false,
                    manualBoot: false,
                    exportName: null,
                    exportNamespace: false,
                    //defineNamespace : null,
                    objects: {}
                };
                val.source = providerObject;
                val.instance = typeof val.source === "function" ? new val.source() : val.source;
                _this.validateProviderObject(val.instance);
                val.manualBoot = !!(typeof val.instance.manualBoot === "function" && val.instance.manualBoot() === true);
                val.exportName = val.instance.exportName();
                val.exportNamespace = val.instance.exportNamespace();
                //val.defineNamespace =
                // Call "register" in provider
                val.instance.register();
                debug("Provider register called: %s", providerName);
                if (val.exportName && typeof val.exportName === "string") {
                    // Convert export name to lower case
                    val.exportName = val.exportName.toLowerCase();
                    _this._providers[providerName] = _this._exports[val.exportName] = val;
                }
                else {
                    _this._providers[providerName] = val;
                }
            };
            //
        }
332285
function(provider) {
        var authType;
        if (_.isString(provider)) {
          authType = provider;
        } else {
          authType = provider.getAuthType();
        }
        var authData = this.get('authData') || {};
        return !!authData[authType];
      }
376290
public function getProvider($provider)
    {
        $name = is_string($provider) ? $provider : get_class($provider);
        return \Nip_Helper_Arrays::first($this->providers, function ($value) use ($name) {
            return $value instanceof $name;
        });
    }
731007
function resolveAddresses(provider, value, paramType) {
    if (Array.isArray(paramType)) {
        var promises_1 = [];
        paramType.forEach(function (paramType, index) {
            var v = null;
            if (Array.isArray(value)) {
                v = value[index];
            }
            else {
                v = value[paramType.name];
            }
            promises_1.push(resolveAddresses(provider, v, paramType));
        });
        return Promise.all(promises_1);
    }
    if (paramType.type === 'address') {
        return provider.resolveName(value);
    }
    if (paramType.type === 'tuple') {
        return resolveAddresses(provider, value, paramType.components);
    }
    // Strips one level of array indexing off the end to recuse into
    var isArrayMatch = paramType.type.match(/(.*)(\[[0-9]*\]$)/);
    if (isArrayMatch) {
        if (!Array.isArray(value)) {
            throw new Error('invalid value for array');
        }
        var promises = [];
        var subParamType = {
            components: paramType.components,
            type: isArrayMatch[1],
        };
        value.forEach(function (v) {
            promises.push(resolveAddresses(provider, v, subParamType));
        });
        return Promise.all(promises);
    }
    return Promise.resolve(value);
}
863334
protected Set<Event> resolveSingleMultifactorProvider(final Optional<RequestContext> context, final RegisteredService service,
                                                          final Principal principal,
                                                          final Collection<MultifactorAuthenticationProvider> providers) {
        val globalPrincipalAttributeValueRegex = casProperties.getAuthn().getMfa().getGlobalPrincipalAttributeValueRegex();
        val provider = providers.iterator().next();
        LOGGER.trace("Found a single multifactor provider [{}] in the application context", provider);
        val attributeNames = commaDelimitedListToSet(casProperties.getAuthn().getMfa().getGlobalPrincipalAttributeNameTriggers());
        return multifactorAuthenticationProviderResolver.resolveEventViaPrincipalAttribute(principal, attributeNames, service, context, providers,
            input -> input != null && input.matches(globalPrincipalAttributeValueRegex));
    }
14107
@SuppressWarnings("unchecked")
    @Nullable
    public <T> Provider<T> get(Class<T> type) {
        return (Provider<T>) providers.get(type.getName());
    }
536004
public static void injectWith(InjectionProvider provider) {

		injectionProvider = provider;
		if (injectionProvider != null) {
			log.info("Registered injection provider: " + injectionProvider.getClass().getName());
		}
	}
537807
public function setProvider($provider = null)
    {
        $this->provider = null;

        if (null === ($provider = $this->internalResolveProvider($provider))) {
            $this->provider = $this->providerId = null;
        } else {
            $this->providerId = $provider->id;
            $this->provider = $provider;
        }

        return $this;
    }
385806
public function getProvider($provider)
    {
        // Check if an instance has already been initiated. If not
        // build it and then add to the providers array.
        if (!isset($this->providers[$provider])) {
            $this->addProvider($provider);
        }

        return $this->providers[$provider];
    }
1256344
@SuppressWarnings("unchecked")
    private static <V> V resolve(ProvidenceConfigContext context,
                                 Token token,
                                 Tokenizer tokenizer,
                                 PDescriptor descriptor) throws TokenizerException {
        Object value = resolveAny(context, token, tokenizer);
        if (value == null) {
            return null;
        }
        return (V) asType(descriptor, value);
    }
1240428
def get_provider(self, provider):
        """"""
        if self.provider is not None:
            return self.provider
        return providers.by_id(provider)
785099
function (providerConstr, args) {
    return new Promise(function (resolve) {
        var instance = new providerConstr();
        addInstanceToStore(args, instance);
        createGetData(instance, args.caller);
        if (args.hasOwnProperty("handler")) {
            instance.setHandler(args.handler);
        }
        if (args.hasOwnProperty("resources")) {
            instance.setResources(args.resources);
        }
        instance.fetchData(resolve, args.caller);
    });
}
144121
function getPromise(provider, extension) {
			var contentTypeIds = provider.getProperty("contentType") || provider.getProperty("contentTypes"), //$NON-NLS-1$ //$NON-NLS-0$
			    fileTypes = provider.getProperty("fileTypes"); // backwards compatibility //$NON-NLS-0$
			if (contentTypeIds) {
				return Deferred.when(contentTypeService.isSomeExtensionOf(contentType, contentTypeIds)).then(
					function (isMatch) {
						return isMatch ? provider : null;
					});
			} else if (extension && fileTypes && fileTypes.indexOf(extension) !== -1) {
				var d = new Deferred();
				d.resolve(provider);
				return d;
			}
			return null;
		}
202178
public function getProvider($provider)
    {
        if (isset($this->aProviders['all'][strtolower($provider)])) {
            return $this->aProviders['all'][strtolower($provider)];
        } else {
            return false;
        }
    }