Check to see if fringe balancing is required following a delete
and do the fringe rebalancing if needed.
358968
private void deleteCheckFringeBalance(
                                         DeleteStack   stack,
                                         GBSNode       endp,
                                         int           endIndex,
                                         int           maxBal)
    {

        int           fDepth = 0;      /* Fringe balance depth                  */

        fDepth = 0;
        if (endp.leftChild() == null)
        {
            fDepth = 1;                /* Last node counts as one               */
            for (int j = endIndex; j > 0; j--)
            {
                GBSNode q = stack.node(j);
                if (q.leftChild() == null)/* Have not found end yet               */
                    fDepth++;
                else                     /* Found the top of the fringe           */
                    break;
            }
        }

        int t0_depth = tZeroDepth();
        int t = t0_depth;
        if (t < 1)
            t = 1;

        if ( (stack.maxDepth() >= t) &&/* Deep enough for a t0 and              */
             (endp.population() == (endp.width()-1))  )/* Last node was full   */
        {
            /* Check for a possible t0 tree          */
            int j = 1;
            if ((kFactor() % 3) == 0)
                j = 2;
            if (fDepth == j)
            {
                _xno++;
                GBSDeleteFringe.singleInstance().balance(
                                                        tZeroDepth(), stack);
            }
        }
        else                          /* Not a t0 fringe                       */
        {
            /* Check for empty node                  */
            if (endp.population() != 0)
                endp.adjustMedian();
            else
            {
                _xno++;
                GBSNode p = stack.node(endIndex);
                if (p.leftChild() == endp)
                    p.setLeftChild(null);
                else
                    p.setRightChild(null);
            }
        }
    }
966680
private void validate() {
        if (isDense() && isPattern())
            throw new IllegalArgumentException(
                    "Matrix cannot be dense with pattern storage");
        if (isReal() && isHermitian())
            throw new IllegalArgumentException(
                    "Data cannot be real with hermitian symmetry");
        if (!isComplex() && isHermitian())
            throw new IllegalArgumentException(
                    "Data must be complex with hermitian symmetry");
        if (isPattern() && isSkewSymmetric())
            throw new IllegalArgumentException(
                    "Storage cannot be pattern and skew symmetrical");
    }
802001
private void addLoadBalancerListener() {
        if (!(lbContext.getLoadBalancer() instanceof BaseLoadBalancer)) {
            return;
        }
        
        ((BaseLoadBalancer) lbContext.getLoadBalancer()).addServerListChangeListener(new ServerListChangeListener() {
            @Override
            public void serverListChanged(List<Server> oldList, List<Server> newList) {
                Set<Server> removedServers = new HashSet<Server>(oldList);
                removedServers.removeAll(newList);
                for (Server server: rxClientCache.keySet()) {
                    if (removedServers.contains(server)) {
                        // this server is no longer in UP status
                        removeClient(server);
                    }
                }
            }
        });
    }
457017
def valid_for_deletion?
      return false if(id.nil? || sync_token.nil?)
      id.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0
    end
280203
boolean sanityCheck(Intrinsic calib ) {
		if(UtilEjml.isUncountable(calib.fx))
			return false;
		if(UtilEjml.isUncountable(calib.fy))
			return false;
		if(UtilEjml.isUncountable(calib.skew))
			return false;

		if( calib.fx < 0 )
			return false;
		if( calib.fy < 0 )
			return false;

		return true;
	}
29106
private void maybeRunValidityCheck(String passName, Node externs, Node root) {
    if (validityCheck == null) {
      return;
    }
    try {
      validityCheck.create(compiler).process(externs, root);
      changeVerifier.checkRecordedChanges(passName, jsRoot);
    } catch (Exception e) {
      throw new IllegalStateException("Validity checks failed for pass: " + passName, e);
    }
  }
1307269
public void check(ReferenceDescriptorDef refDef, String checkLevel) throws ConstraintException
    {
        ensureClassRef(refDef, checkLevel);
        checkProxyPrefetchingLimit(refDef, checkLevel);
    }
