Normalize the excluded directory list.
499230
def normalize_excludes(excludes):
    """"""
    return [os.path.normpath(os.path.abspath(exclude)) for exclude in excludes]
343321
function _emptyDirectoryProm (directory) {

			return new Promise((resolve, reject) => {

				readdir(directory, (err, files) => {
					return err ? reject(err) : resolve(files);
				});

			}).then((files) => {

				const result = [];

					for (let i = 0; i < files.length; ++i) {
						result.push(join(directory, files[i]));
					}

				return Promise.resolve(result);

			}).then((files) => {
				return files.length ? _removeDirectoryContentProm(files) : Promise.resolve();
			});

		}
407638
protected function normalizeListing(array $listing, $prefix = '', $filter = '.', $exclude = array('.svn', '.git', 'CVS', '.DS_Store', '__MACOSX'))
	{
		$base = $prefix;

		$result  = array();
		$listing = $this->removeDotDirectories($listing);

		while ($item = array_shift($listing))
		{
			if (preg_match('#^.*:$#', $item))
			{
				$base = trim($item, ':');
				continue;
			}

			$file = $this->normalizeObject($item, $base);

			$name = basename($file['path']);

			if (preg_match("/$filter/", $name) && !in_array($name, $exclude))
			{
				$result[] = $file;
			}
		}

		return $this->sortListing($result);
	}
37573
def recursive_exclude(self, dir, pattern):
        
        match = translate_pattern(os.path.join(dir, '**', pattern))
        return self._remove_files(match.match)
1030545
protected function _normalizePaths()
    {
        foreach ($this->_paths as &$path) {
            $ds = DIRECTORY_SEPARATOR;
            $path = $this->_normalizePath($path, $ds);
            $path = rtrim($path, $ds) . $ds;
        }
    }
1137092
def normalize_paths(value, parent=os.curdir):
    
    if not value:
        return []
    if isinstance(value, list):
        return value
    paths = []
    for path in value.split(','):
        path = path.strip()
        if '/' in path:
            path = os.path.abspath(os.path.join(parent, path))
        paths.append(path.rstrip('/'))
    return paths
1038095
def getIncludeDirectories(self, engineRoot, delimiter=' '):
		
		return delimiter.join(self.resolveRoot(self.includeDirs, engineRoot))
565754
def ignore(self, filename):
        """"""
        _, ext = os.path.splitext(filename)
        return ext in ['.pyc', '.pyo', '.o', '.swp']
197483
def prune(self, dir):
        """"""
        match = translate_pattern(os.path.join(dir, '**'))
        return self._remove_files(match.match)
765344
def removedirs_p(self):
        
        with contextlib.suppress(FileExistsError, DirectoryNotEmpty):
            with DirectoryNotEmpty.translate():
                self.removedirs()
        return self
1287826
def normalize(self):
        
        if str(self):
            normalized = normpath(str(self)) + ('/' * self.is_dir)
            if normalized.startswith('//'):  # http://bugs.python.org/636648
                normalized = '/' + normalized.lstrip('/')
            self.load(normalized)
        return self
945031
def listdir_nohidden(path):
    """"""
    for f in os.listdir(path):
        if isinstance(f, str):
            f = unicode(f, "utf-8")
        if not f.startswith('.'):
            yield f
1163958
def remove_excludes
      return self if config[:excludes].nil?
      config[:excludes].map { |e| Dir["#{directory}/#{e}"] }.flatten.each do |e|
        FileUtils.remove_entry_secure e
      end
      self
    end
405898
def _build_exclusion_list(exclude):
    """"""
    mod_files = []
    if exclude:
        for mod in exclude:
            mdir = None
            mod_file = None
            for token in mod.split("."):
                try:
                    mfile, mdir, _ = imp.find_module(token, mdir and [mdir])
                    if mfile:
                        mod_file = mfile.name
                        mfile.close()
                except ImportError:
                    msg = "Source for module {mod_name} could not be found"
                    raise ValueError(msg.format(mod_name=mod))
            if mod_file:
                mod_files.append(mod_file.replace(".pyc", ".py"))
    return mod_files
1371591
function retrieveFilesToExclude(excludeFiles) {
  return globby.sync(excludeFiles).map(function(file) {
    return path.normalize(file);
  });
}
204099
def clean(self):

        """"""

        for s in self.visible_files.values():
            s.clean()
        for s in [sub[1][x] for sub in self.avail_files.values() for x in sub[1]]: # Double list comprehensions aren't very
            s.clean()
48036
def normalize_listargument(arg):
    """"""
    if isinstance(arg, np.ndarray):
        return arg.flatten()
    if isinstance(arg, str):
        return [arg]
    if isinstance(arg, list) or isinstance(arg, tuple) or isinstance(arg, dict) or isinstance(arg, set):
        return list(arg)
    return [arg]