(it might be available in your UnitTest, so this method was prepared)
498717
protected <RESULT> RESULT doMasterAccessFixedly(SlaveDBCallback<RESULT> noArgLambda) {
        assertCallbackNotNull(noArgLambda);
        final String currentKey = selectableDataSourceHolder.getCurrentSelectableDataSourceKey();
        final String masterDB = MASTER_DB;
        if (logger.isDebugEnabled()) {
            logger.debug(buildMasterAccessFixedlyDebugMessage(masterDB));
        }
        selectableDataSourceHolder.switchSelectableDataSourceKey(masterDB);
        try {
            return noArgLambda.callback();
        } finally {
            selectableDataSourceHolder.switchSelectableDataSourceKey(currentKey);
        }
    }
805000
private void guessExceptions(){
		List<Class<?>> tmpExceptionList = new ArrayList<>();
		for (Class<?> c:supportedInterfaces){
			Method[] methods = c.getDeclaredMethods();
			for (Method m:methods){
				for (Class<?> exc : m.getExceptionTypes()){
					if (!tmpExceptionList.contains(exc))
						tmpExceptionList.add(exc);
				}
			}
		}
		declaredExceptions = new Class[tmpExceptionList.size()];
		tmpExceptionList.toArray(declaredExceptions);
	}
324398
def prepare(self):
        
        requested_access = self.endpoint_access(self.request.method)
        use_oauth = getattr(options, 'use_oauth', None)
        if use_oauth and requested_access is not self.UNAUTHENTICATED_ACCESS:
            token = self.request.headers.get('Authorization', '').split(' ')[-1]
            if token:
                has_access = yield self.verify_token(token, requested_access)
                if not has_access:
                    msg = "'{}' access not granted.".format(requested_access)
                    raise HTTPError(403, msg)
            else:
                msg = 'OAuth token not provided'
                raise HTTPError(401, msg)
436156
def addSuccess(self, test: unittest.case.TestCase) -> None:
        
        # noinspection PyTypeChecker
        self.add_result(TestState.success, test)
75624
def addUnexpectedSuccess(self, test):
        
        result = self._handle_result(
            test, TestCompletionStatus.unexpected_success)
        self.unexpectedSuccesses.append(result)
765805
private void prepareForEncoding() {
		// remove MESSAGE-INTEGRITY and FINGERPRINT attributes so that we can
		// make sure they are added at the end.
		StunAttribute msgIntAttr = removeAttribute(StunAttribute.MESSAGE_INTEGRITY);
		StunAttribute fingerprint = removeAttribute(StunAttribute.FINGERPRINT);

		// add a SOFTWARE attribute if the user said so, and unless they did it
		// themselves.
		String software = System.getProperty("TelScale Media Server");

		if (getAttribute(StunAttribute.SOFTWARE) == null && software != null && software.length() > 0) {
			addAttribute(StunAttributeFactory.createSoftwareAttribute(software.getBytes()));
		}

		// re-add MESSAGE-INTEGRITY if there was one.
		if (msgIntAttr != null) {
			addAttribute(msgIntAttr);
		}

		// add FINGERPRINT if there was one or if user told us to add it
		// everywhere.
		if (fingerprint == null) {
			fingerprint = StunAttributeFactory.createFingerprintAttribute();
		}

		if (fingerprint != null) {
			addAttribute(fingerprint);
		}
	}
1180131
def prepare(self):
    
    self.src_folder = self.get_src_folder()
    st = os.stat('%s/gradlew' % self.path)
    os.chmod('%s/gradlew' % self.path, st.st_mode | stat.S_IEXEC)
859176
protected void prepareDetectorOptions(Map<String, String> pConfig) {
        StringBuffer detectorOpts = new StringBuffer("{");
        if (pConfig.containsKey("bootAmx") && Boolean.parseBoolean(pConfig.get("bootAmx"))) {
            detectorOpts.append("\"glassfish\" : { \"bootAmx\" : true }");
        }
        if (detectorOpts.length() > 1) {
            detectorOpts.append("}");
            pConfig.put(ConfigKey.DETECTOR_OPTIONS.getKeyValue(),detectorOpts.toString());
        }
    }
1219455
@Override
    protected final void prepareAnalyzer(Engine engine) throws InitializationException {
        if (filesMatched) {
            prepareFileTypeAnalyzer(engine);
        } else {
            this.setEnabled(false);
        }
    }
921083
protected void maybeLoadMethods ()
    {
        if (_methodMap == null) {
            _methodMap = new HashMap<String,List<Member>>();
            Method[] methods = _clazz.getMethods();

            for (int i = 0; i < methods.length; ++i) {
                Method m = methods[i];
                String methodName = m.getName();
                Class<?>[] paramTypes = m.getParameterTypes();

                List<Member> list = _methodMap.get(methodName);
                if (list == null) {
                    list = new ArrayList<Member>();
                    _methodMap.put(methodName, list);
                }

                if (!ClassUtil.classIsAccessible(_clazz)) {
                    m = ClassUtil.getAccessibleMethodFrom(_clazz, methodName, paramTypes );
                }

                if (m != null) {
                    list.add(m);
                    _paramMap.put(m, paramTypes);
                }
            }
        }
    }
307847
def addSkip(self, test: unittest.case.TestCase, reason: str):
        
        test.time_taken = time.time() - self.start_time
        test._outcome = None
        self.result_queue.put((TestState.skipped, test, reason))
