Specialized version in which namespace information is completely ignored.

@since 5.2
345138
public String getValueByLocalName(String localName)
    {
        // NOTE: can't use hashing, must do linear scan
        
        switch (mAttrCount) {
        case 4:
            if (mAttributes[0].hasLocalName(localName)) return getValue(0);
            if (mAttributes[1].hasLocalName(localName)) return getValue(1);
            if (mAttributes[2].hasLocalName(localName)) return getValue(2);
            if (mAttributes[3].hasLocalName(localName)) return getValue(3);
            return null;
        case 3:
            if (mAttributes[0].hasLocalName(localName)) return getValue(0);
            if (mAttributes[1].hasLocalName(localName)) return getValue(1);
            if (mAttributes[2].hasLocalName(localName)) return getValue(2);
            return null;
        case 2:
            if (mAttributes[0].hasLocalName(localName)) return getValue(0);
            if (mAttributes[1].hasLocalName(localName)) return getValue(1);
            return null;
        case 1:
            if (mAttributes[0].hasLocalName(localName)) return getValue(0);
            return null;
        case 0:
            return null;
        default:
            for (int i = 0, end = mAttrCount; i < end; ++i) {
                if (mAttributes[i].hasLocalName(localName)) {
                    return getValue(i);
                }
            }
            return null;
        }
    }
1143579
private function optionalTypeHint() {
    static $array_callable_types = [T_ARRAY, T_CALLABLE];
    $node = NULL;
    if ($node = $this->tryMatchToken($array_callable_types)) {
      return $node;
    }
    elseif (in_array($this->currentType, self::$namespacePathTypes)) {
      return $this->name();
    }
    return NULL;
  }
352229
private void handleTargetNsDecl()
        throws XMLStreamException
    {
        mAnyDTDppFeatures = true;
        
        char c = skipObligatoryDtdWs();
        String name;
        
        // Explicit namespace name?
        if (isNameStartChar(c)) {
            name = readDTDLocalName(c, false);
            c = skipObligatoryDtdWs();
        } else { // no, default namespace (or error)
            name = null;
        }
        
        // Either way, should now get a quote:
        if (c != '"' && c != '\'') {
            if (c == '>') { // slightly more accurate error
                _reportWFCViolation("Missing namespace URI for TARGETNS directive");
            }
            throwDTDUnexpectedChar(c, "; expected a single or double quote to enclose the namespace URI");
        }
        
        /* !!! 07-Nov-2004, TSa: what's the exact value we should get
         *   here? Ns declarations can have any attr value...
         */
        String uri = parseSystemId(c, false, "in namespace URI");
        
        // Do we need to normalize the URI?
        if ((mConfigFlags & CFG_INTERN_NS_URIS) != 0) {
            uri = InternCache.getInstance().intern(uri);
        }
        
        // Ok, and then the closing '>':
        c = skipDtdWs(true);
        if (c != '>') {
            throwDTDUnexpectedChar(c, "; expected '>' to end TARGETNS directive");
        }
        
        if (name == null) { // default NS URI
            mDefaultNsURI = uri;
        } else {
            if (mNamespaces == null) {
                mNamespaces = new HashMap<String,String>();
            }
            mNamespaces.put(name, uri);
        }
    }
