we unwound a previous extension in the decision path
776803
private float unwoundPathSum(final PathPointer unique_path, int unique_depth,
                               int path_index) {
    final float one_fraction = unique_path.get(path_index).one_fraction;
    final float zero_fraction = unique_path.get(path_index).zero_fraction;
    float next_one_portion = unique_path.get(unique_depth).pweight;
    float total = 0;
    for (int i = unique_depth - 1; i >= 0; --i) {
      if (one_fraction != 0) {
        final float tmp = next_one_portion * (unique_depth + 1)
                / ((i + 1) * one_fraction);
        total += tmp;
        next_one_portion = unique_path.get(i).pweight - tmp * zero_fraction * ((unique_depth - i)
                / (float)(unique_depth + 1));
      } else if (zero_fraction != 0) {
        total += (unique_path.get(i).pweight / zero_fraction) / ((unique_depth - i)
                / (float)(unique_depth + 1));
      } else {
        if (unique_path.get(i).pweight != 0)
          throw new IllegalStateException("Unique path " + i + " must have zero getWeight");
      }
    }
    return total;
  }
490039
def _fixpath(self, p):
        """"""
        return os.path.abspath(os.path.expanduser(p))
661693
@Override
    public DecisionType combine(DecisionType op1, DecisionType op2) {
        if (op1 == DecisionType.Deny || op2 == DecisionType.Deny) {
            return DecisionType.Deny;
        } else {
            return DecisionType.Permit;
        }
    }
694531
public boolean remove(ExtendedPropositionDefinition def) {
        if (def instanceof TemporalExtendedPropositionDefinition) {
            if (removeAllRelations((TemporalExtendedPropositionDefinition) def)) {
                return true;
            } else {
                return false;
            }
        }
        boolean result = defs.remove(def);
        if (result) {
            recalculateChildren();
            this.defsAsListOutdated = true;
        }
        return result;
    }
641262
function unpointcut(clazz, opts, advisor, iClass, iInstance, bindTo) {
    var constructor, re, keys, fn, c;

    function doRestore(collection, advisor) {
      var c, key, iConstructor, iStatic, fn;

      for (c in collection) {
        key          = c/1 == c ? collection[c] : c;
        iConstructor = (key === "constructor");
        iStatic      = iClass && clazz[key];

        if (key === "constructor" && iClass) {
          constructor = restore(iClass, advisor);;
        } else {
          if (clazz[key]) {
            clazz[key] = restore(clazz[key], advisor);
          }
          if (bindTo[key]) {
            bindTo[key] = restore(bindTo[key], advisor);
          }
        }
      }
    }

    if (opts === "remove") {
      if ( !advisor) {                                                         // type 1: "remove"
        constructor = iClass && (clazz === clazz[WRAPPER]) && clazz[ORIGIN];
        for (var name in bindTo) {
          bindTo[name] = restore(bindTo[name]) || bindTo[name];
        }
        for (var name in clazz) {
          clazz[name] = restore(clazz[name]) || clazz[name];
        }
      } else {                                                                 // type 2: "remove", advisor
        doRestore(advisor, advisor);
      }
    } else if ((re = /^remove /.exec(opts)) !== null) {                        // type 3: "remove contructor foo"
      keys = opts.replace(re, "").split(" ");
      doRestore(keys);
    } else {
      throw "Invalid params";
    }
    return constructor || clazz;
  }
858045
def feature_path_unset(self):
        """"""
        if not self.feature_file:
            raise IOError('No feature file to unset')

        with open(self.feature_path) as handle:
            feats = list(GFF.parse(handle))
            if len(feats) > 1:
                log.warning('Too many sequences in GFF')
            else:
                tmp = feats[0].features

        self.feature_dir = None
        self.feature_file = None
        self.features = tmp
127265
void advance(SimpleDependencyPath path) {
        if (path.length() >= maxPathLength)
            return;

        // Get the last node and last relation to decide how to expand.
        DependencyRelation lastRelation = path.lastRelation();
        DependencyTreeNode last = path.last(); 
        
        // Expand all of the possible relations from the last node, creating a
        // new path for each, except if the relation is the one that generated
        // this path.
        for (DependencyRelation rel : last.neighbors()) {
            // Skip re-adding the current relation
            if (lastRelation.equals(rel) || !acceptor.accept(rel))
                continue;
            SimpleDependencyPath extended = path.extend(rel);
            frontier.offer(extended);
        }
    }