1180017
private void ensurePreparedForInjection() {
		if (!prepared) {
			try {
				Class<ReflectiveInterceptor> clazz = ReflectiveInterceptor.class;
				method_jlcgdfs = clazz.getDeclaredMethod("jlClassGetDeclaredFields", Class.class);
				method_jlcgdf = clazz.getDeclaredMethod("jlClassGetDeclaredField", Class.class, String.class);
				method_jlcgf = clazz.getDeclaredMethod("jlClassGetField", Class.class, String.class);
				method_jlcgdms = clazz.getDeclaredMethod("jlClassGetDeclaredMethods", Class.class);
				method_jlcgdm = clazz.getDeclaredMethod("jlClassGetDeclaredMethod", Class.class, String.class,
						EMPTY_CLASS_ARRAY_CLAZZ);
				method_jlcgm = clazz.getDeclaredMethod("jlClassGetMethod", Class.class, String.class,
						EMPTY_CLASS_ARRAY_CLAZZ);
				method_jlcgdc = clazz.getDeclaredMethod("jlClassGetDeclaredConstructor", Class.class,
						EMPTY_CLASS_ARRAY_CLAZZ);
				method_jlcgc = clazz.getDeclaredMethod("jlClassGetConstructor", Class.class, EMPTY_CLASS_ARRAY_CLAZZ);
				method_jlcgmods = clazz.getDeclaredMethod("jlClassGetModifiers", Class.class);
				method_jlcgms = clazz.getDeclaredMethod("jlClassGetMethods", Class.class);

				method_jlcgdcs = clazz.getDeclaredMethod("jlClassGetDeclaredConstructors", Class.class);
				method_jlrfg = clazz.getDeclaredMethod("jlrFieldGet", Field.class, Object.class);
				method_jlrfgl = clazz.getDeclaredMethod("jlrFieldGetLong", Field.class, Object.class);
				method_jlrmi = clazz.getDeclaredMethod("jlrMethodInvoke", Method.class, Object.class, Object[].class);
				method_jloObjectStream_hasInitializerMethod = clazz.getDeclaredMethod("jlosHasStaticInitializer",
						Class.class);
			}
			catch (NoSuchMethodException nsme) {
				// cant happen, a-hahaha
				throw new Impossible(nsme);
			}
			prepared = true;
		}
	}
583563
function() {

        /* Prepare our message */
        var message = { proxy: { proxy: clone, arguments: arguments }};

        /* Is this "new F()" or a normal call? */
        if (this instanceof Invocable) {
          message.newInstance = true;
          ProxyPromise.call(this, message, send);
          this.asProxy(true);
        } else {
          return new ProxyPromise(message, send);
        }
      }
1129721
function finalizeMeasurement(id) {
        if (activeTests[id.id]) {
            delete activeTests[id.id];
        }

        if (updatableTests[id.id]) {
            delete updatableTests[id.id];
        }
    }
1302706
def method_missing(method_name, *args, &block)
      if Array.wrap(Config.proxy_method_name).include?(method_name)
        UnitProxyProvider.class_eval do
          define_method(method_name) do |*_args|
            name = _args.first || Function.current_unit.try(:unit_name)
            if name && unit = Loader.load(name)
              UnitProxy.new(unit, self)
            end
          end
        end
        send(method_name, args.first)
      else
        super
      end
    end
941495
def finalize(self):
        
        #Determine the percentage success on the unit tests. Also see the total time for all
        #the unit tests.
        stotal = 0
        ttotal = 0
        for test in self.repo.testing.tests:
            stotal += (1 if test["success"]==True else 0)
            ttotal += (test["end"] - test["start"]).seconds

        self.percent = stotal/float(len(self.repo.testing.tests))
        self.message = "Results: {0:.2%} in {1:d}s.".format(self.percent, ttotal)
        if not self.testmode:
            if percent < 1:
                self.commit.create_status("failure", self.url, self.message)
            elif any([test["code"] == 1 for test in self.repo.testing.tests]):
                self.commit.create_status("pending", self.url, self.message + " Slowdown reported.")
            else:
                self.commit.create_status("success", self.url, self.message)
        self.server.wiki.update(self)
1174434
def prepare_renderable(request, test_case_result, is_admin):
    """"""
    test_case = test_case_result.test_case
    file_directory = request.registry.settings['file_directory']
    sha1 = test_case_result.diff.sha1 if test_case_result.diff else None
    kwargs = {'number': test_case.id, 'group': test_case.testable.name,
              'name': test_case.name, 'points': test_case.points,
              'status': test_case_result.status,
              'extra': test_case_result.extra}

    if test_case.output_type == 'image':
        url = request.route_path('file_item', filename='_', _query={'raw': 1},
                                 sha1sum=sha1) if sha1 else None
        return ImageOutput(url=url, **kwargs)
    elif test_case.output_type == 'text':
        content = None
        if sha1:
            with open(File.file_path(file_directory, sha1)) as fp:
                content = fp.read()
        return TextOutput(content=content, **kwargs)
    elif not test_case_result.diff:  # Outputs match
        return DiffWithMetadata(diff=None, **kwargs)

    try:
        with open(File.file_path(file_directory, sha1)) as fp:
            diff = pickle.load(fp)
    except (AttributeError, EOFError):
        content = 'submit system mismatch -- requeue submission'
        content += traceback.format_exc(1)
        return TextOutput(content=content, **kwargs)
    except Exception:
        content = 'unexected error -- requeue submission\n'
        content += traceback.format_exc(1)
        return TextOutput(content=content, **kwargs)

    diff.hide_expected = not is_admin and test_case.hide_expected
    return DiffWithMetadata(diff=diff, **kwargs)