in case engine was added in namespace
359308
def guess_name(sections)
      if sections.size > 1
        sections[-1] = 'rails_db'
        variable     = sections.join("_")
        result       = eval(variable)
      end
    rescue NameError
      sections.delete_at(-2)
      guess_name(sections)
    end
1185490
def with_outer_namespace(self, outer_namespace):
        """"""
        return self.__class__(self._namespaces + [outer_namespace],
                              self.flags)
781064
public void engineReloaded(Object objectSent) {

    	final JsMessagingEngine engine = (JsMessagingEngine)objectSent;
    	
        final String methodName = "engineReloaded";
        if (TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName, engine);
        }

        RELOADING_MESSAGING_ENGINES.remove(engine.getUuid().toString());

        // Get listeners to notify
        final Set listeners = getListeners(engine.getBusName());

        // Notify listeners
        for (final Iterator iterator = listeners.iterator(); iterator.hasNext();) {

            final SibRaMessagingEngineListener listener = (SibRaMessagingEngineListener) iterator
                    .next();
            listener.messagingEngineReloaded(engine);

        }

        if (TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }

    }
572164
def register_namespace(self, namespace_handler):
        
        if not isinstance(namespace_handler, namespace.ClientNamespace):
            raise ValueError('Not a namespace instance')
        if self.is_asyncio_based() != namespace_handler.is_asyncio_based():
            raise ValueError('Not a valid namespace class for this client')
        namespace_handler._set_client(self)
        self.namespace_handlers[namespace_handler.namespace] = \
            namespace_handler
369687
function(name){
        var engines = this.doc.findall('./engine/[@name="' +name+'"]');
        for(var i=0; i < engines.length; i++){
            var children = this.doc.getroot().getchildren();
            var idx = children.indexOf(engines[i]);
            if(idx > -1){
                children.splice(idx,1);
            }
        }
    }
485116
function(namespaces)
{
    var self        = this;
    this.namespaces = {
        default: {}
    };

    if (namespaces && util.isArray(namespaces)) {

        namespaces.forEach(function(namespace) {
            self.namespaces[namespace] = {};
        });
    }
}
1251443
function getEngine(name) {
            if (!dbconfig.has(name)) {
                d.fatal("Trying to access data storage that is not configured:", name);
            }
            var conf = dbconfig.get(name);
            if (!conf.engine) {
                conf.engine = engine(conf.url);
            }
            return conf.engine;
        }
1186265
function verifyNamespace(namespace) {
	if (namespace && typeof namespace !== 'string') {
		const msg = util.format('Namespace must be a non-empty string: %j', namespace);
		logger.error('verifyNamespace:', msg);
		throw new Error(msg);
	}
}
746837
def is_namespace_ready( self, namespace_id ):
        
        namespace = self.get_namespace( namespace_id )
        if namespace is not None:
            return True
        else:
            return False
223232
def ensure_default_namespace(self) -> Namespace:
        """"""
        namespace = self.get_namespace_by_keyword_version(BEL_DEFAULT_NAMESPACE, BEL_DEFAULT_NAMESPACE_VERSION)

        if namespace is None:
            namespace = Namespace(
                name='BEL Default Namespace',
                contact='charles.hoyt@scai.fraunhofer.de',
                keyword=BEL_DEFAULT_NAMESPACE,
                version=BEL_DEFAULT_NAMESPACE_VERSION,
                url=BEL_DEFAULT_NAMESPACE_URL,
            )

            for name in set(chain(pmod_mappings, gmod_mappings, activity_mapping, compartment_mapping)):
                entry = NamespaceEntry(name=name, namespace=namespace)
                self.session.add(entry)

            self.session.add(namespace)
            self.session.commit()

        return namespace
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__)
99623
def add(self, namespace_uri):
        """"""
        # See if this namespace is already mapped to an alias
        alias = self.namespace_to_alias.get(namespace_uri)
        if alias is not None:
            return alias

        # Fall back to generating a numerical alias
        i = 0
        while True:
            alias = 'ext' + str(i)
            try:
                self.addAlias(namespace_uri, alias)
            except KeyError:
                i += 1
            else:
                return alias

        assert False, "Not reached"
30689
private boolean overridesNamespaceMappings( JcrSession session ) {
        NamespaceRegistry registry = session.context().getNamespaceRegistry();
        if (registry instanceof LocalNamespaceRegistry) {
            Set<Namespace> localNamespaces = ((LocalNamespaceRegistry)registry).getLocalNamespaces();
            if (localNamespaces.isEmpty()) {
                // There are no local mappings ...
                return false;
            }
            for (Namespace namespace : localNamespaces) {
                if (prefixesByUris.containsKey(namespace.getNamespaceUri())) return true;
            }
            // None of the local namespace mappings overrode any namespaces used by this schemata ...
            return false;
        }
        // We can't find the local mappings, so brute-force it ...
        for (Namespace namespace : registry.getNamespaces()) {
            String expectedPrefix = prefixesByUris.get(namespace.getNamespaceUri());
            if (expectedPrefix == null) {
                // This namespace is not used by this schemata ...
                continue;
            }
            if (!namespace.getPrefix().equals(expectedPrefix)) return true;
        }
        return false;
    }
322153
@Override
    public boolean hasObjectWithPrefix(JavaColonNamespace namespace, String name) throws NamingException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "hasObjectWithPrefix (" + namespace + ", " + name + ")");

        if (name == null) {
            throw new InvalidNameException();
        }

        boolean result = false;
        // This helper only provides support for java:comp/env
        if (namespace == JavaColonNamespace.COMP && name.isEmpty()) {
            result = true;
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "hasObjectWithPrefix", result);
        return result;
    }
959099
function engineManager_removeEngine(name) {
    this.selectedEngine = name;

    var button = this.getElement({type: "engine_button", subtype: "remove"});
    this._controller.click(button);

    this._controller.waitForEval("subject.manager.selectedEngine != subject.removedEngine", TIMEOUT, 100,
                                 {manager: this, removedEngine: name});
  }
993652
public boolean hasName(String name, String namespace) {
        return hasName(name) && Objects.equals(this.namespace, namespace);
    }
1120478
def namespace_present(name, **kwargs):
    '''
    

    '''
    ret = {'name': name,
           'changes': {},
           'result': False,
           'comment': ''}

    namespace = __salt__['kubernetes.show_namespace'](name, **kwargs)

    if namespace is None:
        if __opts__['test']:
            ret['result'] = None
            ret['comment'] = 'The namespace is going to be created'
            return ret

        res = __salt__['kubernetes.create_namespace'](name, **kwargs)
        ret['result'] = True
        ret['changes']['namespace'] = {
            'old': {},
            'new': res}
    else:
        ret['result'] = True if not __opts__['test'] else None
        ret['comment'] = 'The namespace already exists'

    return ret