Check that the namespace is defined by an enumeration and that the name is a member.
192005
def has_enumerated_namespace_name(self, namespace: str, name: str) -> bool:
        """"""
        return self.has_enumerated_namespace(namespace) and name in self.namespace_to_terms[namespace]
662149
def CheckEnd(self, filename, clean_lines, linenum, error):
    """"""
    line = clean_lines.raw_lines[linenum]

    # Check how many lines is enclosed in this namespace.  Don't issue
    # warning for missing namespace comments if there aren't enough
    # lines.  However, do apply checks if there is already an end of
    # namespace comment and it's incorrect.
    #
    # TODO(unknown): We always want to check end of namespace comments
    # if a namespace is large, but sometimes we also want to apply the
    # check if a short namespace contained nontrivial things (something
    # other than forward declarations).  There is currently no logic on
    # deciding what these nontrivial things are, so this check is
    # triggered by namespace size only, which works most of the time.
    if (linenum - self.starting_linenum < 10
        and not Match(r'};*\s*(//|/\*).*\bnamespace\b', line)):
      return

    # Look for matching comment at end of namespace.
    #
    # Note that we accept C style "/* */" comments for terminating
    # namespaces, so that code that terminate namespaces inside
    # preprocessor macros can be cpplint clean.
    #
    # We also accept stuff like "// end of namespace <name>." with the
    # period at the end.
    #
    # Besides these, we don't accept anything else, otherwise we might
    # get false negatives when existing comment is a substring of the
    # expected namespace.
    if self.name:
      # Named namespace
      if not Match((r'};*\s*(//|/\*).*\bnamespace\s+' + re.escape(self.name) +
                    r'[\*/\.\\\s]*$'),
                   line):
        error(filename, linenum, 'readability/namespace', 5,
              'Namespace should be terminated with "// namespace %s"' %
              self.name)
    else:
      # Anonymous namespace
      if not Match(r'};*\s*(//|/\*).*\bnamespace[\*/\.\\\s]*$', line):
        # If "// namespace anonymous" or "// anonymous namespace (more text)",
        # mention "// anonymous namespace" as an acceptable form
        if Match(r'}.*\b(namespace anonymous|anonymous namespace)\b', line):
          error(filename, linenum, 'readability/namespace', 5,
                'Anonymous namespace should be terminated with "// namespace"'
                ' or "// anonymous namespace"')
        else:
          error(filename, linenum, 'readability/namespace', 5,
                'Anonymous namespace should be terminated with "// namespace"')
1086885
public static boolean isEnum(String className) {
		try {
			// is it an enum?
			TypeElement element = BindTypeSubProcessor.elementUtils.getTypeElement(className);
			if (element instanceof TypeElement) {
				TypeElement typeElement = element;
				TypeMirror superclass = typeElement.getSuperclass();
				if (superclass instanceof DeclaredType) {
					DeclaredType superclassDeclaredType = (DeclaredType) superclass;

					if (JAVA_LANG_ENUM.equals(getCanonicalTypeName(superclassDeclaredType))) {
						return true;
					}
				}
			}
			return false;
		} catch (Throwable e) {
			return false;
		}
	}
1004358
synchronized void verifiedByClient(int namespaceId, Block block) {
    DataBlockScanner nsScanner = getNSScanner(namespaceId);
    if (nsScanner != null) {
      nsScanner.updateScanStatusUpdateOnly(block,
          DataBlockScanner.ScanType.REMOTE_READ, true);
    } else {
      LOG.warn("No namespace scanner found for namespaceId: " + nsScanner);
    }
  }
46870
def namespace(self, name=None, function=None, recursive=None):
        

        return (
            self._find_single(
                scopedef.scopedef_t._impl_matchers[namespace_t.namespace],
                name=name,
                function=function,
                recursive=recursive)
        )
445888
def has_namespace(self, namespace):
        
        result = requests.get(self._make_url(namespace))
        if result.status_code == 200:
            return True
        elif result.status_code == 404:
            return False
