text:
package eu.lunisolar.magma.func.function.conversion;

import javax.annotation.Nonnull; // NOSONAR
import javax.annotation.Nullable; // NOSONAR
import javax.annotation.concurrent.NotThreadSafe; // NOSONAR
import java.util.Comparator; // NOSONAR
import java.util.Objects; // NOSONAR
import eu.lunisolar.magma.basics.*; //NOSONAR
import eu.lunisolar.magma.basics.builder.*; // NOSONAR
import eu.lunisolar.magma.basics.exceptions.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.aType.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.functional.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.functional.type.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.functional.domain.*; // NOSONAR
import eu.lunisolar.magma.func.IA;
import eu.lunisolar.magma.func.SA;
import eu.lunisolar.magma.func.*; // NOSONAR
import eu.lunisolar.magma.func.tuple.*; // NOSONAR

import java.util.concurrent.*; // NOSONAR
import java.util.function.*; // NOSONAR
import java.util.*; // NOSONAR
import java.lang.reflect.*; // NOSONAR

import eu.lunisolar.magma.func.action.*; // NOSONAR
import eu.lunisolar.magma.func.consumer.*; // NOSONAR
import eu.lunisolar.magma.func.consumer.primitives.*; // NOSONAR
import eu.lunisolar.magma.func.consumer.primitives.bi.*; // NOSONAR
import eu.lunisolar.magma.func.consumer.primitives.obj.*; // NOSONAR
import eu.lunisolar.magma.func.consumer.primitives.tri.*; // NOSONAR
import eu.lunisolar.magma.func.function.*; // NOSONAR
import eu.lunisolar.magma.func.function.conversion.*; // NOSONAR
import eu.lunisolar.magma.func.function.from.*; // NOSONAR
import eu.lunisolar.magma.func.function.to.*; // NOSONAR
import eu.lunisolar.magma.func.operator.binary.*; // NOSONAR
import eu.lunisolar.magma.func.operator.ternary.*; // NOSONAR
import eu.lunisolar.magma.func.operator.unary.*; // NOSONAR
import eu.lunisolar.magma.func.predicate.*; // NOSONAR
import eu.lunisolar.magma.func.supplier.*; // NOSONAR

/**
 * Non-throwing functional interface (lambda) LSrtToCharFunction for Java 8.
 *
 * Type: function
 *
 * Domain (lvl: 1): short a
 *
 * Co-domain: char
 *
 */
@FunctionalInterface
@SuppressWarnings("UnusedDeclaration")
public interface LSrtToCharFunction extends MetaFunction, MetaInterface.NonThrowing, Codomain<aChar>, Domain1<aShort> { // NOSONAR

	String DESCRIPTION = "LSrtToCharFunction: char applyAsChar(short a)";

	// char applyAsChar(short a) ;
	default char applyAsChar(short a) {
		// return nestingApplyAsChar(a);
		try {
			return this.applyAsCharX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.nestCheckedAndThrow(e);
		}
	}

	/**
	 * Implement this, but call applyAsChar(short a)
	 */
	char applyAsCharX(short a) throws Throwable;

	default char tupleApplyAsChar(LSrtSingle args) {
		return applyAsChar(args.value());
	}

	/** Function call that handles exceptions according to the instructions. */
	default char handlingApplyAsChar(short a, HandlingInstructions<Throwable, RuntimeException> handling) {
		try {
			return this.applyAsCharX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handler.handleOrNest(e, handling);
		}
	}

	default LSrtToCharFunction handling(HandlingInstructions<Throwable, RuntimeException> handling) {
		return a -> handlingApplyAsChar(a, handling);
	}

	default char applyAsChar(short a, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage) {
		try {
			return this.applyAsCharX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.wrap(e, factory, newMessage);
		}
	}

	default char applyAsChar(short a, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1) {
		try {
			return this.applyAsCharX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.wrap(e, factory, newMessage, param1);
		}
	}

	default char applyAsChar(short a, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1, @Nullable Object param2) {
		try {
			return this.applyAsCharX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.wrap(e, factory, newMessage, param1, param2);
		}
	}

	default char applyAsChar(short a, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1, @Nullable Object param2, @Nullable Object param3) {
		try {
			return this.applyAsCharX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.wrap(e, factory, newMessage, param1, param2, param3);
		}
	}

	default LSrtToCharFunction trying(@Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage) {
		return a -> applyAsChar(a, factory, newMessage);
	}

	default LSrtToCharFunction trying(@Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1) {
		return a -> applyAsChar(a, factory, newMessage, param1);
	}

	default LSrtToCharFunction trying(@Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1, @Nullable Object param2) {
		return a -> applyAsChar(a, factory, newMessage, param1, param1);
	}

	default LSrtToCharFunction trying(@Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1, @Nullable Object param2, @Nullable Object param3) {
		return a -> applyAsChar(a, factory, newMessage, param1, param2, param3);
	}

	default char applyAsChar(short a, @Nonnull ExWF<RuntimeException> factory) {
		try {
			return this.applyAsCharX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.wrap(e, factory);
		}
	}

	default LSrtToCharFunction trying(@Nonnull ExWF<RuntimeException> factory) {
		return a -> applyAsChar(a, factory);
	}

	default char applyAsCharThen(short a, @Nonnull LToCharFunction<Throwable> handler) {
		try {
			return this.applyAsCharX(a);
		} catch (Throwable e) { // NOSONAR
			Handling.handleErrors(e);
			return handler.applyAsChar(e);
		}
	}

	default LSrtToCharFunction tryingThen(@Nonnull LToCharFunction<Throwable> handler) {
		return a -> applyAsCharThen(a, handler);
	}

	/** Function call that handles exceptions by always nesting checked exceptions and propagating the others as is. */
	default char nestingApplyAsChar(short a) {
		try {
			return this.applyAsCharX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.nestCheckedAndThrow(e);
		}
	}

	/** Function call that handles exceptions by always propagating them as is, even when they are undeclared checked ones. */
	default char shovingApplyAsChar(short a) {
		try {
			return this.applyAsCharX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.shoveIt(e);
		}
	}

	static char shovingApplyAsChar(short a, LSrtToCharFunction func) {
		Null.nonNullArg(func, "func");
		return func.shovingApplyAsChar(a);
	}

	static char handlingApplyAsChar(short a, LSrtToCharFunction func, HandlingInstructions<Throwable, RuntimeException> handling) { // <-
		Null.nonNullArg(func, "func");
		return func.handlingApplyAsChar(a, handling);
	}

	static char tryApplyAsChar(short a, LSrtToCharFunction func) {
		Null.nonNullArg(func, "func");
		return func.nestingApplyAsChar(a);
	}

	static char tryApplyAsChar(short a, LSrtToCharFunction func, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage) {
		Null.nonNullArg(func, "func");
		return func.applyAsChar(a, factory, newMessage);
	}

	static char tryApplyAsChar(short a, LSrtToCharFunction func, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1) {
		Null.nonNullArg(func, "func");
		return func.applyAsChar(a, factory, newMessage, param1);
	}

	static char tryApplyAsChar(short a, LSrtToCharFunction func, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1, @Nullable Object param2) {
		Null.nonNullArg(func, "func");
		return func.applyAsChar(a, factory, newMessage, param1, param2);
	}

	static char tryApplyAsChar(short a, LSrtToCharFunction func, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1, @Nullable Object param2, @Nullable Object param3) {
		Null.nonNullArg(func, "func");
		return func.applyAsChar(a, factory, newMessage, param1, param2, param3);
	}

	static char tryApplyAsChar(short a, LSrtToCharFunction func, @Nonnull ExWF<RuntimeException> factory) {
		Null.nonNullArg(func, "func");
		return func.applyAsChar(a, factory);
	}

	static char tryApplyAsCharThen(short a, LSrtToCharFunction func, @Nonnull LToCharFunction<Throwable> handler) {
		Null.nonNullArg(func, "func");
		return func.applyAsCharThen(a, handler);
	}

	default char failSafeApplyAsChar(short a, @Nonnull LSrtToCharFunction failSafe) {
		try {
			return applyAsChar(a);
		} catch (Throwable e) { // NOSONAR
			Handling.handleErrors(e);
			return failSafe.applyAsChar(a);
		}
	}

	static char failSafeApplyAsChar(short a, LSrtToCharFunction func, @Nonnull LSrtToCharFunction failSafe) {
		Null.nonNullArg(failSafe, "failSafe");
		if (func == null) {
			return failSafe.applyAsChar(a);
		} else {
			return func.failSafeApplyAsChar(a, failSafe);
		}
	}

	static LSrtToCharFunction failSafe(LSrtToCharFunction func, @Nonnull LSrtToCharFunction failSafe) {
		Null.nonNullArg(failSafe, "failSafe");
		return a -> failSafeApplyAsChar(a, func, failSafe);
	}

	/** Just to mirror the method: Ensures the result is not null */
	default char nonNullApplyAsChar(short a) {
		return applyAsChar(a);
	}

	/** Returns description of the functional interface. */
	@Nonnull
	default String functionalInterfaceDescription() {
		return LSrtToCharFunction.DESCRIPTION;
	}

	/** From-To. Intended to be used with non-capturing lambda. */
	public static void fromTo(int min_i, int max_i, short a, @Nonnull LSrtToCharFunction func) {
		Null.nonNullArg(func, "func");
		if (min_i <= max_i) {
			for (int i = min_i; i <= max_i; i++) {
				func.applyAsChar(a);
			}
		} else {
			for (int i = min_i; i >= max_i; i--) {
				func.applyAsChar(a);
			}
		}
	}

	/** From-To. Intended to be used with non-capturing lambda. */
	public static void fromTill(int min_i, int max_i, short a, @Nonnull LSrtToCharFunction func) {
		Null.nonNullArg(func, "func");
		if (min_i <= max_i) {
			for (int i = min_i; i < max_i; i++) {
				func.applyAsChar(a);
			}
		} else {
			for (int i = min_i; i > max_i; i--) {
				func.applyAsChar(a);
			}
		}
	}

	/** From-To. Intended to be used with non-capturing lambda. */
	public static void times(int max_i, short a, @Nonnull LSrtToCharFunction func) {
		if (max_i < 0)
			return;
		fromTill(0, max_i, a, func);
	}

	/** Change function to consumer that ignores output. */
	default LSrtConsumer toConsumer() {
		return this::applyAsChar;
	}

	/** Calls domain consumer before main function. */
	default LSrtToCharFunction beforeDo(@Nonnull LSrtConsumer before) {
		Null.nonNullArg(before, "before");
		return (short a) -> {
			before.accept(a);
			return applyAsChar(a);
		};
	}

	/** Calls codomain consumer after main function. */
	default LSrtToCharFunction afterDo(@Nonnull LCharConsumer after) {
		Null.nonNullArg(after, "after");
		return (short a) -> {
			final char retval = applyAsChar(a);
			after.accept(retval);
			return retval;
		};
	}

	/** Creates function that always returns the same value. */
	static LSrtToCharFunction constant(char r) {
		return a -> r;
	}

