Does persist or unpersist, if successful then returns true. If the
 expression is gone, returns false.
 If there is a 'fresher' version of the expression, re-attempt and returns
 false.
506761
def do_p(pers)

      case r = pers ? try_persist : try_unpersist
        when true
          false # do not go on
        when Hash
          self.h = r
          self.send("do_#{@msg['action']}", @msg) if @msg
          false # do not go on
        else
          true # success, do go on
      end
    end
1372678
private function isRefreshNeededByProbability()
    {
        if (is_null($this->refreshProbability)) {
            return false;
        }
        $rand = (float) mt_rand() / (float) mt_getrandmax();
        if ($this->refreshProbability == 1.0 || $rand <= $this->refreshProbability) {
            return true;
        }
        return false; // @codeCoverageIgnore
    }
709181
def succeed(self, text=None):
        
        return self.stop_and_persist(symbol=LogSymbols.SUCCESS.value, text=text)
334439
@Override
    public boolean persistIfPossible(Command command) {
        if(!(command instanceof CommandJdo)) {
            // ought not to be the case, since this service created the object in the #create() method
            return false;
        }
        final CommandJdo commandJdo = (CommandJdo)command;
        repositoryService.persist(commandJdo);
        return true;
    }
1284529
function validateExpires(req, expires) {
	if(!expires) {
		return false;
	}
	if(Date.now() - (expires * 1000) > 0) {
		clearAllPersistentData(req);
		return false;
	}
	return true;
}
727141
@Override
    public Boolean isReady() {
        try {
            validateInitialization();
            validateActivation();
            validateMiddleware();
            return true;
        } catch (InvalidStateException e) {
            return false;
        }
    }
1211950
def persist(self, name, project=None, drop_model=False, **kwargs):
        
        return super(ODPSModelExpr, self).persist(name, project=project, drop_model=drop_model, **kwargs)
783375
def unpersist(self, blocking=False):
        
        self.is_cached = False
        self._jrdd.unpersist(blocking)
        return self
128264
boolean isEntirelyUnresolvable() {
        if (this == NONE) {
            return false;
        }
        ResolvableType[] generics = getGenerics();
        for (ResolvableType generic : generics) {
            if (!generic.isUnresolvableTypeVariable() && !generic.isWildcardWithoutBounds()) {
                return false;
            }
        }
        return true;
    }
997305
def check_and_reset(self, value=None):
    

    if self.check():
      self.reset(value)
      return True
    return False
1028587
private boolean persistSet(@Nullable final Set<String> set) {
        if (set != null && shouldPersist()) {
            if (set.equals(getPersistedSet(null))) {
                return true;
            }

            Editor editor = getPreferenceManager().getSharedPreferences().edit();
            editor.putStringSet(getKey(), set);
            editor.apply();
            return true;
        }

        return false;
    }
319064
def exists(self, key, fresh=False):
        
        key = key.upper()
        if key in self._deleted:
            return False
        return self.get(key, fresh=fresh, default=missing) is not missing
562579
def is_fresh(self, access_mode):
        
        log_debug("[#0000]  C: <ROUTING> Checking table freshness for %r", access_mode)
        expired = self.last_updated_time + self.ttl <= self.timer()
        has_server_for_mode = bool(access_mode == READ_ACCESS and self.readers) or bool(access_mode == WRITE_ACCESS and self.writers)
        log_debug("[#0000]  C: <ROUTING> Table expired=%r", expired)
        log_debug("[#0000]  C: <ROUTING> Table routers=%r", self.routers)
        log_debug("[#0000]  C: <ROUTING> Table has_server_for_mode=%r", has_server_for_mode)
        return not expired and self.routers and has_server_for_mode
855799
private void keepLastUpdatedUnique() {
        Map<String, SingleTokenStats> temp = new HashMap<>();
        this.tokenStats.forEach(candidate -> {
            SingleTokenStats current = temp.get(candidate.tokenUuid);
            if (current == null) {
                temp.put(candidate.tokenUuid, candidate);
            } else {
                int comparison = SingleTokenStats.COMP_BY_LAST_USE_THEN_COUNTER.compare(current, candidate);
                if (comparison < 0) {
                    // candidate was updated more recently (or has a bigger counter in case of perfectly equivalent dates)
                    temp.put(candidate.tokenUuid, candidate);
                }
            }
        });
        
        this.tokenStats = new ArrayList<>(temp.values());
    }
1282515
function userExists(user) {
  if (_.isEmpty(findUser(user, {refresh: true, throwIfNotFound: false}))) {
    return false;
  } else {
    return true;
  }
}
335479
function(persist) {
          /**
          * is Persistant or not
          * @property {boolean} isPersisted Persistant property
          * @memberof AbstractLocalStorage
          */
          this.isPersisted = persist;

          this.myStore = null;
          /**
          * Is storage supported
          * @method isSupported
          * @memberof AbstractLocalStorage
          * @returns {boolean} Returns true if supported
          */
          this.isSupported = function() {
            return (typeof (Storage) !== "undefined");
          };

          // true = localStorage, false = sessionStorage
          if (this.isSupported()) {
            //logger.debug("AUGMENTED: localStorage exists");

            if (this.isPersisted) {
              this.myStore = localStorage;
            } else {
              this.myStore = sessionStorage;
            }
          } else {
            logger.warn("AUGMENTED: No localStorage.");
          }

          /**
          * Gets an item from storage
          * @method getItem
          * @memberof AbstractLocalStorage
          * @param {string} key The key in storage
          * @returns {object} Returns object from storage
          */
          this.getItem = function(itemKey) {
            var item = this.myStore.getItem(itemKey);
            if (item) {
              return JSON.parse(item);
            }
            return null;
          };

          /**
          * Sets an item to storage
          * @method setItem
          * @memberof AbstractLocalStorage
          * @param {string} key The key in storage
          * @param {object} object The data to set
          */
          this.setItem = function(itemKey, object) {
            this.myStore.setItem(itemKey, JSON.stringify(object));
          };

          /**
          * Removes an item from storage
          * @method removeItem
          * @memberof AbstractLocalStorage
          * @param {string} key The key in storage
          */
          this.removeItem = function(itemKey) {
            this.myStore.removeItem(itemKey);
          };

          /**
          * Clears storage - <b>Warning: Destructive in non-namespaced instances!</b>
          * @method clear
          * @memberof AbstractLocalStorage
          */
          this.clear = function() {
            this.myStore.clear();
          };

          /**
          * Gets the key from storage for index
          * @method key
          * @memberof AbstractLocalStorage
          * @param {number} i The index in storage
          * @returns {string} Returns the key from storage
          */
          this.key = function(i) {
            return this.myStore.key(i);
          };

          /**
          * The length of storage by keys
          * @method length
          * @memberof AbstractLocalStorage
          * @returns {number} Returns the length of storage by keys
          */
          this.length = function() {
            return this.myStore.length;
          };
        }
168048
private synchronized boolean shouldRetry(Throwable e) {
    boolean isIOException = e instanceof IOException
      || (e.getCause() != null && e.getCause() instanceof IOException);
    boolean hasRemainingRetries = retryCount < maxRetries;
    return isIOException && hasRemainingRetries;
  }