return the list of files
@method normalizeEntries
@param files
@returns {*}
771535
function ( files ) {
        files = files || [ ];

        var me = this;
        var nEntries = files.map( function ( file ) {
          return me.getFileDescriptor( file );
        } );

        //normalizeEntries = nEntries;
        return nEntries;
      }
960114
function (file) {
        if (!this.ignore(file)) {
            file = this.map(file);
            file = utils.normalize(file);
            return file;
        }
    }
766165
function filterFiles( files ){
    var filtered = [],
        file,
        i;
    for( i = 0; i < files.length; i++ ){
        file = files[ i ];
        if( file.height &&
            file.width &&
            file.url ){
            //This is sufficient to serve as a level
            filtered.push({
                url: file.url,
                width: Number( file.width ),
                height: Number( file.height )
            });
        }
        else {
            $.console.error( 'Unsupported image format: %s', file.url ? file.url : '<no URL>' );
        }
    }

    return filtered.sort(function(a, b) {
        return a.height - b.height;
    });

}
435238
function filterFiles(files, check) {
	return files.filter(function(file) {
		if (typeof check == 'string') {
			// ignore typecase equal
			return check.toLowerCase() === file.toLowerCase();
		} else if (Util.isRegExp(check)) {
			// regexp test
			return check.test(file);
		} else if (typeof check == 'function') {
			// function callback
			return check(file);
		}
	});
}
1220433
function normalize(file, fn) {
  var orig = utils.extend({}, file);

  // support paths
  if (typeof fn === 'string') {
    file.type = 'path';
    file.path = fn;
    file.origPath = fn;
    file = resolve(file, file.options);

  // support functions
  } else if (typeof fn === 'function') {
    file.type = 'function';
    file.path = file.name;
    file.fn = fn;

  // support instances
  } else if (utils.isAppArg(file.app)) {
    file.type = 'app';
    file.path = file.name;
    file.app = fn;

  } else {
    throw new TypeError('expected env to be a string or function');
  }

  if (file === null) {
    var name = typeof fn === 'string' ? fn : orig.key;
    throw new Error('cannot resolve: ' + util.inspect(name));
  }
  return file;
}
1268484
function listDirectories(dirPath) {
    return fs.readdirSync(dirPath).filter(
        /**
         * @param {string} file
         * @returns {boolean}
         * */
        file => fs.statSync(path.join(dirPath, file)).isDirectory(),
    );
}
289725
function listFiles(root, options) {
    options = _.defaults(options || {}, {
        ignoreFiles: [],
        ignoreRules: []
    });

    var d = Q.defer();

    // Our list of files
    var files = [];

    var ig = Ignore({
        path: root,
        ignoreFiles: options.ignoreFiles
    });

    // Add extra rules to ignore common folders
    ig.addIgnoreRules(options.ignoreRules, '__custom_stuff');

    // Push each file to our list
    ig.on('child', function (c) {
        files.push(
            c.path.substr(c.root.path.length + 1) + (c.props.Directory === true ? '/' : '')
        );
    });

    ig.on('end', function() {
        // Normalize paths on Windows
        if(process.platform === 'win32') {
            return d.resolve(files.map(function(file) {
                return file.replace(/\\/g, '/');
            }));
        }

        // Simply return paths otherwise
        return d.resolve(files);
    });

    ig.on('error', d.reject);

    return d.promise;
}
50187
private function normalize() : array {
    $files = [];

    foreach($_FILES as $key => $file) {
      
      if (!is_array($file['name'])) {
          $files[$key][] = $file;
          continue;
      }

      foreach($file['name'] as $subKey => $name) {
          $files[$key][$subKey] = [
              'name' => $name,
              'type' => $file['type'][$subKey],
              'tmp_name' => $file['tmp_name'][$subKey],
              'error' => $file['error'][$subKey],
              'size' => $file['size'][$subKey]
          ];
      }
    }

    return $files;
  }