912771
private ParseResult parseWithVersions() throws IOException {
    List<TemplateMetadata> templateMetadatas = new ArrayList<>();
    for (CompilationUnitAndKind unit : compilationUnits()) {
      templateMetadatas.addAll(
          TemplateMetadataSerializer.templatesFromCompilationUnit(
              unit.compilationUnit(),
              unit.fileKind(),
              typeRegistry(),
              unit.filePath(),
              errorReporter()));
    }
    IdGenerator nodeIdGen =
        (cache() != null) ? cache().getNodeIdGenerator() : new IncrementingIdGenerator();
    SoyFileSetNode soyTree = new SoyFileSetNode(nodeIdGen.genId(), nodeIdGen);
    boolean filesWereSkipped = false;
    // TODO(lukes): there are other places in the compiler (autoescaper) which may use the id
    // generator but fail to lock on it.  Eliminate the id system to avoid this whole issue.
    synchronized (nodeIdGen) { // Avoid using the same ID generator in multiple threads.
      for (SoyFileSupplier fileSupplier : soyFileSuppliers().values()) {
        SoyFileSupplier.Version version = fileSupplier.getVersion();
        VersionedFile cachedFile =
            cache() != null ? cache().get(fileSupplier.getFilePath(), version) : null;
        SoyFileNode node;
        if (cachedFile == null) {
          node = parseSoyFileHelper(fileSupplier, nodeIdGen);
          // TODO(b/19269289): implement error recovery and keep on trucking in order to display
          // as many errors as possible. Currently, the later passes just spew NPEs if run on
          // a malformed parse tree.
          if (node == null) {
            filesWereSkipped = true;
            continue;
          }
          // Run passes that are considered part of initial parsing.
          passManager().runSingleFilePasses(node, nodeIdGen);
          // Run passes that check the tree.
          if (cache() != null) {
            cache().put(fileSupplier.getFilePath(), VersionedFile.of(node, version));
          }
        } else {
          node = cachedFile.file();
        }
        for (TemplateNode template : node.getChildren()) {
          templateMetadatas.add(TemplateMetadata.fromTemplate(template));
        }
        soyTree.addChild(node);
      }

      TemplateRegistry registry = new TemplateRegistry(templateMetadatas, errorReporter());
      // Run passes that check the tree iff we successfully parsed every file.
      if (!filesWereSkipped) {
        passManager().runWholeFilesetPasses(soyTree, registry);
      }
      return ParseResult.create(soyTree, registry);
    }
  }
1360776
public function shouldEnableLegacyNamespace()
    {
        if (isset($this->pkgAutoloaderMapCoreExtensions) && $this->pkgAutoloaderMapCoreExtensions) {
            // We're no longer using this to denote non-legacy applications, but if a package uses this
            // that means it's NOT using the legacy namespace.
            return false;
        }

        $concrete5 = '7.9.9';
        $package = $this->getApplicationVersionRequired();
        if (version_compare($package, $concrete5, '>')) {
            return false;
        }

        return $this->pkgEnableLegacyNamespace;
    }
1245835
def type(namespace, name)
      if @allow_abstract_types
        @types.fetch([namespace, name]) { abstract_type(namespace, name) }
      else
        @types.fetch([namespace, name]) { NullType.new }
      end
    end
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
1248919
@Override
    public boolean hasObjectWithPrefix(JavaColonNamespace namespace, String name) throws NamingException {
        ComponentMetaData cmd = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
        J2EEName j2eeName = cmd.getJ2EEName();

        boolean b;
        try {
            b = (JavaColonNamespace.APP.equals(namespace) || JavaColonNamespace.GLOBAL.equals(namespace)) &&
                clientSupportFactory.getRemoteClientSupport().hasRemoteObjectWithPrefix(j2eeName.getApplication(), j2eeName.getModule(), j2eeName.getComponent(), namespace.toString(), name);
        } catch (RemoteException ex) {
            //ffdc
            b = false;
        }
        return b;
    }
143352
public boolean compete(NamespaceSpecification other) {
    // if no wildcard for other then we check coverage
    if ("".equals(other.wildcard)) {
      return covers(other.ns);
    }
    // split the namespaces at wildcards     
    String[] otherParts = split(other.ns, other.wildcard);
    
    // if the given namepsace specification does not use its wildcard
    // then we just look if the current namespace specification covers it
    if (otherParts.length == 1) {
      return covers(other.ns);
    }
    // if no wildcard for the current namespace specification
    if ("".equals(wildcard)) {
      return other.covers(ns);
    }
    // also for the current namespace specification
    String[] parts = split(ns, wildcard); 
    // now check if the current namespace specification is just an URI
    if (parts.length == 1) {
      return other.covers(ns);
    }
    // now each namespace specification contains wildcards
    // suppose we have 
    // ns   = a1*a2*...*an 
    // and 
    // other.ns = b1*b2*...*bm
    // then we only need to check matchPrefix(a1, b1) and matchPrefix(an, bn) where
    // matchPrefix(a, b) means a starts with b or b starts with a.
    return matchPrefix(parts[0], otherParts[0])
           && matchPrefix(parts[parts.length - 1], otherParts[otherParts.length - 1]);
  }
