将rootClass注入选择器中
7034
function _injectRootClass(selector, rootClass) {
  // 如果是page开头的选择器则注入到page之后，否则注入到开头
  if (selector.startsWith('page ')) {
    return selector.replace('page', `page .${rootClass}`);
  } else {
    return `.${rootClass} ${selector}`;
  }
}
321010
def get_root(self):
        """"""
        if self.lft == 1:
            return self
        return get_result_class(self.__class__).objects.get(
            tree_id=self.tree_id, lft=1)
411256
function getNameFromRoot(root: Object): string {
  // shallow
  if (root.unrendered) {
    const { type } = root.unrendered;
    return type.name || type;
  }

  const inst = instance(root);
  if (inst) {
    return inst._tag;
  }

  // direct node
  if (typeof root.type === 'string') {
    return root.type;
  }

  return typeof root.name === 'function' ? root.name() : '(anonymous)';
}
286541
private void addRootNode(TrieNode rootNode){
        //计算节点的存储索引
        int index = rootNode.getCharacter()%INDEX_LENGTH;
        //检查索引是否和其他节点冲突
        TrieNode existTrieNode = ROOT_NODES_INDEX[index];
        if(existTrieNode != null){
            //有冲突，将冲突节点附加到当前节点之后
            rootNode.setSibling(existTrieNode);
        }
        //新增的节点总是在最前
        ROOT_NODES_INDEX[index] = rootNode;
    }
79941
private static Throwable findRootCause(Throwable t) {
        Throwable root = t;
        Throwable cause = root.getCause();
        while (cause != null) {
            root = cause;
            cause = root.getCause();
        }
        return root;
    }
959473
function extendObj(){
    /*
 　　*target被扩展的对象
　 　*length参数的数量
　　 *deep是否深度操作
　　*/
    var options, name, src, copy, copyIsArray, clone,
        target = arguments[0] || {},
        i = 1,
        length = arguments.length,
        deep = false;

    // target为第一个参数，如果第一个参数是Boolean类型的值，则把target赋值给deep
    // deep表示是否进行深层面的复制，当为true时，进行深度复制，否则只进行第一层扩展
    // 然后把第二个参数赋值给target
    if ( typeof target === "boolean" ) {
        deep = target;
        target = arguments[1] || {};

        // 将i赋值为2，跳过前两个参数
        i = 2;
    }

    // target既不是对象也不是函数则把target设置为空对象。
    if ( typeof target !== "object" && !(target.constructor == Function) ) {
        target = {};
    }

    // 如果只有一个参数，则把jQuery对象赋值给target，即扩展到jQuery对象上
    if ( length === i ) {
        target = this;

        // i减1，指向被扩展对象
        --i;
    }

    // 开始遍历需要被扩展到target上的参数
    for ( ; i < length; i++ ) {
        // 处理第i个被扩展的对象，即除去deep和target之外的对象
        if ( (options = arguments[ i ]) != null ) {
            // 遍历第i个对象的所有可遍历的属性
            for ( name in options ) {
                // 根据被扩展对象的键获得目标对象相应值，并赋值给src
                src = target[ name ];
                // 得到被扩展对象的值
                copy = options[ name ];

                if ( src === copy ) {
                    continue;
                }

                // 当用户想要深度操作时，递归合并
                // copy是纯对象或者是数组
                if ( deep && copy && ( (copy.constructor == Object) || (copyIsArray = (copy.constructor == Array)) ) ) {
                    // 如果是数组
                    if ( copyIsArray ) {
                        // 将copyIsArray重新设置为false，为下次遍历做准备。
                        copyIsArray = false;
                        // 判断被扩展的对象中src是不是数组
                        clone = src && (src.constructor == Array) ? src : [];
                    } else {
                        // 判断被扩展的对象中src是不是纯对象
                        clone = src && (src.constructor == Object) ? src : {};
                    }

                    // 递归调用extend方法，继续进行深度遍历
                    target[ name ] = extendObj( deep, clone, copy );
                } else if ( copy !== undefined ) {// 如果不需要深度复制，则直接copy（第i个被扩展对象中被遍历的那个键的值）
                    target[ name ] = copy;
                }
            }
        }
    }

    // 原对象被改变，因此如果不想改变原对象，target可传入{}
    return target;
}
761335
function &_allItems(&$rootDoc)
    {
        ob_start();

        echo '<body id="frame">', "\n\n";

        echo "<h1>All Items</h1>\n\n";

        $classes =& $rootDoc->classes();
        if ($classes) {
            ksort($classes);
            echo "<h2>Classes</h2>\n";
            echo "<ul>\n";
            foreach ($classes as $name => $class) {
                $package =& $classes[$name]->containingPackage();
                if ($class->isInterface()) {
                    echo '<li><em><a href="', $classes[$name]->asPath(), '" title="', $classes[$name]->packageName(),'" target="main">', $classes[$name]->name(), "</a></em></li>\n";
                } elseif ($class->isTrait()) {
                    echo '<li><em><a href="', $classes[$name]->asPath(), '" title="', $classes[$name]->packageName(),'" target="main">', $classes[$name]->name(), "</a></em></li>\n";
                } else {
                    echo '<li><a href="', $classes[$name]->asPath(), '" title="', $classes[$name]->packageName(),'" target="main">', $classes[$name]->name(), "</a></li>\n";
                }
            }
            echo "</ul>\n\n";
        }

        $functions =& $rootDoc->functions();
        if ($functions) {
            ksort($functions);
            echo "<h2>Functions</h2>\n";
            echo "<ul>\n";
            foreach ($functions as $name => $function) {
                $package =& $functions[$name]->containingPackage();
                echo '<li><a href="', $package->asPath(), '/package-functions.html#', $functions[$name]->name(), '()" title="', $functions[$name]->packageName(),'" target="main">', $functions[$name]->name(), "</a></li>\n";
            }
            echo "</ul>\n\n";
        }

        $globals =& $rootDoc->globals();
        if ($globals) {
            ksort($globals);
            echo "<h2>Globals</h2>\n";
            echo "<ul>\n";
            foreach ($globals as $name => $global) {
                $package =& $globals[$name]->containingPackage();
                echo '<li><a href="', $package->asPath(), '/package-globals.html#', $globals[$name]->name(), '" title="', $globals[$name]->packageName(),'" target="main">', $globals[$name]->name(), "</a></li>\n";
            }
            echo "</ul>\n\n";
        }

        echo '</body>', "\n\n";

        $output = ob_get_contents();
        ob_end_clean();

        return $output;
    }
