Register externally defined classes.
357020
def register_classes(yaml: ruamel.yaml.YAML, classes: Optional[Iterable[Any]] = None) -> ruamel.yaml.YAML:
    
    # Validation
    if classes is None:
        classes = []

    # Register the classes
    for cls in classes:
        logger.debug(f"Registering class {cls} with YAML")
        yaml.register_class(cls)

    return yaml
321477
def register_cffi_externs(self):
    """"""
    for field_name, _ in self._extern_fields.items():
      bound_method = getattr(self, field_name)
      self._ffi.def_extern()(bound_method)
366564
protected function registerBaseBindings()
    {
        static::setInstance($this);

        $this->instance('app', $this);

        $this->instance(Container::class, $this);

        $this->instance(PackageManifest::class, new PackageManifest(
            new Filesystem, $this->basePath(), $this->getCachedPackagesPath()
        ));
    }
146888
def register_widgets():
    

    # special case
    # register external apps
    Page.create_content_type(
        ApplicationWidget, APPLICATIONS=settings.APPLICATION_CHOICES)

    for _optgroup, _widgets in six.iteritems(settings.WIDGETS):
        optgroup = _optgroup if _optgroup != 'ungrouped' else None
        for widget in _widgets:

            kwargs = {'optgroup': optgroup}

            # load class from strings
            if isinstance(widget, six.string_types):
                try:
                    WidgetCls = get_class_from_string(widget)
                except:
                    exc_info = sys.exc_info()
                    raise six.reraise(*exc_info)
            elif isinstance(widget, tuple):
                try:
                    WidgetCls = get_class_from_string(widget[0])
                    if len(widget) > 1:
                        kwargs.update(widget[1])
                except Exception as e:
                    raise Exception('%s: %s' % (mod, e))
            else:
                WidgetCls = widget

            Page.create_content_type(
                WidgetCls, **kwargs)
1261109
public function register()
    {
        // Handle case-insensitivity of interface names.
        $this->internalInterfaces = $this->arrayKeysToLowercase($this->internalInterfaces);

        $targets = array(\T_CLASS);

        if (\defined('T_ANON_CLASS')) {
            $targets[] = \T_ANON_CLASS;
        }

        return $targets;
    }
1086427
protected function registerClassAliases(): void
	{
		$aliases = $this->config->get('application.class_aliases');

		if(!empty($aliases))
		{
			$aliasLoader = new AliasLoader($aliases);

			spl_autoload_register([$aliasLoader, 'load']);
		}
	}
5127
def register(cls):
    
    registry_entry = RegistryEntry(category = cls.category, namespace = cls.namespace, name = cls.name, cls=cls)
    if registry_entry not in registry and not exists_in_registry(cls.category, cls.namespace, cls.name):
        registry.append(registry_entry)
    else:
        log.warn("Class {0} already in registry".format(cls))
1062160
def register_handlers(self, handler_classes):
        
        for handler_class in handler_classes:
            self.handlers.append(handler_class(client=self.client))
            logging.info('Successfully registered {handler_class}'.format(
                handler_class=getattr(handler_class, '__name__', str(handler_class)))
            )
269172
public static void register(Class<? extends View>... classes) {
        for (Class<? extends View> classe : classes) {
            register(classe);
        }
    }
845674
public function registerPlugins()
    {
        foreach($this->activePlugins() as $plugin){
            $className = $plugin->parseNamespace()."\\Plugin";
            if(class_exists($className)) {
                $pluginInstance = new $className();
                if ($plugin->isActive() && method_exists($pluginInstance, 'register')) {
                    $pluginInstance->register();
                    $this->registeredPlugins[] = $plugin;
                }
            }
        }
        return;
    }
789673
protected function registerAliases()
    {
        $this->app->alias('tymon.jwt', JWT::class);
        $this->app->alias('tymon.jwt.auth', JWTAuth::class);
        $this->app->alias('tymon.jwt.provider.jwt', JWTContract::class);
        $this->app->alias('tymon.jwt.provider.jwt.namshi', Namshi::class);
        $this->app->alias('tymon.jwt.provider.jwt.lcobucci', Lcobucci::class);
        $this->app->alias('tymon.jwt.provider.auth', Auth::class);
        $this->app->alias('tymon.jwt.provider.storage', Storage::class);
        $this->app->alias('tymon.jwt.manager', Manager::class);
        $this->app->alias('tymon.jwt.blacklist', Blacklist::class);
        $this->app->alias('tymon.jwt.payload.factory', Factory::class);
        $this->app->alias('tymon.jwt.validators.payload', PayloadValidator::class);
    }
1287861
protected function registerBaseBindings()
    {
        static::setInstance($this);

        $this->instance('app', $this);

        $this->instance(Container::class, $this);
    }
347492
protected function registerFacadesAliases()
    {
        $loader = AliasLoader::getInstance();
        $loader->alias('AuzoToolsPermissionRegistrar', AuzoToolsPermissionRegistrarFacade::class);
        $loader->alias('GenerateAbilities', GenerateAbilitiesFacade::class);
    }
428284
public function register()
    {
        $loader = AliasLoader::getInstance();

        // Register aliases
        foreach ($this->getAliases() as $alias => $class) {
            $loader->alias($alias, $class);
        }

        // Register service containers
        foreach ($this->getServiceContainers() as $abstract => $concrete) {
            $this->app->singleton($abstract, $concrete);
        }
    }
1294227
def register_type(cls, name):
    """"""
    x = TypeDefinition(name, (cls,), ())
    Validator.types_mapping[name] = x
882763
protected function registerClasses()
    {
        $campaignchainBundlesContent = file_get_contents($this->configFiles['bundles']);
        $symfonyBundlesContent = file_get_contents($this->configFiles['kernel_symfony']);

        $hasNewBundles = false;

        $classes = $this->kernelConfig->getClasses();

        if (!count($classes)) {
            return;
        }

        foreach ($classes as $class) {
            // Check if the bundle is already registered in the kernel.
            if (
                strpos($campaignchainBundlesContent, $class) === false &&
                strpos($symfonyBundlesContent, $class) === false
            ) {
                $hasNewBundles = true;

                // Add the bundle class path to the CampaignChain bundles registry file.
                $campaignchainContentBundle = "\$bundles[] = new ".$class."();";

                $campaignchainBundlesContent .= "\xA".$campaignchainContentBundle;
            }
        }

        if (!$hasNewBundles) {
            return;
        }

        $fs = new Filesystem();
        $fs->dumpFile($this->configFiles['bundles'], $campaignchainBundlesContent);

    }
14478
protected function registerPlugins()
    {
        if ( count($this->externalPlugins) )
        {
            foreach ( $this->externalPlugins as $plugin ) {
                $this->getView()->registerJs("CKEDITOR.plugins.addExternal( '" . $plugin['name'] . "', '" . $plugin['path'] . "', '" . $plugin['file'] . "' );", View::POS_END);
            }
        }
    }