Is the node pointed to by @ref path a name server (specialisation
        of directory nodes)?
11233
def is_nameserver(self, path):
        '''

        '''
        node = self.get_node(path)
        if not node:
            return False
        return node.is_nameserver
678696
def in_tree(self, name):
        
        """
        if self._validate_node_name(name):
            raise RuntimeError("Argument `name` is not valid")
        return name in self._db
810167
def cache_subdirectory(
        reference_name=None,
        annotation_name=None,
        annotation_version=None):
    
    if reference_name is None:
        reference_name = ""
    if annotation_name is None:
        annotation_name = ""
    if annotation_version is None:
        annotation_version = ""
    reference_dir = join(CACHE_BASE_SUBDIR, reference_name)
    annotation_dir = "%s%s" % (annotation_name, annotation_version)
    return join(reference_dir, annotation_dir)
1042666
@Override
    public Ref memberRef(Context cx, Object elem, int memberTypeFlags) {
        boolean attribute = (memberTypeFlags & Node.ATTRIBUTE_FLAG) != 0;
        boolean descendants = (memberTypeFlags & Node.DESCENDANTS_FLAG) != 0;
        if (!attribute && !descendants) {
            // Code generation would use ecma(Get|Has|Delete|Set) for
            // normal name identifiers so one ATTRIBUTE_FLAG
            // or DESCENDANTS_FLAG has to be set
            throw Kit.codeBug();
        }
        XmlNode.QName qname = lib.toNodeQName(cx, elem, attribute);
        XMLName rv = XMLName.create(qname, attribute, descendants);
        rv.initXMLObject(this);
        return rv;
    }
568728
def node_name
      path = self.class.to_s
      if i = path.rindex('::')
        path = path[(i+2)..-1]
      end
      path[0] = path[0].chr.downcase
      path
    end
545696
private Node inlineFunction(Reference ref, Node fnNode, String fnName) {
    Node callNode = ref.callNode;
    Node parent = callNode.getParent();
    Node grandParent = parent.getParent();

    // TODO(johnlenz): Consider storing the callSite classification in the
    // reference object and passing it in here.
    CallSiteType callSiteType = classifyCallSite(ref);
    checkArgument(callSiteType != CallSiteType.UNSUPPORTED);

    // Store the name for the result. This will be used to
    // replace "return expr" statements with "resultName = expr"
    // to replace
    String resultName = null;
    boolean needsDefaultReturnResult = true;
    switch (callSiteType) {
      case SIMPLE_ASSIGNMENT:
        resultName = parent.getFirstChild().getString();
        removeConstantVarAnnotation(ref.scope, resultName);
        break;

      case VAR_DECL_SIMPLE_ASSIGNMENT:
        resultName = parent.getString();
        removeConstantVarAnnotation(ref.scope, resultName);
        break;

      case SIMPLE_CALL:
        resultName = null;  // "foo()" doesn't need a result.
        needsDefaultReturnResult = false;
        break;

      case EXPRESSION:
        throw new IllegalStateException(
            "Movable expressions must be moved before inlining.");

      case DECOMPOSABLE_EXPRESSION:
        throw new IllegalStateException(
            "Decomposable expressions must be decomposed before inlining.");

      default:
        throw new IllegalStateException("Unexpected call site type.");
    }

    FunctionToBlockMutator mutator = new FunctionToBlockMutator(compiler, this.safeNameIdSupplier);

    boolean isCallInLoop = NodeUtil.isWithinLoop(callNode);
    Node newBlock = mutator.mutate(
        fnName, fnNode, callNode, resultName,
        needsDefaultReturnResult, isCallInLoop);
    NodeUtil.markNewScopesChanged(newBlock, compiler);

    // TODO(nicksantos): Create a common mutation function that
    // can replace either a VAR name assignment, assignment expression or
    // a EXPR_RESULT.
    Node greatGrandParent = grandParent.getParent();
    switch (callSiteType) {
      case VAR_DECL_SIMPLE_ASSIGNMENT:
        // Remove the call from the name node.
        Node firstChild = parent.removeFirstChild();
        NodeUtil.markFunctionsDeleted(firstChild, compiler);
        Preconditions.checkState(parent.getFirstChild() == null);
        // Add the call, after the VAR.
        greatGrandParent.addChildAfter(newBlock, grandParent);
        break;

      case SIMPLE_ASSIGNMENT:
        // The assignment is now part of the inline function so
        // replace it completely.
        Preconditions.checkState(grandParent.isExprResult());
        greatGrandParent.replaceChild(grandParent, newBlock);
        NodeUtil.markFunctionsDeleted(grandParent, compiler);
        break;

      case SIMPLE_CALL:
        // If nothing is looking at the result just replace the call.
        Preconditions.checkState(parent.isExprResult());
        grandParent.replaceChild(parent, newBlock);
        NodeUtil.markFunctionsDeleted(parent, compiler);
        break;

      default:
        throw new IllegalStateException("Unexpected call site type.");
    }

    return newBlock;
  }
206908
static boolean nodeAbsent(Object json, Path path, boolean treatNullAsAbsent) {
        Node node = getNode(json, path);
        if (node.isNull()) {
            return treatNullAsAbsent;
        } else {
            return node.isMissingNode();
        }
    }
161933
function findSurroundASTNode(ast, expn, types) {
        var foundNode = ASTWalker.findNodeAround(ast, expn.start, function (nodeType, node) {
            if (expn.end) {
                return types.includes(nodeType) && node.end >= expn.end;
            } else {
                return types.includes(nodeType);
            }
        });
        return foundNode && _.clone(foundNode.node);
    }
260605
function hasDefineAmdReference(ast) {
	var result = false;

	types.visit(ast, {
		visitMemberExpression: function(path) {
			if (this.isDefineAmd(path.node)) {
				result = true;
				this.abort();
			}

			this.traverse(path);
		},

		isDefineAmd: function(node) {
			return (
				n.Identifier.check(node.object) &&
				node.object.name === "define" &&
				n.Identifier.check(node.property) &&
				node.property.name === "amd"
			);
		}
	});

	return result;
}
110618
def process_refs_for_node(cls, manifest, current_project, node):
        """"""
        target_model = None
        target_model_name = None
        target_model_package = None

        for ref in node.refs:
            if len(ref) == 1:
                target_model_name = ref[0]
            elif len(ref) == 2:
                target_model_package, target_model_name = ref

            target_model = cls.resolve_ref(
                manifest,
                target_model_name,
                target_model_package,
                current_project,
                node.get('package_name'))

            if target_model is None or target_model is cls.DISABLED:
                # This may raise. Even if it doesn't, we don't want to add
                # this node to the graph b/c there is no destination node
                node.config['enabled'] = False
                dbt.utils.invalid_ref_fail_unless_test(
                    node, target_model_name, target_model_package,
                    disabled=(target_model is cls.DISABLED)
                )

                continue

            target_model_id = target_model.get('unique_id')

            node.depends_on['nodes'].append(target_model_id)
            manifest.nodes[node['unique_id']] = node
1250910
function(fullSchema, schema, seenObjects, path, options) {
  // Top level reference, dereference it
  if(schema['$ref']) {
    // Dereference
    var dereference = deref(fullSchema, '', schema["$ref"], seenObjects, options);
    // Delete the tag
    delete(schema['$ref']);
    // Merge the dereferenced value
    for(var name in dereference) {
      schema[name] = dereference[name];
    }
  }

  for(var name in schema) {
    var value = schema[name];
    path.push(name);

    if(value instanceof Object) {
      // Extract the path
      if(value["$ref"]) {
        // Get the reference
        var reference = value["$ref"];
        // Unroll the reference
        var dereference = deref(fullSchema, name, reference, seenObjects, path, options);
        // Add the dereferenced value
        schema[name] = dereference;
      } else {
        extractReferences(fullSchema, value, seenObjects, path, options);
      }
    }

    path.pop();
  }
}
510568
function(ref) {
        if (ref.category !== "objectref" || !ref.path || !ref.path.length || !ref.path.join) {
            return null;
        }
        return ref.path.join(".");
    }
924284
private void warnAboutNamespaceRedefinition(Name nameObj, Ref ref) {
    compiler.report(
        JSError.make(ref.getNode(), NAMESPACE_REDEFINED_WARNING, nameObj.getFullName()));
  }
233130
public void prependPath(Object referrer, int index)
    {
        Reference ref = new Reference(referrer, index);
        prependPath(ref);
    }
1175618
function (fileCurrentReference, file) {

        var representations = [];

        //  Scenario 2: Current file is the same directory or lower than the reference
        //              (ie. file.path and the reference file.path are the same)
        //
        //                  file.base = /user/project
        //                  file.path = /user/project/second/current_file.html
        //  fileCurrentReference.path = /user/project/second/index.html

        if (dirname_with_sep(fileCurrentReference.path).indexOf(dirname_with_sep(file.path)) === 0) {

            //  index.html
            representations.push(get_relative_path(Path.dirname(file.path), fileCurrentReference.revPathOriginal, true));

            //  ./index.html   (reference: relative)
            representations.push('.' + get_relative_path(Path.dirname(file.path), fileCurrentReference.revPathOriginal, false));
        }

        //  Scenario 3: Current file is in a different child directory than the reference
        //            (ie. file.path and the reference file.path are different, not in root directory)
        //
        //                  file.base = /user/project
        //                  file.path = /user/project/first/index.html
        //  fileCurrentReference.path = /user/project/second/index.html

        if (dirname_with_sep(file.path) !== dirname_with_sep(fileCurrentReference.path) &&
            dirname_with_sep(fileCurrentReference.path).indexOf(dirname_with_sep(file.path)) === -1) {

            var pathCurrentReference = dirname_with_sep(get_relative_path(fileCurrentReference.base, fileCurrentReference.revPathOriginal));
            var pathFile = dirname_with_sep(get_relative_path(file.base, file.revPathOriginal));

            // ../second/index.html
            var relPath = Path.relative(pathFile, pathCurrentReference);
            relPath = relPath.replace(/\\/g, '/');
            representations.push(relPath + '/' + Path.basename(fileCurrentReference.revPathOriginal));
        }

        return representations;

    }
1331552
Node inline(Reference ref, String fnName, Node fnNode) {
    checkState(compiler.getLifeCycleStage().isNormalized());
    return internalInline(ref, fnName, fnNode);
  }
657907
static boolean isNameReferenced(Node node, String name, Predicate<Node> traverseChildrenPred) {
    return has(node, new MatchNameNode(name), traverseChildrenPred);
  }