1221068
function splitFilesIntoBatches(files, config) {
    // We need to specifiy a different parser for TS files
    const configTS = Object.assign({}, config);
    configTS.parser = 'typescript';

    const batches = [];

    batches.push({
        files: files.filter(fileName => fileMatchesExtension(fileName, EXTENSIONS.js)),
        config: config,
    });

    batches.push({
        files: files.filter(fileName => fileMatchesExtension(fileName, EXTENSIONS.ts)),
        config: configTS,
    });

    return batches;
}
968324
function (dir) {
    let files = [];
    let list = fs.readdirSync(dir);
    list.forEach(function (file) {
        file = dir + '/' + file;
        let stat = fs.statSync(file);
        if (stat && stat.isDirectory()) files = files.concat(walk(file));
        else files.push(file);
    });
    return files;
}
529625
async function filterFiles(files) {
    const clearModule = replace(/^\.\//, '');
    const resources = files | filter(test(/^((icon\.png)|(README(\.\w+)?\.md))$/));
    const missing = without(files, requiredFiles);

    if (missing.length > 0) {
        return reject(Error(`missing ${missing.join(', ')} from the project`));
    }

    if (!contains('icon.png', files)) {
        emitWarning('compiling app without providing an icon.png file');
    }

    const infoFiles = await listFiles('info')
        | filter(test(/[a-z]{2}(_[A-Z]{2,3})?\.md/))
        | map(path.join('info/', _));

    return fs.readFileAsync('index.js', 'utf-8')
        .then(inspect)
        .then(over(lensProp('modules'), filter(startsWith('./'))))
        .then(({ code, modules }) => ({
            code,
            files: union(modules.map(clearModule),
                [...resources, ...requiredFiles, ...infoFiles])
        }));
}
591706
function files(path, ...matchers) {
	if ( matchers.length ) {
		return listFiles(path.replace(/\\/g, '/'), matchers);
	}

	let rs = [];
	if( isDirectoryExists(path) ) {
		let ls = fs.readdirSync(path);
		ls.forEach((file, index) => rs.push(path + "/" + file));
	}
	return rs;
}
30821
function aggregateCoverage(files) {
  var i, len, file, content, results;
  var resultsObj = getEmptyResultObject();

  for (i = 0, len = files.length; i < len; i++) {
    file = files[i];
    content = JSON.parse(fs.readFileSync(file).toString());
    resultsObj = populateCoverage(resultsObj, content);
  }

  return resultsObj;
}
68880
function (files, tolerance) {
    tolerance = tolerance || 5;
    return hashFiles.sync({files: files}).substring(0, tolerance);
  }
1114285
def _normalize_file_paths(self, *args):
        """"""
        paths = []
        for arg in args:
            if arg is None:
                continue
            elif self._is_valid_file(arg):
                paths.append(arg)
            elif isinstance(arg, list) and all(self._is_valid_file(_) for _ in arg):
                paths = paths + arg
            elif not self.ignore_errors:
                raise TypeError('Config file paths must be string path or list of paths!')
        return paths
1266238
function isFileGroup(files) {
  const basePatternString = `~${files.length}/nth/`;
  const mapExpression = (val, idx) => new RegExp(`${basePatternString}${idx}/$`);
  const expressions = Array.from({ length: files.length }, mapExpression);
  return expressions.every(exp => files.some(url => exp.test(url)));
}
260362
function readAndHashFiles(files) {
    const fileHashes = {};
    const fileContents = {};
    const promises = [];

    function readSingleFile(file) {
        return new Promise((resolve, reject) => {
            fs.readFile(file, (err, data) => {
                if (err) {
                    console.log(err);
                    reject(err);
                    return;
                }
                const hash = crypto.createHash('sha1');
                hash.update(data);
                const bufferHash = hash.digest();
                fileHashes[file] = bufferHash.toString('hex');
                if (file.endsWith('.js') && !file.endsWith('.test.js')) {
                    fileContents[file] = data.toString('utf8');
                }
                resolve();
            });
        });
    }

    files.forEach((file) => {
        promises.push(readSingleFile(file));
    });

    return new Promise((resolve, reject) => {
        Promise.all(promises)
            .then(() => {
                resolve({ files, fileContents, fileHashes });
            })
            .catch(reject);
    });
}