for test only!!!
191411
protected boolean delete(@NotNull ByteIterable key, @Nullable ByteIterable value) {
        if (deleteImpl(key, value)) {
            TreeCursorMutable.notifyCursors(this);
            return true;
        }
        return false;
    }
1040421
double qobs(int dummy, double[] xt) {
        int x = (int) (xt[0]);
        double p = Math.random();
        double[] distr = accumP[x];
        int i, left = 0, right = distr.length - 1;
        // Find and return least i s.t. p <= distr[i]
        while (left <= right) {
            // Here distr[left-1] <= p <= distr[right+1]
            i = (left + right) / 2;
            if (p < distr[i]) {
                right = i - 1;
            } else if (distr[i] < p) {
                left = i + 1;
            } else {
                return i;
            }
        }
        // Now p <= distr[left]
        return left;
    }
366325
function (testObj) {
        var duration = PFT.convertMsToHumanReadable(new Date().getTime() - testObj.startTime);
        testObj.duration = duration;
        var suite = "";
        if (testObj.suite) {
            if (testObj.suite.name) {
                suite = testObj.suite.name + " - ";
            }
        }
        var msg = "Completed: '" + suite + testObj.name + "' in " + duration + " with " + testObj.passes + " passes, " +
            testObj.failures.length + " failures, " + testObj.errors.length + " errors.";
        PFT.logger.log(PFT.logger.TEST, msg);
        PFT.tester.onTestCompleted({ test: testObj });
        try {
            testObj.page.close();
        } catch (e) {
            PFT.warn(e);
        }
        PFT.tester.remainingCount--;
        PFT.tester.exitIfDoneTesting();
    }
622806
def only_passed_and_wait(result):
    """"""
    verdict = result.get("verdict", "").strip().lower()
    if verdict in Verdicts.PASS + Verdicts.WAIT:
        return result
    return None
24870
public static void main(String[] args) {
        /*
         * Developers Notes:
         *
         * -No corresponding Junit test class currently
         * provided.  Test by eyeball of the output.
         *
         * -Add a menu with Help(About)
         * --> TBD.
         *
         * -Figure out some sane way to set initial default
         * column sizes.
         *
         * -Lots of inner classes here, done in order to keep
         * all the .class files easily identifiable.  Some of
         * this code is pretty ugly, very procedural in nature.
         * Lots of very tight coupling between all the classes,
         * thinly disguised switch statements, etc ..... This
         * code written on the fly, with almost no thought given
         * to OO design.
         *
         * -Also, I'm not really a GUI guy, so forgive any
         * transgressions.
         *
         */
            if ( args.length < 1 ) {
                System.err.println("File name is required!");
                usage();
                System.exit(1);
            }
        /*
         * Instantiate a DateTimeBrowser and invoke it's go method,
         * passing the input argument list.
         */
        new DateTimeBrowser().go( args );
    }
1263095
function(searchterms, excluded, terms, titleterms) {
    var docnames = this._index.docnames;
    var filenames = this._index.filenames;
    var titles = this._index.titles;

    var i, j, file;
    var fileMap = {};
    var scoreMap = {};
    var results = [];

    // perform the search on the required terms
    for (i = 0; i < searchterms.length; i++) {
      var word = searchterms[i];
      var files = [];
      var _o = [
        {files: terms[word], score: Scorer.term},
        {files: titleterms[word], score: Scorer.title}
      ];

      // no match but word was a required one
      if ($u.every(_o, function(o){return o.files === undefined;})) {
        break;
      }
      // found search word in contents
      $u.each(_o, function(o) {
        var _files = o.files;
        if (_files === undefined)
          return

        if (_files.length === undefined)
          _files = [_files];
        files = files.concat(_files);

        // set score for the word in each file to Scorer.term
        for (j = 0; j < _files.length; j++) {
          file = _files[j];
          if (!(file in scoreMap))
            scoreMap[file] = {}
          scoreMap[file][word] = o.score;
        }
      });

      // create the mapping
      for (j = 0; j < files.length; j++) {
        file = files[j];
        if (file in fileMap)
          fileMap[file].push(word);
        else
          fileMap[file] = [word];
      }
    }

    // now check if the files don't contain excluded terms
    for (file in fileMap) {
      var valid = true;

      // check if all requirements are matched
      if (fileMap[file].length != searchterms.length)
          continue;

      // ensure that none of the excluded terms is in the search result
      for (i = 0; i < excluded.length; i++) {
        if (terms[excluded[i]] == file ||
            titleterms[excluded[i]] == file ||
            $u.contains(terms[excluded[i]] || [], file) ||
            $u.contains(titleterms[excluded[i]] || [], file)) {
          valid = false;
          break;
        }
      }

      // if we have still a valid result we can add it to the result list
      if (valid) {
        // select one (max) score for the file.
        // for better ranking, we should calculate ranking by using words statistics like basic tf-idf...
        var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]}));
        results.push([docnames[file], titles[file], '', null, score, filenames[file]]);
      }
    }
    return results;
  }
