text:
import { QuickInputButtons, QuickPickItem } from 'vscode';
import { Container } from '../../container';
import { GitReference, GitTagReference, Repository } from '../../git/models';
import { QuickPickItemOfT } from '../../quickpicks/items/common';
import { FlagsQuickPickItem } from '../../quickpicks/items/flags';
import { pluralize } from '../../system/string';
import { ViewsWithRepositoryFolders } from '../../views/viewBase';
import {
	appendReposToTitle,
	AsyncStepResultGenerator,
	inputTagNameStep,
	PartialStepState,
	pickBranchOrTagStep,
	pickRepositoryStep,
	pickTagsStep,
	QuickCommand,
	QuickPickStep,
	StepGenerator,
	StepResult,
	StepResultGenerator,
	StepSelection,
	StepState,
} from '../quickCommand';

interface Context {
	repos: Repository[];
	associatedView: ViewsWithRepositoryFolders;
	showTags: boolean;
	title: string;
}

type CreateFlags = '--force' | '-m';

interface CreateState {
	subcommand: 'create';
	repo: string | Repository;
	reference: GitReference;
	name: string;
	message: string;
	flags: CreateFlags[];
}

interface DeleteState {
	subcommand: 'delete';
	repo: string | Repository;
	references: GitTagReference | GitTagReference[];
}

type State = CreateState | DeleteState;
type TagStepState<T extends State> = SomeNonNullable<StepState<T>, 'subcommand'>;
type CreateStepState<T extends CreateState = CreateState> = TagStepState<ExcludeSome<T, 'repo', string>>;
type DeleteStepState<T extends DeleteState = DeleteState> = TagStepState<ExcludeSome<T, 'repo', string>>;

const subcommandToTitleMap = new Map<State['subcommand'], string>([
	['create', 'Create'],
	['delete', 'Delete'],
]);
function getTitle(title: string, subcommand: State['subcommand'] | undefined) {
	return subcommand == null ? title : `${subcommandToTitleMap.get(subcommand)} ${title}`;
}

export interface TagGitCommandArgs {
	readonly command: 'tag';
	confirm?: boolean;
	state?: Partial<State>;
}

export class TagGitCommand extends QuickCommand<State> {
	private subcommand: State['subcommand'] | undefined;

	constructor(container: Container, args?: TagGitCommandArgs) {
		super(container, 'tag', 'tag', 'Tag', {
			description: 'create, or delete tags',
		});

		let counter = 0;
		if (args?.state?.subcommand != null) {
			counter++;

			switch (args.state.subcommand) {
				case 'create':
					if (args.state.reference != null) {
						counter++;
					}

					if (args.state.name != null) {
						counter++;
					}

					if (args.state.message != null) {
						counter++;
					}

					break;
				case 'delete':
					if (
						args.state.references != null &&
						(!Array.isArray(args.state.references) || args.state.references.length !== 0)
					) {
						counter++;
					}

					break;
			}
		}

		if (args?.state?.repo != null) {
			counter++;
		}

		this.initialState = {
			counter: counter,
			confirm: args?.confirm,
			...args?.state,
		};
	}

	override get canConfirm(): boolean {
		return this.subcommand != null;
	}

	override get canSkipConfirm(): boolean {
		return this.subcommand === 'delete' ? false : super.canSkipConfirm;
	}

	override get skipConfirmKey() {
		return `${this.key}${this.subcommand == null ? '' : `-${this.subcommand}`}:${this.pickedVia}`;
	}

	protected async *steps(state: PartialStepState<State>): StepGenerator {
		const context: Context = {
			repos: this.container.git.openRepositories,
			associatedView: this.container.tagsView,
			showTags: false,
			title: this.title,
		};

		let skippedStepTwo = false;

		while (this.canStepsContinue(state)) {
			context.title = this.title;

			if (state.counter < 1 || state.subcommand == null) {
				this.subcommand = undefined;

				const result = yield* this.pickSubcommandStep(state);
				// Always break on the first step (so we will go back)
				if (result === StepResult.Break) break;

				state.subcommand = result;
			}

			this.subcommand = state.subcommand;

			if (state.counter < 2 || state.repo == null || typeof state.repo === 'string') {
				skippedStepTwo = false;
				if (context.repos.length === 1) {
					skippedStepTwo = true;
					state.counter++;

					state.repo = context.repos[0];
				} else {
					const result = yield* pickRepositoryStep(state, context);
					if (result === StepResult.Break) continue;

					state.repo = result;
				}
			}

			context.title = getTitle(state.subcommand === 'delete' ? 'Tags' : this.title, state.subcommand);

			switch (state.subcommand) {
				case 'create': {
					yield* this.createCommandSteps(state as CreateStepState, context);
					// Clear any chosen name, since we are exiting this subcommand
					state.name = undefined;
					break;
				}
				case 'delete':
					yield* this.deleteCommandSteps(state as DeleteStepState, context);
					break;
				default:
					QuickCommand.endSteps(state);
					break;
			}

			// If we skipped the previous step, make sure we back up past it
			if (skippedStepTwo) {
				state.counter--;
			}
		}

		return state.counter < 0 ? StepResult.Break : undefined;
	}

	private *pickSubcommandStep(state: PartialStepState<State>): StepResultGenerator<State['subcommand']> {
		const step = QuickCommand.createPickStep<QuickPickItemOfT<State['subcommand']>>({
			title: this.title,
			placeholder: `Choose a ${this.label} command`,
			items: [
				{
					label: 'create',
					description: 'creates a new tag',
					picked: state.subcommand === 'create',
					item: 'create',
				},
				{
					label: 'delete',
					description: 'deletes the specified tags',
					picked: state.subcommand === 'delete',
					item: 'delete',
				},
			],
			buttons: [QuickInputButtons.Back],
		});
		const selection: StepSelection<typeof step> = yield step;
		return QuickCommand.canPickStepContinue(step, state, selection) ? selection[0].item : StepResult.Break;
	}

	private async *createCommandSteps(state: CreateStepState, context: Context): AsyncStepResultGenerator<void> {
		if (state.flags == null) {
			state.flags = [];
		}

		while (this.canStepsContinue(state)) {
			if (state.counter < 3 || state.reference == null) {
				const result = yield* pickBranchOrTagStep(state, context, {
					placeholder: context =>
						`Choose a branch${context.showTags ? ' or tag' : ''} to create the new tag from`,
					picked: state.reference?.ref ?? (await state.repo.getBranch())?.ref,
					titleContext: ' from',
					value: GitReference.isRevision(state.reference) ? state.reference.ref : undefined,
				});
				// Always break on the first step (so we will go back)
				if (result === StepResult.Break) break;

				state.reference = result;
			}

			if (state.counter < 4 || state.name == null) {
				const result = yield* inputTagNameStep(state, context, {
					placeholder: 'Please provide a name for the new tag',
					titleContext: ` at ${GitReference.toString(state.reference, { capitalize: true, icon: false })}`,
					value: state.name ?? GitReference.getNameWithoutRemote(state.reference),
				});
				if (result === StepResult.Break) continue;

				state.name = result;
			}

			if (state.counter < 5 || state.message == null) {
				const result = yield* this.createCommandInputMessageStep(state, context);
				if (result === StepResult.Break) continue;

				state.message = result;
			}

			if (state.message.length !== 0 && !state.flags.includes('-m')) {
				state.flags.push('-m');
			}

			if (this.confirm(state.confirm)) {
				const result = yield* this.createCommandConfirmStep(state, context);
				if (result === StepResult.Break) continue;

				state.flags = result;
			}

			QuickCommand.endSteps(state);
			void state.repo.tag(
				...state.flags,
				...(state.message.length !== 0 ? [`"${state.message}"`] : []),
				state.name,
				state.reference.ref,
			);
		}
	}

	private async *createCommandInputMessageStep(
		state: CreateStepState,
		context: Context,
	): AsyncStepResultGenerator<string> {
		const step = QuickCommand.createInputStep({
			title: appendReposToTitle(
				`${context.title} at ${GitReference.toString(state.reference, { capitalize: true, icon: false })}`,
				state,
				context,
			),
			placeholder: 'Please provide an optional message to annotate the tag',
			value: state.message,
			prompt: 'Enter optional message',
		});

		const value: StepSelection<typeof step> = yield step;

		if (
			!QuickCommand.canStepContinue(step, state, value) ||
			!(await QuickCommand.canInputStepContinue(step, state, value))
		) {
			return StepResult.Break;
		}

		return value;
	}

	private *createCommandConfirmStep(
		state: CreateStepState<CreateState>,
		context: Context,
	): StepResultGenerator<CreateFlags[]> {
		const step: QuickPickStep<FlagsQuickPickItem<CreateFlags>> = QuickCommand.createConfirmStep(
			appendReposToTitle(`Confirm ${context.title}`, state, context),
			[
				FlagsQuickPickItem.create<CreateFlags>(state.flags, state.message.length !== 0 ? ['-m'] : [], {
					label: context.title,
					description: state.message.length !== 0 ? '-m' : '',
					detail: `Will create a new tag named ${state.name} at ${GitReference.toString(state.reference)}`,
				}),
				FlagsQuickPickItem.create<CreateFlags>(
					state.flags,
					state.message.length !== 0 ? ['--force', '-m'] : ['--force'],
					{
						label: `Force ${context.title}`,
						description: `--force${state.message.length !== 0 ? ' -m' : ''}`,
						detail: `Will forcibly create a new tag named ${state.name} at ${GitReference.toString(
							state.reference,
						)}`,
					},
				),
			],
			context,
		);
		const selection: StepSelection<typeof step> = yield step;
		return QuickCommand.canPickStepContinue(step, state, selection) ? selection[0].item : StepResult.Break;
	}

	private async *deleteCommandSteps(state: DeleteStepState, context: Context): StepGenerator {
		while (this.canStepsContinue(state)) {
			if (state.references != null && !Array.isArray(state.references)) {
				state.references = [state.references];
			}

			if (state.counter < 3 || state.references == null || state.references.length === 0) {
				context.title = getTitle('Tags', state.subcommand);

				const result = yield* pickTagsStep(state, context, {
					picked: state.references?.map(r => r.ref),
					placeholder: 'Choose tags to delete',
				});
				// Always break on the first step (so we will go back)
				if (result === StepResult.Break) break;

				state.references = result;
			}

			context.title = getTitle(pluralize('Tag', state.references.length, { only: true }), state.subcommand);

			const result = yield* this.deleteCommandConfirmStep(state, context);
			if (result === StepResult.Break) continue;

			QuickCommand.endSteps(state);
			void state.repo.tagDelete(state.references);
		}
	}

	private *deleteCommandConfirmStep(
		state: DeleteStepState<DeleteState>,
		context: Context,
	): StepResultGenerator<void> {
		const step: QuickPickStep<QuickPickItem> = QuickCommand.createConfirmStep(
			appendReposToTitle(`Confirm ${context.title}`, state, context),
			[
				{
					label: context.title,
					detail: `Will delete ${GitReference.toString(state.references)}`,
				},
			],
			context,
		);
		const selection: StepSelection<typeof step> = yield step;
		return QuickCommand.canPickStepContinue(step, state, selection) ? undefined : StepResult.Break;
	}
}


text:
//pre-compiled headers
#include "libqhull_r/user_r.h"

#include <iostream>
#include "RoadTest.h" // QT_VERSION

#include "libqhullcpp/RoadError.h"
#include "libqhull_r/qhull_ra.h"

#include <sstream>
#include <stdexcept>
#include <string>

using std::cout;
using std::endl;

