exposed for testing
320394
int probe(Object element)
    {
        int index = this.spread(element);

        int removedIndex = -1;
        if (ObjectBooleanHashMap.isRemovedKey(this.keys[index]))
        {
            removedIndex = index;
        }

        else if (this.keys[index] == null || ObjectBooleanHashMap.nullSafeEquals(this.toNonSentinel(this.keys[index]), element))
        {
            return index;
        }

        int nextIndex = index;
        int probe = 17;

        // loop until an empty slot is reached
        while (true)
        {
            // Probe algorithm: 17*n*(n+1)/2 where n = no. of collisions
            nextIndex += probe;
            probe += 17;
            nextIndex &= this.keys.length - 1;

            if (ObjectBooleanHashMap.isRemovedKey(this.keys[nextIndex]))
            {
                if (removedIndex == -1)
                {
                    removedIndex = nextIndex;
                }
            }
            else if (ObjectBooleanHashMap.nullSafeEquals(this.toNonSentinel(this.keys[nextIndex]), element))
            {
                return nextIndex;
            }
            else if (this.keys[nextIndex] == null)
            {
                return removedIndex == -1 ? nextIndex : removedIndex;
            }
        }
    }
927501
def run():
    

    print('Python ' + sys.version.replace('\n', ''))

    try:
        oscrypto_tests_module_info = imp.find_module('tests', [os.path.join(build_root, 'oscrypto')])
        oscrypto_tests = imp.load_module('oscrypto.tests', *oscrypto_tests_module_info)
        oscrypto = oscrypto_tests.local_oscrypto()
        print('\noscrypto backend: %s' % oscrypto.backend())
    except (ImportError):
        pass

    if run_lint:
        print('')
        lint_result = run_lint()
    else:
        lint_result = True

    if run_coverage:
        print('\nRunning tests (via coverage.py)')
        sys.stdout.flush()
        tests_result = run_coverage(ci=True)
    else:
        print('\nRunning tests')
        sys.stdout.flush()
        tests_result = run_tests()
    sys.stdout.flush()

    return lint_result and tests_result
250726
function() {
            var assert = this;

            // 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 ( !QUnit.config.current ) {
                throw new Error( "assertion outside test context, in " + sourceFromStacktrace( 2 ) );
            }
            if ( !( assert instanceof Assert ) ) {
                assert = QUnit.config.current.assert;
            }
            return assert.test.push.apply( assert.test, arguments );
        }
148467
function (test) {
    var ret = []
    for (var n = 0; n < batchTest.length; n++) {
      if (batchTest[n] === test) continue
      ret.push(batchTest[n])
    }
    batchTest = ret
  }
839247
def guard(ctx, opts=""):
    
    # TODO if coverage was run via pytest-cov, we could add coverage here too
    return test(ctx, include_slow=True, loop_on_fail=True, opts=opts)
719892
function(name, f) {
      // Create the Test object
      var test = new Test(name, f);
      JSLitmus._tests.push(test);

      // Re-render if the test state changes
      test.onChange = JSLitmus.renderTest;

      // Run the next test if this one finished
      test.onStop = function(test) {
        if (JSLitmus.onTestFinish) JSLitmus.onTestFinish(test);
        JSLitmus.currentTest = null;
        JSLitmus._nextTest();
      };

      // Render the new test
      this.renderTest(test);
    }
338039
def show_coverage
      unless @project.nil?
        line = "## Code coverage\n"
        line << total_coverage_markdown
        line << modified_files_coverage_table
        line << '> Powered by [Slather](https://github.com/SlatherOrg/slather)'
        markdown line
      end
    end
