Implement function/method walker.
325851
def visit_FunctionDef(self, node):
        """"""
        # [[[cog
        # cog.out("print(pcolor('Enter function visitor', 'magenta'))")
        # ]]]
        # [[[end]]]
        in_class = self._in_class(node)
        decorator_list = [
            dobj.id if hasattr(dobj, "id") else dobj.attr
            for dobj in node.decorator_list
            if hasattr(dobj, "id") or hasattr(dobj, "attr")
        ]
        node.decorator_list = []
        # Callable can be:
        # a) A class property defined via decorated methods
        # b) A class method
        # c) A function
        # Get callable information (name, line number, etc.)
        action = (
            "getter"
            if "property" in decorator_list
            else (
                "setter"
                if "setter" in decorator_list
                else ("deleter" if "deleter" in decorator_list else None)
            )
        )
        element_type = "meth" if in_class else "func"
        element_full_name = self._pop_indent_stack(node, element_type, action=action)
        code_id = (self._fname, node.lineno)
        self._processed_line = node.lineno
        self._callables_db[element_full_name] = {
            "name": element_full_name,
            "type": element_type,
            "code_id": code_id,
            "last_lineno": None,
        }
        self._reverse_callables_db[code_id] = element_full_name
        # [[[cog
        # code = """
        # print(
        #     pcolor(
        #         'Visiting callable {0}  @ {1}'.format(
        #             element_full_name, code_id[1]
        #         ),
        #         'green'
        #     )
        # )
        # print(pcolor('    in_class = {}'.format(in_class), 'yellow'))
        # """
        # cog.out(code)
        # ]]]
        # [[[end]]]
        self.generic_visit(node)
655366
def walk(self, callback):
    """"""
    callback(self)
    for child in self._child_parsers:
      child.walk(callback)
347273
public function walk() {
        $this->_beforeWalk();
        foreach ($this->_result as $result) {
            call_user_func($this->_function, $result);
        }
        $this->_afterWalk();
    }
324963
def run_func(func, *args, **kwargs):
    """"""
    ray.init()

    func = ray.remote(func)

    # NOTE: kwargs not allowed for now
    result = ray.get(func.remote(*args))

    # Inspect the stack to get calling example
    caller = inspect.stack()[1][3]
    print("%s: %s" % (caller, str(result)))

    return result
960988
def init_functions(connection):
    """"""
    if settings.CFG["db"]["create_functions"]:
        print("Refreshing SQL functions...")
        for file in path.template_files("../sql/", exts=[".sql"]):
            func = sa.DDL(path.template_str(file))
            LOG.info("Loading: '%s' into database", file)
            connection.execute(func)
            connection.commit()
677992
def function_begin(self):
        """"""
        self.newline_label(self.shared.function_name, False, True)
        self.push("%14")
        self.move("%15", "%14")
204741
def _function(self, type, name, args=""):
        
        return FunctionManager(self, type=type, name=name, args=args)
1351060
function (callback, ctx) {
            var _walk = function (depth, node, ctx) {
                if (typeof callback === "function")
                    ctx = callback(depth, node, ctx, false);
                var children = node.children();
                for (var i = 0; i < children.length; i++)
                    ctx = _walk(depth + 1, children[i], ctx);
                if (typeof callback === "function")
                    ctx = callback(depth, node, ctx, true);
                return ctx;
            };
            ctx = _walk(0, this, ctx);
            return ctx;
        }
287027
function methodWrapper(fn) {
  return function() {
    var args = [].slice.call(arguments);
    args.unshift(this);
    return fn.apply(this, args);
  };
}
1059234
def register_function(self, patterns, instances=None, **reg_kwargs):
        """"""

        def wrapper(function):
            self.register(patterns, function, instances=instances, **reg_kwargs)
            return function

        return wrapper
1028077
public void walk(Object root, Class[] skip, Visitor visitor)
    {
        Deque stack = new LinkedList();
        stack.add(root);

        while (!stack.isEmpty())
        {
            Object current = stack.removeFirst();

            if (current == null || _objVisited.containsKey(current))
            {
                continue;
            }

            final Class clazz = current.getClass();
            ClassInfo classInfo = getClassInfo(clazz, skip);
            if (classInfo._skip)
            {  // Do not process any classes that are assignableFrom the skip classes list.
                continue;
            }

            _objVisited.put(current, null);
            visitor.process(current);

            if (clazz.isArray())
            {
                int len = Array.getLength(current);
                Class compType = clazz.getComponentType();

                if (!compType.isPrimitive())
                {   // Speed up: do not walk primitives
                    ClassInfo info = getClassInfo(compType, skip);
                    if (!info._skip)
                    {   // Do not walk array elements of a class type that is to be skipped.
                        for (int i=0; i < len; i++)
                        {
                            Object element = Array.get(current, i);
                            if (element != null)
                            {   // Skip processing null array elements
                                stack.add(Array.get(current, i));
                            }
                        }
                    }
                }
            }
            else
            {   // Process fields of an object instance
                if (current instanceof Collection)
                {
                    walkCollection(stack, (Collection) current);
                }
                else if (current instanceof Map)
                {
                    walkMap(stack, (Map) current);
                }
                else
                {
                    walkFields(stack, current, skip);
                }
            }
        }
    }
1195346
def _walk(path, follow_links=False, maximum_depth=None):
    """"""
    root_level = path.rstrip(os.path.sep).count(os.path.sep)
    for root, dirs, files in os.walk(path, followlinks=follow_links):
        yield root, dirs, files
        if maximum_depth is None:
            continue

        if root_level + maximum_depth <= root.count(os.path.sep):
            del dirs[:]
785855
def trace_walker(module):
    

    for name, function in inspect.getmembers(module, inspect.isfunction):
        yield None, function

    for name, cls in inspect.getmembers(module, inspect.isclass):
        yield cls, None

        for name, method in inspect.getmembers(cls, inspect.ismethod):
            yield cls, method

        for name, function in inspect.getmembers(cls, inspect.isfunction):
            yield cls, function

        for name, accessor in inspect.getmembers(cls, lambda x: type(x) is property):
            yield cls, accessor.fget
            yield cls, accessor.fset
            yield cls, accessor.fdel
257863
function steps() {
	var cur = 0,
		steps = arguments;
	(function next(){
		process.nextTick(function(){
			steps[ cur++ ]( next );
		});
	})();
}
753740
def _onFunction(self, name, line, pos, absPosition,
                    keywordLine, keywordPos,
                    colonLine, colonPos, level,
                    isAsync, returnAnnotation):
        """"""
        self.__flushLevel(level)
        f = Function(name, line, pos, absPosition, keywordLine, keywordPos,
                     colonLine, colonPos, isAsync, returnAnnotation)
        if self.__lastDecorators is not None:
            f.decorators = self.__lastDecorators
            self.__lastDecorators = None
        self.objectsStack.append(f)
133289
def run(self, func, *func_args, **func__kwargs):
        
        self._func = func
        self._func_args = func_args
        self._func_kwargs = func__kwargs
        return self
876358
def walk(self,depth=0,fsNode=None) :
        """"""
        if not fsNode :
            fsNode = FSNode(self.init_path,self.init_path,0)
            
        if fsNode.isdir() :
            if self.check_dir(fsNode) :
                if self.check_return(fsNode) :
                    yield fsNode                
                for n in fsNode.children() :
                    if n.islink() :
                        # currently we don't follow links
                        continue
                    for n2 in self.walk(depth+1,n) :
                        if self.check_return(n2) :
                            yield n2
        else :
            if self.check_file(fsNode) :
                if self.check_return(fsNode) :
                    yield fsNode
        raise StopIteration