	/** Convenient method in case lambda expression is ambiguous for the compiler (that might happen for overloaded methods accepting different interfaces). */
	@Nonnull
	static LSrtToCharFunction srtToCharFunc(final @Nonnull LSrtToCharFunction lambda) {
		Null.nonNullArg(lambda, "lambda");
		return lambda;
	}

	// <editor-fold desc="recursive">

	final class S implements LSrtToCharFunction {
		private LSrtToCharFunction target = null;
		@Override
		public char applyAsCharX(short a) throws Throwable {
			return target.applyAsCharX(a);
		}
	}

	@Nonnull
	static LSrtToCharFunction recursive(final @Nonnull LFunction<LSrtToCharFunction, LSrtToCharFunction> selfLambda) {
		final S single = new S();
		LSrtToCharFunction func = selfLambda.apply(single);
		single.target = func;
		return func;
	}

	// </editor-fold>

	// <editor-fold desc="memento">

	public static M mementoOf(short a, LSrtToCharFunction function) {
		var initialValue = function.applyAsChar(a);
		return initializedMementoOf(initialValue, function);
	}

	public static M initializedMementoOf(char initialValue, LSrtToCharFunction function) {
		return memento(initialValue, initialValue, function, (m, x1, x2) -> x2);
	}

	public static M deltaOf(short a, LSrtToCharFunction function, LCharBinaryOperator deltaFunction) {
		var initialValue = function.applyAsChar(a);
		return initializedDeltaOf(initialValue, function, deltaFunction);
	}

	public static M deltaOf(short a, LSrtToCharFunction function) {
		var initialValue = function.applyAsChar(a);
		return initializedDeltaOf(initialValue, function, (x1, x2) -> (char) (x2 - x1));
	}

	public static M initializedDeltaOf(char initialValue, LSrtToCharFunction function, LCharBinaryOperator deltaFunction) {
		return memento(initialValue, deltaFunction.applyAsChar(initialValue, initialValue), function, (m, x1, x2) -> deltaFunction.applyAsChar(x1, x2));
	}

	public static M memento(char initialBaseValue, char initialValue, LSrtToCharFunction baseFunction, LCharTernaryOperator mementoFunction) {
		return new M(initialBaseValue, initialValue, baseFunction, mementoFunction);
	}

	/**
	 * Implementation that allows to create derivative functions (do not confuse it with math concepts). Very short name is intended to be used with parent (LSrtToCharFunction.M)
	 */
	@NotThreadSafe
	final class M implements LSrtToCharFunction {

		private final LSrtToCharFunction baseFunction;
		private char lastBaseValue;
		private char lastValue;
		private final LCharTernaryOperator mementoFunction;

		private M(char lastBaseValue, char lastValue, LSrtToCharFunction baseFunction, LCharTernaryOperator mementoFunction) {
			this.baseFunction = baseFunction;
			this.lastBaseValue = lastBaseValue;
			this.lastValue = lastValue;
			this.mementoFunction = mementoFunction;
		}

		@Override
		public char applyAsCharX(short a) throws Throwable {
			char x1 = lastBaseValue;
			char x2 = lastBaseValue = baseFunction.applyAsCharX(a);

			return lastValue = mementoFunction.applyAsChar(lastValue, x1, x2);
		}

		public char lastValue() {
			return lastValue;
		};

		public char lastBaseValue() {
			return lastBaseValue;
		};
	}

	// </editor-fold>

	@Nonnull
	static LSrtToCharFunction srtToCharFuncThrowing(final @Nonnull ExF<Throwable> exF) {
		Null.nonNullArg(exF, "exF");
		return a -> {
			throw exF.produce();
		};
	}

	@Nonnull
	static LSrtToCharFunction srtToCharFuncThrowing(final String message, final @Nonnull ExMF<Throwable> exF) {
		Null.nonNullArg(exF, "exF");
		return a -> {
			throw exF.produce(message);
		};
	}

	static char call(short a, final @Nonnull LSrtToCharFunction lambda) {
		Null.nonNullArg(lambda, "lambda");
		return lambda.applyAsChar(a);
	}

	// <editor-fold desc="wrap">

	// </editor-fold>

	// <editor-fold desc="compose (functional)">

	/** Allows to manipulate the domain of the function. */
	@Nonnull
	default LSrtToCharFunction compose(@Nonnull final LSrtUnaryOperator before) {
		Null.nonNullArg(before, "before");
		return v -> this.applyAsChar(before.applyAsSrt(v));
	}

	/** Allows to manipulate the domain of the function. */
	@Nonnull
	default <V> LToCharFunction<V> unboxingCompose(@Nonnull final LToSrtFunction<? super V> before) {
		Null.nonNullArg(before, "before");
		return v -> this.applyAsChar(before.applyAsSrt(v));
	}

	// </editor-fold>

	// <editor-fold desc="then (functional)">

