list the contents of a directory
@param  {[type]} argv [description]
@return {[type]}      [description]
3495
function bin(argv) {
  var uri = argv[2]
  if (!uri) {
    console.error('uri is required')
  }
  shell.ls(uri, function(err, arr) {
    for (i=0; i<arr.length; i++) {
      console.log(arr[i])
    }
  })
}
656202
def list_directory(self, *args, **kwargs):
		
		return tuple(self.dav_client().list(self.session_path()))
1068008
function _mkdirp (directory, mode, callback) {

			if ("undefined" === typeof directory) {
				throw new ReferenceError("missing \"directory\" argument");
			}
				else if ("string" !== typeof directory) {
					throw new TypeError("\"directory\" argument is not a string");
				}
				else if ("" === directory.trim()) {
					throw new Error("\"directory\" argument is empty");
				}
			else if ("undefined" !== typeof callback && "number" !== typeof mode) {
				throw new TypeError("\"mode\" argument is not a number");
			}
			else if ("undefined" === typeof callback && "undefined" === typeof mode) {
				throw new ReferenceError("missing \"callback\" argument");
			}
				else if ("function" !== typeof callback && "function" !== typeof mode) {
					throw new TypeError("\"callback\" argument is not a function");
				}
			else {

				let _callback = callback;
				let _mode = mode;

				if ("undefined" === typeof _callback) {
					_callback = mode;
					_mode = DEFAULT_OPTION;
				}

				isDirectoryProm(directory).then((exists) => {

					return exists ? Promise.resolve() : Promise.resolve().then(() => {

						const SUB_DIRECTORY = dirname(directory);

						return isDirectoryProm(SUB_DIRECTORY).then((_exists) => {

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

								mkdir(directory, _mode, (err) => {
									return err ? reject(err) : resolve();
								});

							}) : new Promise((resolve, reject) => {

								_mkdirp(SUB_DIRECTORY, _mode, (err) => {

									return err ? reject(err) : mkdir(directory, _mode, (_err) => {
										return _err ? reject(_err) : resolve();
									});

								});

							});

						});

					});

				}).then(() => {
					_callback(null);
				}).catch(callback);

			}

		}
1084184
def dirs(self, *args, **kwargs):
        
        return [p for p in self.listdir(*args, **kwargs) if p.isdir()]
526542
def listdir(self, path='/'):
        
        container = self._get_bucket()
        objects = self.driver.list_container_objects(container)
        path = self._clean_name(path)
        if not path.endswith('/'):
            path = "%s/" % path
        files = []
        dirs = []
        # TOFIX: better algorithm to filter correctly
        # (and not depend on google-storage empty folder naming)
        for o in objects:
            if path == '/':
                if o.name.count('/') == 0:
                    files.append(o.name)
                elif o.name.count('/') == 1:
                    dir_name = o.name[:o.name.index('/')]
                    if dir_name not in dirs:
                        dirs.append(dir_name)
            elif o.name.startswith(path):
                if o.name.count('/') <= path.count('/'):
                    # TOFIX : special case for google storage with empty dir
                    if o.name.endswith('_$folder$'):
                        name = o.name[:-9]
                        name = name[len(path):]
                        dirs.append(name)
                    else:
                        name = o.name[len(path):]
                        files.append(name)
        return (dirs, files)
597856
function getModules(argv,modules){
    if(argv.module){
        var which = getModuleConfig(argv.module,modules);
        if(which){
            return [which];
        }else{
            return [];
        }
    }
    return modules;
}
983166
function parseArgs(argv) {
  debug('parseArgs argv: ', argv);

  // default action
  var action = 'deploy';
  if ( argv['_'].length >= 1 ) {
    action = argv['_'][0];
  }

  failIfEmpty('e', 'environment', argv);
  failIfAbsent('e', 'environment', argv);
  if ('s' in argv || 'stacks' in argv) failIfEmpty('s', 'stacks', argv);
  return {
    environment: argv['e'] || argv['environment'],
    extraVars: parseExtraVars(argv['x'] || argv['extraVars']),
    action: action,
    region: argv['r'] || argv['region'],
    profile: argv['p'],
    cfg: argv['c'] || argv['config'],
    stackFilters: argv['s'] || argv['stacks'] || undefined
  };
}
920878
def ListDirectoryAbsolute(directory):
  """"""
  return (os.path.join(directory, path)
          for path in tf.io.gfile.listdir(directory))
