check if we should handle this filePath
332038
function shouldProcess (filePath, done) {
        done(!!multimatch(filePath, transform.pattern, transform.opts).length)
      }
362504
def validateFilepath( self ):
        
        if ( not self.isValidated() ):
            return
        
        valid = self.isValid()
        if ( not valid ):
            fg = self.invalidForeground()
            bg = self.invalidBackground()
        else:
            fg = self.validForeground()
            bg = self.validBackground()
        
        palette = self.palette()
        palette.setColor(palette.Base, bg)
        palette.setColor(palette.Text, fg)
        self._filepathEdit.setPalette(palette)
1079722
def check_path(file_path):
    '''
        
    '''
    directory = os.path.dirname(file_path)
    if directory != '':
        if not os.path.exists(directory):
            os.makedirs(directory, 0o775)
1302474
def is_valid_file(path):
    '''  '''
    return os.path.exists(path) and os.path.isfile(path)
660502
def is_valid_file(parser,arg):
	""""""
	if not os.path.exists(arg):
       		parser.error("File %s not found"%arg)
	else:
	       	return arg
697061
void fileWriteCheck(String filePath, AddOnModel addOnModel) {
        File request;
        try {
            request =  new File(filePath).getCanonicalFile();
        } catch (IOException e) {
            error("Error getting canonical path", e);
            throw getException(filePath);
        }

        isForbidden(request, addOnModel);

        boolean success = false;
        if (allowedWriteDirectories.stream()
                .anyMatch(compare -> request.toPath().startsWith(compare.toPath()))) {
            success = true;
        }

        for (String name : forbiddenWriteFilesNames) {
            if (request.getName().equals(name)) {
                success = false;
            }
        }

        if (!success) {
            throw getException(filePath);
        }

        if (!getSecurityManager().getSecureAccess().checkForExistingFileOrDirectory(request.toString())
                || getSecurityManager().getSecureAccess().checkForDirectory(request.toString())) {
            return;
        }
    }
1041524
function isDirectory(filePath, callback) {
  try {
    fs.stat(filePath, function (err, data) {
      if (err) {
        callback(null, false);
      } else {
        callback(null, data.isDirectory());
      }
    });
  } catch (e) {
    callback(null, false);
  }
}
259197
function fileExists(file_path) {
  try {
    var stats = fs.statSync(file_path);
    if (stats.isFile()) {
      return true;
    }
  } catch (e) {
  }
  return false;
}
1316007
def has_files(the_path):
    """"""
    the_path = Path(the_path)
    try:
        for _ in the_path.walkfiles():
            return True
        return False
    except OSError as ex:
        if ex.errno == errno.ENOENT:
            # ignore
            return False
        else:
            raise
108138
function (filePath) {
    var removeFile = this._removeFile.bind(this)
    var message = 'Should I remove `' + filePath + '`?'

    var promptPromise = this.ui.prompt({
      type: 'confirm',
      name: 'answer',
      message: message,
      choices: [
        { key: 'y', name: 'Yes, remove it', value: 'yes' },
        { key: 'n', name: 'No, leave it there', value: 'no' }
      ]
    })

    return promptPromise.then(function (response) {
      if (response.answer) {
        return removeFile(filePath)
      } else {
        return RSVP.resolve()
      }
    })
  }
1021100
function handleRecipeFiles(folderPath) {
    if (handled[folderPath]) {
        return;
    }
    handled[folderPath] = true;

    handleRecipeFile(path.join(folderPath, 'tsconfig.json'));
    handleRecipeFiles(path.dirname(folderPath));
}
808141
function checkUnix(directoryPath) {
  if (!path.normalize(directoryPath).startsWith(path.sep)) {
    return new Promise((resolve, reject) => {
      reject(new InvalidPathError(`The following path is invalid (should start by ${path.sep}): ${directoryPath}`))
    })
  }

  return check(
    `df -Pk "${module.exports.getFirstExistingParentPath(directoryPath)}"`,
    () => true, // We should only get one line, so we did not need to filter
    {
      diskPath: 5,
      free: 3,
      size: 1
    },
    1024 // We get sizes in kB, we need to convert that to bytes
  )
}
587303
def _check_path(self):
        ""
        if not path.isdir(self._path or '/'):
            raise OSError('Path {!r} is not a directory'.format(self._path))
275163
def check_path(self, path):
        
        path = os.path.abspath(path)
        if os.path.exists(path):
            return path
        else:
            utils.die("input file does not exists:\n  {}".format(path))
136101
function checkFileExistsSync(filepath){
  var flag = true;

  try {
    fs.accessSync(filepath, fs.F_OK);
  } catch(e){
    flag = false;
  }

  return flag;
}
1117264
def is_source_file(args, filepath):
    """"""
    if args.extension:
        return os.path.splitext(filepath)[1] in args.extension
    else:
        return os.path.splitext(filepath)[1] in _CPP_EXTENSIONS
464814
def _handle_browse(self, relpath, params):
    """"""
    abspath = os.path.normpath(os.path.join(self._root, relpath))
    if not abspath.startswith(self._root):
      raise ValueError  # Prevent using .. to get files from anywhere other than root.
    if os.path.isdir(abspath):
      self._serve_dir(abspath, params)
    elif os.path.isfile(abspath):
      self._serve_file(abspath, params)