423579
def _check_required_settings(batches):
    """"""
    required_settings = [
        'sawtooth.consensus.algorithm.name',
        'sawtooth.consensus.algorithm.version']

    for batch in batches:
        for txn in batch.transactions:
            txn_header = TransactionHeader()
            txn_header.ParseFromString(txn.header)
            if txn_header.family_name == 'sawtooth_settings':
                settings_payload = SettingsPayload()
                settings_payload.ParseFromString(txn.payload)
                if settings_payload.action == SettingsPayload.PROPOSE:
                    proposal = SettingProposal()
                    proposal.ParseFromString(settings_payload.data)
                    if proposal.setting in required_settings:
                        required_settings.remove(proposal.setting)

    if required_settings:
        raise CliException(
            'The following setting(s) are required at genesis, but were not '
            'included in the genesis batches: {}'.format(required_settings))
28972
def clean_inconcs(self):
        
        for item in self.data:
            if (item.inconclusive or item.get_verdict() == "unknown") and not item.retries_left > 0:
                return True
        return False
1158823
@Override
    public void afterConsistencyCheck() throws CouldNotPerformException {
        for (final ENTRY entry : changedEntryList) {
            afterUpdate(entry);
        }
        changedEntryList.clear();
    }
143610
private void validatePendingChanges(ChangesItem changesItem) throws ExceededQuotaLimitException
   {
      long delta = changesItem.getWorkspaceChangedSize() + changesLog.getWorkspaceChangedSize();
      if (delta > 0)
      {
         validatePendingWorkspaceChanges(delta);
         validatePendingRepositoryChanges(delta);
         validatePendingGlobalChanges(delta);
      }

      validatePendingNodesChanges(changesItem.getAllNodesCalculatedChangedSize());
   }
603657
def _need_update(self):
        ''
        if self.currval >= self.next_update or self.finished: return True

        delta = time.time() - self.last_update_time
        return self._time_sensitive and delta > self.poll
157471
private void checkDependencies() {
    if (basedOnDatabase != null) {
      if (!input.isComplete() || basedOnDatabase.get() != input.getInputStep().getDatabase()) {
        // We've become invalidated, notify.
        basedOnDatabase = null;
        firePanelUpdated();
      }
    }
  }
923532
protected boolean checkValid() throws InvalidItemStateException
   {
      try
      {
         session.checkLive();
      }
      catch (RepositoryException e)
      {
         throw new InvalidItemStateException("This kind of operation is forbidden after a session.logout().", e);
      }

      if (data == null)
      {
         throw new InvalidItemStateException("Invalid item state. Item was removed or discarded.");
      }

      session.updateLastAccessTime();
      return true;
   }
1276227
def check_sanity
      @vertices.each_with_index do |v,i|
        raise "Removed vertex in vertex list" unless v.index==i
        v.in_edges.each do |ine|
          raise "Removed edge in vertex incoming edges" if ine.index<0
          raise "Vertex and edge don't agree on target" unless ine.target==v
        end
        v.out_edges.each do |oute|
          raise "Removed edge in vertex outgoing edges" if oute.index<0
          raise "Vertex and edge don't agree on source" unless oute.source==v
        end
      end
      @edges.each_with_index do |e,i|
        raise "Removed edge in edge list" unless e.index==i
        raise "Edge in-connected to a removed vertex" if e.source.index<0
        raise "Edge out-connected to a removed vertex" if e.target.index<0
      end
    end
293030
private void rightDepth(
    DeleteStack.FringeNote      xx,
    int           fbalance)
  {
    switch (fbalance)              /* Original father balance factor        */
    {
      case  1:                     /* Have deleted from right of right-heavy*/
                                   /*  Is now balanced but depth has        */
        xx.depthDecrease = true;   /*  decreased.                           */
        break;
      case  0:                     /* Both sides are t0                     */
        /* G has lost one from whichever side.                              */
        /*   UNLESS lastFringe does an insert fringe re-balancing.          */
        /* In which case it remains balanced and no height change           */
        xx.conditionalDecrease = true;
        xx.conditionalBalance = 0;
        break;
      case -1:                     /* Left side has more than one t0        */
        /* Is now balanced.                                                 */
        /* G has lost one from whichever side.                              */
        /*   UNLESS lastFringe does an insert fringe re-balancing.          */
        /* If true, stack.node(ntop).balance = +1,  G has not lost anything */
        xx.conditionalDecrease = true;
        xx.conditionalBalance = 1;
        break;
      default:
        throw new RuntimeException("Help!  fbalance = " + fbalance);
    }
  }
136364
def is_fringe(self, connections=None):
        """"""
        if connections is None:
            return self.is_fringe(self._incoming) or self.is_fringe(self._outgoing)
        else:
            cons = sum([c for c in connections.values()], [])
            return len([c for c in cons if c._direction != Connection.LINKDIR_TURN]) == 0