1130773
function listModulesInDirectory(modulesDir) {
    const log = debug('phantomas:modules');
    log('Getting the list of all modules in ' + modulesDir);

    // https://nodejs.org/api/fs.html#fs_fs_readdirsync_path_options
    var ls = fs.readdirSync(modulesDir),
        modules = [];

    ls.forEach(function(entry) {
        // First check whether an entry is a directory, than check if it contains a module file
        // https://nodejs.org/api/fs.html#fs_fs_existssync_path
        if (fs.existsSync(modulesDir + '/' + entry + '/' + entry + '.js')) {
            modules.push(entry);
        }
    });

    return modules.sort();
}
53473
def listdir(directory):
    
    file_names = list()
    for filename in os.listdir(directory):
        file_path = os.path.join(directory, filename)
        if os.path.isdir(file_path):
            filename = f'{filename}{os.path.sep}'
        file_names.append(filename)
    return file_names
413874
def list_js_files(dir):
    
    for dirpath, dirnames, filenames in os.walk(dir):
        for filename in filenames:
            if is_js_file(filename):
                yield os.path.join(dirpath, filename)
408773
function getFiles(dir) {
    var files = [];

    var traverse = function (dir) {
        var dirList = dir.listFiles();
        dirList.forEach(function (file) {
            if (/\.css$/.test(file)) {
                files.push(file);
            } else if (file.isDirectory()) {
                traverse(file);
            }
        });
    };

    traverse(dir);

    return files;
}
392870
function CliStripNodeJake(argv)
{
    const nodeRegex = /^(.*)\/node$/;
    const yakeRegex = /(.*)yake(.*)$/;
    const taskFileRegex = /\.\/(.*)\.js(\s*)$/;
    // let argsNoNode;
    let argNoNodeNoYake;
    /**
     * Strip ['....node', '....yake'] or ['....yake'] or [./<....>.js] from the start of the argv array
     */

    if (argv[0].match(nodeRegex))
    {
        argNoNodeNoYake = argv.slice(1);
        if (argv[1].match(nodeRegex))
        {
            argNoNodeNoYake = argv.slice(2);
        }
    }
    else if (argv[0].match(yakeRegex))
    {
        argNoNodeNoYake = argv.slice(1);
    }
    else if (argv[0].match(taskFileRegex))
    {
        argNoNodeNoYake = argv.slice(1);
    }
    else
    {
        argNoNodeNoYake = argv.slice();
    }

    return argNoNodeNoYake;
}
1024769
function listApps() {

        // combine directories from pancakes-recipe with dirs from source project
        var dirs = [].concat(fs.readdirSync(__dirname), fs.readdirSync(process.cwd() + '/batch'));

        // list them out in sorted order
        dirs.sort();
        for (var i = 0; i < dirs.length; i++) {
            if (dirs[i] !== 'batch.manager.js') {
                /* eslint no-console:0 */
                console.log(dirs[i]);
            }
        }
    }
1038135
def contents(path = nil)
      contents = []

      object = find_object(path || '/')
      contents << path unless path.nil? || object.nil?
      if object.is_a? Grit::Tree
        (object.blobs + object.trees).each do |obj|
          contents += contents(path.nil? ? obj.basename : File.join(path, obj.basename))
        end
      end

      contents
    end
79190
static File resolveDirectory(String[] args) {
    return Optional.of(resolveArgument(args)).map(File::new).filter(File::isDirectory)
      .orElseThrow(() -> newIllegalArgumentException("Argument [%s] is not a valid directory", args[0]));
  }
1170529
def list_files_in_directory(dir, options)
      files = Dir.glob File.join(dir, "*")

      normalized_file_list options, files, false, options.exclude
    end