5768
function tree() {
            var result = {
                name: 'root',
                children: []
            }

            function _parseChildren(parentClientId, children) {
                Util.each(CACHE, function(item) {
                    if (item.parentClientId === parentClientId) {
                        children.push({
                            name: item.moduleId + ',' + item.clientId,
                            module: item,
                            children: _parseChildren(item.clientId, [])
                        })
                    }
                })
                return children
            }

            _parseChildren(Constant.ROOT_CLIENT_ID, result.children)

            return result
        }
620587
def _get_root_object(models):
    '''
    
    '''
    root = napalm_yang.base.Root()
    for model in models:
        current = napalm_yang
        for part in model.split('.'):
            current = getattr(current, part)
        root.add_model(current)
    return root
236237
def tree():
    
    session = AppAggregate().open_session()
    classes = session.query(AssetClass).all()
    # Get the root classes
    root = []
    for ac in classes:
        if ac.parentid is None:
            root.append(ac)
        # logger.debug(ac.parentid)
    # header
    print_row("id", "asset class", "allocation", "level")
    print(f"-------------------------------")

    for ac in root:
        print_item_with_children(ac, classes, 0)
942052
function findRoot(root) {
  var pkg;
  root = root.split(path.sep);
  while(!pkg && root.length > 1) {
    var cur = root.join(path.sep);
    if(fs.existsSync(path.join(cur, "package.json"))) {
      return cur;
    }
    root.pop();
  }
}
648153
private void scanFile(File file, String rootDir) {
		if (file.isFile()) {
			final String fileName = file.getAbsolutePath();
			if (fileName.endsWith(FileUtil.CLASS_EXT)) {
				final String className = fileName//
						// 8为classes长度，fileName.length() - 6为".class"的长度
						.substring(rootDir.length(), fileName.length() - 6)//
						.replace(File.separatorChar, CharUtil.DOT);//
				//加入满足条件的类
				addIfAccept(className);
			} else if (fileName.endsWith(FileUtil.JAR_FILE_EXT)) {
				try {
					scanJar(new JarFile(file));
				} catch (IOException e) {
					throw new IORuntimeException(e);
				}
			}
		} else if (file.isDirectory()) {
			for (File subFile : file.listFiles()) {
				scanFile(subFile, (null == rootDir) ? subPathBeforePackage(file) : rootDir);
			}
		}
	}