1328278
def namedb_get_namespace_ready( cur, namespace_id, include_history=True ):
    

    select_query = "SELECT * FROM namespaces WHERE namespace_id = ? AND op = ?;"
    namespace_rows = namedb_query_execute( cur, select_query, (namespace_id, NAMESPACE_READY))

    namespace_row = namespace_rows.fetchone()
    if namespace_row is None:
        # no such namespace 
        return None 

    namespace = {}
    namespace.update( namespace_row )

    if include_history:
        hist = namedb_get_history( cur, namespace_id )
        namespace['history'] = hist

    namespace = op_decanonicalize('NAMESPACE_READY', namespace)
    return namespace
9569
def generate_imports_for_referenced_namespaces(
        backend, namespace, insert_type_ignore=False):
    # type: (Backend, ApiNamespace, bool) -> None
    

    imported_namespaces = namespace.get_imported_namespaces(consider_annotation_types=True)
    if not imported_namespaces:
        return

    type_ignore_comment = TYPE_IGNORE_COMMENT if insert_type_ignore else ""

    backend.emit('try:')
    with backend.indent():
        backend.emit('from . import (')
        with backend.indent():
            for ns in imported_namespaces:
                backend.emit(fmt_namespace(ns.name) + ',')
        backend.emit(')')
    backend.emit('except (ImportError, SystemError, ValueError):')
    # Fallback if imported from outside a package.
    with backend.indent():
        for ns in imported_namespaces:
            backend.emit('import {namespace_name}{type_ignore_comment}'.format(
                namespace_name=fmt_namespace(ns.name),
                type_ignore_comment=type_ignore_comment
            ))
    backend.emit()
1138225
function (namespaces, defaultNamespace, name) {
    var self = this;

    assert(namespaces);
    assert(name);
    if (/^\{.+\}/.test(name)) {
      return name;
    }
    else if (/:/.test(name)) {
      var parts = name.split(':');
      assert(parts.length === 2, parts);
      if (!namespaces[parts[0]]) {
        throw new xml2js.ValidationError("Unknown namespace " + parts[0] + ", name: " + name + ", known namespaces: " + util.inspect(namespaces, false, null));
      }
      return '{' + namespaces[parts[0]] + '}' + parts[1];
    }
    else if (defaultNamespace) {
      return '{' + defaultNamespace + '}' + name;
    }
    else {
      throw new xml2js.ValidationError("Unqualified name and no default namespace: " + name);
    }
  }
724691
void nameSpaceChanged()
    {
        if ( nameSourceListeners == null )
            return;

        for(int i=0; i<nameSourceListeners.size(); i++)
            ((NameSource.Listener)(nameSourceListeners.get(i)))
                .nameSourceChanged( this );
    }
899996
public static void ignoreUpdate(Version ver) {
        FOKLogger.info(UpdateChecker.class.getName(), "User ignores all updates up to (and including) version " + ver.toString());
        updatePrefs.setPreference(latestSeenVersionPrefKey, ver.toString());
    }
