Index the available factories

        Query the plugins for an usable factory and register it
177951
def _register_factory(self):
        
        for name, info in self._plugins.items():
            if info['priority']:
                factory = getattr(info['plugin'], 'factory', None)
                if callable(factory):
                    registry[info['factory']] = info['plugin'].factory
        registry.freeze()
10918
def load_factory(name, directory, configuration=None):
    
    for entry_point in pkg_resources.iter_entry_points(ENTRY_POINT):
        if entry_point.name == name:
            factory_class = entry_point.load(require=False)
            return factory_class(directory, configuration)

    raise KeyError
761098
public void register(Object locator, IComponentFactory factory) {
		if (locator == null)
			throw new NullPointerException("Locator cannot be null");
		if (factory == null)
			throw new NullPointerException("Factory cannot be null");

		_registrations.add(new Registration(locator, factory));
	}
586496
public function getSearchFactory(): SearchFactory
    {
        $extensions = $this->extensions;

        if (\count($this->types) > 0 || \count($this->typeExtensions) > 0) {
            $extensions[] = new PreloadedExtension($this->types, $this->typeExtensions);
        }

        $resolvedTypeFactory = $this->resolvedTypeFactory ?? new GenericResolvedFieldTypeFactory();
        $registry = new GenericTypeRegistry($extensions, $resolvedTypeFactory);

        return new GenericSearchFactory($registry, $this->fieldSetRegistry ?? LazyFieldSetRegistry::create());
    }
1327678
public function factory()
    {

        // register additional annotation libraries
        foreach ($this->persistenceUnitNode->getAnnotationRegistries() as $annotationRegistry) {
            AnnotationRegistry::registerAutoloadNamespace(
                $annotationRegistry->getNamespace(),
                $annotationRegistry->getDirectoriesAsArray($this->application->getWebappPath())
            );
        }

        // globally ignore configured annotations to ignore
        foreach ($this->persistenceUnitNode->getIgnoredAnnotations() as $ignoredAnnotation) {
            AnnotationReader::addGlobalIgnoredName($ignoredAnnotation->getNodeValue()->__toString());
        }

        // load the metadata configuration
        $metadataConfiguration = $this->persistenceUnitNode->getMetadataConfiguration();

        // prepare the setup properties
        $absolutePaths = $metadataConfiguration->getDirectoriesAsArray($this->application->getWebappPath());
        $proxyDir = $metadataConfiguration->getParam(MetadataConfigurationInterface::PARAM_PROXY_DIR);
        $isDevMode = $metadataConfiguration->getParam(MetadataConfigurationInterface::PARAM_IS_DEV_MODE);
        $useSimpleAnnotationReader = $metadataConfiguration->getParam(MetadataConfigurationInterface::PARAM_USE_SIMPLE_ANNOTATION_READER);

        // load the factory method from the available mappings
        $factoryMethod = EntityManagerFactory::$metadataMapping[$metadataConfiguration->getType()];

        // create the database configuration and initialize the entity manager
        $configuration = Setup::$factoryMethod($absolutePaths, $isDevMode, $proxyDir, null, $useSimpleAnnotationReader);

        // load the datasource node
        $datasourceNode = null;
        foreach ($this->application->getInitialContext()->getSystemConfiguration()->getDatasources() as $datasourceNode) {
            if ($datasourceNode->getName() === $this->persistenceUnitNode->getDatasource()->getName()) {
                break;
            }
        }

        // throw a exception if the configured datasource is NOT available
        if ($datasourceNode == null) {
            throw new \Exception(
                sprintf(
                    'Can\'t find a datasource node for persistence unit %s',
                    $this->persistenceUnitNode->getName()
                )
            );
        }

        // load the database node
        $databaseNode = $datasourceNode->getDatabase();

        // throw an exception if the configured database is NOT available
        if ($databaseNode == null) {
            throw new \Exception(
                sprintf(
                    'Can\'t find database node for persistence unit %s',
                    $this->persistenceUnitNode->getName()
                )
            );
        }

        // load the driver node
        $driverNode = $databaseNode->getDriver();

        // throw an exception if the configured driver is NOT available
        if ($driverNode == null) {
            throw new \Exception(
                sprintf(
                    'Can\'t find driver node for persistence unit %s',
                    $this->persistenceUnitNode->getName()
                )
            );
        }

        // initialize and return a entity manager decorator instance
        return new DoctrineEntityManagerDecorator(
            EntityManager::create(ConnectionUtil::get($this->application)->fromDatabaseNode($databaseNode), $configuration)
        );
    }