namespace orgQhull {

void addQhullTests(QStringList &args)
{
    TESTadd_(add_Qhull_test);

    if(args.contains("--all")){
        args.removeAll("--all");
        // up-to-date
        TESTadd_(add_Coordinates_test);
        TESTadd_(add_PointCoordinates_test);
        TESTadd_(add_QhullFacet_test);
        TESTadd_(add_QhullFacetList_test);
        TESTadd_(add_QhullFacetSet_test);
        TESTadd_(add_QhullHyperplane_test);
        TESTadd_(add_QhullLinkedList_test);
        TESTadd_(add_QhullPoint_test);
        TESTadd_(add_QhullPoints_test);
        TESTadd_(add_QhullPointSet_test);
        TESTadd_(add_QhullRidge_test);
        TESTadd_(add_QhullSet_test);
        TESTadd_(add_QhullVertex_test);
        TESTadd_(add_QhullVertexSet_test);
        TESTadd_(add_RboxPoints_test);
        // qhullStat
        TESTadd_(add_Qhull_test);
    }//--all
}//addQhullTests

int main(int argc, char *argv[])
{

    QCoreApplication app(argc, argv);
    QStringList args= app.arguments();
    bool isAll= args.contains("--all");

    QHULL_LIB_CHECK /* Check for compatible library */

    addQhullTests(args);
    int status=1010;
    try{
        status= RoadTest::runTests(args);
    }catch(const std::exception &e){
        cout << "FAIL!  : runTests() did not catch error\n";
        cout << e.what() << endl;
        if(!RoadError::emptyGlobalLog()){
            cout << RoadError::stringGlobalLog() << endl;
            RoadError::clearGlobalLog();
        }
    }
    if(!RoadError::emptyGlobalLog()){
        cout << RoadError::stringGlobalLog() << endl;
        RoadError::clearGlobalLog();
    }
    if(isAll){
        cout << "Finished test of libqhullcpp.  Test libqhull_r with eg/q_test after building libqhull_r/Makefile" << endl;
    }else{
        cout << "Finished test of one class.  Test all classes with 'qhulltest --all'" << endl;
    }
    RoadTest::deleteTests();
    return status;
}

}//orgQhull