1291245
@Override
  public void exitPostfix_version(VersionParser.Postfix_versionContext ctx)
  {
    SemanticVersion version = null;

    int count = ctx.getChildCount();
    Object o = stack.pop();
    if (!(o instanceof String)) {
      throw new InvalidRangeRuntimeException("Expected string, got " + o.getClass().getSimpleName() + " (" + o + ")");
    }
    String postfix = (String) o;
    switch (count) {
      case 4: {
        //1.2.3alpha
        switch (postfix.toUpperCase()) {
          case "RELEASE":
          case "FINAL":
          case "GA":
            version = new SemanticVersion(
                ctx.getChild(0).getText() + "."
                    + ctx.getChild(2).getText());
            break;
          default:
            version = new SemanticVersion(
                ctx.getChild(0).getText() + "."
                    + ctx.getChild(2).getText() + "."
                    + "0" + "-"
                    + postfix);
            break;
        }
        break;
      }
      case 5:
        version = new SemanticVersion(
            ctx.getChild(0).getText() + "."
                + ctx.getChild(2).getText() + "."
                + "0" + "-"
                + postfix);
        break;
      case 6: {
        //1.2.3alpha
        switch (postfix.toUpperCase()) {
          case "RELEASE":
          case "FINAL":
          case "GA":
            version = new SemanticVersion(
                ctx.getChild(0).getText() + "."
                    + ctx.getChild(2).getText() + "."
                    + ctx.getChild(4).getText());
            break;
          default:
            version = new SemanticVersion(
                ctx.getChild(0).getText() + "."
                    + ctx.getChild(2).getText() + "."
                    + ctx.getChild(4).getText() + "-"
                    + postfix);
            break;
        }
        break;
      }
      case 7: {
        //1.2.3-alpha
        //1.2.3.alpha
        switch (postfix.toUpperCase()) {
          case "RELEASE":
          case "FINAL":
          case "GA":
            version = new SemanticVersion(
                ctx.getChild(0).getText() + "."
                    + ctx.getChild(2).getText() + "."
                    + ctx.getChild(4).getText());
            break;
          default:
            version = new SemanticVersion(
                ctx.getChild(0).getText() + "."
                    + ctx.getChild(2).getText() + "."
                    + ctx.getChild(4).getText() + "-"
                    + postfix);
            break;
        }
        break;
      }
      case 8:
      case 9: {
        // 0.2.4.23-1-deb7u1
        int major = Integer.parseInt(ctx.getChild(0).getText());
        int minor = Integer.parseInt(ctx.getChild(2).getText());
        int patch = Integer.parseInt(ctx.getChild(4).getText());
        int build = Integer.parseInt(ctx.getChild(6).getText());
        version = new ExtendedSemanticVersion(major, minor, patch, build, postfix);
        break;
      }
    }
    stack.push(version);
  }
670651
Map<String, DefineInfo> collectDefines(Node externs, Node root) {
    GlobalNamespace namespace = null;
    if (namespaceSupplier != null) {
      namespace = namespaceSupplier.get();
    }
    if (namespace == null) {
      namespace = new GlobalNamespace(compiler, externs, root);
    }

    // namespace =
    //     namespaceSupplier != nul
    //         ? namespaceSupplier.get()
    //         : new GlobalNamespace(compiler, externs, root);

    // Find all the global names with a @define annotation
    List<Name> listOfDefines = new ArrayList<>();
    for (Name name : namespace.getNameIndex().values()) {
      Ref decl = name.getDeclaration();
      if (name.getJSDocInfo() != null && name.getJSDocInfo().isDefine()) {
        // Process defines should not depend on check types being enabled,
        // so we look for the JSDoc instead of the inferred type.
        if (isValidDefineType(name.getJSDocInfo().getType())) {
          listOfDefines.add(name);
        } else {
          JSError error = JSError.make(decl.getNode(), INVALID_DEFINE_TYPE_ERROR);
          compiler.report(error);
        }
      } else {
        for (Ref ref : name.getRefs()) {
          if (ref == decl) {
            // Declarations were handled above.
            continue;
          }

          Node n = ref.getNode();
          Node parent = ref.getNode().getParent();
          JSDocInfo info = n.getJSDocInfo();
          if (info == null && parent.isVar() && parent.hasOneChild()) {
            info = parent.getJSDocInfo();
          }

          if (info != null && info.isDefine()) {
            listOfDefines.add(name);
            break;
          }
        }
      }
    }

    CollectDefines pass = new CollectDefines(namespace, listOfDefines);
    NodeTraversal.traverseRoots(compiler, pass, externs, root);
    return pass.allDefines;
  }
279753
public function toPhpString(
        $namespace,
        array $aliased_classes,
        $this_class,
        $php_major_version,
        $php_minor_version
    ) {
        $nullable = false;

        if (!$this->isSingleAndMaybeNullable()
            || $php_major_version < 7
            || (isset($this->types['null']) && $php_minor_version < 1)
        ) {
            return null;
        }

        $types = $this->types;

        if (isset($types['null'])) {
            unset($types['null']);

            $nullable = true;
        }

        if (!$types) {
            return null;
        }

        $atomic_type = array_values($types)[0];

        $atomic_type_string = $atomic_type->toPhpString(
            $namespace,
            $aliased_classes,
            $this_class,
            $php_major_version,
            $php_minor_version
        );

        if ($atomic_type_string) {
            return ($nullable ? '?' : '') . $atomic_type_string;
        }

        return null;
    }