30575
public List<Class<?>> getClassInfo(String root,String pkg) throws Exception
	{
		List<Class<?>> list=new ArrayList<Class<?>>();
		String suffix=".java";
		File rootDir=new File(root);
		Set<File> files=FileUtil.findFileByDirAndSub(rootDir, new FileFilter() {
			@Override
			public boolean accept(File pathname) {
				return pathname.isDirectory() || pathname.getName().endsWith(suffix);
			}
		});
		URLClassLoader loader=new URLClassLoader(new URL[]{rootDir.toURI().toURL()});
		try {
			// 获取路径长度
			int clazzPathLen = rootDir.getAbsolutePath().length() + 1;
			for(File file:files)
			{
				String className = file.getAbsolutePath();
				className = className.substring(clazzPathLen, className.length() - suffix.length());
				className = className.replace(File.separatorChar, '.');
				try {
					Class<?> clazz=loader.loadClass(className);
					String pkgName=clazz.getPackage().getName();
					if(pkgName.startsWith(pkg))
					{
						list.add(clazz);
					}
				} catch (Exception e) {
				}
			}
		} finally {
			loader.close();
		}
		return list;
	}
370478
function(class_data, source_object, is_root) {

		var name,
			skeleton = {},
			value,
			type,
			skeleton_value;

		for (name in source_object) {

			if (is_root && (this._reserved_members.indexOf(name) != -1 || (name in class_data.shared))) {

				continue;

			}

			value = source_object[name];
			type = Firestorm.getType(value);

			switch (type) {
				case 'null':
				case 'boolean':
				case 'number':
					skeleton_value = {type: this.MEMBER_TYPES.PRIMITIVE, value: value};
					break;
				case 'string':
					skeleton_value = {type: this.MEMBER_TYPES.STRING, value: value};
					break;
				case 'function':
					skeleton_value = {type: this.MEMBER_TYPES.FUNCTION, index: class_data.references.length};
					class_data.references.push(value);
					break;
				case 'regexp':
					skeleton_value = {type: this.MEMBER_TYPES.REGEXP, index: class_data.references.length};
					class_data.references.push(value);
					break;
				case 'object':
					skeleton_value = {
						type: this.MEMBER_TYPES.OBJECT,
						skeleton: this._disassemble(class_data, value, false)
					};
					break;
				case 'array':
					if (value.length == 0) {
						skeleton_value = {type: this.MEMBER_TYPES.EMPTY_ARRAY};
					} else if (this.inline_simple_arrays && this.isInlineArray(value)) {
						skeleton_value = {type: this.MEMBER_TYPES.INLINE_ARRAY, value: value};
					} else {
						skeleton_value = {type: this.MEMBER_TYPES.SLICE_ARRAY, index: class_data.references.length};
						class_data.references.push(value);
					}
					break;
				case 'undefined':
					Lava.t("[ClassManager] Forced code style restriction: please, replace undefined member values with null. Member name: " + name);
					break;
				default:
					Lava.t("[ClassManager] Unsupported property type in source object: " + type);
					break;
			}

			skeleton[name] = skeleton_value;

		}

		return skeleton;

	}
638656
function(node){
			var classes = this.getUfClassNames(node);
			if(classes.root && classes.root.length > 0){
				return true;
			}else{
				return false;
			}
		}
463956
def _flatten_subclass_tree(cls):
    
    subclasses = frozenset(cls.__subclasses__())
    children = frozenset(toolz.concat(map(_flatten_subclass_tree, subclasses)))
    return frozenset({cls}) | subclasses | children
597288
function() {
    var dir, leaf, name, names, root, _i, _j, _len, _name;
    root = arguments[0], names = 3 <= arguments.length ? __slice.call(arguments, 1, _i = arguments.length - 1) : (_i = 1, []), name = arguments[_i++];
    leaf = this;
    dir = path.resolve(root);
    for (_j = 0, _len = names.length; _j < _len; _j++) {
      _name = names[_j];
      if (!isObject(leaf[_name])) {
        leaf[_name] = {};
      }
      leaf = leaf[_name];
      dir = path.resolve(dir, _name);
    }
    if (name == null) {
      name = path.basename(dir, path.extname(dir));
      dir = path.dirname(dir);
    }
    walk(leaf, dir, name);
    return this;
  }