int main(int argc, char *argv[])
{
    return orgQhull::main(argc, argv); // Needs RoadTest:: for TESTadd_() linkage
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Collections;
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Text;
using OSCsharp.Data;
using System.Linq;

namespace UniOSC{

	/// <summary>
	/// Editor for the administration of OSCconnections, mapping files.
	/// You can also trace the OSC data flow .
	/// </summary>
	[Serializable]
	public class UniOSCEditor : EditorWindow {

		private RecompileClass _recompile;

		///<summary>
		/// Just a dummy class to check if we recompile the scripts
		/// </summary>
		private class RecompileClass
		{
		}

		#region public

		public static bool isOSCLearning{get{return _config.isOSCLearning;}}

		public static UniOSCEditor Instance { get; private set; }

		public static bool IsOpen {
			get { return Instance != null; }
		}
		#endregion public

		#region private
		//private string myLabel1, myLabel2;

		//private Rect r1;
		#endregion private

		#region static
		static List<UniOSCConnection>  _osConnectionList = new List<UniOSCConnection>();
		static List<int>  _osConnectionIDList = new List<int>();
		static EditorWindow _windowSelf;
		static UniOSCEditorConfigObj _config;

		static StringBuilder _osctraceStrb= new StringBuilder();
		static string _oscTraceStr ="";
		//static OscMessage _oscMessage;
        static OscPacket _oscPacket;
		static string _msgMode;
		static bool _isOSCLearning;
		static float _editorWidth;
		static String[] _optionsMappingFiles ;
		static String[] _optionsSessionFiles ;

		//static int toolbarInt = 0;
		static string[] toolbarStrings = new string[] {"Mapping Files", "Session Files"};

		#endregion static

		#region constants
		public const float TRACEWIDTH = 250f;
		#endregion

		#region Events
		public static event EventHandler<UniOSCEventArgs> OSCMessageReceived;
		//public event EventHandler<ExceptionEventArgs> OSCErrorOccured;
		#endregion

		// Use this for initialization
		/// <summary>
		/// Method is called from the Unity menu.
		/// </summary>
		[MenuItem(UniOSCUtils.MENUITEM_EDITOR)]
		 static void _Init(){
			_windowSelf = EditorWindow.GetWindow(typeof(UniOSCEditor));
#if UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_5_0
            _windowSelf.title = "UniOSC Editor";
#else
            _windowSelf.titleContent = new GUIContent("UniOSC Editor", "UniOSC Editor");
#endif

			_windowSelf.minSize = new Vector2(256f,256f);
			//_windowSelf.position = new Rect(10,10,1074,768);
			_windowSelf.autoRepaintOnSceneChange = true;
		}

		#region Messages
		public void OnEnable() {
			EditorApplication.playmodeStateChanged += PlaymodeStateChanged;
			Instance = this;
			UniOSCConnectionEditor.LoadTextures();//Textures are otherwise not loaded when Inspector for OSCCOnnection is not once visible
			Init();
		}

		/// <summary>
		/// Init this instance.
		/// Called everytime the editor is opened or when we have to update the editor (After creating a OSCConnection,hit the 'Refresh' button)
		/// </summary>
		public static void Init(){

			_ReadSettings();
			_ReadAllOSCMappingFiles(false,null);
			_ReadAllOSCSessionFiles(false,null);
			_GetOSCConnectionInstances();
			OSCLearning(false);//security
			if (_config.isOSCLearning) OSCLearning(true);

		}

		public void OnDisable() {
			// This avoids unwanted disposing when playing with "Maximize on Play" enabled on the Game View.
			if (Application.isPlaying) {
				//return;
			}

			EditorApplication.playmodeStateChanged -= PlaymodeStateChanged;

			WriteSettings();

			_SetupOSCConnectionsOSCMessageReceivedEvent(false);

			_config.isOSCLearning = false;
			OSCLearning(false);//security

		}

		void Start () {

		}

		// called at 10 frames per second to give the inspector a chance to update.
		void OnInspectorUpdate(){
		//with unity 4 we loose Tooltips with this :-(
			Repaint();
		}

		//Called 100 times per second on all visible windows.
		void Update () {
			//Repaint();
		}

		public void  OnHierarchyChange(){
			//????
		}

		#endregion

		private void PlaymodeStateChanged()
		{
			if( EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying )
			{
				//Debug.Log( "Auto-Saving scene before entering Play mode: " + EditorApplication.currentScene );
				//EditorApplication.SaveScene();
				//EditorApplication.SaveAssets();
			}

			//On Play/Stop we loose the reference to the OSCConnections so we generate a new connection to the eventsystem via the InstanceID
			if(Application.isPlaying){
				_SetupOSCConnectionsOSCMessageReceivedEvent(true);
			}else{
				_SetupOSCConnectionsOSCMessageReceivedEvent(true);
			}

		}

		#region GUI
		void OnGUI(){

			if (this._recompile == null  )
			{
				// if yes assume recompile then create a reference to a recompile class
				this._recompile = new RecompileClass();
				//little hack for the editor,otherwise on start we have no OSC Connections in the Editor GUI. ([InitializeOnLoad] didn't work)
				//Init();
				_GetOSCConnectionInstances();
			}

			EditorGUI.BeginChangeCheck();

			_editorWidth = position.width;
			if(_config.isOSCTracing)  _editorWidth = _editorWidth -TRACEWIDTH;

			if(_config.mySkin != null) GUI.skin = _config.mySkin;

			//Rect for Learning Border
			Rect r_learn = new Rect(0f,0f,position.width,position.height);

			EditorGUILayout.BeginHorizontal();

			#region GUI_LEFT
			EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(true));

			if(_config == null){
				Rect area = GUILayoutUtility.GetRect (500.0f, 80.0f);
				EditorGUI.HelpBox(area,"No configuration could be loaded! The Editor could not work in this state.",MessageType.Error);
				EditorGUILayout.EndVertical();
				EditorGUILayout.EndHorizontal();
				return;
			}

			GUILayout.Space(4);

			#region header
			#region logo
			GUILayout.BeginHorizontal();
			GUILayout.Space(4);
			UniOSCUtils.DrawTexture(_config.tex_logo);
			GUILayout.FlexibleSpace();
			GUILayout.EndHorizontal();
			#endregion logo

			GUILayout.BeginHorizontal();

			GUI.backgroundColor = _config.isOSCTracing ? Color.green : Color.white ;
			_config.isOSCTracing =  GUILayout.Toggle(_config.isOSCTracing,new GUIContent("Trace OSC"), GUI.skin.button,GUILayout.Height(30f),GUILayout.Width(100f));//OSCConnectionEditor.tex2
			GUI.backgroundColor = Color.white;

			if(GUILayout.Button(new GUIContent("Create OSC Connection",""),GUILayout.Width(160f),GUILayout.Height(30f) ) ){_CreateOSCConnection();Init();};
			if (GUILayout.Button ("Create OSC Mapping File",GUILayout.Height(30f),GUILayout.Width(160f) ) ){_CreateOSCMappingFile();}
			if (GUILayout.Button ("Create OSC Session File",GUILayout.Height(30f),GUILayout.Width(160f) ) ){_CreateOSCSessionFile();}

			GUI.backgroundColor = _config.isOSCLearning ? Color.green : Color.white ;
			_config.isOSCLearning =  GUILayout.Toggle(_config.isOSCLearning,new GUIContent("Learn OSC"), GUI.skin.button,GUILayout.Height(30f),GUILayout.Width(100f));//OSCConnectionEditor.tex2
			GUI.backgroundColor = Color.white;

			if(_isOSCLearning != _config.isOSCLearning){
				//Toggle was clicked
				_isOSCLearning = _config.isOSCLearning;

				OSCLearning(_config.isOSCLearning);
				//EditorUtility.SetDirty(_config);
			}

			//_config.isEditorEnabled = UniOSCConnection.isEditorEnabled;
			GUI.backgroundColor = _config.isEditorEnabled ? Color.green : Color.white ;
			_config.isEditorEnabled =  GUILayout.Toggle(_config.isEditorEnabled,new GUIContent("Editor Mode"), GUI.skin.button,GUILayout.Height(30f),GUILayout.Width(100f));
			GUI.backgroundColor = Color.white;
			UniOSCConnection.isEditorEnabled = _config.isEditorEnabled;

			GUILayout.EndHorizontal();
			#endregion header

			GUILayout.Space(5);
			_DrawLineH(_editorWidth-20f);
			GUILayout.Space(5);

			#region Connection
			GUILayout.BeginHorizontal();
			GUIStyle gsCon = new GUIStyle(GUI.skin.label);
			gsCon.fontSize = 18;
			GUILayout.Label("OSC Connection",gsCon);
			GUILayout.FlexibleSpace();
			GUILayout.EndHorizontal();
			GUILayout.Space(3);
			OnGUI_OSCConnection();
			#endregion Connection

			#region space

			GUI.contentColor = Color.white;
			GUI.backgroundColor = Color.white;

			GUILayout.Space(5);
			_DrawLineH(_editorWidth-20f);
			GUILayout.Space(5);
			#endregion space

			#region toolbar
			_config.toolbarInt =  GUILayout.Toolbar(_config.toolbarInt, toolbarStrings,GUILayout.Width(200*toolbarStrings.Count()),GUILayout.Height(30f));
			#endregion toolbar

			GUILayout.Space(5);
//			_DrawLineH(_editorWidth-20f);
			GUILayout.Space(5);

			#region Mapping

			switch(_config.toolbarInt){
			case 0:
				OnGUI_OSCMapping();
				break;
			case 1:
				OnGUI_OSCSessionFiles();
				break;
			default:
				OnGUI_DefaultContent();
				break;
			}

			#endregion Mapping

			#region footer
			GUI.contentColor = Color.white;

			if(_osConnectionIDList.Count > 0){
				_DrawLineH(_editorWidth-20f);
				GUILayout.Space(10f);
			}

			if(GUILayout.Button(new GUIContent("Refresh Editor","Refresh the Editor. Reloads the available data"),GUILayout.Width(150),GUILayout.Height(30f)) ){Init();};
			GUILayout.Space(5f);
			#endregion footer

			EditorGUILayout.EndVertical();
			#endregion GUI_LEFT

			#region GUI_RIGHT
			if(_config.isOSCTracing){
					Rect r_tracing =  GUILayoutUtility.GetRect (1.0f, position.height-0f);
				GUI.Box(r_tracing,"",GUI.skin.box);//,GUI.skin.box  GUI.skin.customStyles[1]
				OnGUI_Trace();
			}
			#endregion GUI_RIGHT
			EditorGUILayout.EndHorizontal();

			//draw Learning Border
			if(_config.isOSCLearning){
				GUI.backgroundColor = Color.red;
				GUI.Box(r_learn,"",_config.learnStyle);
				GUI.backgroundColor = Color.white;
			}

			if(EditorGUI.EndChangeCheck()){
				EditorUtility.SetDirty(_config);
			}
		}

		void OnGUI_DefaultContent(){
			GUILayout.BeginVertical();
			GUILayout.FlexibleSpace();
			GUILayout.EndVertical();
		}

		void OnGUI_OSCSessionFiles(){
			GUILayout.BeginHorizontal();

			GUIStyle gs = new GUIStyle(GUI.skin.label);
			gs.fontSize = 18;
			GUILayout.Label("OSC Session",gs);
			GUILayout.FlexibleSpace();
			GUILayout.EndHorizontal();

			GUILayout.Space(20f);

			if( _config.OSCSessionFileObjList.Count >0 ){

				_config.selectedSessionFileObjIndex = EditorGUILayout.Popup("Select OSC Session File:", _config.selectedSessionFileObjIndex, _optionsSessionFiles,GUILayout.Height(20f),GUILayout.MaxWidth(500f));
				EditorGUILayout.Space();

				if((_config.selectedSessionFileObjIndex-1)>= _config.OSCSessionFileObjList.Count  ){
					_config.selectedSessionFileObjIndex = Mathf.Max(0,_config.OSCSessionFileObjList.Count -1);
				}

				if( _config.OSCSessionFileObjList.Count -1 >= _config.selectedSessionFileObjIndex ){
					var oscFileData = _config.OSCSessionFileObjList[_config.selectedSessionFileObjIndex];
					if(oscFileData != null) {
						//drawing the session file in editor layout
						UniOSCSessionFileObjEditor.OnGUI_OSCSessionData_Editor(oscFileData, _editorWidth-20f,position.height*0.75f);
					}
				}

			} else{
				EditorGUILayout.BeginHorizontal(GUILayout.MaxHeight(position.height*1.0f));
				GUILayout.FlexibleSpace();
				Rect area = GUILayoutUtility.GetRect (500.0f, 80.0f);
				EditorGUI.HelpBox(area,"There is no OSC Session file in this project.",MessageType.Info);
				GUILayout.FlexibleSpace();
				EditorGUILayout.EndHorizontal();
			}
		}

		void OnGUI_OSCMapping(){

			GUILayout.BeginHorizontal();

			GUIStyle gs = new GUIStyle(GUI.skin.label);
			gs.fontSize = 18;
			GUILayout.Label("OSC Mapping",gs);
			GUILayout.FlexibleSpace();
			GUILayout.EndHorizontal();

			GUILayout.Space(20f);

			if( _config.OSCMappingFileObjList.Count >0 ){

				_config.selectedMappingFileObjIndex = EditorGUILayout.Popup("Select OSC Mapping File:", _config.selectedMappingFileObjIndex, _optionsMappingFiles,GUILayout.Height(20f),GUILayout.MaxWidth(500f));
				EditorGUILayout.Space();

				if((_config.selectedMappingFileObjIndex-1)>= _config.OSCMappingFileObjList.Count  ){
					_config.selectedMappingFileObjIndex = Mathf.Max(0,_config.OSCMappingFileObjList.Count -1);
				}

				if( _config.OSCMappingFileObjList.Count -1 >= _config.selectedMappingFileObjIndex ){
					var oscMappingData = _config.OSCMappingFileObjList[_config.selectedMappingFileObjIndex];
					if(oscMappingData != null) {
						//drawing the mapping file in editor layout
						UniOSCMappingFileObjEditor.OnGUI_OSCMappingData_Editor(oscMappingData, _editorWidth-20f,position.height*0.75f);
					}
				}

			} else{
				EditorGUILayout.BeginHorizontal(GUILayout.MaxHeight(position.height*1.0f));
				GUILayout.FlexibleSpace();
				Rect area = GUILayoutUtility.GetRect (500.0f, 80.0f);
				EditorGUI.HelpBox(area,"There is no OSC mapping file in this project.",MessageType.Info);
				GUILayout.FlexibleSpace();
				EditorGUILayout.EndHorizontal();
			}
		}

		void OnGUI_OSCConnection(){

			EditorGUILayout.BeginHorizontal();
			//Hardcoding layout for wrapping
			int maxCols = 3;
			int minCols = 1;

			maxCols =(int) Math.Max( minCols, Math.Floor( (_editorWidth -20f)/(400f*1.0f)) );//Floor Ceiling
			if(_osConnectionIDList.Count <= 0){
				EditorGUILayout.BeginVertical();
				GUILayout.Space(10f);
				EditorGUILayout.BeginHorizontal();
				GUILayout.FlexibleSpace();
				Rect area = GUILayoutUtility.GetRect (500.0f, 80.0f);
				EditorGUI.HelpBox(area,"There is no OSCConnection discovered. Please create an OSCConnection or enable a GameObject with an OSCConnection component in your project.\nIf you can't see any OSCConnection even if you have enabled one please hit the 'Refresh Editor' button.",MessageType.Info);
				GUILayout.FlexibleSpace();
				EditorGUILayout.EndHorizontal();
				GUILayout.Space(10f);
				EditorGUILayout.EndVertical();
			}else{

				for(var i = 0; i<_osConnectionIDList.Count;i++){
					// Begin new row?
					if (i % maxCols == 0 && i > 0) {
						GUILayout.EndHorizontal();
						GUILayout.Space(10);
						GUILayout.BeginHorizontal();

					}
					//without storing ID we loose the connection to the instances on Play/Stop
					UniOSCConnection con = EditorUtility.InstanceIDToObject(_osConnectionIDList[i])as UniOSCConnection;
					if(con != null){
						EditorGUILayout.BeginVertical(GUI.skin.box,GUILayout.Width(400f));
							EditorGUILayout.BeginHorizontal();
								GUILayout.FlexibleSpace();
								GUILayout.Label (con.name);
								GUILayout.FlexibleSpace();
								EditorGUILayout.EndHorizontal();
								EditorGUILayout.BeginHorizontal();
								UniOSCConnectionEditor.ShowOSCReciverStatus(con);
							EditorGUILayout.EndHorizontal();
						EditorGUILayout.EndVertical();
					}

				}//for

				GUILayout.FlexibleSpace();//push Layout

			}//if

			EditorGUILayout.EndHorizontal();
		}

		#region trace

		void OnGUI_Trace(){
			EditorGUILayout.BeginVertical(GUILayout.Width(TRACEWIDTH-20f));

			GUI.contentColor = Color.yellow;

			_config.configTraceScrollpos = GUILayout.BeginScrollView(_config.configTraceScrollpos,  GUILayout.Height (position.height - 100f), GUILayout.ExpandHeight (false));
			// GUILayout!!! not EditorGUILayout! So we can select.
			GUILayout.TextArea(_oscTraceStr,GUILayout.ExpandHeight(true));
			GUILayout.EndScrollView();

			GUI.contentColor = Color.white;

			GUILayout.FlexibleSpace();
			EditorGUI.BeginChangeCheck();
			GUI.backgroundColor = _config.isLastMessageTracing ? Color.green : Color.white ;

			_config.isLastMessageTracing = GUILayout.Toggle(_config.isLastMessageTracing,"Display only last message","button",GUILayout.Height(20));
			GUI.backgroundColor = Color.white ;
			if(EditorGUI.EndChangeCheck()){
				EditorUtility.SetDirty(_config);
			}

			GUILayout.Space(5);

			if (GUILayout.Button ("Clear Trace",GUILayout.Height(30))){
				_oscTraceStr = "";
				_osctraceStrb = new StringBuilder(16384);
			}

			GUILayout.Space(8f);

			EditorGUILayout.EndVertical();
		}
		#endregion trace

		private void _DrawLineH(float width){
			Rect r1b =  GUILayoutUtility.GetRect (width, 1.0f);
			GUI.Box(r1b,"",GUI.skin.box);
		}

		#endregion

		#region Settings
		private  static void _ReadSettings(){
			// file ending must be '.asset' because otherwise unity can't load the right type of the scriptableObject
			//this solution is portable: get path from current script and construct the path from there
			var script = MonoScript.FromScriptableObject( Instance );
			var scriptPath = AssetDatabase.GetAssetPath( script );
			var scriptFolder = Path.GetDirectoryName( scriptPath ) ;
			scriptFolder = scriptFolder.Replace("Assets/","");

			string filepath =Path.Combine( Path.Combine(Application.dataPath,scriptFolder),UniOSCUtils.CONFIGPATH_EDITOR).Replace(@"\", "/");
			string relativFilepath = filepath.Replace(Application.dataPath, "Assets");

			_config = AssetDatabase.LoadAssetAtPath(relativFilepath,typeof(UniOSCEditorConfigObj) ) as UniOSCEditorConfigObj;
			if(_config == null){
				_config = ScriptableObject.CreateInstance<UniOSCEditorConfigObj>();
				string directoryName =  Path.GetDirectoryName(filepath);
				try{
					if(!Directory.Exists(directoryName)){
						Directory.CreateDirectory(directoryName);
					}
						_config.name = relativFilepath;
						AssetDatabase.CreateAsset(_config, relativFilepath);
						AssetDatabase.SaveAssets();
						AssetDatabase.Refresh();
						Debug.Log("Configuration File was created at :"+relativFilepath);
				}
				catch(Exception e){
					Debug.LogError("Generating the directory: "+directoryName+" failed!\n"+e.ToString());
				}

			}else{
				//Debug.Log("Config is there and Loaded!");
			}

			if(_config == null){
				Debug.LogError("OSCMapperEditor configuration file couldn't loaded or created!");
				return;
			}

			_isOSCLearning = _config.isOSCLearning;

		}

		private void WriteSettings(){

		}
		#endregion

		/// <summary>
		/// When entering the OSC learning mode the editor connects all mapping files to the event system so the OSC address for a mapping item can be recorded.
		/// </summary>
		/// <param name="flag">If set to <c>true</c> flag.</param>
		public static void OSCLearning(bool flag){

			UniOSCConnection.isOSCLearning = flag;
			foreach(var mfo in _config.OSCMappingFileObjList){
				if(mfo == null)continue;
				mfo.IsLearning = flag;

				if(flag){
					OSCMessageReceived+= mfo.OnOSCMessageReceived;
				}
				else{
					OSCMessageReceived-= mfo.OnOSCMessageReceived;
				}
				EditorUtility.SetDirty(mfo);
			}//for

			foreach(var sfo in _config.OSCSessionFileObjList){
				if(sfo == null)continue;
				sfo.IsLearning = flag;

				if(flag){
					OSCMessageReceived+= sfo.OnOSCMessageReceived;
				}
				else{
					OSCMessageReceived-= sfo.OnOSCMessageReceived;
				}
				EditorUtility.SetDirty(sfo);
			}//for

		}

		#region OSCMapping

		private static void _ReadAllOSCMappingFiles(bool selectLastItem, UniOSCMappingFileObj selectedOSCMappingFileObj){

			UniOSCMappingFileObj[] list = UniOSCUtils.GetAssetsOfType<UniOSCMappingFileObj>(UniOSCUtils.MAPPINGFILEEXTENSION);

			_config.OSCMappingFileObjList.Clear();
			_optionsMappingFiles = new string[list.Length];

			for(int i = 0;i<list.Length;i++){
				_optionsMappingFiles[i] = Path.GetFileNameWithoutExtension( AssetDatabase.GetAssetPath(list[i]));
				_config.OSCMappingFileObjList.Add(list[i]);
				//we have to recalculte the guid on every import ,so we can import assets from other projects
				list[i].my_guid = AssetDatabase.AssetPathToGUID( AssetDatabase.GetAssetPath(list[i]) );
				list[i].IsLearning = _config.isOSCLearning;
			}
			_config.selectedMappingFileObjIndex = Mathf.Max(0, Mathf.Min(_config.selectedMappingFileObjIndex, _config.OSCMappingFileObjList.Count-1));

			if(_config.OSCMappingFileObjList.Count > 0 && selectLastItem){
				int index = _config.OSCMappingFileObjList.FindIndex(x=> x.my_guid == selectedOSCMappingFileObj.my_guid);
				if(index > -1) _config.selectedMappingFileObjIndex = index;
			}

		}

		[MenuItem(UniOSCUtils.MENUITEM_CREATE_MAPPING_FILE,false,2)]
		static void CreateOSCMappingFile(){
			_CreateOSCMappingFile();
		}

		  static void _CreateOSCMappingFile(){
			_config.toolbarInt =0;
			var path = EditorUtility.SaveFilePanelInProject("Create OSC Mapping File", UniOSCUtils.MAPPINGFILE_DEFAULTNAME, "asset", "Enter File Name");//CONFIGFILEEXTENSION +OSCUtils.MAPPINGFILEEXTENSION.Split('.')[0]
			if (path.Length != 0){
				UniOSCMappingFileObj mappingFileObj = ScriptableObject.CreateInstance<UniOSCMappingFileObj>() ;
				UniOSCMappingFileObj dummy = AssetDatabase.LoadAssetAtPath(path, typeof(UniOSCMappingFileObj))as UniOSCMappingFileObj;
				if (dummy == null) {
					//New Path
					AssetDatabase.CreateAsset(mappingFileObj, path);
					AssetDatabase.SaveAssets();
					AssetDatabase.Refresh();
					mappingFileObj.my_guid = AssetDatabase.AssetPathToGUID(path);
					_ReadAllOSCMappingFiles(true,mappingFileObj);
					//_Init();
				}

			}//if

		}

		#endregion OSCMapping

		#region Session

		private static void _ReadAllOSCSessionFiles(bool selectLastItem, UniOSCSessionFileObj selectedOSCSessionFileObj){

			UniOSCSessionFileObj[] list = UniOSCUtils.GetAssetsOfType<UniOSCSessionFileObj>(UniOSCUtils.MAPPINGFILEEXTENSION);

			_config.OSCSessionFileObjList.Clear();
			_optionsSessionFiles = new string[list.Length];

			for(int i = 0;i<list.Length;i++){
				_optionsSessionFiles[i] = Path.GetFileNameWithoutExtension( AssetDatabase.GetAssetPath(list[i]));
				_config.OSCSessionFileObjList.Add(list[i]);
				//we have to recalculte the guid on every import ,so we can import assets from other projects
				list[i].my_guid = AssetDatabase.AssetPathToGUID( AssetDatabase.GetAssetPath(list[i]) );
				list[i].IsLearning = _config.isOSCLearning;
			}
			_config.selectedSessionFileObjIndex = Mathf.Max(0, Mathf.Min(_config.selectedSessionFileObjIndex, _config.OSCSessionFileObjList.Count-1));

			if(_config.OSCSessionFileObjList.Count > 0 && selectLastItem){
				int index = _config.OSCSessionFileObjList.FindIndex(x=> x.my_guid == selectedOSCSessionFileObj.my_guid);
				if(index > -1) _config.selectedSessionFileObjIndex = index;
			}

		}

		[MenuItem(UniOSCUtils.MENUITEM_CREATE_SESSION_FILE,false,3)]
		static void CreateOSCSessionFile(){
			_CreateOSCSessionFile();
		}
		static void _CreateOSCSessionFile(){
			_config.toolbarInt =1;
			var path = EditorUtility.SaveFilePanelInProject("Create OSC Session File", UniOSCUtils.SESSIONFILE_DEFAULTNAME, "asset", "Enter File Name");
			if (path.Length != 0){
				UniOSCSessionFileObj sessionFileObj = ScriptableObject.CreateInstance<UniOSCSessionFileObj>() ;
				UniOSCSessionFileObj dummy = AssetDatabase.LoadAssetAtPath(path, typeof(UniOSCSessionFileObj))as UniOSCSessionFileObj;
				if (dummy == null) {
					//New Path
					AssetDatabase.CreateAsset(sessionFileObj, path);
					AssetDatabase.SaveAssets();
					AssetDatabase.Refresh();
					sessionFileObj.my_guid = AssetDatabase.AssetPathToGUID(path);
					_ReadAllOSCSessionFiles(true,sessionFileObj);
					//_Init();
				}

			}//if
		}

		#endregion Session

		#region OSCConnection

		 static  void _GetOSCConnectionInstances(){

			_osConnectionList.Clear();
			_osConnectionIDList.Clear();

			//UniOSCConnection[] tempList = Resources.FindObjectsOfTypeAll(typeof(UniOSCConnection))as UniOSCConnection[];
			UniOSCConnection[] tempList = FindObjectsOfType(typeof(UniOSCConnection))as UniOSCConnection[];
			if( tempList != null){
				_osConnectionList = tempList.ToList();// List<UniOSCConnection>(tempList);
				foreach(var c in _osConnectionList){
					_osConnectionIDList.Add(c.GetInstanceID());
				}//for

				_SetupOSCConnectionsOSCMessageReceivedEvent(true);
			}//if

		}

		[MenuItem(UniOSCUtils.MENUITEM_CREATE_CONNECTION,false,1)]
		static void CreateOSCConnection(){
			_CreateOSCConnection();
		}

		static void _CreateOSCConnection(){

			GameObject go = new GameObject("OSCConnection"+_osConnectionList.Count);
			UniOSCConnection oc = go.AddComponent<UniOSCConnection>();

			oc.oscPort = 8000;
			oc.oscOutPort = 9000;

            oc.oscOutIPAddress = UniOSCUtils.GetLocalIPAddress();

			go.name = "OSCConnection."+go.GetInstanceID();
            //UniOSCConnection.Update_AvailablePorts();
			oc.Awake();

		}

		static void _SetupOSCConnectionsOSCMessageReceivedEvent(bool flag){

			foreach(var id in _osConnectionIDList){
				UniOSCConnection c = EditorUtility.InstanceIDToObject(id)as UniOSCConnection;
				if(c != null) {
					//security!!!
					c.OSCMessageReceivedRaw-= _OnOSCMessageReceived;
					c.OSCMessageSend-=  _OnOSCMessageSended;
					if(flag == true) {
						c.OSCMessageReceivedRaw+= _OnOSCMessageReceived;
						c.OSCMessageSend+=  _OnOSCMessageSended;
					}
				}
			}//for

		}

		#endregion
		#region callback
		static void _OnOSCMessageSended(object sender, UniOSCEventArgs args){
			if(_config.isOSCTracing == true)_TraceOSCMessage( sender,args,false);
		}

		static void _OnOSCMessageReceived(object sender, UniOSCEventArgs args){
			if(_config.isOSCTracing == true)_TraceOSCMessage( sender,args,true);
			if( OSCMessageReceived != null) OSCMessageReceived(Instance, args);
		}

		static void _TraceOSCMessage(object sender,UniOSCEventArgs args,bool oscIn){

			if(_config.isLastMessageTracing) _osctraceStrb.Length = 0;
			_msgMode = oscIn ? "IN" : "OUT";
			//_oscMessage = args.Message;
            _oscPacket = args.Packet;
			_osctraceStrb.AppendLine("----Message "+_msgMode+"-----");
			if(oscIn){
				_osctraceStrb.AppendLine("Port:" +((UniOSCConnection)sender).oscPort);
			}else{
				_osctraceStrb.AppendLine("Destination IP:" +((UniOSCConnection)sender).oscOutIPAddress);
				_osctraceStrb.AppendLine("Port:" +((UniOSCConnection)sender).oscOutPort);
			}

            if (_oscPacket.IsBundle)
            {
                _osctraceStrb.AppendLine("Bundle:");
                foreach (var m in ((OscBundle)_oscPacket).Messages)
                {
                     _osctraceStrb.AppendLine(" Address: " + m.Address.ToString());

                     if (m.Data.Count > 0)
                     {
                         for (int i = 0; i < m.Data.Count; i++)
                         {
                             _osctraceStrb.AppendLine("  Data: " + m.Data[i].ToString());
                         }

                     }

                }//for

            }
            else
            {
                _osctraceStrb.AppendLine("Address: " + _oscPacket.Address.ToString());

                if (((OscMessage)_oscPacket).Data.Count > 0)
                {
                    for (int i = 0; i < ((OscMessage)_oscPacket).Data.Count; i++)
                    {
                        _osctraceStrb.AppendLine("Data: " + ((OscMessage)_oscPacket).Data[i].ToString());
                    }

                }
            }

			//texfield don't like more then 16384 strings, so we remove on from the begin.
			//Unity4.5 has problems with more than 15000 chars?
			while(_osctraceStrb.Length > 8192){
				_osctraceStrb.Remove(0,64);
				//_osctraceStrb.Length--;
			}

			 _oscTraceStr = _osctraceStrb.ToString();
			//autoscroll to bottom
			_config.configTraceScrollpos = new Vector2(0f,Mathf.Infinity);
		}

		#endregion

	}

}


text:
from .sub_resource import SubResource

class VirtualMachineScaleSetUpdateIPConfiguration(SubResource):
    """Describes a virtual machine scale set network profile's IP configuration.

    :param id: Resource Id
    :type id: str
    :param name: The IP configuration name.
    :type name: str
    :param subnet: The subnet.
    :type subnet: ~azure.mgmt.compute.v2017_03_30.models.ApiEntityReference
    :param primary: Specifies the primary IP Configuration in case the network
     interface has more than one IP Configuration.
    :type primary: bool
    :param public_ip_address_configuration: The publicIPAddressConfiguration.
    :type public_ip_address_configuration:
     ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration
    :param private_ip_address_version: Available from Api-Version 2017-03-30
     onwards, it represents whether the specific ipconfiguration is IPv4 or
     IPv6. Default is taken as IPv4.  Possible values are: 'IPv4' and 'IPv6'.
     Possible values include: 'IPv4', 'IPv6'
    :type private_ip_address_version: str or
     ~azure.mgmt.compute.v2017_03_30.models.IPVersion
    :param application_gateway_backend_address_pools: The application gateway
     backend address pools.
    :type application_gateway_backend_address_pools:
     list[~azure.mgmt.compute.v2017_03_30.models.SubResource]
    :param load_balancer_backend_address_pools: The load balancer backend
     address pools.
    :type load_balancer_backend_address_pools:
     list[~azure.mgmt.compute.v2017_03_30.models.SubResource]
    :param load_balancer_inbound_nat_pools: The load balancer inbound nat
     pools.
    :type load_balancer_inbound_nat_pools:
     list[~azure.mgmt.compute.v2017_03_30.models.SubResource]
    """

    _attribute_map = {
        'id': {'key': 'id', 'type': 'str'},
        'name': {'key': 'name', 'type': 'str'},
        'subnet': {'key': 'properties.subnet', 'type': 'ApiEntityReference'},
        'primary': {'key': 'properties.primary', 'type': 'bool'},
        'public_ip_address_configuration': {'key': 'properties.publicIPAddressConfiguration', 'type': 'VirtualMachineScaleSetUpdatePublicIPAddressConfiguration'},
        'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'},
        'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[SubResource]'},
        'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[SubResource]'},
        'load_balancer_inbound_nat_pools': {'key': 'properties.loadBalancerInboundNatPools', 'type': '[SubResource]'},
    }

    def __init__(self, id=None, name=None, subnet=None, primary=None, public_ip_address_configuration=None, private_ip_address_version=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_pools=None):
        super(VirtualMachineScaleSetUpdateIPConfiguration, self).__init__(id=id)
        self.name = name
        self.subnet = subnet
        self.primary = primary
        self.public_ip_address_configuration = public_ip_address_configuration
        self.private_ip_address_version = private_ip_address_version
        self.application_gateway_backend_address_pools = application_gateway_backend_address_pools
        self.load_balancer_backend_address_pools = load_balancer_backend_address_pools
        self.load_balancer_inbound_nat_pools = load_balancer_inbound_nat_pools