1244301
private static Set<String> mergeDecision(final LdapAttribute ldapConsent, final ConsentDecision decision) {
        if (decision.getId() < 0) {
            decision.setId(System.currentTimeMillis());
        }

        if (ldapConsent != null) {
            val result = removeDecision(ldapConsent, decision.getId());
            val json = mapToJson(decision);
            if (StringUtils.isBlank(json)) {
                throw new IllegalArgumentException("Could not map consent decision to JSON");
            }
            result.add(json);
            LOGGER.debug("Merged consent decision [{}] with LDAP attribute [{}]", decision, ldapConsent.getName());
            return CollectionUtils.wrap(result);
        }
        val result = new HashSet<String>();
        val json = mapToJson(decision);
        if (StringUtils.isBlank(json)) {
            throw new IllegalArgumentException("Could not map consent decision to JSON");
        }
        result.add(json);
        return result;
    }
1298069
private void backward(final CLClause c, final int ignore) {
        int minlit = 0;
        int minoccs = Integer.MAX_VALUE;
        int litoccs;
        this.stats.steps++;
        for (int i = 0; i < c.lits().size(); i++) {
            final int lit = c.lits().get(i);
            if (lit == ignore) { continue; }
            if (val(lit) < 0) { continue; }
            litoccs = occs(lit).count();
            if (minlit != 0 && minoccs >= litoccs) { continue; }
            minlit = lit;
            minoccs = litoccs;
        }
        if (minoccs >= this.config.bwocclim) { return; }
        assert minlit != 0;
        for (int i = 0; i < c.lits().size(); i++) { mark(c.lits().get(i)); }
        final CLOccs os = occs(minlit);
        for (final CLClause d : os) {
            if (d == c) { continue; }
            int lit;
            int count = this.seen.size();
            int negated = 0;
            this.stats.steps++;
            for (int p = 0; count != 0 && p < d.lits().size(); p++) {
                lit = d.lits().get(p);
                final int m = marked(lit);
                if (m == 0) { continue; }
                assert count > 0;
                count--;
                if (m > 0) { continue; }
                assert m < 0;
                if (negated != 0) {
                    count = Integer.MAX_VALUE;
                    break;
                }
                negated = lit;
            }
            if (count != 0) { continue; }
            if (negated != 0) {
                this.tostrengthen.push(new Pair<>(d, negated));
                this.stats.backwardStrengthened++;
            } else {
                this.stats.backwardSubsumed++;
                dumpClause(d);
            }
        }
        unmark();
    }
863197
public void do_not_split( ) {
      if( _pid == NO_PARENT) return; // skip root
      DecidedNode dn = _tree.decided(_pid);
      for( int i=0; i<dn._nids.length; i++ )
        if( dn._nids[i]==_nid )
          { dn._nids[i] = ScoreBuildHistogram.UNDECIDED_CHILD_NODE_ID; return; }
      throw H2O.fail();
    }
89269
private void removeDataPullUpperBounds() {
    log.info("Removing data pull upper bound for last work unit");
    Iterator<Predicate> it = predicateList.iterator();
    while (it.hasNext()) {
      Predicate predicate = it.next();
      if (predicate.getType() == Predicate.PredicateType.HWM) {
        log.info("Remove predicate: " + predicate.condition);
        it.remove();
      }
    }
  }
493078
private static long addUnsignedReturnOverflow(Slice left, Slice right, Slice result, boolean resultNegative)
    {
        // TODO: consider two 7 bytes operations
        int l0 = getInt(left, 0);
        int l1 = getInt(left, 1);
        int l2 = getInt(left, 2);
        int l3 = getInt(left, 3);

        int r0 = getInt(right, 0);
        int r1 = getInt(right, 1);
        int r2 = getInt(right, 2);
        int r3 = getInt(right, 3);

        long intermediateResult;
        intermediateResult = (l0 & LONG_MASK) + (r0 & LONG_MASK);

        int z0 = (int) intermediateResult;

        intermediateResult = (l1 & LONG_MASK) + (r1 & LONG_MASK) + (intermediateResult >>> 32);

        int z1 = (int) intermediateResult;

        intermediateResult = (l2 & LONG_MASK) + (r2 & LONG_MASK) + (intermediateResult >>> 32);

        int z2 = (int) intermediateResult;

        intermediateResult = (l3 & LONG_MASK) + (r3 & LONG_MASK) + (intermediateResult >>> 32);

        int z3 = (int) intermediateResult & (~SIGN_INT_MASK);

        pack(result, z0, z1, z2, z3, resultNegative);

        return intermediateResult >> 31;
    }