763321
protected function registerFactory(): void
    {
        $this->app->singleton('facebook.factory', function () {
            return new FacebookFactory();
        });

        $this->app->alias('facebook.factory', FacebookFactory::class);
    }
741928
public function registerSystemAliases() {

		$factory = Yii::$app->factory->getContainer();

		$factory->set( 'facebookService', 'cmsgears\social\connect\common\services\system\FacebookService' );
		$factory->set( 'googleService', 'cmsgears\social\connect\common\services\system\GoogleService' );
		$factory->set( 'twitterService', 'cmsgears\social\connect\common\services\system\TwitterService' );
		$factory->set( 'linkedinService', 'cmsgears\social\connect\common\services\system\LinkedinService' );
	}
1040237
def load(self, name):
        
        try:
            return self._factories[name]()
        except KeyError:
            raise ValueError(
                "no %s factory registered under name %r, options are: %r" %
                (self.interface.__name__, name, sorted(self._factories)),
            )
192386
protected function registerFactory()
    {
        $this->app->singleton('throttle.factory', function (Container $app) {
            $cache = $app->cache->driver($app->config->get('throttle.driver'));

            return new CacheFactory($cache);
        });

        $this->app->alias('throttle.factory', CacheFactory::class);
        $this->app->alias('throttle.factory', FactoryInterface::class);
    }
393958
def create_factory(create_factory_body, opts = {})
      data, _status_code, _headers = create_factory_with_http_info(create_factory_body, opts)
      return data
    end
47218
def register( cls, plugin ):
        
        if ( not plugin ):
            return
            
        if ( cls._plugins is None ):
            cls._plugins = {}
            
        cls._plugins[plugin.uniqueName()] = plugin
177259
final public static function register(Factory $factory) {
        if(!isset(self::$factories[$factory->driver]))
            self::$factories[$factory->driver] = $factory;
    }
846975
def filter_factory(global_conf, **local_conf):
    """"""
    conf = global_conf.copy()
    conf.update(local_conf)

    def visible(app):
        return VisibleFilter(app, conf)
    return visible
274736
public function registerFactory()
    {
        $this->app->singleton('view', function ($app) {
            // Next we need to grab the engine resolver instance that will be used by the
            // factory. The resolver will be used by a factory to get each of
            // the various engine implementations such as plain PHP or Blade engine.
            $resolver = $app['view.engine.resolver'];

            $finder = $app['view.finder'];

            $factory = new View\Factory($resolver, $finder, $app['events'], $app['presenter.decorator']);

            // We will also set the container instance on this view factory since the
            // view composers may be classes registered in the container, which allows
            // for great testable, flexible composers for the application developer.
            $factory->setContainer($app);

            $factory->share('app', $app);

            return $factory;
        });
    }
1309819
protected function registerFactory(Application $app)
    {
        $app->singleton('opensearch.factory', function ($app) {
            return new Factories\OpensearchFactory();
        });
        $app->alias('opensearch.factory', 'Orzcc\Opensearch\Factories\OpensearchFactory');
    }
737849
def provider_factory(factory=_sentinel, scope=NoneScope):
    '''
    
    '''
    if factory is _sentinel:
        return functools.partial(provider_factory, scope=scope)
    provider = Provider(factory, scope)
    return provider
104079
public function registerFactory()
    {
        Zilf::$container->register(
            'view', function () {
                // Next we need to grab the engine resolver instance that will be used by the
                // environment. The resolver will be used by an environment to get each of
                // the various engine implementations such as plain PHP or Blade engine.
                $resolver = Zilf::$container->getShare('view.engine.resolver');

                $finder = Zilf::$container->getShare('view.finder');

                $factory = $this->createFactory($resolver, $finder);

                // We will also set the container instance on this view environment since the
                // view composers may be classes registered in the container, which allows
                // for great testable, flexible composers for the application developer.
                /* $factory->setContainer($app);

                $factory->share('app', $app);*/

                return $factory;
            }
        );
    }