	/** Combines two functions together in a order. */
	@Nonnull
	default <V> LSrtFunction<V> then(@Nonnull LCharFunction<? extends V> after) {
		Null.nonNullArg(after, "after");
		return a -> after.apply(this.applyAsChar(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LSrtToByteFunction thenToByte(@Nonnull LCharToByteFunction after) {
		Null.nonNullArg(after, "after");
		return a -> after.applyAsByte(this.applyAsChar(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LSrtUnaryOperator thenToSrt(@Nonnull LCharToSrtFunction after) {
		Null.nonNullArg(after, "after");
		return a -> after.applyAsSrt(this.applyAsChar(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LSrtToIntFunction thenToInt(@Nonnull LCharToIntFunction after) {
		Null.nonNullArg(after, "after");
		return a -> after.applyAsInt(this.applyAsChar(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LSrtToLongFunction thenToLong(@Nonnull LCharToLongFunction after) {
		Null.nonNullArg(after, "after");
		return a -> after.applyAsLong(this.applyAsChar(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LSrtToFltFunction thenToFlt(@Nonnull LCharToFltFunction after) {
		Null.nonNullArg(after, "after");
		return a -> after.applyAsFlt(this.applyAsChar(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LSrtToDblFunction thenToDbl(@Nonnull LCharToDblFunction after) {
		Null.nonNullArg(after, "after");
		return a -> after.applyAsDbl(this.applyAsChar(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LSrtToCharFunction thenToChar(@Nonnull LCharUnaryOperator after) {
		Null.nonNullArg(after, "after");
		return a -> after.applyAsChar(this.applyAsChar(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LSrtPredicate thenToBool(@Nonnull LCharPredicate after) {
		Null.nonNullArg(after, "after");
		return a -> after.test(this.applyAsChar(a));
	}

	// </editor-fold>

	// <editor-fold desc="variant conversions">

	// </editor-fold>

	/** Does nothing (LSrtToCharFunction) Function */
	public static char doNothing(short a) {
		return Function4U.defaultCharacter;
	}

	/**
	* For each element (or tuple) from arguments, calls the function and passes the result to consumer.
	* Thread safety, fail-fast, fail-safety of this method is not expected.
	*/
	default <C0> void forEach(IndexedRead<C0, aShort> ia, C0 source, LCharConsumer consumer) {
		int size = ia.size(source);
		LOiToSrtFunction<Object> oiFunc0 = (LOiToSrtFunction) ia.getter();
		int i = 0;
		for (; i < size; i++) {
			short a = oiFunc0.applyAsSrt(source, i);
			consumer.accept(this.applyAsChar(a));
		}
	}

	/**
	* For each element (or tuple) from arguments, calls the function and passes the result to consumer.
	* Thread safety, fail-fast, fail-safety of this method depends highly on the arguments.
	*/
	default <C0, I0> void iterate(SequentialRead<C0, I0, aShort> sa, C0 source, LCharConsumer consumer) {
		Object iterator0 = ((LFunction) sa.adapter()).apply(source);
		LPredicate<Object> testFunc0 = (LPredicate) sa.tester();
		LToSrtFunction<Object> nextFunc0 = (LToSrtFunction) sa.supplier();
		while (testFunc0.test(iterator0)) {
			short a = nextFunc0.applyAsSrt(iterator0);
			consumer.accept(this.applyAsChar(a));
		}
	}

}


text:
// Copyright (c) 2014 mogoweb. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package com.mogoweb.chrome.impl;

import android.os.StrictMode;
import android.util.AndroidRuntimeException;
import android.util.Log;

/**
 * Top level factory, used creating all the main WebView implementation classes.
 *
 * @hide
 */
public final class WebViewFactory {

    private static final String CHROMIUM_WEBVIEW_FACTORY =
            "com.mogoweb.chrome.impl.WebViewChromiumFactoryProvider";

    private static final String LOGTAG = "WebViewFactory";

    private static final boolean DEBUG = true;

    private static class Preloader {
        static WebViewFactoryProvider sPreloadedProvider;
        static {
            try {
                sPreloadedProvider = getFactoryClass().newInstance();
            } catch (Exception e) {
                Log.w(LOGTAG, "error preloading provider", e);
            }

            org.chromium.content.R.attr.select_dialog_multichoice = com.mogoweb.chrome.R.attr.select_dialog_multichoice;
            org.chromium.content.R.attr.select_dialog_singlechoice = com.mogoweb.chrome.R.attr.select_dialog_singlechoice;
            org.chromium.content.R.dimen.link_preview_overlay_radius = com.mogoweb.chrome.R.dimen.link_preview_overlay_radius;
            org.chromium.content.R.drawable.ondemand_overlay = com.mogoweb.chrome.R.drawable.ondemand_overlay;
            org.chromium.content.R.id.ampm = com.mogoweb.chrome.R.id.ampm;
            org.chromium.content.R.id.arrow_image = com.mogoweb.chrome.R.id.arrow_image;
            org.chromium.content.R.id.date_picker = com.mogoweb.chrome.R.id.date_picker;
            org.chromium.content.R.id.date_time_suggestion_value = com.mogoweb.chrome.R.id.date_time_suggestion_value;
            org.chromium.content.R.id.hour = com.mogoweb.chrome.R.id.hour;
            org.chromium.content.R.id.main_text = com.mogoweb.chrome.R.id.main_text;
            org.chromium.content.R.id.milli = com.mogoweb.chrome.R.id.milli;
            org.chromium.content.R.id.minute = com.mogoweb.chrome.R.id.minute;
            org.chromium.content.R.id.pickers = com.mogoweb.chrome.R.id.pickers;
            org.chromium.content.R.id.position_in_year = com.mogoweb.chrome.R.id.position_in_year;
            org.chromium.content.R.id.second = com.mogoweb.chrome.R.id.second;
            org.chromium.content.R.id.second_colon = com.mogoweb.chrome.R.id.second_colon;
            org.chromium.content.R.id.second_dot = com.mogoweb.chrome.R.id.second_dot;
            org.chromium.content.R.id.select_action_menu_select_all = com.mogoweb.chrome.R.id.select_action_menu_select_all;
            org.chromium.content.R.id.select_action_menu_cut = com.mogoweb.chrome.R.id.select_action_menu_cut;
            org.chromium.content.R.id.select_action_menu_copy = com.mogoweb.chrome.R.id.select_action_menu_copy;
            org.chromium.content.R.id.select_action_menu_paste = com.mogoweb.chrome.R.id.select_action_menu_paste;
            org.chromium.content.R.id.select_action_menu_share = com.mogoweb.chrome.R.id.select_action_menu_share;
            org.chromium.content.R.id.select_action_menu_web_search = com.mogoweb.chrome.R.id.select_action_menu_web_search;
            org.chromium.content.R.id.sub_text = com.mogoweb.chrome.R.id.sub_text;
            org.chromium.content.R.id.time_picker = com.mogoweb.chrome.R.id.time_picker;
            org.chromium.content.R.id.year = com.mogoweb.chrome.R.id.year;
            org.chromium.content.R.layout.date_time_picker_dialog = com.mogoweb.chrome.R.layout.date_time_picker_dialog;
            org.chromium.content.R.layout.date_time_suggestion = com.mogoweb.chrome.R.layout.date_time_suggestion;
            org.chromium.content.R.layout.two_field_date_picker = com.mogoweb.chrome.R.layout.two_field_date_picker;
            org.chromium.content.R.layout.multi_field_time_picker_dialog = com.mogoweb.chrome.R.layout.multi_field_time_picker_dialog;
            org.chromium.content.R.layout.validation_message_bubble = com.mogoweb.chrome.R.layout.validation_message_bubble;
            org.chromium.content.R.menu.select_action_menu = com.mogoweb.chrome.R.menu.select_action_menu;
            org.chromium.content.R.string.accessibility_content_view = com.mogoweb.chrome.R.string.accessibility_content_view;
            org.chromium.content.R.string.accessibility_date_picker_month = com.mogoweb.chrome.R.string.accessibility_date_picker_month;
            org.chromium.content.R.string.accessibility_date_picker_week = com.mogoweb.chrome.R.string.accessibility_date_picker_week;
            org.chromium.content.R.string.accessibility_date_picker_year = com.mogoweb.chrome.R.string.accessibility_date_picker_year;
            org.chromium.content.R.string.accessibility_datetime_picker_date = com.mogoweb.chrome.R.string.accessibility_datetime_picker_date;
            org.chromium.content.R.string.accessibility_datetime_picker_time = com.mogoweb.chrome.R.string.accessibility_datetime_picker_time;
            org.chromium.content.R.string.actionbar_share = com.mogoweb.chrome.R.string.actionbar_share;
            org.chromium.content.R.string.actionbar_web_search = com.mogoweb.chrome.R.string.actionbar_web_search;
            org.chromium.content.R.string.date_picker_dialog_clear = com.mogoweb.chrome.R.string.date_picker_dialog_clear;
            org.chromium.content.R.string.date_picker_dialog_set = com.mogoweb.chrome.R.string.date_picker_dialog_set;
            org.chromium.content.R.string.date_picker_dialog_title = com.mogoweb.chrome.R.string.date_picker_dialog_title;
            org.chromium.content.R.string.date_picker_dialog_other_button_label = com.mogoweb.chrome.R.string.date_picker_dialog_other_button_label;
            org.chromium.content.R.string.date_time_picker_dialog_title = com.mogoweb.chrome.R.string.date_time_picker_dialog_title;
            org.chromium.content.R.string.media_player_error_button = com.mogoweb.chrome.R.string.media_player_error_button;
            org.chromium.content.R.string.media_player_error_text_invalid_progressive_playback = com.mogoweb.chrome.R.string.media_player_error_text_invalid_progressive_playback;
            org.chromium.content.R.string.media_player_error_text_unknown = com.mogoweb.chrome.R.string.media_player_error_text_unknown;
            org.chromium.content.R.string.media_player_error_title = com.mogoweb.chrome.R.string.media_player_error_title;
            org.chromium.content.R.string.media_player_loading_video = com.mogoweb.chrome.R.string.media_player_loading_video;
            org.chromium.content.R.string.month_picker_dialog_title = com.mogoweb.chrome.R.string.month_picker_dialog_title;
            org.chromium.content.R.string.profiler_error_toast = com.mogoweb.chrome.R.string.profiler_error_toast;
            org.chromium.content.R.string.profiler_no_storage_toast = com.mogoweb.chrome.R.string.profiler_no_storage_toast;
            org.chromium.content.R.string.profiler_started_toast = com.mogoweb.chrome.R.string.profiler_started_toast;
            org.chromium.content.R.string.profiler_stopped_toast = com.mogoweb.chrome.R.string.profiler_stopped_toast;
            org.chromium.content.R.string.time_picker_dialog_am = com.mogoweb.chrome.R.string.time_picker_dialog_am;
            org.chromium.content.R.string.time_picker_dialog_hour_minute_separator = com.mogoweb.chrome.R.string.time_picker_dialog_hour_minute_separator;
            org.chromium.content.R.string.time_picker_dialog_minute_second_separator = com.mogoweb.chrome.R.string.time_picker_dialog_minute_second_separator;
            org.chromium.content.R.string.time_picker_dialog_second_subsecond_separator = com.mogoweb.chrome.R.string.time_picker_dialog_second_subsecond_separator;
            org.chromium.content.R.string.time_picker_dialog_pm = com.mogoweb.chrome.R.string.time_picker_dialog_pm;
            org.chromium.content.R.string.time_picker_dialog_title = com.mogoweb.chrome.R.string.time_picker_dialog_title;
            org.chromium.content.R.string.week_picker_dialog_title = com.mogoweb.chrome.R.string.week_picker_dialog_title;
            org.chromium.content.R.style.SelectPopupDialog = com.mogoweb.chrome.R.style.SelectPopupDialog;

            org.chromium.ui.R.string.copy_to_clipboard_failure_message = com.mogoweb.chrome.R.string.copy_to_clipboard_failure_message;
            org.chromium.ui.R.string.low_memory_error = com.mogoweb.chrome.R.string.low_memory_error;
            org.chromium.ui.R.string.opening_file_error = com.mogoweb.chrome.R.string.opening_file_error;
            org.chromium.ui.R.string.color_picker_button_more = com.mogoweb.chrome.R.string.color_picker_button_more;
            org.chromium.ui.R.string.color_picker_hue = com.mogoweb.chrome.R.string.color_picker_hue;
            org.chromium.ui.R.string.color_picker_saturation = com.mogoweb.chrome.R.string.color_picker_saturation;
            org.chromium.ui.R.string.color_picker_value = com.mogoweb.chrome.R.string.color_picker_value;
            org.chromium.ui.R.string.color_picker_button_set = com.mogoweb.chrome.R.string.color_picker_button_set;
            org.chromium.ui.R.string.color_picker_button_cancel = com.mogoweb.chrome.R.string.color_picker_button_cancel;
            org.chromium.ui.R.string.color_picker_dialog_title = com.mogoweb.chrome.R.string.color_picker_dialog_title;
            org.chromium.ui.R.string.color_picker_button_red = com.mogoweb.chrome.R.string.color_picker_button_red;
            org.chromium.ui.R.string.color_picker_button_cyan = com.mogoweb.chrome.R.string.color_picker_button_cyan;
            org.chromium.ui.R.string.color_picker_button_blue = com.mogoweb.chrome.R.string.color_picker_button_blue;
            org.chromium.ui.R.string.color_picker_button_green = com.mogoweb.chrome.R.string.color_picker_button_green;
            org.chromium.ui.R.string.color_picker_button_magenta = com.mogoweb.chrome.R.string.color_picker_button_magenta;
            org.chromium.ui.R.string.color_picker_button_yellow = com.mogoweb.chrome.R.string.color_picker_button_yellow;
            org.chromium.ui.R.string.color_picker_button_black = com.mogoweb.chrome.R.string.color_picker_button_black;
            org.chromium.ui.R.string.color_picker_button_white = com.mogoweb.chrome.R.string.color_picker_button_white;
            org.chromium.ui.R.id.autofill_label = com.mogoweb.chrome.R.id.autofill_label;
            org.chromium.ui.R.id.autofill_popup_window = com.mogoweb.chrome.R.id.autofill_popup_window;
            org.chromium.ui.R.id.autofill_sublabel = com.mogoweb.chrome.R.id.autofill_sublabel;
            org.chromium.ui.R.id.selected_color_view = com.mogoweb.chrome.R.id.selected_color_view;
            org.chromium.ui.R.id.title = com.mogoweb.chrome.R.id.title;
            org.chromium.ui.R.id.more_colors_button = com.mogoweb.chrome.R.id.more_colors_button;
            org.chromium.ui.R.id.color_picker_advanced = com.mogoweb.chrome.R.id.color_picker_advanced;
            org.chromium.ui.R.id.color_picker_simple = com.mogoweb.chrome.R.id.color_picker_simple;
            org.chromium.ui.R.id.color_button_swatch = com.mogoweb.chrome.R.id.color_button_swatch;
            org.chromium.ui.R.id.more_colors_button_border = com.mogoweb.chrome.R.id.more_colors_button_border;
            org.chromium.ui.R.id.gradient= com.mogoweb.chrome.R.id.gradient;
            org.chromium.ui.R.id.text = com.mogoweb.chrome.R.id.text;
            org.chromium.ui.R.id.seek_bar = com.mogoweb.chrome.R.id.seek_bar;
            org.chromium.ui.R.layout.autofill_text = com.mogoweb.chrome.R.layout.autofill_text;
            org.chromium.ui.R.layout.color_picker_dialog_title = com.mogoweb.chrome.R.layout.color_picker_dialog_title;
            org.chromium.ui.R.layout.color_picker_dialog_content = com.mogoweb.chrome.R.layout.color_picker_dialog_content;
            org.chromium.ui.R.layout.color_picker_advanced_component = com.mogoweb.chrome.R.layout.color_picker_advanced_component;
            org.chromium.ui.R.drawable.color_button_background = com.mogoweb.chrome.R.drawable.color_button_background;
            org.chromium.ui.R.drawable.color_picker_advanced_select_handle = com.mogoweb.chrome.R.drawable.color_picker_advanced_select_handle;
            org.chromium.ui.R.style.AutofillPopupWindow = com.mogoweb.chrome.R.style.AutofillPopupWindow;
            org.chromium.ui.R.color.autofill_dark_divider_color = com.mogoweb.chrome.R.color.autofill_dark_divider_color;
            org.chromium.ui.R.color.autofill_divider_color = com.mogoweb.chrome.R.color.autofill_divider_color;
            org.chromium.ui.R.color.color_picker_border_color = com.mogoweb.chrome.R.color.color_picker_border_color;
            org.chromium.ui.R.dimen.autofill_text_height = com.mogoweb.chrome.R.dimen.autofill_text_height;
            org.chromium.ui.R.dimen.autofill_text_divider_height = com.mogoweb.chrome.R.dimen.autofill_text_divider_height;
            org.chromium.ui.R.dimen.color_button_height = com.mogoweb.chrome.R.dimen.color_button_height;
        }
    }

    // Cache the factory both for efficiency, and ensure any one process gets all webviews from the
    // same provider.
    private static WebViewFactoryProvider sProviderInstance;
    private static final Object sProviderLock = new Object();

    public static WebViewFactoryProvider getProvider() {
        synchronized (sProviderLock) {
            // For now the main purpose of this function (and the factory abstraction) is to keep
            // us honest and minimize usage of WebView internals when binding the proxy.
            if (sProviderInstance != null) return sProviderInstance;

            Class<WebViewFactoryProvider> providerClass;
            try {
                providerClass = getFactoryClass();
            } catch (ClassNotFoundException e) {
                Log.e(LOGTAG, "error loading provider", e);
                throw new AndroidRuntimeException(e);
            }

            // This implicitly loads Preloader even if it wasn't preloaded at boot.
            if (Preloader.sPreloadedProvider != null &&
                Preloader.sPreloadedProvider.getClass() == providerClass) {
                sProviderInstance = Preloader.sPreloadedProvider;
                if (DEBUG) Log.v(LOGTAG, "Using preloaded provider: " + sProviderInstance);
                return sProviderInstance;
            }

            // The preloaded provider isn't the one we wanted; construct our own.
            StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
            try {
                sProviderInstance = providerClass.newInstance();
                if (DEBUG) Log.v(LOGTAG, "Loaded provider: " + sProviderInstance);
                return sProviderInstance;
            } catch (Exception e) {
                Log.e(LOGTAG, "error instantiating provider", e);
                throw new AndroidRuntimeException(e);
            } finally {
                StrictMode.setThreadPolicy(oldPolicy);
            }
        }
    }

    private static Class<WebViewFactoryProvider> getFactoryClass() throws ClassNotFoundException {
        return (Class<WebViewFactoryProvider>) Class.forName(CHROMIUM_WEBVIEW_FACTORY);
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Configuration;

namespace DataImporter
{
    public partial class SettingsForm : Form
    {
        private Configuration config;

        public SettingsForm()
        {
            InitializeComponent();

            this.config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
        }

        private void LoadConfig()
        {
            ConnectionStringsSection connectionStrings =
                config.GetSection("connectionStrings") as ConnectionStringsSection;

            if (connectionStrings.ConnectionStrings["EtilicContext"] != null)
            {
                this.connectionStringTextBox.Text =
                    connectionStrings.ConnectionStrings["EtilicContext"].ConnectionString;
            }
        }

        private void SaveConfig()
        {
            ConnectionStringsSection connectionStrings =
                config.GetSection("connectionStrings") as ConnectionStringsSection;

            connectionStrings.ConnectionStrings.Add(new ConnectionStringSettings("EtilicContext", this.connectionStringTextBox.Text, "System.Data.SqlClient"));

            config.Save(ConfigurationSaveMode.Modified);

            ConfigurationManager.RefreshSection("connectionStrings");
        }

        #region Cancel
        private void cancelButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        #endregion

        private void saveButton_Click(object sender, EventArgs e)
        {
            this.SaveConfig();
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        protected override void OnShown(EventArgs e)
        {
            this.LoadConfig();

            base.OnShown(e);
        }
    }
}


text:
package com.chinalwb.are.styles;

import android.text.style.BackgroundColorSpan;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.ImageView;

import com.chinalwb.are.AREditText;

public class ARE_BackgroundColor extends ARE_ABS_Style<BackgroundColorSpan> {

    private ImageView mBackgroundImageView;

    private boolean mBackgroundChecked;

    private int mColor;

    private AREditText mEditText;

    /**
     * @param backgroundImage
     */
    public ARE_BackgroundColor(ImageView backgroundImage, int backgroundColor) {
        super(backgroundImage.getContext());
        this.mBackgroundImageView = backgroundImage;
        this.mColor = backgroundColor;
        setListenerForImageView(this.mBackgroundImageView);
    }

    public void setEditText(AREditText editText) {
        this.mEditText = editText;
    }

    @Override
    public EditText getEditText() {
        return mEditText;
    }

    @Override
    public void setListenerForImageView(final ImageView imageView) {
        imageView.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                mBackgroundChecked = !mBackgroundChecked;
                ARE_Helper.updateCheckStatus(ARE_BackgroundColor.this, mBackgroundChecked);
                if (null != mEditText) {
                    applyStyle(mEditText.getEditableText(), mEditText.getSelectionStart(), mEditText.getSelectionEnd());
                }
            }
        });
    }

    @Override
    public ImageView getImageView() {
        return this.mBackgroundImageView;
    }

    @Override
    public void setChecked(boolean isChecked) {
        this.mBackgroundChecked = isChecked;
    }

    @Override
    public boolean getIsChecked() {
        return this.mBackgroundChecked;
    }

    @Override
    public BackgroundColorSpan newSpan() {
        return new BackgroundColorSpan(this.mColor);
    }
}


text:
import django
from django.conf import settings
from django.utils import six

# Django 1.5 add support for custom auth user model
if django.VERSION >= (1, 5):
    AUTH_USER_MODEL = settings.AUTH_USER_MODEL
else:
    AUTH_USER_MODEL = "auth.User"

try:
    from django.contrib.auth import get_user_model
except ImportError:
    from django.contrib.auth.models import User
    get_user_model = lambda: User

try:
    from urllib import quote
except ImportError:
    from urllib.parse import quote  # noqa

if six.PY3:
    from threading import get_ident
else:
    from thread import get_ident  # noqa


text:
package v102316;

import static org.junit.Assert.*;

public class HelloWorldTest {
    @org.junit.Before
    public void setUp() throws Exception {

    }

    @org.junit.After
    public void tearDown() throws Exception {

    }

    @org.junit.Test
    public void setOutput() throws Exception {

    }

    @org.junit.Test
    public void getOutput() throws Exception {

    }

    @org.junit.Test
    public void hasOutput() throws Exception {

    }

    @org.junit.Test
    public void hasOutput1() throws Exception {

    }

    @org.junit.Test
    public void print() throws Exception {

    }

}


text:
<?php
namespace reconciliation_engine\stages\helpers;

/**
 * Shell Abstract Class
 *
 * Abstract class that allows a subclass to easily call and report values from
 * a shell script.  This makes it easy for a stage writer to use another
 * language or technology to create the stage.  Once written, a future stage
 * may inherit this class and define the shell script to be called.  Values
 * will be properly passed to the shell script defined by the $script_name
 * field.
 *
 * The shell script output must be of the form:
 * ```
 * ##.### identity string
 * ##.## identity string
 * ...
 * ```
 *
 * @author Robbie Hott
 */
abstract class shell implements stage {

    /**
     * @var string Unique Name of this stage
     *
     * Should be overwritten with the proper name.
     */
    private $name = "Abstract Shell Stage";

    /**
     * @var string Shell script to run.
     *
     * This is the script path and name, including parameters.  It should be of
     * the form:
     *
     * `/path/to/script [options] STRING`
     *
     * Where `STRING` is a literal, which will be replaced by the string passed
     * to the run function below.
     */
    protected $script_name;

    /**
     * Combining function
     *
     * This function defines which parts of the identity object should be used
     * as command line argument to the shell script. It takes an identity
     * object, comines the interested parts of the identity together, then
     * returns the resulting string.
     *
     * @param \identity $identity The identity to parse.
     * @return string The combined string that will be sent to the shell script.
     */
    protected function combine_string($identity);

    /**
     * Run function
     *
     * Runs the function defined in the $script_name field, replacing `STRING`
     * with the string to be considered.  Takes the return value from the
     * defined output method and returns that to the caller. The string will be
     * escaped and wrapped with single quotes.
     *
     * @param \identity $search The identity to be evaluated.
     * @param \identity[] $list A list of identities to evaluate against.  This
     * may be null.
     * @return array An array of matches and strengths,
     * `{"id":identity, "strength":float}`.
     * the stage's definition
     *
     */
    public function run($search, $list) {

        // Assume list is null.  We're not using it now

        // Result list
        $results = array();

        // if search is null, then don't complete
        if ($search == null) {
            return $results;
        }

        // Buffers for output and return value
        $output = array();
        $retval = PHP_INT_MAX;

        // Clean up the string
        $cleaned = escapeshellarg($this->combine_string($search));

        // Replace STRING with the cleaned string
        $toexec = str_replace('STRING', $cleaned, $this->script_name);

        // Execute the shell script
        exec($toexec, $output, $retval);

        // Handle the output
        foreach ($output as $line) {
            // Break the output into "float rest"
            list($value, $idstr) = explode(" ", $line, 2);

            array_push($results, array( "id"=> new \reconciliation_engine\identity\identity($idstr),
                "strength"=>floatval($value)));
        }

        // Return the results
        return $results;
    }

    /**
     * Return the name of the stage
     *
     * @return string Name of the stage
     */
    public function get_name() {
        return $this->name;
    }
}


text:
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.DotNet.Tools.Common;
using Microsoft.Extensions.DependencyModel;
using NuGet.Configuration;
using NuGet.Frameworks;
using NuGet.ProjectModel;
using NuGet.Versioning;
using ConcurrencyUtilities = NuGet.Common.ConcurrencyUtilities;

namespace Microsoft.DotNet.Cli.Utils
{
    public class ProjectToolsCommandResolver : ICommandResolver
    {
        private const string ProjectToolsCommandResolverName = "projecttoolscommandresolver";

        private static readonly CommandResolutionStrategy s_commandResolutionStrategy =
            CommandResolutionStrategy.ProjectToolsPackage;

        private List<string> _allowedCommandExtensions;
        private IPackagedCommandSpecFactory _packagedCommandSpecFactory;

        private IEnvironmentProvider _environment;

        public ProjectToolsCommandResolver(
            IPackagedCommandSpecFactory packagedCommandSpecFactory,
            IEnvironmentProvider environment)
        {
            _packagedCommandSpecFactory = packagedCommandSpecFactory;
            _environment = environment;

            _allowedCommandExtensions = new List<string>()
            {
                FileNameSuffixes.DotNet.DynamicLib
            };
        }

        public CommandSpec Resolve(CommandResolverArguments commandResolverArguments)
        {
            if (commandResolverArguments.CommandName == null
                || commandResolverArguments.ProjectDirectory == null)
            {
                Reporter.Verbose.WriteLine(string.Format(
                    LocalizableStrings.InvalidCommandResolverArguments,
                    ProjectToolsCommandResolverName));

                return null;
            }

            return ResolveFromProjectTools(commandResolverArguments);
        }

        private CommandSpec ResolveFromProjectTools(CommandResolverArguments commandResolverArguments)
        {
            var projectFactory = new ProjectFactory(_environment);

            var project = projectFactory.GetProject(
                commandResolverArguments.ProjectDirectory,
                commandResolverArguments.Framework,
                commandResolverArguments.Configuration,
                commandResolverArguments.BuildBasePath,
                commandResolverArguments.OutputPath);

            if (project == null)
            {
                Reporter.Verbose.WriteLine(string.Format(
                    LocalizableStrings.DidNotFindProject, ProjectToolsCommandResolverName));

                return null;
            }

            var tools = project.GetTools();

            return ResolveCommandSpecFromAllToolLibraries(
                tools,
                commandResolverArguments.CommandName,
                commandResolverArguments.CommandArguments.OrEmptyIfNull(),
                project);
        }

        private CommandSpec ResolveCommandSpecFromAllToolLibraries(
            IEnumerable<SingleProjectInfo> toolsLibraries,
            string commandName,
            IEnumerable<string> args,
            IProject project)
        {
            Reporter.Verbose.WriteLine(string.Format(
                LocalizableStrings.ResolvingCommandSpec,
                ProjectToolsCommandResolverName,
                toolsLibraries.Count()));

            foreach (var toolLibrary in toolsLibraries)
            {
                var commandSpec = ResolveCommandSpecFromToolLibrary(
                    toolLibrary,
                    commandName,
                    args,
                    project);

                if (commandSpec != null)
                {
                    return commandSpec;
                }
            }

            Reporter.Verbose.WriteLine(string.Format(
                LocalizableStrings.FailedToResolveCommandSpec,
                ProjectToolsCommandResolverName));

            return null;
        }

        private CommandSpec ResolveCommandSpecFromToolLibrary(
            SingleProjectInfo toolLibraryRange,
            string commandName,
            IEnumerable<string> args,
            IProject project)
        {
            Reporter.Verbose.WriteLine(string.Format(
                LocalizableStrings.AttemptingToResolveCommandSpec,
                ProjectToolsCommandResolverName,
                toolLibraryRange.Name));

            var possiblePackageRoots = GetPossiblePackageRoots(project).ToList();
            Reporter.Verbose.WriteLine(string.Format(
                LocalizableStrings.NuGetPackagesRoot,
                ProjectToolsCommandResolverName,
                string.Join(Environment.NewLine, possiblePackageRoots.Select((p) => $"- {p}"))));

            var toolPackageFramework = project.DotnetCliToolTargetFramework;

            var toolLockFile = GetToolLockFile(
                toolLibraryRange,
                toolPackageFramework,
                possiblePackageRoots);

            if (toolLockFile == null)
            {
                return null;
            }

            Reporter.Verbose.WriteLine(string.Format(
                LocalizableStrings.FoundToolLockFile,
                ProjectToolsCommandResolverName,
                toolLockFile.Path));

            var toolLibrary = toolLockFile.Targets
                .FirstOrDefault(t => toolPackageFramework == t.TargetFramework)
                ?.Libraries.FirstOrDefault(
                    l => StringComparer.OrdinalIgnoreCase.Equals(l.Name, toolLibraryRange.Name));
            if (toolLibrary == null)
            {
                Reporter.Verbose.WriteLine(string.Format(
                    LocalizableStrings.LibraryNotFoundInLockFile,
                    ProjectToolsCommandResolverName));

                return null;
            }

            var depsFileRoot = Path.GetDirectoryName(toolLockFile.Path);

            var depsFilePath = GetToolDepsFilePath(
                toolLibraryRange,
                toolPackageFramework,
                toolLockFile,
                depsFileRoot);

            var packageFolders = toolLockFile.PackageFolders.Select(p =>
                PathUtility.EnsureNoTrailingDirectorySeparator(p.Path));

            Reporter.Verbose.WriteLine(string.Format(
                LocalizableStrings.AttemptingToCreateCommandSpec,
                ProjectToolsCommandResolverName));

            var commandSpec = _packagedCommandSpecFactory.CreateCommandSpecFromLibrary(
                    toolLibrary,
                    commandName,
                    args,
                    _allowedCommandExtensions,
                    packageFolders,
                    s_commandResolutionStrategy,
                    depsFilePath,
                    null);

            if (commandSpec == null)
            {
                Reporter.Verbose.WriteLine(string.Format(
                    LocalizableStrings.CommandSpecIsNull,
                    ProjectToolsCommandResolverName));
            }

            commandSpec?.AddEnvironmentVariablesFromProject(project);

            return commandSpec;
        }

        private IEnumerable<string> GetPossiblePackageRoots(IProject project)
        {
            if (project.TryGetLockFile(out LockFile lockFile))
            {
                return lockFile.PackageFolders.Select((packageFolder) => packageFolder.Path);
            }

            return Enumerable.Empty<string>();
        }

        private LockFile GetToolLockFile(
            SingleProjectInfo toolLibrary,
            NuGetFramework framework,
            IEnumerable<string> possibleNugetPackagesRoot)
        {
            foreach (var packagesRoot in possibleNugetPackagesRoot)
            {
                if (TryGetToolLockFile(toolLibrary, framework, packagesRoot, out LockFile lockFile))
                {
                    return lockFile;
                }
            }

            return null;
        }

        private static async Task<bool> FileExistsWithLock(string path)
        {
            return await ConcurrencyUtilities.ExecuteWithFileLockedAsync(
                path,
                lockedToken => Task.FromResult(File.Exists(path)),
                CancellationToken.None);
        }

        private bool TryGetToolLockFile(
            SingleProjectInfo toolLibrary,
            NuGetFramework framework,
            string nugetPackagesRoot,
            out LockFile lockFile)
        {
            lockFile = null;
            var lockFilePath = GetToolLockFilePath(toolLibrary, framework, nugetPackagesRoot);

            if (!FileExistsWithLock(lockFilePath).Result)
            {
                return false;
            }

            try
            {
                lockFile = new LockFileFormat()
                    .ReadWithLock(lockFilePath)
                    .Result;
            }
            catch (FileFormatException ex)
            {
                throw ex;
            }

            return true;
        }

        private string GetToolLockFilePath(
            SingleProjectInfo toolLibrary,
            NuGetFramework framework,
            string nugetPackagesRoot)
        {
            var toolPathCalculator = new ToolPathCalculator(nugetPackagesRoot);

            return toolPathCalculator.GetBestLockFilePath(
                toolLibrary.Name,
                VersionRange.Parse(toolLibrary.Version),
                framework);
        }

        private string GetToolDepsFilePath(
            SingleProjectInfo toolLibrary,
            NuGetFramework framework,
            LockFile toolLockFile,
            string depsPathRoot)
        {
            var depsJsonPath = Path.Combine(
                depsPathRoot,
                toolLibrary.Name + FileNameSuffixes.DepsJson);

            Reporter.Verbose.WriteLine(string.Format(
                LocalizableStrings.ExpectDepsJsonAt,
                ProjectToolsCommandResolverName,
                depsJsonPath));

            EnsureToolJsonDepsFileExists(toolLockFile, framework, depsJsonPath, toolLibrary);

            return depsJsonPath;
        }

        private void EnsureToolJsonDepsFileExists(
            LockFile toolLockFile,
            NuGetFramework framework,
            string depsPath,
            SingleProjectInfo toolLibrary)
        {
            if (!File.Exists(depsPath))
            {
                GenerateDepsJsonFile(toolLockFile, framework, depsPath, toolLibrary);
            }
        }

        internal void GenerateDepsJsonFile(
            LockFile toolLockFile,
            NuGetFramework framework,
            string depsPath,
            SingleProjectInfo toolLibrary)
        {
            Reporter.Verbose.WriteLine(string.Format(
                LocalizableStrings.GeneratingDepsJson,
                depsPath));

            var dependencyContext = new DepsJsonBuilder()
                .Build(toolLibrary, null, toolLockFile, framework, null);

            var tempDepsFile = Path.GetTempFileName();
            using (var fileStream = File.Open(tempDepsFile, FileMode.Open, FileAccess.Write))
            {
                var dependencyContextWriter = new DependencyContextWriter();

                dependencyContextWriter.Write(dependencyContext, fileStream);
            }

            try
            {
                File.Move(tempDepsFile, depsPath);
            }
            catch (Exception e)
            {
                Reporter.Verbose.WriteLine(string.Format(
                    LocalizableStrings.UnableToGenerateDepsJson,
                    e.Message));

                try
                {
                    File.Delete(tempDepsFile);
                }
                catch (Exception e2)
                {
                    Reporter.Verbose.WriteLine(string.Format(
                        LocalizableStrings.UnableToDeleteTemporaryDepsJson,
                        e2.Message));
                }
            }
        }
    }
}


text:
find_path(GRIDTOOLS_ROOT NAMES include/gridtools.hpp)

# Look for GridTools headers
find_path(GRIDTOOLS_INCLUDE_DIRS
    NAMES gridtools.hpp
    HINTS ${GRIDTOOLS_ROOT}/include
          $ENV{GRIDTOOLS_ROOT}/include
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GRIDTOOLS DEFAULT_MSG GRIDTOOLS_INCLUDE_DIRS)

if(GRIDTOOLS_FOUND)
    mark_as_advanced(GRIDTOOLS_INCLUDE_DIRS)
    message(STATUS "GridTools found at ${GRIDTOOLS_ROOT}")
else()
    # If the package was required we abort the process
    if(${GridTools_FIND_REQUIRED})
        message(FATAL_ERROR "Could NOT find GRIDTOOLS. (Try setting GRIDTOOLS_ROOT in the env)")
    endif(${GridTools_FIND_REQUIRED})
endif()


text:
Simple Type
--FILE--
<?php

try {

    // create client in WSDL mode
    $client = new WSClient(array ("wsdl" =>"http://localhost/services/wsdl_mode/SimpleTypeService.php?wsdl",
                                  "to" => "http://localhost:80/services/wsdl_mode/SimpleTypeService.php",
                            ));

    // get proxy object reference form client
    $proxy = $client->getProxy();

    // create input object and set values
    //TODO: fill $input with (data type: int) data to match your business logic
    $input = 3;

    // call the operation
    $response = $proxy->myDemo($input);
    //TODO: Implement business logic to consume $response, which is of type int

    echo $response."\n";

} catch (Exception $e) {
    // in case of an error, process the fault
    if ($e instanceof WSFault) {
        printf("Soap Fault: %s\n", $e->Reason);
    } else {
        printf("Message = %s\n", $e->getMessage());
    }
}
?>
--EXPECT--
3


text:
/*jslint
*/

/*global
  $,
  Line, Markers, Persist
*/

var Lines = {};
Lines.m_map = null;
Lines.m_nextLineId = 0;
Lines.m_lines = [];

Lines.init = function (themap) {
    'use strict';

    Lines.m_map = themap;
    Lines.m_nextLineId = 0;
    Lines.m_lines = [];
};

Lines.newLine = function (source, target) {
    'use strict';

    var m1 = Markers.getById(source),
        m2 = Markers.getById(target);

    if (!m1 || m1.isFree()) {
        source = -1;
    }
    if (!m2 || m2.isFree()) {
        target = -1;
    }

    this.m_lines.push(new Line(Lines.m_map, this.m_nextLineId, source, target));
    this.m_nextLineId += 1;
    this.updateTotalDistance();
    this.store();
};

Lines.getLineIndex = function (id) {
    'use strict';

    var index, line;

    for (index = 0; index < this.m_lines.length; index += 1) {
        line = this.m_lines[index];
        if (line && line.getId() === id) {
            return index;
        }
    }

    return -1;
};

Lines.getLineById = function (id) {
    'use strict';

    var index = this.getLineIndex(id);
    if (index < 0) {
        return null;
    }
    return this.m_lines[index];
};

Lines.getLinesText = function () {
    'use strict';

    var a = [];
    this.m_lines.map(function (line) {
        if (line) {
            a.push(line.getEndpointsString());
        }
    });
    return a.join("*");
};

Lines.store = function () {
    'use strict';

    Persist.setValue("lines", this.getLinesText());
};

Lines.selectLineSourceById = function (id, markerId) {
    'use strict';

    this.getLineById(id).setSource(markerId);
    this.updateTotalDistance();
    this.store();
};

Lines.selectLineSource = function (id) {
    'use strict';

    var markerId = -1,
        opt = $("#dynline" + id + " .source option:selected");

    if (opt) {
        markerId = parseInt(opt.val(), 10);
    }

    this.selectLineSourceById(id, markerId);
};

Lines.selectLineTargetById = function (id, markerId) {
    'use strict';

    this.getLineById(id).setTarget(markerId);
    this.updateTotalDistance();
    this.store();
};

Lines.selectLineTarget = function (id) {
    'use strict';

    var markerId = -1,
        opt = $("#dynline" + id + " .target option:selected");

    if (opt) {
        markerId = parseInt(opt.val(), 10);
    }

    this.selectLineTargetById(id, markerId);
};

Lines.updateLinesMarkerMoved = function (markerId) {
    'use strict';

    this.m_lines.map(function (line) {
        if (line) {
            line.updateMarkerMoved(markerId);
        }
    });

    this.updateTotalDistance();
};

Lines.updateLinesMarkerAdded = function () {
    'use strict';

    this.m_lines.map(function (line) {
        if (line) {
            line.updateMarkerAdded();
        }
    });
};

Lines.updateLinesMarkerRemoved = function (markerId) {
    'use strict';

    this.m_lines.map(function (line) {
        if (line) {
            line.updateMarkerRemoved(markerId);
        }
    });

    this.updateTotalDistance();
    this.store();
};

Lines.updateLine = function (id) {
    'use strict';

    var index = this.getLineIndex(id);
    if (index < 0) {
        return;
    }

    this.m_lines[index].update();
    this.updateTotalDistance();
};

Lines.deleteLine = function (id) {
    'use strict';

    $('#dynline' + id).remove();

    var index = this.getLineIndex(id);
    if (index < 0 || !this.m_lines[index]) {
        return;
    }

    this.m_lines[index].clearMapObject();
    this.m_lines[index] = null;

    this.updateTotalDistance();
    this.store();
};

Lines.deleteAllLines = function () {
    'use strict';

    var self = this;
    this.m_lines.map(function (line) {
        if (line) {
            self.deleteLine(line.getId());
        }
    });

    this.updateTotalDistance();
};

Lines.updateTotalDistance = function () {
    'use strict';

    var lines = 0,
        distance = 0;

    this.m_lines.map(function (line) {
        if (line) {
            var d = line.distance();
            lines += 1;
            if (d > 0) {
                distance += d;
            }
        }
    });

    if (lines > 0) {
        $('#lineDist').html(distance.toFixed() + "m");
        $('#lineDistDiv').show();
    } else {
        $('#lineDistDiv').hide();
    }
};


text:
package com.zegoggles.smssync.auth;

import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AccountsException;
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import com.zegoggles.smssync.preferences.AuthPreferences;

import java.io.IOException;

import static android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH;
import static android.text.TextUtils.isEmpty;
import static com.zegoggles.smssync.App.TAG;
import static com.zegoggles.smssync.activity.auth.AccountManagerAuthActivity.AUTH_TOKEN_TYPE;
import static com.zegoggles.smssync.activity.auth.AccountManagerAuthActivity.GOOGLE_TYPE;

public class TokenRefresher {
    private @Nullable final AccountManager accountManager;
    private final OAuth2Client oauth2Client;
    private AuthPreferences authPreferences;

    public TokenRefresher(Context context, OAuth2Client oauth2Client, AuthPreferences authPreferences) {
        this(AccountManager.get(context), oauth2Client, authPreferences);
    }

    TokenRefresher(@Nullable AccountManager accountManager, OAuth2Client oauth2Client,
                   AuthPreferences authPreferences) {
        this.authPreferences = authPreferences;
        this.oauth2Client = oauth2Client;
        this.accountManager = accountManager;
    }

    public void refreshOAuth2Token() throws TokenRefreshException{
        final String token = authPreferences.getOauth2Token();
        final String refreshToken = authPreferences.getOauth2RefreshToken();
        final String name = authPreferences.getOauth2Username();

        if (isEmpty(token)) {
            throw new TokenRefreshException("no current token set");
        }

        if (!isEmpty(refreshToken)) {
            // user authenticated using webflow
            refreshUsingOAuth2Client(name, refreshToken);
        } else {
            refreshUsingAccountManager(token, name);
        }
    }

    private void refreshUsingAccountManager(String token, String name) throws TokenRefreshException {
        if (accountManager == null) throw new TokenRefreshException("account manager is null");
        invalidateToken(token);
        try {
            Bundle bundle = getAuthToken(new Account(name, GOOGLE_TYPE));

            if (bundle != null) {
                String newToken = bundle.getString(AccountManager.KEY_AUTHTOKEN);

                if (!isEmpty(newToken)) {
                    authPreferences.setOauth2Token(name, newToken, null);
                } else {
                    throw new TokenRefreshException("no new token obtained");
                }
            } else {
                throw new TokenRefreshException("no bundle received from accountmanager");
            }
        } catch (AccountsException e) {
            Log.w(TAG, e);
            throw new TokenRefreshException(e);
        } catch (IOException e) {
            Log.w(TAG, e);
            throw new TokenRefreshException(e);
        }
    }

    private Bundle getAuthToken(Account account) throws AccountsException, IOException {
        if (Build.VERSION.SDK_INT >= 14) {
            return getAuthTokenApi14(account);
        } else {
            return getAuthTokenPreApi14(account);
        }
    }

    @SuppressWarnings("deprecation")
    private Bundle getAuthTokenPreApi14(Account account) throws AccountsException, IOException {
        return accountManager.getAuthToken(
                account,
                AUTH_TOKEN_TYPE,
                true,
                null,
                null
        ).getResult();
    }

    @TargetApi(ICE_CREAM_SANDWICH)
    private Bundle getAuthTokenApi14(Account account) throws AccountsException, IOException {
        return accountManager.getAuthToken(account,
                AUTH_TOKEN_TYPE,
                null,
                true,
                null,
                null
        ).getResult();
    }

    public boolean invalidateToken(String token) {
        if (accountManager != null) {
            // USE_CREDENTIALS permission should be enough according to docs
            // but some systems require MANAGE_ACCOUNTS

            // java.lang.SecurityException: caller uid 10051 lacks android.permission.MANAGE_ACCOUNTS
            try {
                accountManager.invalidateAuthToken(GOOGLE_TYPE, token);
                return true;
            } catch (SecurityException e) {
                Log.w(TAG, e);
            }
        }
        return false;
    }

    private void refreshUsingOAuth2Client(String name, String refreshToken) throws TokenRefreshException {
        try {
            final OAuth2Token token = oauth2Client.refreshToken(refreshToken);
            authPreferences.setOauth2Token(name, token.accessToken, isEmpty(token.refreshToken) ? refreshToken : token.refreshToken);
        } catch (IOException e) {
            throw new TokenRefreshException(e);
        }
    }
}


text:
package org.hawkular.apm.instrumenter.io;

import java.io.IOException;
import java.io.InputStream;

import org.hawkular.apm.api.model.config.Direction;
import org.hawkular.apm.client.collector.TraceCollector;

/**
 * This class provides an instrumented proxy for an input stream.
 *
 * @author gbrown
 */
public class InstrumentedInputStream extends InputStream {

    private TraceCollector collector;
    private Direction direction;
    private InputStream is;

    /**
     * The constructor for the instrumented input stream.
     *
     * @param collector The collector
     * @param direction The direction
     * @param is The original input stream
     */
    public InstrumentedInputStream(TraceCollector collector, Direction direction, InputStream is) {
        this.collector = collector;
        this.direction = direction;
        this.is = is;

        if (direction == Direction.In) {
            collector.initInBuffer(null, this);
        } else {
            collector.initOutBuffer(null, this);
        }
    }

    @Override
    public int available() throws IOException {
        return is.available();
    }

    @Override
    public void mark(int readlimit) {
        is.mark(readlimit);
    }

    @Override
    public boolean markSupported() {
        return is.markSupported();
    }

    @Override
    public int read() throws IOException {
        return is.read();
    }

    @Override
    public int read(byte[] b) throws IOException {
        int len=is.read(b);
        if (direction == Direction.In) {
            collector.appendInBuffer(null, this, b, 0, len);
        } else {
            collector.appendOutBuffer(null, this, b, 0, len);
        }
        return len;
    }

    @Override
    public int read(byte[] b, int off, int len) throws IOException {
        int actuallen=is.read(b, off, len);
        if (direction == Direction.In) {
            collector.appendInBuffer(null, this, b, off, actuallen);
        } else {
            collector.appendOutBuffer(null, this, b, off, actuallen);
        }
        return actuallen;
    }

    @Override
    public void reset() throws IOException {
        is.reset();
    }

    @Override
    public long skip(long n) throws IOException {
        return is.skip(n);
    }

    @Override
    public void close() throws IOException {
        if (direction == Direction.In) {
            collector.recordInBuffer(null, this);
        } else {
            collector.recordOutBuffer(null, this);
        }
        is.close();
    }

    public String toString() {
        return "InstrumentedInputStream[" + is + "]";
    }
}


text:
// +build !ignore_autogenerated

// Code generated by controller-gen. DO NOT EDIT.

package v1alpha1

import (
	"k8s.io/api/core/v1"
	runtime "k8s.io/apimachinery/pkg/runtime"
)

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CacheCondition) DeepCopyInto(out *CacheCondition) {
	*out = *in
	in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime)
	in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CacheCondition.
func (in *CacheCondition) DeepCopy() *CacheCondition {
	if in == nil {
		return nil
	}
	out := new(CacheCondition)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in CacheStateList) DeepCopyInto(out *CacheStateList) {
	{
		in := &in
		*out = make(CacheStateList, len(*in))
		for key, val := range *in {
			(*out)[key] = val
		}
	}
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CacheStateList.
func (in CacheStateList) DeepCopy() CacheStateList {
	if in == nil {
		return nil
	}
	out := new(CacheStateList)
	in.DeepCopyInto(out)
	return *out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CacheStatus) DeepCopyInto(out *CacheStatus) {
	*out = *in
	if in.Conditions != nil {
		in, out := &in.Conditions, &out.Conditions
		*out = make([]CacheCondition, len(*in))
		for i := range *in {
			(*in)[i].DeepCopyInto(&(*out)[i])
		}
	}
	if in.CacheStates != nil {
		in, out := &in.CacheStates, &out.CacheStates
		*out = make(CacheStateList, len(*in))
		for key, val := range *in {
			(*out)[key] = val
		}
	}
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CacheStatus.
func (in *CacheStatus) DeepCopy() *CacheStatus {
	if in == nil {
		return nil
	}
	out := new(CacheStatus)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CacheableNodeAffinity) DeepCopyInto(out *CacheableNodeAffinity) {
	*out = *in
	if in.Required != nil {
		in, out := &in.Required, &out.Required
		*out = new(v1.NodeSelector)
		(*in).DeepCopyInto(*out)
	}
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CacheableNodeAffinity.
func (in *CacheableNodeAffinity) DeepCopy() *CacheableNodeAffinity {
	if in == nil {
		return nil
	}
	out := new(CacheableNodeAffinity)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Dataset) DeepCopyInto(out *Dataset) {
	*out = *in
	out.TypeMeta = in.TypeMeta
	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
	in.Spec.DeepCopyInto(&out.Spec)
	in.Status.DeepCopyInto(&out.Status)
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dataset.
func (in *Dataset) DeepCopy() *Dataset {
	if in == nil {
		return nil
	}
	out := new(Dataset)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Dataset) DeepCopyObject() runtime.Object {
	if c := in.DeepCopy(); c != nil {
		return c
	}
	return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DatasetList) DeepCopyInto(out *DatasetList) {
	*out = *in
	out.TypeMeta = in.TypeMeta
	in.ListMeta.DeepCopyInto(&out.ListMeta)
	if in.Items != nil {
		in, out := &in.Items, &out.Items
		*out = make([]Dataset, len(*in))
		for i := range *in {
			(*in)[i].DeepCopyInto(&(*out)[i])
		}
	}
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatasetList.
func (in *DatasetList) DeepCopy() *DatasetList {
	if in == nil {
		return nil
	}
	out := new(DatasetList)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *DatasetList) DeepCopyObject() runtime.Object {
	if c := in.DeepCopy(); c != nil {
		return c
	}
	return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DatasetSpec) DeepCopyInto(out *DatasetSpec) {
	*out = *in
	if in.Mounts != nil {
		in, out := &in.Mounts, &out.Mounts
		*out = make([]Mount, len(*in))
		for i := range *in {
			(*in)[i].DeepCopyInto(&(*out)[i])
		}
	}
	if in.Replicas != nil {
		in, out := &in.Replicas, &out.Replicas
		*out = new(int32)
		**out = **in
	}
	if in.NodeAffinity != nil {
		in, out := &in.NodeAffinity, &out.NodeAffinity
		*out = new(CacheableNodeAffinity)
		(*in).DeepCopyInto(*out)
	}
	if in.Tolerations != nil {
		in, out := &in.Tolerations, &out.Tolerations
		*out = make([]v1.Toleration, len(*in))
		for i := range *in {
			(*in)[i].DeepCopyInto(&(*out)[i])
		}
	}
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatasetSpec.
func (in *DatasetSpec) DeepCopy() *DatasetSpec {
	if in == nil {
		return nil
	}
	out := new(DatasetSpec)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DatasetStatus) DeepCopyInto(out *DatasetStatus) {
	*out = *in
	in.CacheStatus.DeepCopyInto(&out.CacheStatus)
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatasetStatus.
func (in *DatasetStatus) DeepCopy() *DatasetStatus {
	if in == nil {
		return nil
	}
	out := new(DatasetStatus)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Mount) DeepCopyInto(out *Mount) {
	*out = *in
	if in.Options != nil {
		in, out := &in.Options, &out.Options
		*out = make(map[string]string, len(*in))
		for key, val := range *in {
			(*out)[key] = val
		}
	}
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Mount.
func (in *Mount) DeepCopy() *Mount {
	if in == nil {
		return nil
	}
	out := new(Mount)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Runtime) DeepCopyInto(out *Runtime) {
	*out = *in
	out.TypeMeta = in.TypeMeta
	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
	in.Spec.DeepCopyInto(&out.Spec)
	in.Status.DeepCopyInto(&out.Status)
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Runtime.
func (in *Runtime) DeepCopy() *Runtime {
	if in == nil {
		return nil
	}
	out := new(Runtime)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Runtime) DeepCopyObject() runtime.Object {
	if c := in.DeepCopy(); c != nil {
		return c
	}
	return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RuntimeCondition) DeepCopyInto(out *RuntimeCondition) {
	*out = *in
	in.LastProbeTime.DeepCopyInto(&out.LastProbeTime)
	in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeCondition.
func (in *RuntimeCondition) DeepCopy() *RuntimeCondition {
	if in == nil {
		return nil
	}
	out := new(RuntimeCondition)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RuntimeList) DeepCopyInto(out *RuntimeList) {
	*out = *in
	out.TypeMeta = in.TypeMeta
	in.ListMeta.DeepCopyInto(&out.ListMeta)
	if in.Items != nil {
		in, out := &in.Items, &out.Items
		*out = make([]Runtime, len(*in))
		for i := range *in {
			(*in)[i].DeepCopyInto(&(*out)[i])
		}
	}
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeList.
func (in *RuntimeList) DeepCopy() *RuntimeList {
	if in == nil {
		return nil
	}
	out := new(RuntimeList)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *RuntimeList) DeepCopyObject() runtime.Object {
	if c := in.DeepCopy(); c != nil {
		return c
	}
	return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RuntimeSpec) DeepCopyInto(out *RuntimeSpec) {
	*out = *in
	if in.Options != nil {
		in, out := &in.Options, &out.Options
		*out = make(map[string]string, len(*in))
		for key, val := range *in {
			(*out)[key] = val
		}
	}
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeSpec.
func (in *RuntimeSpec) DeepCopy() *RuntimeSpec {
	if in == nil {
		return nil
	}
	out := new(RuntimeSpec)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RuntimeStatus) DeepCopyInto(out *RuntimeStatus) {
	*out = *in
	if in.Conditions != nil {
		in, out := &in.Conditions, &out.Conditions
		*out = make([]RuntimeCondition, len(*in))
		for i := range *in {
			(*in)[i].DeepCopyInto(&(*out)[i])
		}
	}
	if in.CacheStates != nil {
		in, out := &in.CacheStates, &out.CacheStates
		*out = make(CacheStateList, len(*in))
		for key, val := range *in {
			(*out)[key] = val
		}
	}
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeStatus.
func (in *RuntimeStatus) DeepCopy() *RuntimeStatus {
	if in == nil {
		return nil
	}
	out := new(RuntimeStatus)
	in.DeepCopyInto(out)
	return out
}


text:
class RenameMicropostsToTasks < ActiveRecord::Migration
  def change
    rename_table :microposts, :tasks
  end
end


text:
package me.tsukanov.counter.domain;

import androidx.annotation.NonNull;
import dagger.Module;
import dagger.Provides;
import javax.inject.Singleton;
import me.tsukanov.counter.CounterApplication;
import me.tsukanov.counter.R;
import me.tsukanov.counter.infrastructure.BroadcastHelper;
import me.tsukanov.counter.repository.CounterStorage;
import me.tsukanov.counter.repository.SharedPrefsCounterStorage;

@Module
public class CounterModule {

  private final CounterApplication app;

  public CounterModule(CounterApplication app) {
    this.app = app;
  }

  @Provides
  @Singleton
  CounterApplication provideApp() {
    return app;
  }

  @Provides
  @Singleton
  CounterStorage<IntegerCounter> provideCounterStorage(final @NonNull CounterApplication app) {
    return new SharedPrefsCounterStorage(
        app,
        new BroadcastHelper(app),
        (String) app.getResources().getText(R.string.default_counter_name));
  }
}


text:
package com.ripariandata.timberwolf.writer.hive;

import com.ripariandata.timberwolf.mail.MailboxItem;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;

import java.util.ArrayList;

import org.apache.commons.lang.StringUtils;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.PositionedReadable;
import org.apache.hadoop.fs.Seekable;
import org.apache.hadoop.io.SequenceFile;
import org.apache.hadoop.io.Text;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

/** Excercises and verifies the functionality of SequenceFileMailWriter. */
public class SequenceFileMailWriterTest
{
    /** An entirely in-memory input stream that can be consumed by FSDataInputStream. */
    private class SeekablePositionedReadableByteArrayInputStream
        extends ByteArrayInputStream
        implements Seekable, PositionedReadable
    {
        public SeekablePositionedReadableByteArrayInputStream(final byte[] data)
        {
            super(data);
        }

        // PositionReadable methods

        public int read(final long position, final byte[] buffer, final int offset, final int length) throws IOException
        {
            this.mark(0);

            int r = 0;
            try
            {
                this.seek(position);
                r = this.read(buffer, offset, length);
            }
            finally
            {
                this.reset();
            }

            return r;
        }

        public void readFully(final long position, final byte[] buffer, final int offset, final int length)
            throws IOException
        {
            int r = this.read(position, buffer, offset, length);
            if (r != length)
            {
                throw new IOException();
            }
        }

        public void readFully(final long position, final byte[] buffer) throws IOException
        {
            this.readFully(position, buffer, 0, buffer.length);
        }

        // Seekable methods

        public void seek(final long pos) throws IOException
        {
            if (pos > this.count)
            {
                throw new IOException();
            }
            this.pos = (int) pos;
        }

        public long getPos() throws IOException
        {
            return this.pos;
        }

        public boolean seekToNewSource(final long targetPos) throws IOException
        {
            throw new IOException("I don't really know what this is supposed to do.");
        }
    }

    @SuppressWarnings("deprecation")
    private FileSystem mockFileSystem(final String path, final byte[] data) throws IOException
    {
        FileSystem fs = mock(FileSystem.class);
        Path fsPath = new Path(path);
        when(fs.open(eq(fsPath), any(int.class)))
            .thenReturn(new FSDataInputStream(new SeekablePositionedReadableByteArrayInputStream(data)));
        when(fs.getLength(eq(fsPath))).thenReturn((long) data.length);
        return fs;
    }

    @SuppressWarnings("deprecation")
    private SequenceFile.Reader writeMails(final Iterable<MailboxItem> mails) throws IOException
    {
        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        FSDataOutputStream output = new FSDataOutputStream(byteOut);
        SequenceFileMailWriter writer = new SequenceFileMailWriter(output);

        writer.write(mails);

        FileSystem fs = mockFileSystem("file", byteOut.toByteArray());
        return new SequenceFile.Reader(fs, new Path("file"), new Configuration());
    }

    @Test
    public void testWriteNothing() throws IOException
    {
        SequenceFile.Reader reader = writeMails(new ArrayList<MailboxItem>());

        Text key = new Text();
        Text value = new Text();
        assertFalse(reader.next(key, value));
    }

    private static MailboxItem mockMailboxItem(final String key, final String body, final String subject,
                                               final String timesent, final String sender, final String to,
                                               final String cc, final String bcc)
    {
        MailboxItem mail = mock(MailboxItem.class);
        ArrayList<String> headers = new ArrayList<String>();
        when(mail.hasKey(any(String.class))).thenReturn(true);
        when(mail.getHeader("Item ID")).thenReturn(key);
        if (body != null)
        {
            when(mail.getHeader("Body")).thenReturn(body);
            headers.add("Body");
        }
        if (subject != null)
        {
            when(mail.getHeader("Subject")).thenReturn(subject);
            headers.add("Subject");
        }
        if (timesent != null)
        {
            when(mail.getHeader("Time Sent")).thenReturn(timesent);
            headers.add("Time Sent");
        }
        if (sender != null)
        {
            when(mail.getHeader("Sender")).thenReturn(sender);
            headers.add("Sender");
        }
        if (to != null)
        {
            when(mail.getHeader("To")).thenReturn(to);
            headers.add("To");
        }
        if (cc != null)
        {
            when(mail.getHeader("Cc")).thenReturn(cc);
            headers.add("Cc");
        }
        if (bcc != null)
        {
            when(mail.getHeader("Bcc")).thenReturn(bcc);
            headers.add("Bcc");
        }
        when(mail.getHeaderKeys()).thenReturn(headers.toArray(new String[0]));
        return mail;
    }

    @Test
    public void testWriteAllHeaders() throws IOException
    {
        MailboxItem mail = mockMailboxItem("key", "Here's an email.", "Subject!!", "11 o'clock", "jim@example.com",
                                           "james@example.com", "j@example.com", "jane@example.com");
        ArrayList<MailboxItem> mails = new ArrayList<MailboxItem>();
        mails.add(mail);
        SequenceFile.Reader reader = writeMails(mails);

        char separator = 0x1F;
        Text key = new Text();
        Text value = new Text();
        assertTrue(reader.next(key, value));
        assertEquals("key", key.toString());
        assertEquals(StringUtils.join(new String[] { "Here's an email.", "Subject!!", "11 o'clock", "jim@example.com",
                                                     "james@example.com", "j@example.com", "jane@example.com" },
                                      separator), value.toString());
        assertFalse(reader.next(key, value));
    }

    @Test
    public void testWriteSomeHeaders() throws IOException
    {
        MailboxItem mail = mockMailboxItem("key", "Body of an email.", null, "12 o'clock", null, null, null,
                                           "j@example.com");
        ArrayList<MailboxItem> mails = new ArrayList<MailboxItem>();
        mails.add(mail);
        SequenceFile.Reader reader = writeMails(mails);

        char separator = 0x1F;
        Text key = new Text();
        Text value = new Text();
        assertTrue(reader.next(key, value));
        assertEquals("key", key.toString());
        assertEquals(StringUtils.join(new String[] { "Body of an email.", "", "12 o'clock", "", "", "",
                                                     "j@example.com" }, separator), value.toString());
        assertFalse(reader.next(key, value));
    }

    @Test
    public void testWriteManyMails() throws IOException
    {
        ArrayList<MailboxItem> mails = new ArrayList<MailboxItem>();
        mails.add(mockMailboxItem("key1", "BodyOne", "SubjectTwo", "TimeSentThree", null, null, null, null));
        mails.add(mockMailboxItem("key2", "BodyA", "SubjectB", "TimeSentC", null, null, null, null));
        mails.add(mockMailboxItem("key3", "BodyDee", "SubjectEee", "TimeSentEff", null, null, null, null));
        SequenceFile.Reader reader = writeMails(mails);

        char separator = 0x1F;
        Text key = new Text();
        Text value = new Text();
        assertTrue(reader.next(key, value));
        assertEquals("key1", key.toString());
        assertEquals(StringUtils.join(new String[] { "BodyOne", "SubjectTwo", "TimeSentThree", "", "", "", "" },
                                      separator), value.toString());
        assertTrue(reader.next(key, value));
        assertEquals("key2", key.toString());
        assertEquals(StringUtils.join(new String[] { "BodyA", "SubjectB", "TimeSentC", "", "", "", "" }, separator),
                     value.toString());
        assertTrue(reader.next(key, value));
        assertEquals("key3", key.toString());
        assertEquals(StringUtils.join(new String[] { "BodyDee", "SubjectEee", "TimeSentEff", "", "" , "", "" },
                                      separator), value.toString());
        assertFalse(reader.next(key, value));
    }

    @Test
    public void testWriteMailWithNoHeaders() throws IOException
    {
        MailboxItem mail = mock(MailboxItem.class);
        String[] headers = {"Item ID" };
        when(mail.getHeaderKeys()).thenReturn(headers);
        when(mail.hasKey(any(String.class))).thenReturn(true);
        when(mail.getHeader("Item ID")).thenReturn("key");
        ArrayList<MailboxItem> mails = new ArrayList<MailboxItem>();
        mails.add(mail);
        SequenceFile.Reader reader = writeMails(mails);

        char separator = 0x1F;
        Text key = new Text();
        Text value = new Text();
        assertTrue(reader.next(key, value));
        assertEquals("key", key.toString());
        assertEquals(StringUtils.join(new String[] { "", "", "", "", "", "", "" }, separator), value.toString());
    }

    /** An output stream that throws an exception whenever you try to write to it. */
    private class ExceptionalOutputStream extends OutputStream
    {
        @Override
        public void write(final int b) throws IOException
        {
            throw new IOException("Can't write to exceptional stream.");
        }
    }

    @Test
    @SuppressWarnings("deprecation")
    public void testWriteMailToStreamWithException() throws IOException
    {
        ArrayList<MailboxItem> mails = new ArrayList<MailboxItem>();
        mails.add(mockMailboxItem("key1", "body", "subject", "timesent", "sender", "to", "cc", "bcc"));
        OutputStream byteOut = new ExceptionalOutputStream();
        FSDataOutputStream output = new FSDataOutputStream(byteOut);
        SequenceFileMailWriter writer = new SequenceFileMailWriter(output);

        try
        {
            writer.write(mails);
            fail("Call to write should have thrown an exception.");
        }
        catch (HiveMailWriterException e)
        {
            // Our static analysis doesn't like empty blocks.
            assertTrue(true);
        }
        catch (Exception e)
        {
            fail("Wrong exception type.");
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Dapper;
using Meracord.Transactions.LedgerBalance.Operations;

namespace Meracord.Transactions.LedgerBalance.Queries
{
    public class GetCompleteAccountTransactionHistoryQuery
        : IOperation<Transaction>
    {
        private readonly IDebtSettlementConnection _connection;
        private readonly Guid _accountId;

        public GetCompleteAccountTransactionHistoryQuery(IDebtSettlementConnection connection, Guid accountId) {
            _connection = connection;
            _accountId = accountId;
        }

        public IEnumerable<Transaction> Execute(IEnumerable<Transaction> input) {
            using (var conn = _connection.CreateConnection()) {
                conn.Open();

                const string q = @"
                SELECT t.TransactionId
                    , t.ParentTransactionId
                    , t.TransactionGuid
                    , t.AccountId
                    , t.DisbursementAccountId
                    , t.ReceiptId
                    , t.TransactionTypeId
                    , t.Amount
                    , t.IsReallocated
                    , t.IsClearedForGoodFunds
                    , t.IsReversed
                    , t.TransactionTypeGuid
                    , t.AllocationTypeId
                    , t.CreationDateTime
                    , t.LastEditDateTime
                    , dbo.fnDateTrunc(case when Receipts.EffectiveDate is not null then Receipts.EffectiveDate else t.CreationDateTime end) as TransactionDate
	            FROM VTransactionsLedgerView t WITH (NOLOCK)
	            INNER JOIN Accounts ON t.AccountId = Accounts.AccountId
                INNER JOIN Receipts ON t.ReceiptId = Receipts.ReceiptId
                WHERE Accounts.AccountGUID = @AccountGUID

        	    UNION

                SELECT t.TransactionId
                    , t.ParentTransactionId
                    , t.TransactionGuid
                    , t.AccountId
                    , t.DisbursementAccountId
                    , t.ReceiptId
                    , t.TransactionTypeId
                    , t.Amount
                    , t.IsReallocated
                    , t.IsClearedForGoodFunds
                    , t.IsReversed
                    , t.TransactionTypeGuid
                    , t.AllocationTypeId
                    , t.CreationDateTime
                    , t.LastEditDateTime
                    , dbo.fnDateTrunc(case when Receipts.EffectiveDate is not null then Receipts.EffectiveDate else t.CreationDateTime end) as TransactionDate
	            FROM VTransactionsLedgerView t WITH (NOLOCK)
	            INNER JOIN Accounts ON t.DisbursementAccountId = Accounts.AccountId
                INNER JOIN Receipts ON t.ReceiptId = Receipts.ReceiptId
                WHERE Accounts.AccountGUID = @AccountGUID";

                return conn.Query<Transaction>(q, new { AccountGUID = _accountId }).Distinct();
            }
        }
    }
}


text:
package uk.theretiredprogrammer.racetrainingdemonstrator.core.api;

import org.openide.util.Lookup;
import uk.theretiredprogrammer.racetrainingdemonstrator.core.ScenarioElement;

/**
 * The Abstract DisplayableElement Factory Class.
 *
 * @author Richard Linsdale (richard at theretiredprogrammer.uk)
 */
public abstract class FlowElementFactory {

    /**
     * createInstance an element
     *
     * @param instancename the objectname
     * @param scenario the scenario to be applied
     * @return the element
     */
    public abstract FlowElement createInstance(String instancename, ScenarioElement scenario);

    /**
     * createInstance the classrefname of this FlowElement class.
     *
     * @return the classrefname name
     */
    public abstract String getName();

    /**
     * Create a new Instance of the target class.
     *
     * @param classrefname the classrefname of the target class
     * @param instancename the name to be given to the instance
     * @param scenario the scenario to be applied
     * @return the new instance of the target class
     */
    public static FlowElement createInstance(String classrefname, String instancename, ScenarioElement scenario) {
        for (FlowElementFactory factory : Lookup.getDefault().lookupAll(FlowElementFactory.class)) {
            if (factory.getName().equals(classrefname)) {
                return factory.createInstance(instancename, scenario);
            }
        }
        return null;
    }

}


text:
class AddCollectionItemsCountToUsers < ActiveRecord::Migration
  def change
    add_column :users, :collection_items_count, :integer, default: 0
  end
end


text:
package com.pentaho.di.services;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;

/**
 * This object contains factory methods for each Java content interface and Java element interface generated in the
 * com.pentaho.di.services package.
 * <p>
 * An ObjectFactory allows you to programatically construct new instances of the Java representation for XML content.
 * The Java representation of XML content can consist of schema derived interfaces and classes representing the binding
 * of schema type definitions, element declarations and model groups. Factory methods for each of these are provided in
 * this class.
 *
 */
@XmlRegistry
public class ObjectFactory {

  private final static QName _FileVersioningConfiguration_QNAME = new QName( "", "fileVersioningConfiguration" );

  /**
   * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package:
   * com.pentaho.di.services
   *
   */
  public ObjectFactory() {
  }

  /**
   * Create an instance of {@link FileVersioningConfiguration }
   *
   */
  public FileVersioningConfiguration createFileVersioningConfiguration() {
    return new FileVersioningConfiguration();
  }

  /**
   * Create an instance of {@link JAXBElement }{@code <}{@link FileVersioningConfiguration }{@code >}
   *
   */
  @XmlElementDecl( namespace = "", name = "fileVersioningConfiguration" )
  public JAXBElement<FileVersioningConfiguration> createFileVersioningConfiguration( FileVersioningConfiguration value ) {
    return new JAXBElement<FileVersioningConfiguration>( _FileVersioningConfiguration_QNAME,
        FileVersioningConfiguration.class, null, value );
  }

}