Returns ``True`` on success.

        Returns ``False`` if the name already exists in the namespace.
762459
def add_if_unique(self, name):
        
        with self.lock:
            if name not in self.names:
                self.names.append(name)
                return True
        return False
58859
public boolean containsName(final String name) {
        for (final T i : this) {
            if (i.getName().equals(name)) {
                return true;
            }
        }
        return false;
    }
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
417012
def in_namespace(name)
      name ||= generate_name
      @scope = Scope.new(name, @scope)
      ns = NameSpace.new(self, @scope)
      yield(ns)
      ns
    ensure
      @scope = @scope.tail
    end
1276946
def key_exists(self, namespace, key):
        

        return namespace in self.__data and key in self.__data[namespace]
722032
def has_attribute?(namespace = nil, key = nil)
      namespace, key = to_nns namespace, key

      if namespace or key
        attributes = @attributesByNamespace[namespace]
        return attributes.nil? ? false : attributes.has_key?(key)

      else
        attributes { return true }
        return false
      end
    end
126715
def _has_name(soup_obj):
    """"""
    try:
        name = soup_obj.name
        if name == None:
            return False
        return True
    except AttributeError:
        return False
463837
function(name) {
    name = name || '';

    // TODO optimize with RegExp

    var nameChain = name.split('.');
    for(var i=0; i<nameChain.length; i++) {
      if(!nameChain[i].match(/[a-zA-Z0-9_]+/)) {
        return false;
      }
    }

    return true;
  }
874218
def method_name_exist(self, meth_name):
        

        methods = self.current_class.get_methods()
        for m in methods:
            if m.name == meth_name:
                return True
        return False
525134
public static function has(string $name, string $namespace = '*'): bool
    {
        self::initialize();
        return isset($_SESSION[$namespace]) && array_key_exists($name, $_SESSION[$namespace]);
    }
891329
def get_unique_name(self, obj, name='', name_from_system=''):
        
        ns = self.namespace
        newname = name
        if not newname:
            newname = name_from_system

        if not newname:
            newname = u"Nameless_" + obj.__class__.__name__

        if not newname in ns:
            return newname

        counter = 0
        while True:
            newname1 = u"%s_%.2d" % (newname, counter)
            if not newname1 in ns:
                return newname1
            counter += 1
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)
1286315
def _class_exists(self, classname, namespace):
        
        class_repo = self._get_class_repo(namespace)
        return classname in class_repo
1369660
def get_by_name(self, name, namespace=None):
        
        if not namespace:
            namespace, name = get_namespace_from_name(name)
        if not namespace:
            namespace = AuthConfigManager.get_access_token().username
        try:
            response = self.request('GET', '%s/%s/%s' % (self.url, namespace, name))
            return Dataset.from_dict(response.json())
        except NotFoundException:
            return None
715295
public static boolean nameEquals(
            final XMLStreamReader reader,
            final String namespace,
            final String localName) {
        if (!reader.getLocalName().equals(localName)) {
            return false;
        }
        if (namespace == null) {
            return true;
        }
        final String namespaceURI = reader.getNamespaceURI();
        if (namespaceURI == null) {
            return StringUtils.isEmpty(namespace);
        }
        return namespaceURI.equals(StringUtils.defaultString(namespace));
    }
993652
public boolean hasName(String name, String namespace) {
        return hasName(name) && Objects.equals(this.namespace, namespace);
    }
342159
def installed(self, name):
        
        logger.debug("name: %s", name)

        self._installed[name] = True
        return name