Scan a single node.
The current path is updated for the duration of the scan.
346144
@Override
    public R scan(Tree tree, P p) {
        if (tree == null)
            return null;

        TreePath prev = path;
        path = new TreePath(path, tree);
        try {
            return tree.accept(this, p);
        } finally {
            path = prev;
        }
    }
913097
@Override
    public R scan(DocTree tree, P p) {
        if (tree == null)
            return null;

        DocTreePath prev = path;
        path = new DocTreePath(path, tree);
        try {
            return tree.accept(this, p);
        } finally {
            path = prev;
        }
    }
454611
function(node) {
			this.currentNode = node;// Updates the code path.
			// And emits onCodePathStart/onCodePathSegmentStart events.
			processCodePathToExit(this, node);

			// Emits node events.
			this.original.leaveNode(node);

			// Emits the last onCodePathStart/onCodePathSegmentStart events.
			postprocess(this, node);

			this.currentNode = null;
		}
170085
function(node) {
			this.currentNode = node;

			// Updates the code path due to node's position in its parent node.
			if (node.parent) {
				preprocess(this, node);
			}

			// Updates the code path.
			// And emits onCodePathStart/onCodePathSegmentStart events.
			processCodePathToEnter(this, node);

			// Emits node events.
			this.original.enterNode(node);

			this.currentNode = null;
		}
819336
private <F extends FileDescriptor> void scanPath(MavenProjectDirectoryDescriptor projectDescriptor, String path, Scope scope, Scanner scanner) {
        File file = new File(path);
        if (!file.exists()) {
            LOGGER.debug(file.getAbsolutePath() + " does not exist, skipping.");
        } else {
            F fileDescriptor = scanFile(projectDescriptor, file, path, scope, scanner);
            if (fileDescriptor != null) {
                projectDescriptor.getContains().add(fileDescriptor);
            }
        }
    }
768404
@GuardedBy("monitor")
  private /*@Nullable*/ TreeNode findNode(/*@Nullable*/ String path) {
    if (Strings.isNullOrEmpty(path) || "/".equals(path)) { // Go back to the root directory.
      return root;
    } else {
      List<String> dirs = PATH_SPLITTER.splitToList(path);
      TreeNode node = root;
      for (int i = 0; i < dirs.size(); i++) {
        String dir = dirs.get(i);
        if ("".equals(dir) && i == 0) {
          continue; // Skip the first "", the path of root node.
        }
        if (!node.children.containsKey(dir)) {
          return null;
        } else {
          node = node.children.get(dir);
        }
      }
      return node;
    }
  }
1112671
def scan_file(path)
      @parser.reset
      ast, comments = @parser.parse_with_comments(make_buffer(path))

      results = @call_finder.collect_calls ast do |send_node, method_name|
        send_node_to_key_occurrence(send_node, method_name)
      end

      magic_comments  = comments.select { |comment| comment.text =~ MAGIC_COMMENT_PREFIX }
      comment_to_node = Parser::Source::Comment.associate_locations(ast, magic_comments).tap do |h|
        # transform_values is only available in ActiveSupport 4.2+
        h.each { |k, v| h[k] = v.first }
      end.invert
      results + (magic_comments.flat_map do |comment|
        @parser.reset
        associated_node = comment_to_node[comment]
        @call_finder.collect_calls(
          @parser.parse(make_buffer(path, comment.text.sub(MAGIC_COMMENT_PREFIX, '').split(/\s+(?=t)/).join('; ')))
        ) do |send_node, _method_name|
          # method_name is not available at this stage
          send_node_to_key_occurrence(send_node, nil, location: associated_node || comment.location)
        end
      end)
    rescue Exception => e # rubocop:disable Lint/RescueException
      raise ::I18n::Tasks::CommandError.new(e, "Error scanning #{path}: #{e.message}")
    end
377297
def walk(self, node):
        ""
        node = self.visit(node)

        if node is None:
            return None

        if isinstance(node, parso.tree.BaseNode):
            walked = map(self.walk, node.children)
            node.children = [child for child in walked if child is not None]

        return node
262766
function updateNodeScope(path) {
  if (!isGlobal(path)) {
    replacePathScope(path, path.node)

    return false
  }

  this.traverse(path)
}
839988
public boolean processScanNodeWithReAggNode(AbstractPlanNode node, AbstractPlanNode reAggNode) {
        // MV table scan node can not be in in-lined nodes.
        for (int i = 0; i < node.getChildCount(); i++) {
            AbstractPlanNode child = node.getChild(i);

            if (child instanceof AbstractScanPlanNode) {
                AbstractScanPlanNode scanNode = (AbstractScanPlanNode) child;
                if (!scanNode.getTargetTableName().equals(getMVTableName())) {
                    continue;
                }
                if (reAggNode != null) {
                    // Join query case.
                    node.setAndLinkChild(i, reAggNode);
                }
                // Process scan node.
                // Set up the scan plan node's scan columns. Add in-line projection node for scan node.
                scanNode.addInlinePlanNode(m_scanInlinedProjectionNode);
                m_scanNode = scanNode;
                return true;
            }
            else {
                boolean replaced = processScanNodeWithReAggNode(child, reAggNode);
                if (replaced) {
                    return true;
                }
            }
        }
        return false;
    }
611950
def node_updated(self, node):
        
        if self._capture_node and node == self._capture_node["node"] and node.status != "started":
            yield from self.stop_capture()
91029
def scan_path(executable="mongod"):
    
    for path in os.environ.get("PATH", "").split(":"):
        path = os.path.abspath(path)
        executable_path = os.path.join(path, executable)
        if os.path.exists(executable_path):
            return executable_path
852061
def visit(self, node):
        
        for pattern, replace in know_pattern:
            check = Check(node, dict())
            if check.visit(pattern):
                node = PlaceholderReplace(check.placeholders).visit(replace())
                self.update = True
        return super(PatternTransform, self).visit(node)
605423
function  (node) {
		  	var parent = node.parentNode,
			  	path = [],
			  	index = this.getChildIndex(node);

		  if(parent && (path = this.getNodePath(parent))){
			   if(index > -1){
				   path.push(index);
			   }
		  }
		  return path;
		}
493186
def scan_in_memory(node, env, path=()):
    
    try:
        entries = node.entries
    except AttributeError:
        # It's not a Node.FS.Dir (or doesn't look enough like one for
        # our purposes), which can happen if a target list containing
        # mixed Node types (Dirs and Files, for example) has a Dir as
        # the first entry.
        return []
    entry_list = sorted(filter(do_not_scan, list(entries.keys())))
    return [entries[n] for n in entry_list]
699643
protected void scanDir(final File file, final String path) {
        for ( final File child: file.listFiles() ) {
            final String newPath = (path==null ? child.getName() : path + '/' + child.getName() );
            if ( child.isDirectory() ) {
                scanDir(child, newPath);
            }
            else {
                handleItem(newPath);
            }
        }
    }
640359
function walk(node, callback)
{
	var childNode,i;
	
	if (callback(node) === false) return false;
	
	if (node.childNodes != null)
	{
		i = 0;
		childNode = node.childNodes[i];
	}
	
	while (childNode != null)
	{
		if (walk(childNode, callback) === false) return false;
		
		childNode = node.childNodes[++i];
	}
}