Only return False if the certificate is a file path. Otherwise it
    is a file object or raw string and will need to be fed to the
    file open context.
173322
def pem_as_string(cert):
    
    if hasattr(cert, 'read'): # File object - return as is
        return cert
    cert = cert.encode('utf-8') if isinstance(cert, unicode) else cert
    if re.match(_PEM_RE, cert):
        return True
    return False
1089027
def is_readonly_path(fn):
    

    fn = fs_encode(fn)
    if os.path.exists(fn):
        file_stat = os.stat(fn).st_mode
        return not bool(file_stat & stat.S_IWRITE) or not os.access(fn, os.W_OK)
    return False
581386
def _cs_path_exists(fspath):
        
        if not os.path.exists(fspath):
            return False
        # make absolute so we always have a directory
        abspath = os.path.abspath(fspath)
        directory, filename = os.path.split(abspath)
        return filename in os.listdir(directory)
1319573
function isRelativeFilepath(str) {
  if (str) {
    return (
      isFilepath(str) && (str.indexOf('./') == 0 || str.indexOf('../') == 0)
    );
  }
  return false;
}
411590
def get_certificate_der(self, filename):
        
        pkcs7message = self.get_file(filename)

        pkcs7obj = cms.ContentInfo.load(pkcs7message)
        cert = pkcs7obj['content']['certificates'][0].chosen.dump()
        return cert
352423
function readCertificateDataFromFile ({ keyFile, certFile, caFile }) {
  let key, cert, ca;

  if (keyFile) {
    key = fs.readFileSync(keyFile);
  }

  if (certFile) {
    cert = fs.readFileSync(certFile);
  }

  if (caFile) {
    ca = fs.readFileSync(caFile);
  }

  return { key, cert, ca };
}
1258479
def is_file(path):
    """"""
    try:
        return path.expanduser().absolute().is_file()
    except AttributeError:
        return os.path.isfile(os.path.abspath(os.path.expanduser(str(path))))
241596
def cert(self):
        
        if self.cert_files is not None:
            return self.cert_files

        certs = self.certs or '/certs/'
        ssl_path = os.path.join(os.pardir, certs)
        try:
            cert_path = os.listdir(ssl_path)
        except FileNotFoundError:
            raise CertsError(certs)
        except OSError:   # Python 2 compatability
            raise CertsError(certs)

        cert = None
        key = None
        for file in cert_path:
            ext = os.path.splitext(file)[-1]
            if ext in ['.crt', '.cert']:
                cert = os.path.join(ssl_path, file)
            elif ext == '.key':
                key = os.path.join(ssl_path, file)
        if cert is None or key is None:
            raise CertsError(certs)
        return [cert, key]
145073
def isdir(self, relpath, rsc=None):
        
        filepath = self.find(relpath, rsc)
        if filepath.startswith(':'):
            resource = QtCore.QResource(filepath)
            return not resource.isFile()
        else:
            return os.path.isdir(filepath)
1207337
def is_exe(fpath):
    
    return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
868676
def is_prefix(cls, path):
        
        lagofile = paths.Paths(path).prefix_lagofile()
        return os.path.isfile(lagofile)
804197
public boolean isFile(Path f) throws IOException {
    try {
      return !getFileStatus(f).isDir();
    } catch (FileNotFoundException e) {
      return false;               // f does not exist
    }
  }
497690
public static boolean isFile(Path path, boolean isFollowLinks) {
		if (null == path) {
			return false;
		}
		final LinkOption[] options = isFollowLinks ? new LinkOption[0] : new LinkOption[] { LinkOption.NOFOLLOW_LINKS };
		return Files.isRegularFile(path, options);
	}
980560
def file_is_present(self, file_path):
        
        real_path = self.cont_path(file_path)
        if not os.path.exists(real_path):
            return False
        if not os.path.isfile(real_path):
            raise IOError("%s is not a file" % file_path)
        return True
814722
def get_vexbot_certificate_filepath() -> (str, bool):
    
    public_filepath, secret_filepath = _certificate_helper('vexbot.key','vexbot.key_secret')
    if path.isfile(secret_filepath):
        return secret_filepath, True
    if not path.isfile(public_filepath):
        err = ('certificates not found. Generate certificates from the '
               'command line using `vexbot_generate_certificates`')
        raise FileNotFoundError(err)
    return public_filepath, False
1367696
def __is_file_to_be_busted(self, filepath):
        
        if not self.extensions:
            return True
        return Path(filepath).suffix in self.extensions if filepath else False
623844
public function isFilePath()
    {
        if (is_string($this->data)) {
            try {
                return is_file($this->data);
            } catch (\Exception $e) {
                return false;
            }
        }

        return false;
    }