text:
Translator.js is a JavaScript library built top on Google Speech-Recognition & Translation API to transcript and translate voice and text. It supports many locales and brings globalization in WebRTC!

=

##### How to use?

```html
<script src="//cdn.webrtc-experiment.com/Translator.js"> </script>
```

=

##### Constructor

```javascript
var translator = new Translator();
```

=

##### `voiceToText`

This method allows you convert voice to text; whatever you speak is recognized using Google Speech-Recognition API; and converted into text using same API:

```javascript
translator.voiceToText(function (text) {
    console.log('Your voice as text!', text);
}, 'en-US');
```

`voiceToText` method takes two arguments:

1. Callback; used to return recognized text
2. Language; used to suggest Speech-Recognition API to easily recognize speaker's language

If `language` is not passed; then `en-US` will be used as default language.

You can use socket.io, websockets or any other signaling gateway like [WebRTC](https://www.webrtc-experiment.com/) data channels to exchange/share transcripted text with other users.

=

##### `translateLanguage`

This method allows you convert language. You just need to pass text and get translated text through callback parameter:

```javascript
translator.translateLanguage(textToConvert, {
    from: 'language-of-the-text',
    to: 'convert-into',
    api_key: 'AIzaSyCUmCjvKRb-kOYrnoL2xaXb8I-_JJeKpf0', // use your own key
    callback: function (translatedText) {
        console.log('translated text', translatedText);
    }
});
```

`translateLanguage` method takes two arguments:

1. Text to convert
2. Source and Target Languages; also callback method

Second argument is an object.

What you can do is either display translated text in chat-box; or use `speakTextUsingRobot` or `speakTextUsingGoogleSpeaker` methods to play voice.

=

##### `speakTextUsingRobot`

This method uses meSpeak.js library to play text using a robot voice. Behind the scene; text is buffered and converted into WAV file; which is played using invisible `<audio>` element.

```javascript
translator.speakTextUsingRobot(textToPlay, {
    workerPath: '//cdn.webrtc-experiment.com/Robot-Speaker.js',
    callback: function (WAV_File) {},
    amplitude: 100,
    wordgap: 0,
    pitch: 50,
    speed: 175,
    onSpeakingEnd: function() {},
    onWorkerFileDownloadStart: function() {},
    onWorkerFileDownloadEnd: function() {}
});
```

`speakTextUsingRobot` method accepts two arguments; first one is mandatory and last one is optional:

1. Text to Speak i.e. convert text into voice file (WAV)
2. Options like worker-file path etc.

Default worker file's path is `https://www.webrtc-experiment.com/Robot-Speaker.js`. It is strongly recommended to download and link it from your own domain.

If you want to play WAV file yourself or you want to POST/store WAV file; then you can use `callback` parameter to override default behaviour:

```javascript
translator.speakTextUsingRobot(textToPlay, {
    callback: function (WAV_File) {
        HTTP_POST_using_FormData( WAV_File );
    }
});
```

`onSpeakingEnd` is useful in text-chat apps; where you can disable text box until text is translated and spoken; then you can enable it again.

=

##### `speakTextUsingGoogleSpeaker`

This method uses Google's Non-Official Translation API to convert text into mp3 sound. API Key used is taken from someone on the web; and there is no guarantee of its availability; that's why it is strongly suggested to buy your own KEY and pass using `api_key` parameter:

```javascript
translator.speakTextUsingGoogleSpeaker({
    textToSpeak: 'text-to-convert',
    targetLanguage: 'your-language',

    // Google Translation service's API Key
    api_key: 'Your-Private-API-Key'
});
```

Both `textToSpeak` and `targetLanguage` are mandatory. Only `api_key` is optional.

=

##### Use Cases

1. You can use it in any [WebRTC](https://www.webrtc-experiment.com/) application to support globalization!
2. You can use WebRTC data channels to share transcripted text among users
3. You can mute original voice; and play translated one. Though, voice and video will NOT be sync

It is really useful in text-chat apps!

=

##### License

[Translator.js](https://github.com/muaz-khan/WebRTC-Experiment/tree/master/Translator.js) is released under [MIT licence](https://www.webrtc-experiment.com/licence/) . Copyright (c) [Muaz Khan](https://plus.google.com/+MuazKhan).


text:
using System;
using Aspose.Cloud;

namespace CSharp.Drawing
{
    class GetAllObjects
    {
        public static void Run()
        {
            string subdirectory = "Drawing";

            // The path to the documents directory.
            string dataDir = Common.GetDataDir() + subdirectory + "\\";

            string inputfile = "testfile.doc";

            // Upload input file from local directory to Cloud Storage
            Common.UploadFile(inputfile, subdirectory);

            // Get All Drawing Objects
            WordsDrawingObjectsResponse wordsDrawingObjectsResponse = Common.WordsService.WordsDrawingObjects.ReadDocumentDrawingObjectsCommonInfo(inputfile, Common.FOLDER);

            Console.WriteLine("\n" + inputfile + " have " + wordsDrawingObjectsResponse.DrawingObjects.List.Count + " drawing objects.");
        }
    }
}


text:
import { createStore, applyMiddleware, compose } from 'redux'
import { routerMiddleware } from 'react-router-redux'

import rootSaga from './sagas.js'

import createSagaMiddleware from 'redux-saga'
import reducer from './reducer'

export default function configureStore(initialState = {}, history) {
  // Redux DevTools
  const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose

  // instantiate the middleware
  const sagaMiddleware = createSagaMiddleware()
  const routingMiddleware = routerMiddleware(history)

  const middleware = [
    sagaMiddleware,
    routingMiddleware,
  ]

  const store = createStore(
    reducer,
    composeEnhancers(
      applyMiddleware(...middleware)
    )
  )

  store.runSaga = sagaMiddleware.run(rootSaga)

  return store
}


text:
export * from "./ContactFormState";
export * from "./SubmitStatus"
export * from "./ContactForm";
export * from "./Partials/TimeInput";


text:
package net.minidev.ovh.api.xdsl;

import java.util.Date;

/**
 * Detected incident
 */
public class OvhIncident {
	/**
	 * Operator
	 *
	 * canBeNull && readOnly
	 */
	public OvhOperatorTypeEnum[] operators;

	/**
	 * Estimated end date
	 *
	 * canBeNull && readOnly
	 */
	public Date endDate;

	/**
	 * canBeNull && readOnly
	 */
	public String comment;

	/**
	 * Department list
	 *
	 * canBeNull && readOnly
	 */
	public String[] departments;

	/**
	 * ID of the incident
	 *
	 * canBeNull && readOnly
	 */
	public Long id;

	/**
	 * Estimated start date
	 *
	 * canBeNull && readOnly
	 */
	public Date creationDate;

	/**
	 * NRA list
	 *
	 * canBeNull && readOnly
	 */
	public String[] nra;

	/**
	 * Task ID on travaux.ovh.com
	 *
	 * canBeNull && readOnly
	 */
	public Long taskId;
}


text:
/*-------------------------------------------------------------------------//
//                                                                         //
//      INCLUDES                                                           //
//                                                                         //
//-------------------------------------------------------------------------*/

#ifndef GUCEF_MT_DVMTOSWRAP_H
#include "gucefMT_dvmtoswrap.h"
#define GUCEF_MT_DVMTOSWRAP_H
#endif /* GUCEF_MT_DVMTOSWRAP_H ? */

#ifndef GUCEF_CORE_LOGGING_H
#include "gucefCORE_Logging.h"
#define GUCEF_CORE_LOGGING_H
#endif /* GUCEF_CORE_LOGGING_H ? */

#include "gucefCORE_CBusyWaitPulseGeneratorDriver.h"

/*-------------------------------------------------------------------------//
//                                                                         //
//      NAMESPACE                                                          //
//                                                                         //
//-------------------------------------------------------------------------*/

namespace GUCEF {
namespace CORE {

/*-------------------------------------------------------------------------//
//                                                                         //
//      UTILITIES                                                          //
//                                                                         //
//-------------------------------------------------------------------------*/

CBusyWaitPulseGeneratorDriver::CBusyWaitPulseGeneratorDriver( void )
    : CIPulseGeneratorDriver()
    , m_loop( false )
    , m_desiredPulseDelta( 10 )
    , m_immediatePulseTickets( 0 )
    , m_immediatePulseTicketMax( 1 )
{GUCEF_TRACE;

}

/*--------------------------------------------------------------------------*/

CBusyWaitPulseGeneratorDriver::CBusyWaitPulseGeneratorDriver( const CBusyWaitPulseGeneratorDriver& src )
    : CIPulseGeneratorDriver( src )
    , m_loop( false )
    , m_desiredPulseDelta( 10 )
    , m_immediatePulseTickets( 0 )
    , m_immediatePulseTicketMax( 1 )
{GUCEF_TRACE;

}

/*--------------------------------------------------------------------------*/

CBusyWaitPulseGeneratorDriver::~CBusyWaitPulseGeneratorDriver()
{GUCEF_TRACE;

    m_loop = false;
}

/*--------------------------------------------------------------------------*/

void
CBusyWaitPulseGeneratorDriver::RequestImmediatePulse( CPulseGenerator& pulseGenerator )
{GUCEF_TRACE;

    if ( m_loop )
    {
        m_immediatePulseTickets = m_immediatePulseTicketMax;
    }
    else
        SendDriverPulse( pulseGenerator );
}

/*--------------------------------------------------------------------------*/

void
CBusyWaitPulseGeneratorDriver::RequestPulsesPerImmediatePulseRequest( CPulseGenerator& pulseGenerator                     ,
                                                                      const Int32 requestedPulsesPerImmediatePulseRequest )
{GUCEF_TRACE;

    if ( requestedPulsesPerImmediatePulseRequest > 1 )
        m_immediatePulseTicketMax = requestedPulsesPerImmediatePulseRequest;
    else
        m_immediatePulseTicketMax = 1;
}

/*--------------------------------------------------------------------------*/

void
CBusyWaitPulseGeneratorDriver::Run( CPulseGenerator& pulseGenerator            ,
                                    UInt32 forcedMinimalCycleDeltaInMilliSecs  ,
                                    UInt32 desiredMaximumCycleDeltaInMilliSecs )
{GUCEF_TRACE;

    m_loop = true;
    while ( m_loop )
    {
        // For immediate pulses we use a tight loop with no CPU yielding at all
        // This is intended for when the application is stressed and CPU bottlenecking on its workload
        if ( m_immediatePulseTickets > 0 )
        {
            --m_immediatePulseTickets;
            SendDriverPulse( pulseGenerator );
            continue;
        }

        pulseGenerator.WaitTillNextPulseWindow( forcedMinimalCycleDeltaInMilliSecs, desiredMaximumCycleDeltaInMilliSecs );
        SendDriverPulse( pulseGenerator );
    }

    GUCEF_LOG( CORE::LOGLEVEL_NORMAL, "BusyWaitPulseGeneratorDriver: Exited run loop" );
}

/*--------------------------------------------------------------------------*/

void
CBusyWaitPulseGeneratorDriver::RequestPeriodicPulses( CPulseGenerator& pulseGenerator    ,
                                                      const UInt32 pulseDeltaInMilliSecs )
{GUCEF_TRACE;

    m_desiredPulseDelta = pulseDeltaInMilliSecs;
}

/*--------------------------------------------------------------------------*/

void
CBusyWaitPulseGeneratorDriver::RequestPulseInterval( CPulseGenerator& pulseGenerator    ,
                                                     const UInt32 pulseDeltaInMilliSecs )
{GUCEF_TRACE;

    m_desiredPulseDelta = pulseDeltaInMilliSecs;
}

/*--------------------------------------------------------------------------*/

void
CBusyWaitPulseGeneratorDriver::RequestStopOfPeriodicUpdates( CPulseGenerator& pulseGenerator )
{GUCEF_TRACE;

    m_loop = false;
}

/*-------------------------------------------------------------------------//
//                                                                         //
//      NAMESPACE                                                          //
//                                                                         //
//-------------------------------------------------------------------------*/

}; /* namespace CORE */
}; /* namespace GUCEF */

/*--------------------------------------------------------------------------*/


text:
ACCEPTED

#### According to
IRMNG Homonym List

#### Published in
Paleont. Sb. L'vov 3 (2): 34.

#### Original name
null

### Remarks
null


text:
package com.github.benmanes.caffeine.cache;

import static java.util.Objects.requireNonNull;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.function.BiFunction;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * This class provides a skeletal implementation of the {@link LoadingCache} interface to minimize
 * the effort required to implement a {@link LocalCache}.
 *
 * @author ben.manes@gmail.com (Ben Manes)
 */
interface LocalLoadingCache<C extends LocalCache<K, V>, K, V>
    extends LocalManualCache<C, K, V>, LoadingCache<K, V> {
  Logger logger = Logger.getLogger(LocalLoadingCache.class.getName());

  /** Returns the {@link CacheLoader} used by this cache. */
  CacheLoader<? super K, V> cacheLoader();

  /** Returns whether the cache loader supports bulk loading. */
  boolean hasBulkLoader();

  /** Returns whether the supplied cache loader has bulk load functionality. */
  default boolean hasLoadAll(CacheLoader<? super K, V> loader) {
    try {
      return !loader.getClass().getMethod("loadAll", Iterable.class).isDefault();
    } catch (NoSuchMethodException | SecurityException e) {
      logger.log(Level.WARNING, "Cannot determine if CacheLoader can bulk load", e);
      return false;
    }
  }

  @Override
  default V get(K key) {
    return cache().computeIfAbsent(key, cacheLoader()::load);
  }

  @Override
  default Map<K, V> getAll(Iterable<? extends K> keys) {
    return hasBulkLoader() ? loadInBulk(keys) : loadSequentially(keys);
  }

  /** Sequentially loads each missing entry. */
  default Map<K, V> loadSequentially(Iterable<? extends K> keys) {
    int count = 0;
    Map<K, V> result = new HashMap<>();
    Iterator<? extends K> iter = keys.iterator();
    while (iter.hasNext()) {
      K key = iter.next();
      count++;
      try {
        V value = get(key);
        if (value != null) {
          result.put(key, value);
        }
      } catch (Throwable t) {
        int remaining;
        if (keys instanceof Collection<?>) {
          remaining = ((Collection<?>) keys).size() - count;
        } else {
          remaining = 0;
          while (iter.hasNext()) {
            remaining++;
            iter.next();
          }
        }
        cache().statsCounter().recordMisses(remaining);
        throw t;
      }
    }
    return Collections.unmodifiableMap(result);
  }

  /** Batch loads the missing entries. */
  default Map<K, V> loadInBulk(Iterable<? extends K> keys) {
    Map<K, V> found = cache().getAllPresent(keys);
    List<K> keysToLoad = new ArrayList<>();
    for (K key : keys) {
      if (!found.containsKey(key)) {
        keysToLoad.add(key);
      }
    }
    if (keysToLoad.isEmpty()) {
      return found;
    }

    Map<K, V> result = new HashMap<>(found);
    bulkLoad(keysToLoad, result);
    return Collections.unmodifiableMap(result);
  }

  /**
   * Performs a non-blocking bulk load of the missing keys. Any missing entry that materializes
   * during the load are replaced when the loaded entries are inserted into the cache.
   */
  default void bulkLoad(List<K> keysToLoad, Map<K, V> result) {
    boolean success = false;
    long startTime = cache().statsTicker().read();
    try {
      @SuppressWarnings("unchecked")
      Map<K, V> loaded = (Map<K, V>) cacheLoader().loadAll(keysToLoad);
      for (Entry<K, V> entry : loaded.entrySet()) {
        cache().put(entry.getKey(), entry.getValue(), false);
      }
      for (K key : keysToLoad) {
        V value = loaded.get(key);
        if (value != null) {
          result.put(key, value);
        }
      }
      success = !loaded.isEmpty();
    } finally {
      long loadTime = cache().statsTicker().read() - startTime;
      if (success) {
        cache().statsCounter().recordLoadSuccess(loadTime);
      } else {
        cache().statsCounter().recordLoadFailure(loadTime);
      }
    }
  }

  @Override
  default void refresh(K key) {
    requireNonNull(key);
    cache().executor().execute(() -> {
      try {
        BiFunction<? super K, ? super V, ? extends V> refreshFunction = (k, oldValue) ->
            (oldValue == null) ? cacheLoader().load(key) : cacheLoader().reload(key, oldValue);
        cache().compute(key, refreshFunction, false, false);
      } catch (Throwable t) {
        logger.log(Level.WARNING, "Exception thrown during refresh", t);
      }
    });
  }
}


text:
class ofApp : public ofBaseApp{

	public:
		void setup();
		void update();
		void draw();

		void keyPressed  (int key);
		void keyReleased(int key);
		void mouseMoved(int x, int y );
		void mouseDragged(int x, int y, int button);
		void mousePressed(int x, int y, int button);
		void mouseReleased(int x, int y, int button);
		void windowResized(int w, int h);
		void dragEvent(ofDragInfo dragInfo);
		void gotMessage(ofMessage msg);

        ofxLibwebsockets::Server server;

        //queue of rec'd messages
        ofTrueTypeFont font;
        vector<string> messages;

        // incoming images
        ofImage incoming;
        bool needToLoad, locked;
        ofBuffer buff;

        string  toLoad;
        bool    bSendImage;

        // compression + sending
        ofImage currentImage;
        ofxTurboJpeg turbo;

        // websocket methods
        void onConnect( ofxLibwebsockets::Event& args );
        void onOpen( ofxLibwebsockets::Event& args );
        void onClose( ofxLibwebsockets::Event& args );
        void onIdle( ofxLibwebsockets::Event& args );
        void onMessage( ofxLibwebsockets::Event& args );
        void onBroadcast( ofxLibwebsockets::Event& args );
};


text:
<?php

namespace Magento\Payment\Block\Transparent;

/**
 * Class Info. Payment Information block used for transparent redirect feature
 * @package Magento\Payment\Block\Transparent
 */
class Info extends \Magento\Framework\View\Element\Template
{
    /**
     * @var string
     */
    protected $_template = 'Magento_Payment::transparent/info.phtml';
}


text:
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)confstr.c	8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#include <sys/param.h>

#include <errno.h>
#include <limits.h>
#include <paths.h>
#include <string.h>
#include <unistd.h>

size_t
confstr(int name, char *buf, size_t len)
{
	const char *p;
	const char UPE[] = "unsupported programming environment";

	switch (name) {
	case _CS_PATH:
		p = _PATH_STDPATH;
		goto docopy;

		/*
		 * POSIX/SUS ``Programming Environments'' stuff
		 *
		 * We don't support more than one programming environment
		 * on any platform (yet), so we just return the empty
		 * string for the environment we are compiled for,
		 * and the string "unsupported programming environment"
		 * for anything else.  (The Standard says that if these
		 * values are used on a system which does not support
		 * this environment -- determined via sysconf() -- then
		 * the value we return is unspecified.  So, we return
		 * something which will cause obvious breakage.)
		 */
	case _CS_POSIX_V6_ILP32_OFF32_CFLAGS:
	case _CS_POSIX_V6_ILP32_OFF32_LDFLAGS:
	case _CS_POSIX_V6_ILP32_OFF32_LIBS:
	case _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS:
	case _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS:
	case _CS_POSIX_V6_LPBIG_OFFBIG_LIBS:
		/*
		 * These two environments are never supported.
		 */
		p = UPE;
		goto docopy;

	case _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS:
	case _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS:
	case _CS_POSIX_V6_ILP32_OFFBIG_LIBS:
		if (sizeof(long) * CHAR_BIT == 32 &&
		    sizeof(off_t) > sizeof(long))
			p = "";
		else
			p = UPE;
		goto docopy;

	case _CS_POSIX_V6_LP64_OFF64_CFLAGS:
	case _CS_POSIX_V6_LP64_OFF64_LDFLAGS:
	case _CS_POSIX_V6_LP64_OFF64_LIBS:
		if (sizeof(long) * CHAR_BIT >= 64 &&
		    sizeof(void *) * CHAR_BIT >= 64 &&
		    sizeof(int) * CHAR_BIT >= 32 &&
		    sizeof(off_t) >= sizeof(long))
			p = "";
		else
			p = UPE;
		goto docopy;

	case _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS:
		/* XXX - should have more complete coverage */
		if (sizeof(long) * CHAR_BIT >= 64)
			p = "_POSIX_V6_LP64_OFF64";
		else
			p = "_POSIX_V6_ILP32_OFFBIG";
		goto docopy;

docopy:
		if (len != 0 && buf != NULL)
			strlcpy(buf, p, len);
		return (strlen(p) + 1);

	default:
		errno = EINVAL;
		return (0);
	}
	/* NOTREACHED */
}


text:
package io.shardingsphere.shardingproxy.transport.mysql.packet.command.query.binary.execute.protocol;

import io.shardingsphere.shardingproxy.transport.mysql.packet.MySQLPacketPayload;
import org.hamcrest.CoreMatchers;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

import java.sql.Timestamp;
import java.util.Calendar;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.when;

@RunWith(MockitoJUnitRunner.class)
public final class TimeBinaryProtocolValueTest {

    @Mock
    private MySQLPacketPayload payload;

    @Test
    public void assertReadWithZeroByte() {
        assertThat(new TimeBinaryProtocolValue().read(payload), CoreMatchers.<Object>is(new Timestamp(0)));
    }

    @Test
    public void assertReadWithEightBytes() {
        when(payload.readInt1()).thenReturn(8, 0, 10, 59, 0);
        Calendar actual = Calendar.getInstance();
        actual.setTimeInMillis(((Timestamp) new TimeBinaryProtocolValue().read(payload)).getTime());
        assertThat(actual.get(Calendar.HOUR_OF_DAY), is(10));
        assertThat(actual.get(Calendar.MINUTE), is(59));
        assertThat(actual.get(Calendar.SECOND), is(0));
    }

    @Test
    public void assertReadWithTwelveBytes() {
        when(payload.readInt1()).thenReturn(12, 0, 10, 59, 0);
        Calendar actual = Calendar.getInstance();
        actual.setTimeInMillis(((Timestamp) new TimeBinaryProtocolValue().read(payload)).getTime());
        assertThat(actual.get(Calendar.HOUR_OF_DAY), is(10));
        assertThat(actual.get(Calendar.MINUTE), is(59));
        assertThat(actual.get(Calendar.SECOND), is(0));
    }

    @Test(expected = IllegalArgumentException.class)
    public void assertReadWithIllegalArgument() {
        when(payload.readInt1()).thenReturn(100);
        new TimeBinaryProtocolValue().read(payload);
    }
}


text:
#ifndef FASTEFFECTIVEDPFILTER_H
#define FASTEFFECTIVEDPFILTER_H

#include <VoxieClient/Array.hpp>
#include <VoxieClient/ClaimedOperation.hpp>

class FastEffectiveDPFilter {
 public:
  FastEffectiveDPFilter();
  void compute(vx::Array2<float>& vertices,
               vx::Array2<const uint32_t> triangles, double threshold,
               int iterations,
               vx::ClaimedOperation<
                   de::uni_stuttgart::Voxie::ExternalOperationRunFilter>& prog);

 private:
  double threshold;
  QList<QVector3D> filteredNormals;
  QList<QVector3D> normals;
  QList<QList<int>> neighbours;
  QList<QVector3D> differences;
  QList<QVector3D> centroids;

  void getTrianglesInfo(vx::Array2<float> vertices,
                        vx::Array2<const uint32_t> triangles);
  void filterNormals(vx::Array2<float> vertices,
                     vx::Array2<const uint32_t> triangles);
  void setUpNeighbours(vx::Array2<float> vertices,
                       vx::Array2<const uint32_t> triangles);
  void updateVertices(vx::Array2<float>& vertices,
                      vx::Array2<const uint32_t> triangles);
};

#endif  // FASTEFFECTIVEDPFILTER_H


text:
(function () {

    var PipelineStage = require(EclairJS_Globals.NAMESPACE + '/ml/PipelineStage');
    var Logger = require(EclairJS_Globals.NAMESPACE + '/Logger');
    var Utils = require(EclairJS_Globals.NAMESPACE + '/Utils');

    /**
     * @classdesc
     * [Decision tree]{@link http://en.wikipedia.org/wiki/Decision_tree_learning} learning algorithm
     * for classification.
     * It supports both binary and multiclass labels, as well as both continuous and categorical
     * features.
     * @class
     * @extends module:eclairjs/ml.PipelineStage
     * @memberof module:eclairjs/ml/classification
     * @param {string} [uid]
     */
    var DecisionTreeClassifier = function(uid) {
    	 this.logger = Logger.getLogger("ml.classification.DecisionTreeClassifier_js");
        var jvmObject;
        if (uid) {
            if (uid instanceof org.apache.spark.ml.classification.DecisionTreeClassifier) {
                jvmObject = uid;
            } else {
                jvmObject = new org.apache.spark.ml.classification.DecisionTreeClassifier(uid);
            }
        } else {
            jvmObject = new org.apache.spark.ml.classification.DecisionTreeClassifier();
        }
        PipelineStage.call(this, jvmObject);

    };

    DecisionTreeClassifier.prototype = Object.create(PipelineStage.prototype);

    DecisionTreeClassifier.prototype.constructor = DecisionTreeClassifier;

    /**
     * Accessor for supported impurities: entropy, gini
     * @returns {string[]}
     */
    DecisionTreeClassifier.prototype.supportedImpurities = function() {
        return this.getJavaObject().supportedImpurities();
    };

    /**
     * An immutable unique ID for the object and its derivatives.
     * @returns {string}
     */
    DecisionTreeClassifier.prototype.uid = function () {
        return this.getJavaObject().uid();
    };

    /**
     * @param {integer} value
     * @returns {module:eclairjs/ml/classification.DecisionTreeClassifier}
     */
    DecisionTreeClassifier.prototype.setMaxDepth = function(value) {
       var javaObject =  this.getJavaObject().setMaxDepth(value);
       return new DecisionTreeClassifier(javaObject);
    };

    /**
     * @param {integer} value
     * @returns {module:eclairjs/ml/classification.DecisionTreeClassifier}
     */
    DecisionTreeClassifier.prototype.setMaxBins = function(value) {
       var javaObject =  this.getJavaObject().setMaxBins(value);
       return new DecisionTreeClassifier(javaObject);
    };

    /**
     * @param {integer} value
     * @returns {module:eclairjs/ml/classification.DecisionTreeClassifier}
     */
    DecisionTreeClassifier.prototype.setMinInstancesPerNode = function(value) {
       var javaObject =  this.getJavaObject().setMinInstancesPerNode(value);
       return new DecisionTreeClassifier(javaObject);
    };

    /**
     * @param {float} value
     * @returns {module:eclairjs/ml/classification.DecisionTreeClassifier}
     */
    DecisionTreeClassifier.prototype.setMinInfoGain = function(value) {
       var javaObject =  this.getJavaObject().setMinInfoGain(value);
       return new DecisionTreeClassifier(javaObject);
    };

    /**
     * @param {integer} value
     * @returns {module:eclairjs/ml/classification.DecisionTreeClassifier}
     */
    DecisionTreeClassifier.prototype.setMaxMemoryInMB = function(value) {
       var javaObject =  this.getJavaObject().setMaxMemoryInMB(value);
       return new DecisionTreeClassifier(javaObject);
    };

    /**
     * @param {boolean} value
     * @returns {module:eclairjs/ml/classification.DecisionTreeClassifier}
     */
    DecisionTreeClassifier.prototype.setCacheNodeIds = function(value) {
       var javaObject =  this.getJavaObject().setCacheNodeIds(value);
       return new DecisionTreeClassifier(javaObject);
    };

    /**
     * @param {integer} value
     * @returns {module:eclairjs/ml/classification.DecisionTreeClassifier}
     */
    DecisionTreeClassifier.prototype.setCheckpointInterval = function(value) {
       var javaObject =  this.getJavaObject().setCheckpointInterval(value);
       return new DecisionTreeClassifier(javaObject);
    };

    /**
     * @param {string} value
     * @returns {module:eclairjs/ml/classification.DecisionTreeClassifier}
     */
    DecisionTreeClassifier.prototype.setImpurity = function(value) {
       var javaObject =  this.getJavaObject().setImpurity(value);
       return new DecisionTreeClassifier(javaObject);
    };

    /**
     * @param {integer} value
     * @returns {module:eclairjs/ml/classification.DecisionTreeClassifier}
     */
    DecisionTreeClassifier.prototype.setSeed = function(value) {
       var javaObject =  this.getJavaObject().setSeed(value);
       return new DecisionTreeClassifier(javaObject);
    };

    /**
     * @param {module:eclairjs/ml/param.ParamMap} extra
     * @returns {module:eclairjs/ml/classification.DecisionTreeClassifier}
     */
    DecisionTreeClassifier.prototype.copy = function(extra) {
       var extra_uw = Utils.unwrapObject(extra);
       var javaObject =  this.getJavaObject().copy(extra_uw);
       return new DecisionTreeClassifier(javaObject);
    };

    /**
     * Validates and transforms the input schema with the provided param map.
     * @param {module:eclairjs/sql/types.StructType} schema
     * @param {boolean} fitting  whether this is in fitting
     * @param {module:eclairjs/sql/types.DataType} featuresDataType SQL DataType for FeaturesType.
     * E.g., {@link module:eclairjs/sql/types.VectorUDT}for vector features
     * @returns {module:eclairjs/sql/types.StructType}
     */
    DecisionTreeClassifier.prototype.validateAndTransformSchema = function (schema, fitting, featuresDataType) {
        var schema_uw = Utils.unwrapObject(schema);
        var featuresDataType_uw = Utils.unwrapObject(featuresDataType);
        var javaObject = this.getJavaObject().validateAndTransformSchema(schema_uw, fitting, featuresDataType_uw);
        return Utils.javaToJs(javaObject);
    };

    /**
     * Param for raw prediction (a.k.a. confidence) column name.
     * @returns {module:eclairjs/ml/param.Param}
     */
    DecisionTreeClassifier.prototype.rawPredictionCol = function() {
        var javaObject =  this.getJavaObject().rawPredictionCol();
        return Utils.javaToJs(javaObject);
    };

    /**
     * @returns {string}
     */
    DecisionTreeClassifier.prototype.getRawPredictionCol = function() {
        return this.getJavaObject().getRawPredictionCol();
    };

    /**
     * Param for label column name.
     * @returns {module:eclairjs/ml/param.Param}
     */
    DecisionTreeClassifier.prototype.labelCol = function() {
        var javaObject =  this.getJavaObject().labelCol();
        return Utils.javaToJs(javaObject);
    };

    /**
     * @returns {string}
     */
    DecisionTreeClassifier.prototype.getLabelCol = function() {
        return this.getJavaObject().getLabelCol();
    };

    /**
     * @param {string} value
     * @returns {module:eclairjs/ml/classification.DecisionTreeClassifier} value
     */
    DecisionTreeClassifier.prototype.setLabelCol = function(value) {
        return Utils.javaToJs(this.getJavaObject().setLabelCol(value));
    };

    /**
     * Param for features column name.
     * @returns {module:eclairjs/ml/param.Param}
     */
    DecisionTreeClassifier.prototype.featuresCol = function() {
        var javaObject =  this.getJavaObject().featuresCol();
        return Utils.javaToJs(javaObject);
    };

    /**
     * @returns {string}
     */
    DecisionTreeClassifier.prototype.getFeaturesCol = function() {
        return this.getJavaObject().getFeaturesCol();
    };

    /**
     * @param {string} value
     * @returns {module:eclairjs/ml/classification.DecisionTreeClassifier} value
     */
    DecisionTreeClassifier.prototype.setFeaturesCol = function(value) {
        return Utils.javaToJs(this.getJavaObject().setFeaturesCol(value));
    };

    /**
     * Param for prediction column name.
     * @returns {module:eclairjs/ml/param.Param}
     */
    DecisionTreeClassifier.prototype.predictionCol = function() {
        var javaObject =  this.getJavaObject().predictionCol();
        return Utils.javaToJs(javaObject);
    };

    /**
     * @returns {string}
     */
    DecisionTreeClassifier.prototype.getPredictionCol = function() {
        return this.getJavaObject().getPredictionCol();
    };

    /**
     * @param {string} value
     * @returns {module:eclairjs/ml/classification.DecisionTreeClassifier} value
     */
    DecisionTreeClassifier.prototype.setPredictionCol = function(value) {
        return Utils.javaToJs(this.getJavaObject().setPredictionCol(value));
    };

    module.exports = DecisionTreeClassifier;
})();


text:
package io.github.lonamiwebs.stringlate.adapters;

import android.content.Context;
import android.graphics.Typeface;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import java.util.List;

import io.github.lonamiwebs.stringlate.R;
import io.github.lonamiwebs.stringlate.classes.resources.ResourcesTranslation;

public class ResourcesTranslationAdapter extends ArrayAdapter<ResourcesTranslation> {

    // https://developer.android.com/training/improving-layouts/smooth-scrolling.html#ViewHolder
    private static class ViewHolder {
        TextView stringId, originalValue, translatedValue;
    }

    public ResourcesTranslationAdapter(Context context,
                                       List<ResourcesTranslation> resourcesTranslations) {
        super(context, R.layout.item_resource_list, resourcesTranslations);
    }

    @NonNull
    public View getView(int position, View convertView, @NonNull ViewGroup parent) {
        ResourcesTranslation rt = getItem(position);

        // This may be the first time we use the recycled view
        if (convertView == null) {
            convertView = LayoutInflater.from(getContext())
                    .inflate(R.layout.item_resource_list, parent, false);

            final ViewHolder holder = new ViewHolder();
            holder.stringId = convertView.findViewById(R.id.stringIdTextView);
            holder.originalValue = convertView.findViewById(R.id.originalValueTextView);
            holder.translatedValue = convertView.findViewById(R.id.translatedValueTextView);
            convertView.setTag(holder);
        }
        if (rt != null) {
            final ViewHolder holder = (ViewHolder) convertView.getTag();
            holder.stringId.setText(rt.getId());
            holder.originalValue.setText(rt.getOriginal());

            if (rt.hasTranslation()) {
                holder.translatedValue.setText(rt.getTranslation());
                holder.translatedValue.setTypeface(null, Typeface.NORMAL);
            } else {
                holder.translatedValue.setText(R.string.not_translated);
                holder.translatedValue.setTypeface(null, Typeface.ITALIC);
            }
        }
        return convertView;
    }
}


text:
const assert = require("chai").assert
const expect = require("chai").expect
const testConfigs = require("../config")

const NeuronState = require("../../src/enums").NeuronState
const Layer = require("../../src/layer")
const Neuron = require("../../src/neuron")

describe("Neuron Unit Tests", () => {

    const config = {
        name: "layer 1",
        origin: {x: 0, y: 0, z: 0},
        miniColumns: false,
        neuronCount: 1000,
        dimensions: {
            x: 10, y: 10, z: 10
        }
    }
    let layer = new Layer(config)
    let neurons = layer.getNeurons()

    describe("upon creation by Layer", () => {
        describe("if created without a position", () => {
            it("throw an execption", () => {
                expect(() => new Neuron({origin: {x: 0, y: 0, z: 0}}))
                    .to.throw("Cannot create Neuron without position");
            })
        })
        it("returns the proper cell index", () => {
            neurons.forEach((neuron, index) => {
                expect(neuron.getIndex()).to.equal(index)
            })
        })
        it("can be activated", () => {
            neurons.forEach((neuron, index) => {
                neuron._state = NeuronState.inactive
                neuron.activate()
                expect(neuron.getState()).to.equal(NeuronState.active)
            })

        })
        it("can be deactivated", () => {
            neurons.forEach((neuron, index) => {
                neuron._state = NeuronState.active
                neuron.deactivate()
                expect(neuron.getState()).to.equal(NeuronState.inactive)
            })
        })
        it("returns the correct position", () => {
            // Let's take index 0 first.
            let position = neurons[0].getPosition()
            expect(position.x).to.equal(0)
            expect(position.y).to.equal(0)
            expect(position.z).to.equal(0)
            position = neurons[1].getPosition()
            expect(position.x).to.equal(0)
            expect(position.y).to.equal(1)
            expect(position.z).to.equal(0)
            // Jump ahead out of the first mini-column.
            position = neurons[10].getPosition()
            expect(position.x).to.equal(1)
            expect(position.y).to.equal(0)
            expect(position.z).to.equal(0)
            position = neurons[11].getPosition()
            expect(position.x).to.equal(1)
            expect(position.y).to.equal(1)
            expect(position.z).to.equal(0)
            // Jump to the next mini-column.
            position = neurons[20].getPosition()
            expect(position.x).to.equal(2)
            expect(position.y).to.equal(0)
            expect(position.z).to.equal(0)
            position = neurons[21].getPosition()
            expect(position.x).to.equal(2)
            expect(position.y).to.equal(1)
            expect(position.z).to.equal(0)
        })
        it("returns the correct origin with scale applied", () => {
            let config = {
                name: "layer 1",
                origin: {x: 0, y: 0, z: 0},
                miniColumns: false,
                neuronCount: 1000,
                dimensions: {
                    x: 10, y: 10, z: 10
                },
                scale: 2
            }
            let layer = new Layer(config)
            let neurons = layer.getNeurons()
            // Let's take index 0 first.
            let origin = neurons[0].getOrigin()
            expect(origin.x).to.equal(0)
            expect(origin.y).to.equal(0)
            expect(origin.z).to.equal(0)
            origin = neurons[1].getOrigin()
            expect(origin.x).to.equal(0)
            expect(origin.y).to.equal(2)
            expect(origin.z).to.equal(0)
            // Jump ahead out of the first mini-column.
            origin = neurons[10].getOrigin()
            expect(origin.x).to.equal(2)
            expect(origin.y).to.equal(0)
            expect(origin.z).to.equal(0)
            origin = neurons[11].getOrigin()
            expect(origin.x).to.equal(2)
            expect(origin.y).to.equal(2)
            expect(origin.z).to.equal(0)
            // Jump to the next mini-column.
            origin = neurons[20].getOrigin()
            expect(origin.x).to.equal(4)
            expect(origin.y).to.equal(0)
            expect(origin.z).to.equal(0)
            origin = neurons[21].getOrigin()
            expect(origin.x).to.equal(4)
            expect(origin.y).to.equal(2)
            expect(origin.z).to.equal(0)
        })
        it("returns no children", () => {
            neurons.forEach((neuron, index) => {
                expect(neuron.getChildren()).to.eql([])
            })
        })
    })

})


text:
package functions.unary;

import functions.interfaces.OOFunction;

public class Constant implements OOFunction {

	private float value;

	public Constant (float aValue) {

		value = aValue;
	}

	public float evaluateWith(float aValue) {

		return value;
	}

}


text:
Copyright 2005 Tarek Ziadé

The software is licensed according to the terms of the PSF (Python Software Foundation) license found here: http://www.python.org/psf/license/


text:
{-# LANGUAGE StandaloneDeriving, DeriveGeneric, LambdaCase #-}
module Test.Grammar where

import qualified Grin.Grin as Grin
import Test.QuickCheck (NonEmptyList(..))
import GHC.Generics

data Name = Name { unName :: Grin.Name }
  deriving (Eq, Generic, Show)

deriving instance Generic (NonEmptyList a)

data Prog = Prog (NonEmptyList Def)
  deriving (Generic, Show)

data Def = Def Name [Name] Exp
  deriving (Generic, Show)

data Exp
  = EBind SExp LPat Exp
  | ECase Val (NonEmptyList Alt)
  | SExp SExp
  deriving (Generic, Show)

data Alt = Alt Grin.CPat Exp
  deriving (Generic, Show)

data SExp
  = SApp     Name [SimpleVal]
  | SReturn  Val
  | SStore   Val
  | SFetchI  Name (Maybe Int)
  | SUpdate  Name Val
  | SBlock   Exp
  deriving (Generic, Show)

data Val
  = ConstTagNode  Grin.Tag [SimpleVal]
  | VarTagNode    Name     [SimpleVal]
  | ValTag        Grin.Tag
  | Unit
  | SimpleVal SimpleVal
  deriving (Eq, Generic, Show)

data SimpleVal
  = Lit Grin.Lit
  | Var Name
  deriving (Eq, Generic, Show)

data LPat
  = LPatVal  Val
  | LPatSVal SimpleVal
  deriving (Generic, Show)

type Loc = Int

data ExtraVal
  = Loc Loc
  deriving (Eq, Generic, Show)

toName (Name n) = n

class AsVal t where
  asVal :: t -> Grin.Val

instance AsVal Val where
  asVal = \case
    ConstTagNode  tag  simpleVals -> Grin.ConstTagNode tag (asVal <$> simpleVals)
    VarTagNode    name simpleVals -> Grin.VarTagNode (toName name) (asVal <$> simpleVals)
    ValTag        tag             -> Grin.ValTag tag
    Unit                          -> Grin.Unit
    SimpleVal     simpleVal       -> asVal simpleVal

instance AsVal SimpleVal where
  asVal = \case
    Lit lit  -> Grin.Lit lit
    Var name -> Grin.Var (toName name)

instance AsVal LPat where
  asVal = \case
    LPatVal  val  -> asVal val
    LPatSVal sval -> asVal sval

class AsExp t where
  asExp :: t -> Grin.Exp

instance AsExp Prog where
  asExp = \case
    Prog defs -> Grin.Program [] (asExp <$> getNonEmpty defs)

instance AsExp Def where
  asExp = \case
    Def name params exp -> Grin.Def (toName name) (toName <$> params) (asExp exp)

instance AsExp SExp where
  asExp = \case
    SApp     name simpleVals -> Grin.SApp (toName name) (asVal <$> simpleVals)
    SReturn  val -> Grin.SReturn (asVal val)
    SStore   val -> Grin.SStore (asVal val)
    SFetchI  name pos -> Grin.SFetchI (toName name) pos
    SUpdate  name val -> Grin.SUpdate (toName name) (asVal val)
    SBlock   exp -> Grin.SBlock (asExp exp)

instance AsExp Exp where
  asExp = \case
    EBind sexp lpat exp -> Grin.EBind (asExp sexp) (asVal lpat) (asExp exp)
    ECase val alts      -> Grin.ECase (asVal val) (asExp <$> getNonEmpty alts)
    SExp sexp           -> asExp sexp

instance AsExp Alt where
  asExp = \case
    Alt cpat exp -> Grin.Alt cpat (asExp exp)


text:
<form method="POST" name="myform" action="index.php?anyid={$anyid}&lang={$lang}&cs={$cs}" target="_self">
<input name="action" type="hidden" value="modify" />

	生成ICO网址推荐:

	http://www.ico.la/

	http://tool.alixixi.com/ico/

	http://ico.55.la/

        ICO地址栏图标:

			<input name="met_upsql" type="file" id="file_upload" />

			 推荐上传32*32的ICO图标

		更新本机IOC缓存:

		更新 注:如打开连接后任然未更新缓存,请刷新页面

		注:

		如无法看到新上传的ICO图标,请清空浏览器缓存,并重启浏览器。

</form>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/LinearLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/board_title "
        style="@style/BoardHeader"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="All Time Winners" />

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <ProgressBar
            android:id="@+id/progressBar"
            style="?android:attr/progressBarStyleLarge"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center" />

        <TableLayout
            android:id="@+id/table_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

        </TableLayout>
    </FrameLayout>

</LinearLayout>


text:
import { IOEndpoint, IONode, IOOptions, IOPromise, startIO } from '../io-tools';
import { TransactionOptions } from '../transactions';

export interface IORecord extends IONode {
    getEndpoint() : IOEndpoint
    save( options? : object ) : IOPromise<this>
    fetch( options? : object ) : IOPromise<this>
    destroy( options? : object ) : IOPromise<this>
    toJSON( options? : object ) : any
    parse( data : any, options? : object ) : any
    isNew() : boolean
    id : string | number
    set( json : object, options : TransactionOptions ) : this
}

export const IORecordMixin = {
    save( this : IORecord, options : IOOptions = {} ){
        const endpoint = this.getEndpoint(),
              json = this.toJSON({ ioMethod : 'save', ...options });

        return startIO(
            this,
            this.isNew() ?
                endpoint.create( json, options, this ) :
                endpoint.update( this.id, json, options, this ),
            options,

            update => {
                this.set( update, {
                    parse : true,
                    ioMethod : 'save',
                    ...options
                } );
            }
        );
    },

    fetch( options : IOOptions = {} ){
        return startIO(
            this,
            this.getEndpoint().read( this.id, options, this ),
            options,

            json => this.set( json, { parse : true, ioMethod : 'fetch', ...options } )
        );
    },

    destroy( options : IOOptions = {} ){
        return startIO(
            this,
            this.getEndpoint().destroy( this.id, options, this ),
            options,

            () => {
                const { collection } = this;
                if( collection ){
                    collection.remove( this, options );
                }
                else{
                    this.dispose();
                }

                return this;
            }
        )
    }
}


text:
import { RouteHandler } from './route_handlers/route_handler';
import { Url } from '../url_parser';
import { ComponentInstruction } from '../instruction';
import { RoutePath } from './route_paths/route_path';
import { GeneratedUrl } from './route_paths/route_path';
export declare abstract class RouteMatch {
}
export declare class PathMatch extends RouteMatch {
    instruction: ComponentInstruction;
    remaining: Url;
    remainingAux: Url[];
    constructor(instruction: ComponentInstruction, remaining: Url, remainingAux: Url[]);
}
export declare class RedirectMatch extends RouteMatch {
    redirectTo: any[];
    specificity: any;
    constructor(redirectTo: any[], specificity: any);
}
export interface AbstractRule {
    hash: string;
    path: string;
    recognize(beginningSegment: Url): Promise<RouteMatch>;
    generate(params: {
        [key: string]: any;
    }): ComponentInstruction;
}
export declare class RedirectRule implements AbstractRule {
    private _pathRecognizer;
    redirectTo: any[];
    hash: string;
    constructor(_pathRecognizer: RoutePath, redirectTo: any[]);
    path: string;
    /**
     * Returns `null` or a `ParsedUrl` representing the new path to match
     */
    recognize(beginningSegment: Url): Promise<RouteMatch>;
    generate(params: {
        [key: string]: any;
    }): ComponentInstruction;
}
export declare class RouteRule implements AbstractRule {
    private _routePath;
    handler: RouteHandler;
    private _routeName;
    specificity: string;
    terminal: boolean;
    hash: string;
    private _cache;
    constructor(_routePath: RoutePath, handler: RouteHandler, _routeName: string);
    path: string;
    recognize(beginningSegment: Url): Promise<RouteMatch>;
    generate(params: {
        [key: string]: any;
    }): ComponentInstruction;
    generateComponentPathValues(params: {
        [key: string]: any;
    }): GeneratedUrl;
    private _getInstruction(urlPath, urlParams, params);
}


text:
package edu.mit.ll.em.api.dataaccess;

import java.util.Set;

import edu.mit.ll.em.api.rs.PsixResource;

public class PsixResourceDAO extends BaseDAO {

	private static final String CNAME = PsixResourceDAO.class.getName();

	// Lazy-initialization Holder class idiom.
	private static class Holder {
		public static PsixResourceDAO instance = new PsixResourceDAO();
	}

	public static PsixResourceDAO getInstance() {
		return Holder.instance;
	}

	public PsixResource createPsixResource(PsixResource psixResource) throws ICSDatastoreException {
		if (psixResource == null) {
			throw new NullPointerException(CNAME + ":createPsixResource called with null psixResource argument");
		}
		// TODO: Insert implementation here.
		return psixResource;
	}

	public Set<Integer> getAllPsixResourceIds() {
		Set<Integer> ret = null;
		// TODO: Insert implementation here.
		return ret;
	}

	public PsixResource getPsixResourceById(int id) {
		PsixResource ret = null;
		// TODO: Insert implementation here.
		return ret;
	}

	public void removePsixResource(int id) throws ICSDatastoreException {
		// TODO: Insert implementation here.
	}

	public PsixResource updatePsixResource(int psixResourceId, PsixResource other) throws ICSDatastoreException {
		PsixResource ret = null;
		if (other == null) {
			throw new NullPointerException(CNAME + ":updatePsixResource called with null psixResource argument");
		}
		// TODO: Insert implementation here.
		return ret;
	}

	public int getPsixResourceCount() {
		int count = -1;
		// TODO: Insert implementation here.
		return count;
	}
}


text:
/* global it expect */
import React from 'react';
import Enzyme, { shallow, mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import SprkCard from './SprkCard';

Enzyme.configure({ adapter: new Adapter() });

describe('SprkCard:', () => {
  it('should display a Card div with the correct base classes', () => {
    const wrapper = shallow(<SprkCard />);
    expect(wrapper.find('.sprk-o-Stack').hasClass('sprk-c-Card')).toBe(true);
  });

  it('should display children inside of Card', () => {
    const testVariable =
test
;
    const wrapper = mount(<SprkCard>{testVariable}</SprkCard>);
    const hasChildren = wrapper.find('p').contains('test');
    expect(hasChildren).toBe(true);
  });

  it('should display a Card div with the correct standout classes', () => {
    const wrapper = shallow(<SprkCard isStandout />);
    expect(wrapper.find('.sprk-c-Card').hasClass('sprk-c-Card--standout')).toBe(
      true,
    );
  });

  it('should display a Card with the correct additionalClasses', () => {
    const wrapper = shallow(<SprkCard additionalClasses="sprk-u-mam" />);
    expect(wrapper.find('.sprk-c-Card').hasClass('sprk-u-mam')).toBe(true);
  });

  it('should not add standout class if isStandout is false', () => {
    const wrapper = shallow(<SprkCard isStandout={false} />);
    expect(wrapper.find('.sprk-c-Card').hasClass('sprk-c-Card--standout')).toBe(
      false,
    );
  });

  it('should assign data-id when idString has a value', () => {
    const wrapper = mount(<SprkCard idString="321" />);
    expect(wrapper.find('[data-id="321"]').length).toBe(1);
  });

  it('should not assign data-id when idString is not provided', () => {
    const wrapper = mount(<SprkCard />);
    expect(wrapper.find('[data-id]').length).toBe(0);
  });
});