Attempt to register any unregistered extension namespaces.
2986
public void registerUnregisteredNamespaces()
  {
    for (int i = 0; i < m_unregisteredExtensions.size(); i++)
    {
      String ns = (String)m_unregisteredExtensions.get(i);
      ExtensionNamespaceSupport extNsSpt = defineJavaNamespace(ns);
      if (extNsSpt != null)
        m_extensions.add(extNsSpt);
    }    
  }
1268694
def declare_namespace(packageName):
    """"""

    _imp.acquire_lock()
    try:
        if packageName in _namespace_packages:
            return

        path = sys.path
        parent, _, _ = packageName.rpartition('.')

        if parent:
            declare_namespace(parent)
            if parent not in _namespace_packages:
                __import__(parent)
            try:
                path = sys.modules[parent].__path__
            except AttributeError:
                raise TypeError("Not a package:", parent)

        # Track what packages are namespaces, so when new path items are added,
        # they can be updated
        _namespace_packages.setdefault(parent or None, []).append(packageName)
        _namespace_packages.setdefault(packageName, [])

        for path_item in path:
            # Ensure all the parent's path items are reflected in the child,
            # if they apply
            _handle_ns(packageName, path_item)

    finally:
        _imp.release_lock()
1158484
private void registerAbilities() {
    try {
      // Collect all classes that implement AbilityExtension declared in the bot
      List<AbilityExtension> extensions = stream(getClass().getMethods())
          .filter(checkReturnType(AbilityExtension.class))
          .map(returnExtension(this))
          .collect(Collectors.toList());

      // Add the bot itself as it is an AbilityExtension
      extensions.add(this);

      // Extract all abilities from every single extension instance
      abilities = extensions.stream()
          .flatMap(ext -> stream(ext.getClass().getMethods())
              .filter(checkReturnType(Ability.class))
              .map(returnAbility(ext)))
          // Abilities are immutable, build it respectively
          .collect(ImmutableMap::<String, Ability>builder,
              (b, a) -> b.put(a.name(), a),
              (b1, b2) -> b1.putAll(b2.build()))
          .build();

      // Extract all replies from every single extension instance
      Stream<Reply> extensionReplies = extensions.stream()
          .flatMap(ext -> stream(ext.getClass().getMethods())
              .filter(checkReturnType(Reply.class))
              .map(returnReply(ext)));

      // Replies can be standalone or attached to abilities, fetch those too
      Stream<Reply> abilityReplies = abilities.values().stream()
          .flatMap(ability -> ability.replies().stream());

      // Now create the replies registry (list)
      replies = Stream.concat(abilityReplies, extensionReplies).collect(
          ImmutableList::<Reply>builder,
          Builder::add,
          (b1, b2) -> b1.addAll(b2.build()))
          .build();
    } catch (IllegalStateException e) {
      BotLogger.error(TAG, "Duplicate names found while registering abilities. Make sure that the abilities declared don't clash with the reserved ones.", e);
      throw propagate(e);
    }
  }
778064
def _set_namespace(self, namespaces):
        """"""
        self.namespace = {}
        for m in namespaces[::-1]:
            buf = _get_namespace(m)
            self.namespace.update(buf)
        self.namespace.update(self.__dict__)
1135820
def register(plugin, name=None):
        
        if name is None:
            name = plugin.__name__

        Builder._plugins[nstr(name)] = plugin
199490
def delete(self, namespacePrefix):
        """"""
        ns = db.ConfigNamespace.find_one(ConfigNamespace.namespace_prefix == namespacePrefix)
        if not ns:
            return self.make_response('No such namespace: {}'.format(namespacePrefix), HTTP.NOT_FOUND)

        db.session.delete(ns)
        db.session.commit()

        self.dbconfig.reload_data()
        auditlog(
            event='configNamespace.delete',
            actor=session['user'].username,
            data={'namespacePrefix': namespacePrefix}
        )
        return self.make_response('Namespace deleted')
897581
private void registerExtensions() {
    Iterator<Cache2kExtensionProvider> it =
      ServiceLoader.load(Cache2kExtensionProvider.class, CacheManager.class.getClassLoader()).iterator();
    while (it.hasNext()) {
      try {
        it.next().registerCache2kExtension();
      } catch (ServiceConfigurationError ex) {
        Log.getLog(CacheManager.class.getName()).debug("Error loading cache2k extension", ex);
      }
    }
  }
862980
public function register(Extension $extension)
    {
        if ($extension instanceof DocumentExtension) {
            array_unshift($this->registry[DocumentExtension::class], $extension);
        }
        if ($extension instanceof ElementExtension) {
            array_unshift($this->registry[ElementExtension::class], $extension);
        }
        if ($extension instanceof NamespaceExtension) {
            $this->registry[NamespaceExtension::class][] = $extension;
        }
    }
