// IsAccessible reports if file exists and user has permission to use it
488379
func IsAccessible(filepath string) bool {
	exist, err := existsWithError(filepath)
	return exist && !os.IsPermission(err)
}
1270252
func (c *Context) IsEnabled(capability int) bool {
	return c.Call("isEnabled", capability).Bool()
}
1087536
func (s *CreateRelationalDatabaseFromSnapshotInput) SetPubliclyAccessible(v bool) *CreateRelationalDatabaseFromSnapshotInput {
	s.PubliclyAccessible = &v
	return s
}
1342907
func (md *RootMetadata) IsReadable() bool {
	return md.TlfID().Type() == tlf.Public || md.data.Dir.IsInitialized()
}
710151
func (s *SetupClientSession) IsServerProofValid(proof []byte) bool {
	return s.session.VerifyServerAuthenticator(proof)
}
126152
func (fp *FileProvider) SessionExist(sid string) bool {
	filepder.lock.Lock()
	defer filepder.lock.Unlock()

	_, err := os.Stat(path.Join(fp.savePath, string(sid[0]), string(sid[1]), sid))
	if err == nil {
		return true
	}
	return false
}
984234
func (fs *noLstatFs) LstatIfPossible(name string) (os.FileInfo, bool, error) {
	fi, err := fs.Stat(name)
	return fi, false, err
}
1217784
func CheckWriteable(filename string) error {
	// Check if file exists already. if it doesn't, we will delete it after
	// checking for writeabilty
	fileExistsAlready := false

	if _, err := os.Stat(filename); err == nil {
		fileExistsAlready = true
	}

	err := os.MkdirAll(filepath.Dir(filename), 0771)
	if err != nil {
		return err
	}

	w, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0600)
	if err != nil {
		return err
	}
	w.Close()

	if !fileExistsAlready {
		err := os.Remove(filename)
		if err != nil {
			return err
		}
	}
	return nil
}
546606
func (bl *blockLock) DoRUnlockedIfPossible(
	lState *kbfssync.LockState, f func(*kbfssync.LockState)) {
	if !bl.locked {
		bl.RUnlock(lState)
		defer bl.RLock(lState)
	}

	f(lState)
}
1227620
func IsAutoClip(ctx context.Context) bool {
	bv, ok := ctx.Value(ctxKeyAutoClip).(bool)
	if !ok {
		return true
	}
	return bv
}
565836
func isSessionExists(sid string) bool {
	sessionFile, err := getSessionFile(sid)
	fatalIf(err.Trace(sid), "Unable to determine session filename for `"+sid+"`.")

	if _, e := os.Stat(sessionFile); e != nil {
		return false
	}

	return true // Session exists.
}
116937
func IsAccessible() bool {
	if pkcs11Lib == "" {
		return false
	}
	ctx, session, err := SetupHSMEnv(pkcs11Lib, defaultLoader)
	if err != nil {
		return false
	}
	defer cleanup(ctx, session)
	return true
}
1316441
func isVPCNotUsableError(err error) bool {
	err = errors.Cause(err)
	_, ok := err.(*vpcNotUsableError)
	return ok
}
1130285
func IsStreamable(p string) (bool, error) {
	proto, err := New(Protocol(p), nil, nil)
	if err != nil {
		return false, err
	}
	return proto.IsStreamable(), nil
}
617640
func IsAuthorisationFailure(err error) bool {
	// This should cover most cases.
	if gomaasapi.IsPermissionError(err) {
		return true
	}

	// This should cover exceptional circumstances.
	if maasErr, ok := err.(gomaasapi.ServerError); ok {
		return common.AuthorisationFailureStatusCodes.Contains(maasErr.StatusCode)
	}
	return false
}
1032709
func (s *HTTPServer) IsUIEnabled() bool {
	return s.agent.config.UIDir != "" || s.agent.config.EnableUI
}
153801
func (mock *Mock) IsProcessable(file string) bool {
	items := mock.getReturnValues("IsProcessable")
	return items[0].(bool)
}