Returns true if the user opted in, and false otherwise
354861
function showPrompt () {
    return new Promise(function (resolve, reject) {
        var msg = 'May Cordova anonymously report usage statistics to improve the tool over time?';
        insight._permissionTimeout = module.exports.timeoutInSecs || 30;
        insight.askPermission(msg, function (unused, optIn) {
            var EOL = require('os').EOL;
            if (optIn) {
                console.log(EOL + 'Thanks for opting into telemetry to help us improve cordova.');
                module.exports.track('telemetry', 'on', 'via-cli-prompt-choice', 'successful');
            } else {
                console.log(EOL + 'You have been opted out of telemetry. To change this, run: cordova telemetry on.');
                // Always track telemetry opt-outs! (whether opted-in or opted-out)
                module.exports.track('telemetry', 'off', 'via-cli-prompt-choice', 'successful');
            }
            resolve(optIn);
        });
    });
}
741658
def has_logged_in(self):
        """"""
        r = self.http.get(CHECKPOINT_URL)
        if r.state is False:
            return True
        # If logged out, flush cache
        self._reset_cache()
        return False
283305
public static function ActiveUserSelectedACurrency()
    {
        $bSelected = false;
        $oUser = TdbDataExtranetUser::GetInstance();
        if ($oUser && is_array($oUser->sqlData) && array_key_exists('pkg_shop_currency_id', $oUser->sqlData) && !empty($oUser->sqlData['pkg_shop_currency_id'])) {
            $bSelected = true;
        }

        return $bSelected;
    }
192091
function isLoggedInAsync(cb) {
      if (currentUser.hasOwnProperty('$promise')) {
        currentUser.$promise.then(function () {
          cb(true);
        }).catch(function () {
          cb(false);
        });
      } else if (currentUser.hasOwnProperty('role')) {
        cb(true);
      } else {
        cb(false);
      }
    }
1083445
def _is_logged_in_with_confirmed_email(user_manager):
    
    # User must be logged in
    if user_manager.call_or_get(current_user.is_authenticated):
        # Is unconfirmed email allowed for this view by @allow_unconfirmed_email?
        unconfirmed_email_allowed = \
            getattr(g, '_flask_user_allow_unconfirmed_email', False)
        
        # unconfirmed_email_allowed must be True or
        # User must have at least one confirmed email address
        if unconfirmed_email_allowed or user_manager.db_manager.user_has_confirmed_email(current_user):
            return True

    return False
770167
def has_opt(self, opt):
        
        for sec in self.sections:
            val = self.cp.has_option(sec, opt)
            if val:
                return val

        return False
539800
def confirm_user(self, user):
        
        if user.confirmed_at is not None:
            return False
        user.confirmed_at = self.security.datetime_factory()
        user.active = True
        self.user_manager.save(user)

        user_confirmed.send(app._get_current_object(), user=user)
        return True
306880
def deactivate_user(self, user):
        
        if user.active:
            user.active = False
            return True
        return False
26449
public function isEnabled()
    {
        if (null !== $this->getRequireRouteName())
        {
            if ($this->getInvertRequireRouteName() XOR ($this->getCurrentRouteName() != $this->getRequireRouteName()))
            {
                return false;
            }
        }

        return $this->enabledIfRoleMissing || $this->userHasRequiredRole();
    }
411043
def check_user(self, user_id):
        

        if self.hidden == 'N':
            return True

        for owner in self.owners:
            if int(owner.user_id) == int(user_id):
                if owner.view == 'Y':
                    return True
        return False
686585
public boolean isDue() {
        // user opted out. no data collection.
        if(!Jenkins.getInstance().isUsageStatisticsCollected() || DISABLED)     return false;
        
        long now = System.currentTimeMillis();
        if(now - lastAttempt > DAY) {
            lastAttempt = now;
            return true;
        }
        return false;
    }
443478
def _is_whitelisted(self, req):
        """"""

        if not self.roles_whitelist:
            return False

        if not hasattr(req, 'context'):
            self.log.info("No context found.")
            return False

        if not hasattr(req.context, 'roles'):
            self.log.info("No roles found in context")
            return False

        roles = req.context.roles
        self.log.debug("Received request from user with roles: %s",
                       ' '.join(roles))
        for key in self.roles_whitelist:
            if key in roles:
                self.log.debug("User role (%s) is whitelisted.", key)
                return True

        return False
305667
def is_installed(self):
        """"""

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

        return r is not None
936471
def was_into_check(self) -> bool:
        
        king = self.king(not self.turn)
        return king is not None and self.is_attacked_by(self.turn, king)
1316628
private function isPosting() {
		if ( empty( $_POST['activateKey'] ) ) {
			return false;
		}

		if ( empty( $_GET['nonce'] ) || ! wp_verify_nonce( $_GET['nonce'], 'bglib-key-prompt') ) {
			return false;
		}

		if ( ! current_user_can( 'update_plugins' ) ) {
			return false;
		}

		return true;
	}
595011
public boolean isRoleMapped(Long pRoleId){
       if(userRoles == null || userRoles.length == 0){
            return false;
        }
        for(int i=0; i<userRoles.length; i++){
            if(userRoles[i].getId().longValue() == pRoleId.longValue()){
                return true;
            }
        }
        return false;
    }
1185262
public function isNewsSubscribed()
    {
        if ($this->_blNewsSubscribed === null) {
            if (($isSubscribedToNews = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('blnewssubscribed')) === null) {
                $isSubscribedToNews = false;
            }
            if (($user = $this->getUser())) {
                $isSubscribedToNews = $user->getNewsSubscription()->getOptInStatus();
            }
            $this->_blNewsSubscribed = $isSubscribedToNews;
        }

        if (is_null($this->_blNewsSubscribed)) {
            $this->_blNewsSubscribed = false;
        }

        return $this->_blNewsSubscribed;
    }