1316317
def TEST(fname):
    
    #fname = os.path.join(os.getcwd(), '..','..',  # os.path.join(os.path.getcwd(), '
    m = MapObject(fname, os.path.join(os.getcwd(), 'img_prog_results'))
    m.add_layer(ImagePathFollow('border'))
    m.add_layer(ImagePathFollow('river'))
    m.add_layer(ImagePathFollow('road'))
    
    m.add_layer(ImageArea('sea', col='Blue', density='light'))
    m.add_layer(ImageArea('desert', col='Yellow', density='med'))
    m.add_layer(ImageArea('forest', col='Drak Green', density='light'))
    m.add_layer(ImageArea('fields', col='Green', density='light'))
    
    m.add_layer(ImageObject('mountains'))
    m.add_layer(ImageObject('trees'))
    m.add_layer(ImageObject('towns'))
1092082
def SecurityCheck(self, func, request, *args, **kwargs):
    """"""
    request.user = self.username
    request.token = access_control.ACLToken(
        username="Testing", reason="Just a test")
    return func(request, *args, **kwargs)
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 );
	}
1133215
def cover(session):
    
    session.interpreter = 'python3.6'
    session.install('coverage', 'pytest-cov')
    session.run('coverage', 'report', '--show-missing', '--fail-under=100')
    session.run('coverage', 'erase')
543110
public static void assertAccessibility(String htmlString, Testable testable) {
        assertThat(htmlString, is(compliantTo(testable)));
    }
1148869
function isGonnaBeLegen() {
        current = shift.call(queue);
        if (current) {
            if (typeof current == "function") {
                current = {name: current[NAME] || "anonymous", test: current};
            }
            log(OUTPUT_SEPARATOR);
            log(
                (iHasIt(current, NAME) && current[NAME])
                ||
                (iHasIt(current, DESCRIPTION) && current[DESCRIPTION])
                ||
                UNKNOWN
            );
            pass = [];
            fail = [];
            fatal = [];
            tmp = {};
            giveItATry("setup");
            fatal[LENGTH] || giveItATry("test");
            waitForIt || Dary();
        } else {
            showSummary();
        }
    }
158247
private static synchronized void initDEVTESTPROD() {
    if (IS_DEV != null)
      return;
    IS_DEV = false;
    IS_TEST = false;
    IS_PROD = false;
    final List<String> envs = singletonInstance.getSearchEnvironments();
    for (final String env : envs) {
      if (env.equalsIgnoreCase("DEV")) {
        IS_DEV = true;
      }
    }
    for (final String env : envs) {
      if (env.equalsIgnoreCase("TEST")) {
        IS_DEV = false;
        IS_TEST = true;
      }
    }
    for (final String env : envs) {
      if (env.equalsIgnoreCase("PROD")) {
        IS_DEV = false;
        IS_TEST = false;
        IS_PROD = true;
      }
    }

  }
1280601
def __verify_ready(self, creating=False):
        '''
        '''

        if len(self._value_ranges) == 0:
            self._logger.log(
                'crit',
                'Attribute value_ranges must have at least one value'
            )
            raise RuntimeWarning(
                'Attribute value_ranges must have at least one value'
            )
        if len(self._employers) == 0 and creating is False:
            self._logger.log('crit', 'Need to create employers')
            raise RuntimeWarning('Need to create employers')
619769
def real_main(release_url=None,
              tests_json_path=None,
              upload_build_id=None,
              upload_release_name=None):
    """"""
    coordinator = workers.get_coordinator()
    fetch_worker.register(coordinator)
    coordinator.start()

    data = open(FLAGS.tests_json_path).read()
    tests = load_tests(data)

    item = DiffMyImages(
        release_url,
        tests,
        upload_build_id,
        upload_release_name,
        heartbeat=workers.PrintWorkflow)
    item.root = True

    coordinator.input_queue.put(item)
    coordinator.wait_one()
    coordinator.stop()
    coordinator.join()
680785
function exposeThenNative(Browser, command) {
    var exposed = ['then', ucfirst(command)].join('');

    Browser.prototype[exposed] = function () {
        var args = arguments;
        ensureDriverCommand.call(this, command, 'exposeThenNative');

        this.then(function (next) {
            args = wrapArguments.call(this, args, chainAndErrorCallback, next);
            this._driver[command].apply(this._driver, args);
        });

        return this;
    };
}