Checks if the namespace is the NVDL namespace and if yes then it creates
a schema receiver, otherwise returns null.
175658
public SchemaReceiver createSchemaReceiver(String namespaceUri, PropertyMap properties) {
    if (!SchemaImpl.NVDL_URI.equals(namespaceUri))
      return null;
    return new SchemaReceiverImpl(properties);
  }
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
1040919
public boolean containsNamespace(String ns)
    {
        return _namespace.equals(ns) || (_aliasNamespace != null && _aliasNamespace.equals(ns));
    }
1194560
public static boolean checkName(String nameSpec, String identifier, LombokNode<?, ?, ?> errorNode) {
		if (identifier.isEmpty()) {
			errorNode.addError(nameSpec + " cannot be the empty string.");
			return false;
		}
		
		if (!JavaIdentifiers.isValidJavaIdentifier(identifier)) {
			errorNode.addError(nameSpec + " must be a valid java identifier.");
			return false;
		}
		
		return true;
	}
923752
def checkSubstitute(self, typecode):
        '''
        '''
        if not isinstance(typecode, ElementDeclaration): 
            return False

        try:
            nsuri,ncname = typecode.substitutionGroup
        except (AttributeError, TypeError):
            return False

        if (nsuri,ncname) != (self.schema,self.literal):
            # allow slop with the empty namespace 
            if not nsuri and not self.schema and ncname == self.literal:
                 return True

            return False

        sub = GED(self.schema, self.literal)
        if sub is None or sub is not typecode:
            return False

        return True
1156749
def check_status(self):
        

        def validate_namespace(self):
            if not self.has_namespace(self.namespace):
                log.warning(format_multiline(["",
                                              """\tnamespace '{}' does not
                                              exist. Creating namespace"""],
                                              self.namespace))
                self.create_namespace(self.namespace)

        if self.url:
            return True
        try:
            result = requests.get(self._make_url(self.namespace,
                                                 self.ext_url,
                                                 check_status_call=True))
            self.url = self.ext_url
            validate_namespace(self)
            return True
        except requests.exceptions.ConnectionError:
            pass
        try:
            result = requests.get(self._make_url(self.namespace,
                                                 self.local_url,
                                                 check_status_call=True))
            log.warning("Url '%s' not connecting. Using local_url '%s'" % \
                     (self.ext_url, self.local_url))
            self.url = self.local_url
            validate_namespace(self)
            return True
        except requests.exceptions.ConnectionError:
            self.url = None
            log.warning("Unable to connect using urls: %s" % set([self.ext_url,
                                                               self.local_url]))
            return False
1087109
def does_schema_exist(self, connection):
        

        if '.' in self.table:
            query = ("select 1 as schema_exists "
                     "from pg_namespace "
                     "where nspname = lower(%s) limit 1")
        else:
            return True

        cursor = connection.cursor()
        try:
            schema = self.table.split('.')[0]
            cursor.execute(query, [schema])
            result = cursor.fetchone()
            return bool(result)
        finally:
            cursor.close()
993652
public boolean hasName(String name, String namespace) {
        return hasName(name) && Objects.equals(this.namespace, namespace);
    }
267519
def process_alias_create_namespace(namespace):
    
    namespace = filter_alias_create_namespace(namespace)
    _validate_alias_name(namespace.alias_name)
    _validate_alias_command(namespace.alias_command)
    _validate_alias_command_level(namespace.alias_name, namespace.alias_command)
    _validate_pos_args_syntax(namespace.alias_name, namespace.alias_command)
298108
public static Node getNodeBySpaceAndId(String nameSpace, String zealotId) {
        String filePath = XmlContext.INSTANCE.getXmlPathMap().get(nameSpace);
        Document doc = XmlNodeHelper.getDocument(filePath);
        return doc == null ? null : XmlNodeHelper.getZealotNodeById(doc, zealotId);
    }
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
954617
public static void checkDescriptor(DatasetDescriptor descriptor) {
    Preconditions.checkNotNull(descriptor, "Descriptor cannot be null");

    Schema schema = descriptor.getSchema();
    checkSchema(schema);

    if (descriptor.isPartitioned()) {
      // marked as [BUG] because this is checked in DatasetDescriptor
      Preconditions.checkArgument(schema.getType() == Schema.Type.RECORD,
          "[BUG] Partitioned datasets must have record schemas");

      Set<String> names = Sets.newHashSet();
      for (Schema.Field field : schema.getFields()) {
        names.add(field.name());
      }

      List<String> incompatible = Lists.newArrayList();
      List<String> duplicates = Lists.newArrayList();
      for (FieldPartitioner fp : Accessor.getDefault().getFieldPartitioners(descriptor
          .getPartitionStrategy())) {
        String name = fp.getName();
        if (!isCompatibleName(name)) {
          incompatible.add(name);
        } else if (names.contains(name)) {
          duplicates.add(name);
        } else {
          names.add(name);
        }
      }
      ValidationException.check(incompatible.isEmpty(),
          "Partition names are not alphanumeric (plus '_'): %s",
          Joiner.on(", ").join(incompatible));
      ValidationException.check(duplicates.isEmpty(),
          "Partition names duplicate data fields: %s",
          Joiner.on(", ").join(duplicates));
    }
  }
416866
public static void checkDatasetName(String namespace, String name) {
    Preconditions.checkNotNull(namespace, "Namespace cannot be null");
    Preconditions.checkNotNull(name, "Dataset name cannot be null");
    ValidationException.check(Compatibility.isCompatibleName(namespace),
        "Namespace %s is not alphanumeric (plus '_')",
        namespace);
    ValidationException.check(Compatibility.isCompatibleName(name),
        "Dataset name %s is not alphanumeric (plus '_')",
        name);
  }
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]);
  }
844469
def has_namespace(self, namespace: str) -> bool:
        """"""
        return self.has_enumerated_namespace(namespace) or self.has_regex_namespace(namespace)
521281
SchemaFuture installHandlers(XMLReader in, SchemaReceiverImpl sr) {
    Handler h = new Handler(sr);
    in.setContentHandler(h);
    return h;
  }
1360401
@Override
    public void createNamespace() {
        // Use a temporary, no-keyspace session
        try (DBConn dbConn = createAndConnectConn(null)) {
            synchronized (m_schemaLock) {
                if (!m_schemaMgr.keyspaceExists(dbConn, m_keyspace)) {
                    m_schemaMgr.createKeyspace(dbConn, m_keyspace);
                }
            }
        }
    }