Validate and set namespace ID
761299
private void setNameSpaceID(File storage, String nsid)
      throws InconsistentFSStateException {
    if (nsid == null || nsid.equals("")) {
      throw new InconsistentFSStateException(storage, "file "
          + STORAGE_FILE_VERSION + " is invalid.");
    }
    int newNsId = Integer.parseInt(nsid);
    if (namespaceID > 0 && namespaceID != newNsId) {
      throw new InconsistentFSStateException(storage,
          "Unexepcted namespaceID " + nsid + " . Expected " + namespaceID);
    }
    namespaceID = newNsId;
  }
999147
def register_value_proxy(namespace, value_proxy, help_text):
    """"""
    namespace.register_proxy(value_proxy)
    config.config_help.add(
        value_proxy.config_key, value_proxy.validator, value_proxy.default,
        namespace.get_name(), help_text)
1292540
public static void setNamespace(Element element, String namespace,
            String schemaLocation) {
        element.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI,
                XMLConstants.XMLNS_ATTRIBUTE, namespace);
        element.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, XMLNS_XSI,
                XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
        element.setAttributeNS(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,
                XSI_SCHEMA_LOCATION, schemaLocation);
    }
393375
def _set_default_namespace(self, default_namespace):
        """"""
        if default_namespace is not None:
            default_namespace = default_namespace.strip('/')
        else:
            default_namespace = DEFAULT_NAMESPACE
        self._default_namespace = _ensure_unicode(default_namespace)
988776
def _namespace_requested(self, namespace):
        """"""
        if namespace is None:
            return False
        namespace_tuple = self._tuplefy_namespace(namespace)
        if namespace_tuple[0] in IGNORE_DBS:
            return False
        elif namespace_tuple[1] in IGNORE_COLLECTIONS:
            return False
        else:
            return self._tuple_requested(namespace_tuple)
473255
public function setNamespace($namespace)
    {
        if (is_string($namespace) === false) {
            $msg = "The namespace argument must be a string.";
            throw new InvalidArgumentException($msg);
        } elseif ($namespace === '') {
            $msg = "The namespace argument must be a non-empty string.";
            throw new InvalidArgumentException($msg);
        } else {
            $this->namespace = $namespace;
        }
    }
763932
def check(self, value, namespace):
        
        for i, check in enumerate(self._checks):
            if check(value, namespace):
                return True
        return False
118785
function namespace() {
  var args = Array.prototype.slice.call(arguments);
  var setComponents = function(context, first, rest) {
    if(!context[first]) {
      context[first] = {
        models: {},
        collections: {},
        views: {},
      };
    }
    if(rest.length) {
      setComponents(context[first], _.first(rest), _.rest(rest));
    }
  };
  setComponents(window, _.first(args), _.rest(args));
}
1076196
def _add_namespace(self, namespace):
        """"""
        src_name = namespace.source_name
        if "*" in src_name:
            self._regex_map.append((namespace_to_regex(src_name), namespace))
        else:
            self._add_plain_namespace(namespace)
531236
def reset_namespace(self, namespace=None, params=None):
        
        namespace = pick(namespace, self.namespace)
        params = pick(params, self.namespace_params)
        log.warning(" Reseting namespace '%s' at host: %s",
                 namespace,
                 self.url)
        try:
            self.delete_namespace(namespace)
        except KeyError:
            pass
        self.create_namespace(namespace, params)
1077061
def validate_name(ctx, param, value):
    """"""
    if not value:
        value = os.path.basename(ctx.params['directory'].rstrip(os.path.sep))
    return value
523045
protected void validateNamespace(final SqlValidatorNamespace namespace,
		RelDataType targetRowType) {
		namespace.validate(targetRowType);
		if (namespace.getNode() != null) {
			setValidatedNodeType(namespace.getNode(), namespace.getType());
		}
	}
600773
def setOpenIDNamespace(self, openid_ns_uri, implicit):
        
        if openid_ns_uri not in self.allowed_openid_namespaces:
            raise InvalidOpenIDNamespace(openid_ns_uri)

        self.namespaces.addAlias(openid_ns_uri, NULL_NAMESPACE, implicit)
        self._openid_ns_uri = openid_ns_uri
409013
def _set_attribute(self, name, value):
        """"""
        setattr(self, name, value)
        self.namespace.update({name: getattr(self, name)})
294099
def _setns(self, value):
        
        if self.conn is not None:
            self.conn.default_namespace = value
        else:
            self.__default_namespace = value
907634
def namedb_namespace_insert( cur, input_namespace_rec ):
    

    namespace_rec = copy.deepcopy( input_namespace_rec )

    namedb_namespace_fields_check( namespace_rec )

    try:
        query, values = namedb_insert_prepare( cur, namespace_rec, "namespaces" )
    except Exception, e:
        log.exception(e)
        log.error("FATAL: Failed to insert revealed namespace '%s'" % namespace_rec['namespace_id']) 
        os.abort()

    namedb_query_execute( cur, query, values )
    return True
496743
def p_namespace(self, p):
        """"""
        if p[1] == 'namespace':
            doc = None
            if len(p) > 4:
                doc = p[5]
            p[0] = AstNamespace(
                self.path, p.lineno(1), p.lexpos(1), p[2], doc)
        else:
            raise ValueError('Expected namespace keyword')