Returns whether the node initializes a goog.provide'd namespace (e.g. `a.b = {};`) with a
simple namespace object literal (e.g. not `a.b = class {}`;)
160214
private static boolean isNamespacePlaceholder(Node n) {
    if (!n.getBooleanProp(Node.IS_NAMESPACE)) {
      return false;
    }

    Node value = null;
    if (n.isExprResult()) {
      Node assign = n.getFirstChild();
      value = assign.getLastChild();
    } else if (n.isVar()) {
      Node name = n.getFirstChild();
      value = name.getFirstChild();
    }

    if (value == null) {
      return false;
    }
    if (value.isCast()) {
      // There may be a cast to unknown type wrapped around the value.
      value = value.getOnlyChild();
    }
    return value.isObjectLit() && !value.hasChildren();
  }
1120478
def namespace_present(name, **kwargs):
    '''
    

    '''
    ret = {'name': name,
           'changes': {},
           'result': False,
           'comment': ''}

    namespace = __salt__['kubernetes.show_namespace'](name, **kwargs)

    if namespace is None:
        if __opts__['test']:
            ret['result'] = None
            ret['comment'] = 'The namespace is going to be created'
            return ret

        res = __salt__['kubernetes.create_namespace'](name, **kwargs)
        ret['result'] = True
        ret['changes']['namespace'] = {
            'old': {},
            'new': res}
    else:
        ret['result'] = True if not __opts__['test'] else None
        ret['comment'] = 'The namespace already exists'

    return ret
1333496
private boolean propertyMustBeInitializedByFullName(Name name) {
    // If an object or function literal in the global namespace is never
    // aliased, then its properties can only come from one of 2 places:
    // 1) From its prototype chain, or
    // 2) From an assignment to its fully qualified name.
    // If we assume #1 is not the case, then #2 implies that its
    // properties must all be modeled in the GlobalNamespace as well.
    //
    // We assume that for global object literals and types (constructors and
    // interfaces), we can find all the properties inherited from the prototype
    // chain of functions and objects.
    if (name.getParent() == null) {
      return false;
    }

    if (isNameUnsafelyAliased(name.getParent())) {
      // e.g. if we have `const ns = {}; escape(ns); alert(ns.a.b);`
      // we don't expect ns.a.b to be defined somewhere because `ns` has escaped
      return false;
    }

    if (objectPrototypeProps.contains(name.getBaseName())) {
      // checks for things on Object.prototype, e.g. a call to
      // something.hasOwnProperty('a');
      return false;
    }

    if (name.getParent().isObjectLiteral()) {
      // if this is a property on an object literal, always expect an initialization somewhere
      return true;
    }

    if (name.getParent().isClass()) {
      // only warn on class properties if there is no superclass, because we don't handle
      // class side inheritance here very well yet.
      return !hasSuperclass(name.getParent());
    }

    // warn on remaining names if they are on a constructor and are not a Function.prototype
    // property (e.g. f.call(1);)
    return name.getParent().isFunction()
        && name.getParent().isDeclaredType()
        && !functionPrototypeProps.contains(name.getBaseName());
  }
1242480
def parse_namespace(parser, event, node):
    #pylint: disable=unused-argument
    
    name = _get_required_attribute(node, 'NAME')

    (next_event, next_node) = six.next(parser)

    if not _is_end(next_event, next_node, 'NAMESPACE'):
        raise ParseError('Expecting end NAMESPACE')

    return name
351565
function _gpfWebGetNamespaceAndName (name) {
    var EXPECTED_PARTS_COUNT = 2,
        NAMESPACE_PREFIX = 0,
        NAME = 1,
        parts = name.split(":");
    if (parts.length === EXPECTED_PARTS_COUNT) {
        return {
            namespace: _gpfWebGetNamespace(parts[NAMESPACE_PREFIX]),
            name: parts[NAME]
        };
    }
}
176000
public static String getNamespace(JsonNode node) {
		JsonNode nodeNs = obj(node).get(ID_NAMESPACE);
		return (nodeNs != null) ? nodeNs.asText() : null;
	}
657907
static boolean isNameReferenced(Node node, String name, Predicate<Node> traverseChildrenPred) {
    return has(node, new MatchNameNode(name), traverseChildrenPred);
  }
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
741046
protected static boolean isAdditionalNamespace(String namespaceURI) {
		assert (namespaceURI != null);
		if (namespaceURI.equals(Constants.XML_NULL_NS_URI)
				|| namespaceURI.equals(Constants.XML_NS_URI)
				|| namespaceURI.equals(Constants.XML_SCHEMA_INSTANCE_NS_URI)
				|| namespaceURI.equals(Constants.XML_SCHEMA_NS_URI)) {
			return false;
		} else {
			return true;
		}
	}
541345
def namespace_inclusion_builder(namespace: Strings) -> NodePredicate:
    """"""
    if isinstance(namespace, str):
        def namespace_filter(_: BELGraph, node: BaseEntity) -> bool:
            """Pass only for a node that has the enclosed namespace."""
            return NAMESPACE in node and node[NAMESPACE] == namespace

    elif isinstance(namespace, Iterable):
        namespaces = set(namespace)

        def namespace_filter(_: BELGraph, node: BaseEntity) -> bool:
            """Pass only for a node that has a namespace in the enclosed set."""
            return NAMESPACE in node and node[NAMESPACE] in namespaces

    else:
        raise TypeError('Invalid type for argument: {}'.format(namespace))

    return namespace_filter
1161847
function getNamespace() {
  const type = NodeType.NamespaceType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const content = '|';

  pos++;

  return newNode(type, content, line, column);
}
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)
        )
504773
def epp_namespace(node, name = nil, namespaces = {})
      return namespaces['epp'] if namespaces.has_key?('epp')
      xml_namespace(node, name, 'urn:ietf:params:xml:ns:epp-1.0')
    end
859697
private static boolean isClinitMethod(Node fnNode) {
    if (!fnNode.isFunction()) {
      return false;
    }

    String fnName = NodeUtil.getName(fnNode);
    return fnName != null && isClinitMethodName(fnName);
  }
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)
11364
def alreadyHasEntry(oldClassString, og):
    
    namespace = oldClassString.split(':')[0]
    if namespace == 'http':
        target = rdflib.URIRef(oldClassString)
        print('OLD CLASS ID IS A URL', oldClassString)
    else:
        try:
            og.add_known_namespaces(namespace)
            target = og.expand(oldClassString)
        except KeyError:
            print('MISSING NAMESPACE', namespace, oldClassString)
            return True  # we only want known namespaces
    return (target, rdf.type, owl.Class) in og.g
616035
function nodeClass (name, res) {
    var patt = name;
    if (res) {
      patt += res.type === "array"
        ? "(" + res.pattern.substring(1, res.pattern.length - 1) + ")"
        : res.pattern;
    }
    return node("class", patt, name, res ? [res] : undefined);
  }