Check if the settings file exists or not
557220
def file_exists(self) -> bool:
        
        cfg_path = self.file_path
        assert cfg_path

        return path.isfile(cfg_path)
445159
def file_exists?(paths, file)
      paths.any? do |path|
        Find.find(path)
            .map { |path_file| Shellwords.escape(path_file) }
            .include?(file)
      end
    end
462000
def check(cls):
        
        if cls == AppSettings:
            return None

        exceptions = []
        for setting in cls.settings.values():
            try:
                setting.check()
            # pylama:ignore=W0703
            except Exception as e:
                exceptions.append(str(e))
        if exceptions:
            raise ImproperlyConfigured("\n".join(exceptions))
222436
def _copy_settings_file(source, destination, name):
    

    if os.path.exists(destination):
        try:
            ch = six.moves.input(
                'File %s already exists, overwrite? y/[n]):' % destination)
            if ch not in ('Y', 'y'):
                return
        except KeyboardInterrupt:
            return

    filepath = os.path.dirname(destination)
    if not os.path.exists(filepath):
        os.makedirs(filepath)

    print('Copying default %s to %s' % (name, destination))
    shutil.copy(source, destination)
    os.chmod(destination, 0o664)
353848
def file_exists(self, fid):
        
        res = self.get_file_size(fid)
        if res is not None:
            return True
        return False
186930
def exists(self, filename):
        """"""
        client = boto3.client("s3")
        bucket, path = self.bucket_and_path(filename)
        r = client.list_objects(Bucket=bucket, Prefix=path, Delimiter="/")
        if r.get("Contents") or r.get("CommonPrefixes"):
            return True
        return False
147331
def file_exists(original_file):
    
    if original_file.startswith("s3://"):
        from filesystem import s3
        return s3.file_exists(original_file)
    else:
        if not os.path.exists(original_file):
            return False
        if not os.path.isfile(original_file):
            return False
    return True
596660
def load_and_check(self, base_settings, prompt=None):
        
        checker = Checker(self.file_name, self.section, self.registry, self.strategy_type, prompt)
        settings = self.load(base_settings)
        if checker.check(settings):
            return settings, True
        return None, False
570607
def _make_sure_dir_exists(self):
        
        filename = self.model_config.checkpoint_dir()
        pathlib.Path(filename).mkdir(parents=True, exist_ok=True)
813501
def exists(provider, config_location=DEFAULT_CONFIG_DIR):
    

    config_dir = os.path.join(config_location, NOIPY_CONFIG)
    auth_file = os.path.join(config_dir, provider)
    return os.path.exists(auth_file)
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
225385
protected function checkSettings()
    {
        if (empty($this->settings['additional']['detailPid'])) {
            $this->settings['additional']['detailPid'] = $GLOBALS['TSFE']->id;
        }

        if (empty($this->settings['additional']['listPid'])) {
            $this->settings['additional']['listPid'] = $GLOBALS['TSFE']->id;
        }

        if (empty($this->settings['associationID'])) {
            $this->addFlashMessage(
          'Please set a association',
          'Configuration Error',
          FlashMessage::ERROR
        );
        }
    }
1081951
function exists()
    {
        $path = $this->filePath;
        $rc = isset( $this->metaData['mtime'] );
        eZDebugSetting::writeDebug( 'kernel-clustering', "fs::exists( '$path' ): " . ( $rc ? 'true' :'false' ), __METHOD__ );
        return $rc;
    }
994783
def _HasFile(self, file_name):
    """"""
    if self._zip:
      return file_name in self._zip.namelist()
    else:
      file_path = os.path.join(self._path, file_name)
      return os.path.exists(file_path) and os.path.isfile(file_path)
1113462
def _locate_settings(settings=''):
    ""

    import imp
    import sys
    sys.path.append(os.getcwd())
    settings = settings or os.getenv('DJANGO_SETTINGS_MODULE')
    if settings:
        parts = settings.split('.')
        f = imp.find_module(parts[0])[1]
        args = [f] + parts[1:]
        path = os.path.join(*args)
        path = path + '.py'
        if os.path.exists(path):
            return path
1327333
def exists(self, filepath):
        """"""
        if self.is_ssh(filepath):
            self._check_ftp()
            remotepath = self._get_remote(filepath)
            try:
                self.ftp.stat(remotepath)
            except IOError as e:
                if e.errno == errno.ENOENT:
                    return False
            else:
                return True
        else:
            return os.path.exists(filepath)
1215973
function fileExists(fileName) {
        if (!fileName) {
            return false;
        }

        var filePath = PathUtils.resolveInRoot(outputFolder, fileName);
        return fs.existsSync(filePath);
    }