returns an array of every folder that is a component
1366
def components
      return @components if @components

      @components = {}
      app_folders do |app_folder|
        Dir["#{app_folder}/*"].sort.each do |folder|
          if File.directory?(folder)
            folder_name = folder[/[^\/]+$/]

            # Add in the folder if it's not alreay in there
            folders = (@components[folder_name] ||= [])
            folders << folder unless folders.include?(folder)
          end
        end
      end

      @components
    end
1091772
function findAllNodeModules(startDir) {
	let dir = path.resolve(startDir);
	let dirs = [];
	const { root } = path.parse(startDir);

	// eslint-disable-next-line no-constant-condition
	while (true) {
		const joined = path.join(dir, 'node_modules');
		if (existsSync(joined)) {
			dirs.push(joined);
		}
		if (dir === root) {
			return dirs;
		}
		dir = path.dirname(dir);
	}
}
48344
function (files, component) {
            var self = this;
            return files.map(function (file) {
                return file.replace(path.normalize(self._resolvePath(component) + path.sep), '');
            });
        }
615437
function getFoldersAndFiles(fpath, folders, files){
	fs.readdirSync(fpath).forEach(function(name){
		var stat = fs.statSync(fpath + name);
		if(stat.isDirectory()){
			folders.push({
				path : fpath,
				name : name
			});
			
			getFoldersAndFiles(fpath + name + '/', folders, files);
		}else{
			files.push({
				path : fpath,
				name : name
			});
		}
	});
}
1357898
function fetchComponents(filter, options) {
    console.log('Fetching dependencies...');

    var componentList = [];

    if (_.isObject(filter) || _.isArray(filter)) {
      var dependencies = fetchBowerComponents();
      _.each(dependencies, function(dep) {
        var bowerObj = getBower(dep);
        if (bowerObj) {
          var mainFiles = fetchMainFiles(bowerObj);

          var componentFiles = [];
          _.each(filter, function(destDir, expression) {
            var expressionObj = {};
            expressionObj[expression] = destDir;

            var filteredValues = filterByExpression(mainFiles, expressionObj, options);

            Array.prototype.push.apply(componentFiles,
              filteredValues);
          });

          // create Component class and encapsulate Component
          // related info in that.
          componentList.push(new Component(bowerObj, componentFiles));

          console.log(componentFiles.length + ' file(s) found for ' + dep);
        }
      });

      console.log('##### Total dependencie(s) found ' + componentList.length);
    }

    return componentList;
  }
503957
def folders(self, mountPoint):
        
        if isinstance(mountPoint, six.string_types):
            # shortcut: pass a mountpoint name
            mountPoint = self.mountPoints[mountPoint]
        try:
            return [JFSFolder(f, self, parentpath='%s/%s' % (self.path, mountPoint.name)) for f in self.contents(mountPoint).folders.iterchildren()]
        except AttributeError as err:
            # no files at all
            return [x for x in []]
543312
function checkContainsPathComponent(dirs, path) {
    return _.find(dirs, function(dir) {
      var v = path.indexOf(dir);
      return v == 0;
    });
  }
1314598
def get_folder_list(folder='.'):
    
    dir_list = get_content_list(folder)
    return [f for f in dir_list if not os.path.isfile(os.path.join(folder, f))]