539606
def dependency_failed(test, results):
        """"""
        for d in (NoseDepUtils.test_name(i) for i in dependencies[test]):
            if results.get(d) and results.get(d) != 'passed':
                return "Required test '{}' {}".format(d, results.get(d).upper())
        return None
341406
public final void sample()
  {
    long sum = _sum.getAndSet(0);
    int count = _count.getAndSet(0);

    if (count != 0)
      _value =sum / (double) count;
    else
      _value = 0;
  }
360134
function( /* result, actual, expected, message */ ) {
		var assert = this,
			currentTest = ( assert instanceof Assert && assert.test ) || QUnit.config.current;

		// Backwards compatibility fix.
		// Allows the direct use of global exported assertions and QUnit.assert.*
		// Although, it's use is not recommended as it can leak assertions
		// to other tests from async tests, because we only get a reference to the current test,
		// not exactly the test where assertion were intended to be called.
		if ( !currentTest ) {
			throw new Error( "assertion outside test context, in " + sourceFromStacktrace( 2 ) );
		}

		if ( currentTest.usedAsync === true && currentTest.semaphore === 0 ) {
			currentTest.pushFailure( "Assertion after the final `assert.async` was resolved",
				sourceFromStacktrace( 2 ) );

			// Allow this assertion to continue running anyway...
		}

		if ( !( assert instanceof Assert ) ) {
			assert = currentTest.assert;
		}
		return assert.test.push.apply( assert.test, arguments );
	}
638889
public static void main(String[] args) {
		final int trials = 10000;
		final int maxLength = 10000;

		Random rnd = new Random();
		final int seed = rnd.nextInt();

		System.out.print("Test correctness... ");
		rnd = new Random(seed);
		for (int i = 0; i < trials; i++) {
			int[] x = new int[rnd.nextInt(maxLength)];
			for (int j = 0; j < x.length; j++)
				x[j] = rnd.nextInt(Integer.MAX_VALUE);

			int size1 = 0;
			for (int j = 0; j < x.length; j++)
				size1 += Integer.bitCount(x[j]);
			int size2 = count(x);

			if (size1 != size2) {
				System.out.println("i = " + i);
				System.out.println("ERRORE!");
				System.out.println(size1 + ", " + size2);
				for (int j = 0; j < x.length; j++)
					System.out.format("x[%d] = %d --> %d\n", j, x[j], Integer.bitCount(x[j]));
				return;
			}
		}
		System.out.println("done!");

		System.out.print("Test correctness II... ");
		rnd = new Random(seed);
		for (int i = 0; i < trials; i++) {
			int[] x = new int[rnd.nextInt(maxLength << 1)];
			for (int j = 1; j < x.length; j += 2)
				x[j] = rnd.nextInt(Integer.MAX_VALUE);

			int size1 = 0;
			for (int j = 1; j < x.length; j += 2)
				size1 += Integer.bitCount(x[j]);
			int size2 = count_2(x);

			if (size1 != size2) {
				System.out.println("i = " + i);
				System.out.println("ERRORE!");
				System.out.println(size1 + ", " + size2);
				for (int j = 1; j < x.length; j += 2)
					System.out.format("x[%d] = %d --> %d\n", j, x[j], Integer.bitCount(x[j]));
				return;
			}
		}
		System.out.println("done!");

		System.out.print("Test time count(): ");
		rnd = new Random(seed);
		long t = System.currentTimeMillis();
		for (int i = 0; i < trials; i++) {
			int[] x = new int[rnd.nextInt(maxLength)];
			for (int j = 0; j < x.length; j++)
				x[j] = rnd.nextInt(Integer.MAX_VALUE);

			@SuppressWarnings("unused")
			int size = 0;
			for (int j = 0; j < x.length; j++)
				size += Integer.bitCount(x[j]);
		}
		System.out.println(System.currentTimeMillis() - t);

		System.out.print("Test time BitCount.count():   ");
		rnd = new Random(seed);
		t = System.currentTimeMillis();
		for (int i = 0; i < trials; i++) {
			int[] x = new int[rnd.nextInt(maxLength)];
			for (int j = 0; j < x.length; j++)
				x[j] = rnd.nextInt(Integer.MAX_VALUE);
			count(x);
		}
		System.out.println(System.currentTimeMillis() - t);

		System.out.print("Test II time count(): ");
		rnd = new Random(seed);
		t = System.currentTimeMillis();
		for (int i = 0; i < trials; i++) {
			int[] x = new int[rnd.nextInt(maxLength << 1)];
			for (int j = 1; j < x.length; j += 2)
				x[j] = rnd.nextInt(Integer.MAX_VALUE);

			@SuppressWarnings("unused")
			int size = 0;
			for (int j = 1; j < x.length; j += 2)
				size += Integer.bitCount(x[j]);
		}
		System.out.println(System.currentTimeMillis() - t);

		System.out.print("Test II time BitCount.count():   ");
		rnd = new Random(seed);
		t = System.currentTimeMillis();
		for (int i = 0; i < trials; i++) {
			int[] x = new int[rnd.nextInt(maxLength << 1)];
			for (int j = 1; j < x.length; j += 2)
				x[j] = rnd.nextInt(Integer.MAX_VALUE);
			count_2(x);
		}
		System.out.println(System.currentTimeMillis() - t);
	}