671318
synchronized void checkLeases() {
    int numPathsChecked = 0;
    for(; sortedLeases.size() > 0; ) {
      final Lease oldest = sortedLeases.first();
      if (!oldest.expiredHardLimit()) {
        return;
      }
      
      // internalReleaseLease() removes paths corresponding to empty files,
      // i.e. it needs to modify the collection being iterated over
      // causing ConcurrentModificationException
      String[] leasePaths = new String[oldest.getPaths().size()];
      oldest.getPaths().toArray(leasePaths);
      LOG.info("Lease " + oldest
          + " has expired hard limit. Recovering lease for paths: "
          + Arrays.toString(leasePaths));
      for(String p : leasePaths) {
        if (++numPathsChecked > this.maxPathsPerCheck) {
          return;
        }
        try {
          fsnamesystem.getFSNamesystemMetrics().numLeaseRecoveries.inc();
          fsnamesystem.internalReleaseLeaseOne(
              oldest, p, this.discardLastBlockIfNoSync);
        } catch (IOException e) {
          LOG.error("Cannot release the path "+p+" in the lease "+oldest, e);
          removeLease(oldest, p);
          fsnamesystem.getFSNamesystemMetrics().numLeaseManagerMonitorExceptions.inc();
        }
      }
    }
  }
791799
def fixed(self):
        
        decision = False
        for record in self.history:
            # Completely ignore older changes
            if record["when"] < self.options.since.date:
                continue
            # Look for status change to MODIFIED (unless already found)
            if not decision and record["when"] < self.options.until.date:
                for change in record["changes"]:
                    if (change["field_name"] == "status"
                            and change["added"] == "MODIFIED"
                            and change["removed"] != "CLOSED"):
                        decision = True
            # Make sure that the bug has not been later moved to ASSIGNED.
            # (This would mean the issue has not been fixed properly.)
            else:
                for change in record["changes"]:
                    if (change["field_name"] == "status"
                            and change["added"] == "ASSIGNED"):
                        decision = False
        return decision
1297800
private void checkPathfinderChanges()
    {
        if (pathFoundChanged)
        {
            if (currentStep < getMaxStep())
            {
                removeObjectId(path.getX(currentStep), path.getY(currentStep));
            }
            if (path != null)
            {
                path.clear();
            }
            path = pathfinder.findPath(this, destX, destY, false);
            pathFoundChanged = false;
            currentStep = 0;
            skip = false;
            reCheckRef = false;

            if (path == null)
            {
                pathStoppedRequested = true;
            }
        }
        if (pathStoppedRequested)
        {
            pathStopped = true;
            pathStoppedRequested = false;
            onArrived();
        }
    }
186050
private boolean discardDone(INodeFileUnderConstruction pendingFile,
                              String src) throws IOException {
    Block[] blocks = pendingFile.getBlocks();
    if (blocks == null || blocks.length == 0) {
      return false;
    }
    Block last = blocks[blocks.length-1];
    if (last.getNumBytes() == 0) {
      dir.removeBlock(src, pendingFile, last);
      finalizeINodeFileUnderConstruction(src, pendingFile);
      NameNode.stateChangeLog.warn("BLOCK*" +
          " internalReleaseLease: discarded last block " + last +
          " , lease removed for " +  src);
      return true;
    }
    return false;
  }
582270
private <S, E1, E2> GraphTraversal<S, E2> choose(
            GraphTraversal<S, E1> traversal, GraphTraversal<E1, ?> traversalPredicate,
            GraphTraversal<E1, ? extends E2> trueChoice, GraphTraversal<E1, ? extends E2> falseChoice) {

        // This is safe. The generics for `GraphTraversal#choose` are more restrictive than necessary
        //noinspection unchecked
        return traversal.choose(
                traversalPredicate, (GraphTraversal<S, E2>) trueChoice, (GraphTraversal<S, E2>) falseChoice);
    }