Make sure the next objects to be tallied are compatible with the
        stored trace.
429652
def _check_compatibility(self):
        """"""
        stored_descr = self._file_trace_description()
        try:
            for k, v in self._model_trace_description():
                assert(stored_descr[k][0] == v[0])
        except:
            raise ValueError(
                "The objects to tally are incompatible with the objects stored in the file.")
1156478
def should_collect(self, value):
        """"""
        return (
            # decorated with @transition
            isinstance(value, TransitionWrapper)
            # Relates to a compatible transition
            and value.trname in self.workflow.transitions
            # Either not bound to a state field or bound to the current one
            and (not value.field or value.field == self.state_field))
833367
void keepOnlyPositiveCounts() {
    // Starting from the back, find the first empty cell, which marks a boundary between clusters.
    int firstProbe = keys.length - 1;
    while (states[firstProbe] > 0) {
      firstProbe--;
    }

    //Work towards the front; delete any non-positive entries.
    for (int probe = firstProbe; probe-- > 0; ) {
      // When we find the next non-empty cell, we know we are at the high end of a cluster,
      //  which is tracked by firstProbe.
      if ((states[probe] > 0) && (values[probe] <= 0)) {
        hashDelete(probe); //does the work of deletion and moving higher items towards the front.
        numActive--;
      }
    }
    //now work on the first cluster that was skipped.
    for (int probe = keys.length; probe-- > firstProbe;) {
      if ((states[probe] > 0) && (values[probe] <= 0)) {
        hashDelete(probe);
        numActive--;
      }
    }
  }
214241
public void nextRangeMaximumAvailable()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "nextRangeMaximumAvailable");

        synchronized (_globalUniqueLock) 
        {
            _globalUniqueThreshold = _globalUniqueLimit + _midrange;
            _globalUniqueLimit     = _globalUniqueLimit + _range;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "nextRangeMaximumAvailable");
    }
1311612
private void matchInstances(@NonNull ArrayMap<View, TransitionValues> unmatchedStart,
                                @NonNull ArrayMap<View, TransitionValues> unmatchedEnd) {
        for (int i = unmatchedStart.size() - 1; i >= 0; i--) {
            View view = unmatchedStart.keyAt(i);
            if (view != null && isValidTarget(view)) {
                TransitionValues end = unmatchedEnd.remove(view);
                if (end != null && isValidTarget(end.view)) {
                    TransitionValues start = unmatchedStart.removeAt(i);
                    mStartValuesList.add(start);
                    mEndValuesList.add(end);
                }
            }
        }
    }
1303491
public static List<Invocation> findMatchingChunk(List<Invocation> invocations, MatchableInvocation wanted, int wantedCount, InOrderContext context) {
        List<Invocation> unverified = removeVerifiedInOrder(invocations, context);
        List<Invocation> firstChunk = getFirstMatchingChunk(wanted, unverified);

        if (wantedCount != firstChunk.size()) {
            return findAllMatchingUnverifiedChunks(invocations, wanted, context);
        } else {
            return firstChunk;
        }
    }
19020
def trace(self, item):
        """"""
        if DEVELOP:
            item.debugActions = (
                None,  # no start action
                self._trace_success_action,
                self._trace_exc_action,
            )
            item.debug = True
        return item
1200945
private void associateToDetected( List<CombinedTrack<TD>> known ) {
		// initialize data structures
		detectedDesc.reset();
		knownDesc.reset();

		// create a list of detected feature descriptions
		int N = detector.getNumberOfFeatures();
		for( int i = 0; i < N; i++ ) {
			detectedDesc.add(detector.getDescription(i));
		}

		// create a list of previously created track descriptions
		for( CombinedTrack<TD> t : known ) {
			knownDesc.add(t.desc);
		}

		// associate features
		associate.setSource(knownDesc);
		associate.setDestination(detectedDesc);
		associate.associate();

		N = Math.max(known.size(),detector.getNumberOfFeatures());
		if( associated.length < N )
			associated = new boolean[N];
	}
1260471
private void ensureSorted() {
    if (sorted) {
      return;
    }

    ensureCapacity();

    DataUtils.sort(byBlockHash);
    for (int i = 0; i < size; i++) {
      resourceIdsIndex[i] = i;
    }
    DataUtils.sort(byResourceId);

    sorted = true;
  }
1352647
def settrace(self, do_set):
        """"""
        if do_set:
            sys.settrace(self.trace_dispatch)
        else:
            sys.settrace(None)
307358
private synchronized void ensureNonPatternSetsReady() {
        if (!areNonPatternSetsReady) {
            includePatterns = fillNonPatternSet(includeNonPatterns, includes);
            excludePatterns = fillNonPatternSet(excludeNonPatterns, excludes);
            areNonPatternSetsReady = true;
        }
    }
1171287
def must_be_same(self, klass):
        
        if isinstance(self, klass) or klass is Entry:
            return
        raise TypeError("Tried to lookup %s '%s' as a %s." %\
              (self.__class__.__name__, self.get_internal_path(), klass.__name__))
489072
def ensure(self, collection):
        ''' 
        '''
        components = []
        for c in self.components:
            if isinstance(c[0], Field):
                c = (c[0].db_field, c[1])
            components.append(c)

        extras = {}
        if self.__min is not None:
            extras['min'] = self.__min
        if self.__max is not None:
            extras['max'] = self.__max
        if self.__bucket_size is not None:
            extras['bucket_size'] = self.__bucket_size
        if self.__expire_after is not None:
            extras['expireAfterSeconds'] = self.__expire_after

        collection.ensure_index(components, unique=self.__unique,
            drop_dups=self.__drop_dups, **extras)
        return self
811155
function ensureMap(set) {
            if (!set['[[SetData]]']) {
              var m = set['[[SetData]]'] = new collectionShims.Map();
              Object.keys(set._storage).forEach(function(k) {
                // fast check for leading '$'
                if (k.charCodeAt(0) === 36) {
                  k = k.substring(1);
                } else {
                  k = +k;
                }
                m.set(k, k);
              });
              set._storage = null; // free old backing storage
            }
          }
1224776
private void makeIncoming() {
        if (stays == null && move == null) {
            for (BitSet in : ins) {
                in.clear();
            }
            stays = new BitSet();
            move = new BitSet();
            for (int i = 0; i < hosts.length; i++) {
                if (hosts[i] != null && hosts[i].isInstantiated()) {
                    int newPos = hosts[i].getValue();
                    if (oldPos[i] != -1 && newPos != oldPos[i]) {
                        //The VM has move
                        ins[newPos].set(i);
                        move.set(i);
                    } else if (newPos == oldPos[i]) {
                        stays.set(i);
                    }
                }
            }
        }
    }
545347
private void waitForNextRecord(long startingTime, long timestamp) {
        if(mFirstTimestamp == 0) {
            mFirstTimestamp = timestamp;
            Log.d(TAG, "Storing " + timestamp + " as the first " +
                    "timestamp of the trace file");
        }
        long targetTime = startingTime + (timestamp - mFirstTimestamp);
        long sleepDuration = Math.max(targetTime - System.currentTimeMillis(), 0);
        try {
            Thread.sleep(sleepDuration);
        } catch(InterruptedException e) {}
    }
1104256
def ensure_list(value: Union[T, Sequence[T]]) -> Sequence[T]:
    """"""
    if value is None:
        return []
    return value if isinstance(value, list) else [value]