280105
def check(self, values, namespace):
        """"""
        is_tuplish_type = (issubclass(self._cls, tg.Tuple) or
                           issubclass(type(values), self._cls))
        if (not _is_sequence(values) or not is_tuplish_type or
                len(values) != len(self._checks)):
            return False
        for thischeck, thisvalue in zip(self._checks, values):
            if not thischeck(thisvalue, namespace):
                return False
        return True
380817
public boolean containsNamespace(String ns)
    {
        for (int i = 0; i < this.libraries.length; i++)
        {
            if (this.libraries[i].containsNamespace(ns))
            {
                return true;
            }
        }
        return false;
    }
273851
def is_member(self, m):
        """"""
        if not m:
            return False
        elif isinstance(m, basestring):
            jid = m
        else:
            jid = m['JID']

        is_member = len(filter(lambda m: m['JID'] == jid and m.get('STATUS') in ('ACTIVE', 'INVITED'), self.params['MEMBERS'])) > 0

        return is_member
742570
function assertEnumerated (key, value, descriptor) {
  var enumeration = descriptor.enum
  if (enumeration && enumeration.indexOf(value) === -1) {
    throw new Error(key + ' must be an enumerated value')
  } else {
    return true
  }
}
1313912
private function areMultipleNamespacesInFile()
    {
        if (count($this->objects) === 0) {
            return false;
        }

        $foundNamespaces = array();
        foreach ($this->objects as $object) {
            $ns = $object->getNamespace();
            if ($ns !== null) {
                $foundNamespaces[$ns] = $ns;
            }
        }

        $foundNamespacesCount = count($foundNamespaces);

        if ($foundNamespacesCount === 0) {
            return false;
        } elseif ($foundNamespacesCount > 1) {
            return true;
        } else {
            return !isset($foundNamespaces[$this->getNamespace()]);
        }
    }
1073002
private static boolean hasConflictingClassName(DescriptorProto messageDesc, String name) {
    if (name.equals(messageDesc.getName())) {
      return true;
    }
    for (EnumDescriptorProto enumDesc : messageDesc.getEnumTypeList()) {
      if (name.equals(enumDesc.getName())) {
        return true;
      }
    }
    for (DescriptorProto nestedMessageDesc : messageDesc.getNestedTypeList()) {
      if (hasConflictingClassName(nestedMessageDesc, name)) {
        return true;
      }
    }
    return false;
  }
221610
def _namespace_filtered_iterator(graph, namespace):
    """"""
    for it_namespace, name in _identifier_filtered_iterator(graph):
        if namespace == it_namespace:
            yield name
460419
def _tuplefy_namespace(self, namespace):
        """"""
        namespace_split = namespace.split('.', 1)
        if len(namespace_split) is 1:
            # we treat a single element as a collection name.
            # this also properly tuplefies '*'
            namespace_tuple = ('*', namespace_split[0])
        elif len(namespace_split) is 2:
            namespace_tuple = (namespace_split[0],namespace_split[1])
        else:
            return None
        return namespace_tuple
1123516
def has_regex_namespace_name(self, namespace: str, name: str) -> bool:
        """"""
        return self.has_regex_namespace(namespace) and self.namespace_to_pattern[namespace].match(name)
849182
def namespaces(
            self,
            name=None,
            function=None,
            recursive=None,
            allow_empty=None):
        

        return (
            self._find_multiple(
                scopedef.scopedef_t._impl_matchers[namespace_t.namespace],
                name=name,
                function=function,
                recursive=recursive,
                allow_empty=allow_empty)
        )
1112566
private function namespaceMatches() : bool
    {
        $currentNamespace = ($this->currentNamespace && is_array($this->currentNamespace->name->parts))
            ? $this->currentNamespace->name->toString()
            : '';

        return $currentNamespace === $this->reflectedClass->getNamespaceName();
    }