916170
function getFileNames(fileNames = [], componentName) {
  const defaultFileNames = {
    testFileName: `${defaultOptions.testFileName}.${componentName}`,
    componentFileName: componentName,
    styleFileName: componentName,
  }

  const formattedFileNames = Object.keys(fileNames).reduce(
    (acc, curr) => {
      acc[curr] = replaceKeys(fileNames[curr], componentName)
      return acc
    },
    { ...defaultFileNames }
  )

  return formattedFileNames
}
857134
async function makeDocumentableObject(folder) {
  const fullPath = path.join(REACT_MD_JS, folder);
  const contents = await readFile(path.join(fullPath, 'index.js'), 'UTF-8');

  const components = contents.split(/\r?\n/).reduce((exports, line) => {
    // go line-by-line in the src/js/SECTION/index.js file to get a list of the exported
    // components in this section
    if (line.match(/export/)) {
      const component = line.replace(/export (default |{ )?(\w+).*/, '$2');
      if (exports.indexOf(component) === -1 && DEPRECATED.indexOf(component) === -1 && component.indexOf('FakeInked') === -1) {
        exports.push(component);
      }
    }

    return exports;
  }, []);

  return { folder, components, fullPath };
}
865559
function (folder) {
		var elems = getFolderElements( folder ),
			result = {};

		// files
		elems.files.forEach( function (route) {
			// get object name
			var fileName = path.basename( route, '.json' );
			// assign object data from file
			result[ fileName ] = getData.file( route );
		});

		// no namesake folders
		elems.folders.forEach( function (route) {
			// get object name
			var fileName = path.basename( route );
			// assign data from folder
			result[ fileName ] = extend( result[ fileName ] || {}, getData.folder( route ));
		});

		return result;
	}
615970
function getFiles(base, dir = '', results = []) {
            const files = fs.readdirSync(path.join(base, dir));
            for (const file of files) {
                const relativeToBase = path.join(dir, file);
                if (fs.statSync(path.join(base, relativeToBase)).isDirectory()) {
                    getFiles(base, relativeToBase, results);
                } else {
                    results.push(relativeToBase);
                }
            }
            return results;
        }
1374778
def Extract(self, components):
    

    for index, component in enumerate(components):
      if component.lower().endswith(self.EXECUTABLE_EXTENSIONS):
        extracted_path = " ".join(components[0:index + 1])
        return [extracted_path]

    return []
737933
function getComponents() {
	var results = [];

	if (extensions && extensions.hasOwnProperty('components')) {
		var sourceArray = extensions.components;

		for (index = 0; index < sourceArray.length; ++index) {
		    results.push(sourceArray[index]);
		}
	}

	return results;
}
881033
function getArrayOfPartials() {
        var _partialsArr = [];
        for (var file in mainPartialList) {
            if (mainPartialList.hasOwnProperty(file)) {
                _partialsArr.push(file);
            }
        }
        return _partialsArr;
    }
1005401
public function build_folder_tree(&$arrFolders, $folder, $delm = '/', $path = '')
    {
        // Handle namespace prefix
        $prefix = '';
        if (!$path) {
            $n_folder = $folder;
            $folder   = $this->storage->mod_folder($folder);

            if ($n_folder != $folder) {
                $prefix = substr($n_folder, 0, -strlen($folder));
            }
        }

        $pos = strpos($folder, $delm);

        if ($pos !== false) {
            $subFolders    = substr($folder, $pos+1);
            $currentFolder = substr($folder, 0, $pos);

            // sometimes folder has a delimiter as the last character
            if (!strlen($subFolders)) {
                $virtual = false;
            }
            else if (!isset($arrFolders[$currentFolder])) {
                $virtual = true;
            }
            else {
                $virtual = $arrFolders[$currentFolder]['virtual'];
            }
        }
        else {
            $subFolders    = false;
            $currentFolder = $folder;
            $virtual       = false;
        }

        $path .= $prefix . $currentFolder;

        if (!isset($arrFolders[$currentFolder])) {
            $arrFolders[$currentFolder] = array(
                'id'      => $path,
                'name'    => rcube_charset::convert($currentFolder, 'UTF7-IMAP'),
                'virtual' => $virtual,
                'folders' => array()
            );
        }
        else {
            $arrFolders[$currentFolder]['virtual'] = $virtual;
        }

        if (strlen($subFolders)) {
            $this->build_folder_tree($arrFolders[$currentFolder]['folders'], $subFolders, $delm, $path.$delm);
        }
    }
602845
function getNuxtChildComponents($parent, $components = []) {
  $parent.$children.forEach(($child) => {
    if ($child.$vnode.data.nuxtChild && !$components.find(c =>(c.$options.__file === $child.$options.__file))) {
      $components.push($child)
    }
    if ($child.$children && $child.$children.length) {
      getNuxtChildComponents($child, $components)
    }
  })

  return $components
}