This checks if requirements file exists.
@param {string} servicePath
@param {Object} options
@param {string} fileName
960701
function requirementsFileExists(servicePath, options, fileName) {
  if (
    options.usePoetry &&
    fse.existsSync(path.join(servicePath, 'pyproject.toml'))
  ) {
    return true;
  }

  if (options.usePipenv && fse.existsSync(path.join(servicePath, 'Pipfile'))) {
    return true;
  }

  if (fse.existsSync(fileName)) {
    return true;
  }

  return false;
}
1031470
private static boolean requiredByOtherFeature(Map<String, ProvisioningFeatureDefinition> features, File baseDir, File testFile) {
        for (ProvisioningFeatureDefinition fd : features.values()) {
            if (requiredByFile(fd, baseDir, testFile))
                return true;
        }
        return false;
    }
467158
function tryRequire(filePath) {
  let resolvedPath = req.resolve(filePath);

  if (resolvedPath) {
    return req(resolvedPath);
  }

  return undefined;
}
1127231
def _options_file_exists(name):
    '''
    
    '''
    return os.path.isfile(os.path.join(_options_dir(name), 'options'))
231343
function fileExist(fileName) {
  return new Promise((resolve, reject) => {
    fs.stat(fileName, (err, stats) => {
      if (err === null && stats.isFile()) {
        resolve(fileName);
      } else {
        resolve(false);
      }
    });
  });
}
341514
function doesFileExist (path) {
  return new Promise(resolve => {
    fs.stat(path, (err, stat) => {
      // The file exists if there were no errors, and it's a file
      resolve(!err && stat.isFile())
    })
  })
}
317612
function fileChecks( filepath )
		{
			// check if file exists
			if (!grunt.file.exists(filepath))
			{
				grunt.log.warn('Source file "' + filepath + '" not found');
				return false;
			}

			if(options.checkFilesize)
			{
				// check for size
				var stats = fs.lstatSync( filepath );

				if(stats.size > UNCRITICAL_FILE_SIZE)
				{
					grunt.log.warn('uncritical datauri size (' + filesize(UNCRITICAL_FILE_SIZE) + ') exceeded: ' + filepath + ' (' + filesize(stats.size) + ')');
				}
			}

			return true;
		}
422486
private static boolean requiredByPlatformFeature(File baseDir, File testFile) {
        try {
            Map<String, ProvisioningFeatureDefinition> features = new Product(baseDir).getFeatureDefinitions();
            for (ProvisioningFeatureDefinition fd : features.values()) {
                if (fd.isKernel()) {
                    if (requiredByFile(fd, baseDir, testFile))
                        return true;
                }
            }
        } catch (Exception e) {
        }
        return false;
    }
399580
def has_file_extension(filepath, ext_required):
    '''
    '''
    ext = os.path.splitext(filepath)[-1]
    if ext != ext_required:
        msg_tmpl = "The extension for {}, which is {}, does not equal {}"
        msg_format = msg_tmpl.format(filepath, ext, ext_required)
        raise ValueError(msg_format)
    return True
851274
def requirements(self, requires):
        '''
        
        '''
        if requires:
            if isinstance(requires, basestring) and \
               os.path.isfile(os.path.abspath(requires)):
                self._requirements_file = os.path.abspath(requires)
            else:
                if isinstance(self._requirements, basestring):
                    requires = requires.split()
                self._requirements_file = None
                self._requirements = requires
        else:
            # If the default requirements file is found use that
            if os.path.isfile(self._requirements_file):
                return
            self._requirements, self._requirements_file = None, None
303971
function exists(filepath) {
  const cached = existsCache.has(filepath);

  // Only return positive to allow for generated files
  if (cached) return true;

  const filepathExists = fs.existsSync(filepath);

  if (filepathExists) existsCache.add(filepath);

  return filepathExists;
}
27290
def IsFileRequired(self, filename):
    """"""
    if filename not in self._file_mapping:
      return False
    mapping = self._file_mapping[filename]
    return mapping['required']
994440
private static final function isServiceExists(string $serviceFile, string $serviceClass): bool
    {
        if (!file_exists($serviceFile)) {
            return false;
        }

        return class_exists($serviceClass, true);
    }
790974
function fileExists(file) {
    try {
        var targetStat = fs.statSync(file);
        if (targetStat.isDirectory() ) {
            throw new Error("File exists but it's a driectory: " + file);
        }
    }
    catch(err) {
        if (err.code == 'ENOENT') {         // No such file or directory
            return false;
        }
        else {
            throw err;
        }
    }
    return true;
}
1200423
def get_requirements(requirements_filepath):
    '''
    
    '''
    requirements = []
    with open(os.path.join(ROOT_DIR, requirements_filepath), 'rt') as f:
        for line in f:
            if line.startswith('#'):
                continue
            line = line.rstrip()
            if not line:
                continue
            requirements.append(line)
    return requirements
393777
function requirePath(fromPath, require) {
  // console.log('requirePath:fromPath: ' + fromPath);
  // console.log('requirePath:require: ' + require);
  if (fromPath === null || fromPath === undefined
    || require === null || require === undefined) {
    return null;
  }
  var filePath = path.resolve(path.dirname(fromPath), require);
  return realRequirPath(filePath);
}
843205
function moduleExists(name) {
  //TODO: Check that the file exists before trying to require it.
  try {
    require.resolve(name);
  }
  catch (err) {
    this.server.emit('error', err);
    return false;
  }
  return true;
}