233660
function(onCalibrated) {
      for (var i = 0; i < Test.CALIBRATIONS.length; i++) {
        var cal = Test.CALIBRATIONS[i];
        if (cal.running) return true;
        if (!cal.count) {
          cal.isCalibration = true;
          cal.onStop = onCalibrated;
          //cal.MIN_TIME = .1; // Do calibrations quickly
          cal.run(2e4);
          return true;
        }
      }
      return false;
    }
1280625
public static void main(String[] args) {
		System.out.println("Test of GoldenSectionSearch Class.\n");

		// Test 1
		System.out.println("1. Find minimum of f(x) = (x - 0.656) * (x - 0.656):");

		GoldenSectionSearch search = new GoldenSectionSearch(-1.0, 5.0);
		while(search.getAccuracy() > 1E-11 && !search.isDone()) {
			double x = search.getNextPoint();

			double y = (x - 0.656) * (x - 0.656);

			search.setValue(y);
		}

		System.out.println("Result....: " + search.getBestPoint());
		System.out.println("Solution..: 0.656");
		System.out.println("Iterations: " + search.getNumberOfIterations() + "\n");

		// Test 2
		System.out.println("2. Find minimum of f(x) = cos(x) on [0.0,6.0]:");

		GoldenSectionSearch search2 = new GoldenSectionSearch(0.0, 6.0);
		while(search2.getAccuracy() > 1E-11 && !search2.isDone()) {
			double x = search2.getNextPoint();

			double y = Math.cos(x);

			search2.setValue(y);
		}

		System.out.println("Result....: " + search2.getBestPoint());
		System.out.println("Solution..: " + Math.PI + " (Pi)");
		System.out.println("Iterations: " + search2.getNumberOfIterations() + "\n");
	}
293199
boolean scanIsEmpty() {
		// This 'slow' implementation is still faster than any external one
		// could be
		// (e.g.: (bitSet.length() == 0 || bitSet.nextSetBit(0) == -1))
		// especially for small BitSets
		// Depends on the ghost bits being clear!
		final int count = numWords;

		for (int i = 0; i < count; i++) {
			if (bits[i] != 0)
				return false;
		}

		return true;
	}
763103
function() {
      console.log('start : init test : ' + bench.initFcts.length);
      for (let i = 0; i < bench.initFcts.length; i++) {
        console.log(
          'initializing test data ' + (i + 1) + '/' + bench.initFcts.length
        );
        if (bench.initFcts[i]) {
          bench.initFcts[i].call(this, bench.CONN.MARIADB.drv);
        }
      }
      this.currentNb = 0;
      console.log('initializing test data done');
    }
999007
def cmp_out(test)
      test.out_result = FileUtils.cmp(test.expected_out_path, 
                                      test.result_out_path)
    end
459956
def main(): # mini/unit test
    
    options = optionsParser().parse_args()
    params = getSelectionParams(options)
    if options.list or options.details:
        specifiedMaps = filterMapNames(
            options.mapname,
            records = filterMapAttrs(**params),
            excludeRegex=options.exclude,
            closestMatch=options.best
        )
        if specifiedMaps:
            for v in specifiedMaps:
                if options.details: v.display()
                else:               print(v)
            print("Found %d maps that match given criteria."%(len(specifiedMaps)))
        else:
            print("No matching maps found.")
    else:
        try:
            specifiedMaps = selectMap(
                options.mapname,
                excludeName =options.exclude,
                closestMatch=options.best,
                **params)
        except Exception as e:
            specifiedMaps = []
            print("No matching maps found: %s"%e)
        if not isinstance(specifiedMaps, list):
            specifiedMaps = [specifiedMaps]
        for m in specifiedMaps:
            if options.path:    print(m.path)
            else:               print(m.name)
417773
private Map<String, Integer> runSampling(
            final ProctorContext proctorContext,
            final Set<String> targetTestNames,
            final TestType testType,
            final int determinationsToRun
    ) {
        final Set<String> targetTestGroups = getTargetTestGroups(targetTestNames);
        final Map<String, Integer> testGroupToOccurrences = Maps.newTreeMap();
        for (final String testGroup : targetTestGroups) {
            testGroupToOccurrences.put(testGroup, 0);
        }

        for (int i = 0; i < determinationsToRun; ++i) {
            final Identifiers identifiers = TestType.RANDOM.equals(testType)
                    ? new Identifiers(Collections.<TestType, String>emptyMap(), /* randomEnabled */ true)
                    : Identifiers.of(testType, Long.toString(random.nextLong()));
            final AbstractGroups groups = supplier.getRandomGroups(proctorContext, identifiers);
            for (final Entry<String, TestBucket> e : groups.getProctorResult().getBuckets().entrySet()) {
                final String testName = e.getKey();
                if (targetTestNames.contains(testName)) {
                    final int group = e.getValue().getValue();
                    final String testGroup = testName + group;
                    testGroupToOccurrences.put(testGroup, testGroupToOccurrences.get(testGroup) + 1);
                }
            }
        }

        return testGroupToOccurrences;
    }