Check whether OS Login is installed.

    Args:
      two_factor: bool, True if two factor should be enabled.

    Returns:
      bool, True if OS Login is installed.
342819
def _GetStatus(self, two_factor=False):
    
    params = ['status']
    if two_factor:
      params += ['--twofactor']
    retcode = self._RunOsLoginControl(params)
    if retcode is None:
      if self.oslogin_installed:
        self.logger.warning('OS Login not installed.')
        self.oslogin_installed = False
      return None

    # Prevent log spam when OS Login is not installed.
    self.oslogin_installed = True
    if not os.path.exists(constants.OSLOGIN_NSS_CACHE):
      return False
    return not retcode
900327
public function isUserTwoFactorAuthEnabled($userId) {
        $result = DB::table('users')
            ->where('id', '=', $userId)
            ->value('two_factor_auth_enabled')
        ;

        if ($result) {
            return true;
        }
        return false;
    }
1177030
function isCompassInstalled() {
  var deferred = q.defer(),
      cmd = 'compass';

  exec(cmd, function (err) {
    deferred.resolve(! err);
  });

  return deferred.promise;
}
224240
def check_auth(self):
        
        if self.type_of_auth == BboxConstant.AUTHENTICATION_TYPE_LOCAL:
            access_level_required = self.get_auth_access_needed_for_local()
        else:
            access_level_required = self.get_auth_access_needed_for_remote()

        if access_level_required == BboxConstant.AUTHENTICATION_LEVEL_NONE:
            return False
        elif access_level_required == BboxConstant.AUTHENTICATION_LEVEL_PRIVATE:
            return self.is_authentified()
        elif access_level_required == BboxConstant.AUTHENTICATION_LEVEL_PUBLIC:
            return True
950751
def is_default(name=None, index=None):
    

    if not is_configured():
        raise JutException('No configurations available, please run `jut config add`')

    count = 1
    for configuration in _CONFIG.sections():

        if index != None:
            if _CONFIG.has_option(configuration, 'default') and count == index:
                return True

        if name != None:
            if _CONFIG.has_option(configuration, 'default') and configuration == name:
                return True

        count += 1

    return False
31094
def is_installed(name):
    
    pkgs = installed_packages()
    for pkge in pkgs:
        if pkge.name == name:
            return True
    return False
1146424
public static boolean isInstalled() throws SecurityException {
        java.util.logging.Logger rootLogger = getRootLogger();
        Handler[] handlers = rootLogger.getHandlers();
        for (int i = 0; i < handlers.length; i++) {
            if (handlers[i] instanceof SLF4JBridgeHandler) {
                return true;
            }
        }
        return false;
    }
462850
def check_for_authentication(self):
        
        auth_required = self.current.workflow_name not in settings.ANONYMOUS_WORKFLOWS
        if auth_required and not self.current.is_auth:
            self.current.log.debug("LOGIN REQUIRED:::: %s" % self.current.workflow_name)
            raise HTTPError(401, "Login required for %s" % self.current.workflow_name)
305667
def is_installed(self):
        """"""

        r = self.library.resolve(self.identity.vid)

        return r is not None
1369362
def is_device(self):
		

		if self in {type(self).DEVICE_ADDED, type(self).DEVICE_REMOVED}:
			return True
		else:
			return False
1276272
def _sysv_is_enabled(name, runlevel=None):
    '''
    
    '''
    # Try chkconfig first.
    result = _chkconfig_is_enabled(name, runlevel)
    if result:
        return True

    if runlevel is None:
        runlevel = _runlevel()
    return (
        len(glob.glob('/etc/rc.d/rc{0}.d/S??{1}'.format(runlevel, name))) > 0)
296875
def is_external(self):
        """"""
        # NOTE: Checking for equality HintSystem==False returns False if the
        # property is resolved to a None value (interface not available).
        if self._P.Block.HintSystem == False:       # noqa: E712
            return True
        # NOTE: udisks2 seems to guess incorrectly in some cases. This
        # leads to HintSystem=True for unlocked devices. In order to show
        # the device anyway, it needs to be recursively checked if any
        # parent device is recognized as external.
        if self.is_luks_cleartext and self.luks_cleartext_slave.is_external:
            return True
        if self.is_partition and self.partition_slave.is_external:
            return True
        return False
439571
public static boolean isInstalled(int major, int minor, String targetMachine, IJIAuthInfo session) throws JIException, UnknownHostException {
        IJIWinReg registry = JIWinRegFactory.getSingleTon().getWinreg(session,targetMachine,true);
        JIPolicyHandle hklm=null;
        JIPolicyHandle key=null;

        try {
            hklm = registry.winreg_OpenHKLM();
            key = registry.winreg_OpenKey(hklm,"SOFTWARE\\Microsoft\\.NETFramework", IJIWinReg.KEY_READ );

            for( int i=0; ; i++ ) {
                String keyName = registry.winreg_EnumKey(key,i)[0];
                if(matches(keyName,major,minor))
                    return true;
            }
        } catch (JIException e) {
            if(e.getErrorCode()==2)
                return false;       // not found
            throw e;
        } finally {
            if(hklm!=null)
                registry.winreg_CloseKey(hklm);
            if(key!=null)
                registry.winreg_CloseKey(key);
            registry.closeConnection();
        }
    }
779311
function isInstalled(dep) {
    if (_.has(exceptions, dep)) return exceptions[dep];
    return installedDeps.has(dep);
}
1000396
public static boolean isAuthenticationEnabled(AlluxioConfiguration conf) {
    return !conf.getEnum(PropertyKey.SECURITY_AUTHENTICATION_TYPE, AuthType.class)
        .equals(AuthType.NOSASL);
  }
25275
def isApplicationInstalled(self, pchAppKey):
        """"""

        fn = self.function_table.isApplicationInstalled
        result = fn(pchAppKey)
        return result
912580
def is_enabled(self):
        
        if self.name in settings.exclude_rules:
            return False
        elif self.name in settings.rules:
            return True
        elif self.enabled_by_default and ALL_ENABLED in settings.rules:
            return True
        else:
            return False