1192742
def match_namespace(self, el, tag):
        """"""

        match = True
        namespace = self.get_tag_ns(el)
        default_namespace = self.namespaces.get('')
        tag_ns = '' if tag.prefix is None else self.namespaces.get(tag.prefix, None)
        # We must match the default namespace if one is not provided
        if tag.prefix is None and (default_namespace is not None and namespace != default_namespace):
            match = False
        # If we specified `|tag`, we must not have a namespace.
        elif (tag.prefix is not None and tag.prefix == '' and namespace):
            match = False
        # Verify prefix matches
        elif (
            tag.prefix and
            tag.prefix != '*' and (tag_ns is None or namespace != tag_ns)
        ):
            match = False
        return match
1184738
private void tryRegister(String className, String fromStringMethodName) throws ClassNotFoundException {
        Class<?> cls = loadType(className);
        registerMethods(cls, "toString", fromStringMethodName);
    }
112558
public void registerPrefixForNamespace(String prefix, String namespace) {
        getEnvironment().registerNamespace(prefix, getUrl(namespace));
    }
1338422
private void addInstalledExtension(DefaultInstalledExtension installedExtension, String namespace)
    {
        addCachedExtension(installedExtension);

        boolean isValid = installedExtension.isValid(namespace);

        // Register the extension in the installed extensions for the provided namespace
        addInstalledFeatureToCache(installedExtension.getId(), namespace, installedExtension, isValid);

        // Add virtual extensions
        for (ExtensionId feature : installedExtension.getExtensionFeatures()) {
            addInstalledFeatureToCache(feature, namespace, installedExtension, isValid);
        }

        if (this.updateBackwardDependencies) {
            // Recalculate backward dependencies index
            updateMissingBackwardDependencies();
        }
    }
24510
public void registerExtensions(final Class<?>... extensions) {
        for (Class<?> extension : extensions) {
            register(ConfigItem.Extension, extension);
        }
    }
718153
public void register( Map<String, String> namespaceUrisByPrefix ) {
        if (namespaceUrisByPrefix == null || namespaceUrisByPrefix.isEmpty()) return;
        final Lock lock = this.namespacesLock.writeLock();
        try {
            lock.lock();
            SystemContent systemContent = systemContent(false);
            systemContent.registerNamespaces(namespaceUrisByPrefix);
            systemContent.save();
            for (Map.Entry<String, String> entry : namespaceUrisByPrefix.entrySet()) {
                String prefix = entry.getKey().trim();
                String uri = entry.getValue().trim();
                if (prefix.length() == 0) continue;
                this.cache.register(prefix, uri);
            }
        } finally {
            lock.unlock();
        }
    }
716039
function Namespacer(settings, callback) {
      if (settings.namespace != null) {
        this.groupNamespace = settings.namespace;
      } else {
        callback('Error: \'namespace\' is not configured');
      }
      if (settings.templates != null) {
        this.templates = settings.templates;
      } else {
        callback('Error: \'templates\' is not configured');
      }
      if (settings.skiproot != null) {
        this.skiproot = settings.skiproot;
      }
      if ((this.groupNamespace != null) && (this.templates != null)) {
        this.callback = callback;
        this.namespaces = [];
        this.result = [];
        this.init();
      }
    }
1350531
protected function registerNamespaces()
    {
        $this->mergeConfigFrom(__DIR__.'/src/config/config.php', 'menus');
        $this->loadViewsFrom(__DIR__.'/src/views', 'menus');

        $this->publishes([
            __DIR__.'/src/config/config.php' => config_path('menus.php'),
        ], 'config');

        $this->publishes([
            __DIR__.'/src/views' => base_path('resources/views/vendor/pingpong/menus'),
        ], 'views');
    }
880560
def _validate_namespaces(self, input_namespaces):
        """"""
        output_namespaces = []
        if input_namespaces == []:
            return output_namespaces
        elif '*' in input_namespaces:
            if len(input_namespaces) > 1:
                warning = 'Warning: Multiple namespaces are '
                warning += 'ignored when one namespace is "*"\n'
                sys.stderr.write(warning)
            return output_namespaces
        else:
            for namespace in input_namespaces:
                if not isinstance(namespace, unicode):
                    namespace = unicode(namespace)
                namespace_tuple = self._tuplefy_namespace(namespace)
                if namespace_tuple is None:
                    warning = 'Warning: Invalid namespace ' + namespace
                    warning += ' will be ignored\n'
                    sys.stderr.write(warning)
                else:
                    if namespace_tuple not in output_namespaces:
                        output_namespaces.append(namespace_tuple)
                    else:
                        warning = 'Warning: Duplicate namespace ' + namespace
                        warning += ' will be ignored\n'
                        sys.stderr.write(warning)
        return output_namespaces