Match a {@link NamespaceHeader namespace header} to a species taxonomy
id.

@param hdr {@link NamespaceHeader}
@param species {@code int} species
@return {@code true} if the namespace data is specific to
{@code species}, {@code false} otherwise
191197
private boolean matchesSpecies(final NamespaceHeader hdr, int species) {
        final String speciesHdr = hdr.getNamespaceBlock().getSpeciesString();

        // empty header, no match
        if (noLength(speciesHdr)) {
            return false;
        }

        // non-numeric, no match
        if (!isNumeric(speciesHdr)) {
            return false;
        }

        // convert and match
        int v = Integer.parseInt(speciesHdr);
        return v == species;
    }
80233
def get_species(species_id):
    '''  '''
    result = _get(species_id, settings.SPECIES)
    return Species(result.content)
1165677
def namespace_match(pattern: str, namespace: str):
    
    if pattern[0] == '*' and namespace.endswith(pattern[1:]):
        return True
    elif pattern == namespace:
        return True
    return False
301496
def namedb_namespace_fields_check( namespace_rec ):
    

    assert namespace_rec.has_key('namespace_id'), "BUG: namespace record has no ID"
    assert namespace_rec.has_key('buckets'), 'BUG: missing price buckets'
    assert isinstance(namespace_rec['buckets'], str), 'BUG: namespace data is not in canonical form'

    return namespace_rec
1277816
public static void requireNamespace(final XMLExtendedStreamReader reader, final Namespace requiredNs) throws XMLStreamException {
        Namespace actualNs = Namespace.forUri(reader.getNamespaceURI());
        if (actualNs != requiredNs) {
            throw unexpectedElement(reader);
        }
    }
1291419
def normalize_release_properties(ensembl_release, species):
    
    ensembl_release = check_release_number(ensembl_release)
    if not isinstance(species, Species):
        species = find_species_by_name(species)
    reference_name = species.which_reference(ensembl_release)
    return ensembl_release, species.latin_name, reference_name
408266
def ensure_namespace(self, name):
        # type: (str) -> ApiNamespace
        
        if name not in self.namespaces:
            self.namespaces[name] = ApiNamespace(name)
        return self.namespaces[name]
195485
def delete_namespace(self, namespace):
        

        # if not self.has_namespace(namespace):
        #     return "Namespace does not exists"

        # log = logging.getLogger("%s.%s" % (self.log_name,
        #                                    inspect.stack()[0][3]))
        # log.setLevel(self.log_level)

        url = self._make_url(namespace).replace("/sparql", "")
        result = requests.delete(url=url)
        if result.status_code == 200:
            log.critical(result.text)
            return result.text
        raise RuntimeError(result.text)
1350440
protected void setNamespaceID(Properties props, StorageDirectory sd)
      throws InconsistentFSStateException {
    int nsId = Integer.parseInt(getProperty(props, sd, NAMESPACE_ID));
    if (namespaceID != 0 && nsId != 0 && namespaceID != nsId) {
      throw new InconsistentFSStateException(sd.root,
          "namespaceID is incompatible with others.");
    }
    namespaceID = nsId;
  }
1225874
def get_header_by_name(self, hdrname):
        '''
        
        '''
        for hdr in self._headers:
            if hdr.__class__.__name__ == hdrname:
                return hdr
        return None
701525
def namedb_name_fields_check( name_rec ):
    

    if not name_rec.has_key('name'):
        raise Exception("BUG: name record has no name")

    # extract namespace ID if it's not already there 
    if not name_rec.has_key('namespace_id'):
        name_rec['namespace_id'] = get_namespace_from_name( name_rec['name'] )

    # extract name_hash if it's not already there 
    if not name_rec.has_key('name_hash128'):
        name_rec['name_hash128'] = hash256_trunc128( name_rec['name'] )

    return True
771503
@Override
    public Enumeration<String> getHeaders(String hdr) {
        List<String> rc = this.request.getHeaders(hdr);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getHeaders: " + hdr + " " + rc.size());
        }
        return Collections.enumeration(rc);
    }
1303147
public void init(HttpInboundServiceContext sc, BNFHeaders hdrs) {
        // for requests, we don't care about the validation
        setHeaderValidation(false);
        setOwner(sc);
        setBinaryParseState(HttpInternalConstants.PARSING_BINARY_VERSION);
        if (null != hdrs) {
            hdrs.duplicate(this);
        }
    }
782085
@Override
    public void addHeader(String hdr, String value) {
        this.response.addHeader(hdr, value);
    }
501769
def search_upper_header(hdr)
      hdr.class.known_headers.each do |nh, bindings|
        return nh if bindings.check?(hdr)
      end

      nil
    end
315276
def has_namespace_name(self, line: str, position: int, namespace: str, name: str) -> bool:
        """"""
        self.raise_for_missing_namespace(line, position, namespace, name)
        return self.has_enumerated_namespace_name(namespace, name) or self.has_regex_namespace_name(namespace, name)
310784
@SuppressWarnings("unused") // called in SoyFileParser.jj
  public static final String calculateFullCalleeName(
      Identifier ident, SoyFileHeaderInfo header, ErrorReporter errorReporter) {

    String name = ident.identifier();
    switch (ident.type()) {
      case DOT_IDENT:
        // Case 1: Source callee name is partial.
        return header.getNamespace() + name;
      case DOTTED_IDENT:
        // Case 2: Source callee name is a proper dotted ident, which might start with an alias.
        return header.resolveAlias(name);
      case SINGLE_IDENT:
        // Case 3: Source callee name is a single ident (not dotted).
        if (header.hasAlias(name)) {
          // Case 3a: This callee collides with a namespace alias, which likely means the alias
          // incorrectly references a template.
          errorReporter.report(ident.location(), CALL_COLLIDES_WITH_NAMESPACE_ALIAS, name);
        } else {
          // Case 3b: The callee name needs a namespace.
          errorReporter.report(ident.location(), MISSING_CALLEE_NAMESPACE, name);
        }
        return name;
    }
    throw new AssertionError(ident.type());
  }