text:
#region -- License Terms --
//
// MessagePack for CLI
//
// Copyright (C) 2010-2016 FUJIWARA, Yusuke
//
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
//
//        http://www.apache.org/licenses/LICENSE-2.0
//
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.
//
#endregion -- License Terms --

using System;
using System.Collections.Generic;
#if FEATURE_TAP
using System.Threading;
using System.Threading.Tasks;
#endif // FEATURE_TAP

using MsgPack.Serialization.CollectionSerializers;

namespace MsgPack.Serialization.DefaultSerializers
{
	// ReSharper disable once InconsistentNaming
	[Preserve( AllMembers = true )]
	internal sealed class System_Collections_Generic_Stack_1MessagePackSerializer<TItem> : MessagePackSerializer<Stack<TItem>>, ICollectionInstanceFactory
	{
		private readonly MessagePackSerializer<TItem> _itemSerializer;

		public System_Collections_Generic_Stack_1MessagePackSerializer( SerializationContext ownerContext )
			: base( ownerContext, SerializerCapabilities.PackTo | SerializerCapabilities.UnpackFrom | SerializerCapabilities.UnpackTo )
		{
			this._itemSerializer = ownerContext.GetSerializer<TItem>();
		}

		[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods", MessageId = "0", Justification = "Validated internally" )]
		[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods", MessageId = "1", Justification = "Validated internally" )]
		protected internal override void PackToCore( Packer packer, Stack<TItem> objectTree )
		{
			packer.PackArrayHeader( objectTree.Count );
			foreach ( var item in objectTree )
			{
				this._itemSerializer.PackTo( packer, item );
			}
		}

		[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods", MessageId = "0", Justification = "Validated internally" )]
		protected internal override Stack<TItem> UnpackFromCore( Unpacker unpacker )
		{
			if ( !unpacker.IsArrayHeader )
			{
				SerializationExceptions.ThrowIsNotArrayHeader( unpacker );
			}

			return new Stack<TItem>( this.UnpackItemsInReverseOrder( unpacker, UnpackHelpers.GetItemsCount( unpacker ) ) );
		}

		[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods", MessageId = "0", Justification = "Validated internally" )]
		[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods", MessageId = "1", Justification = "Validated internally" )]
		protected internal override void UnpackToCore( Unpacker unpacker, Stack<TItem> collection )
		{
			if ( !unpacker.IsArrayHeader )
			{
				SerializationExceptions.ThrowIsNotArrayHeader( unpacker );
			}

			foreach ( var item in this.UnpackItemsInReverseOrder( unpacker, UnpackHelpers.GetItemsCount( unpacker ) ) )
			{
				collection.Push( item );
			}
		}

		private IEnumerable<TItem> UnpackItemsInReverseOrder( Unpacker unpacker, int count )
		{
			var buffer = new TItem[ count ];

			using ( var subTreeUnpacker = unpacker.ReadSubtree() )
			{
				// Reverse Order
				for ( var i = buffer.Length - 1; i >= 0; i-- )
				{
					if ( !subTreeUnpacker.Read() )
					{
						SerializationExceptions.ThrowUnexpectedEndOfStream( unpacker );
					}

					buffer[ i ] = this._itemSerializer.UnpackFrom( subTreeUnpacker );
				}
			}

			return buffer;
		}

		public object CreateInstance( int initialCapacity )
		{
			return new Stack<TItem>( initialCapacity );
		}

#if FEATURE_TAP

		protected internal override async Task PackToAsyncCore( Packer packer, Stack<TItem> objectTree, CancellationToken cancellationToken )
		{
			await packer.PackArrayHeaderAsync( objectTree.Count, cancellationToken ).ConfigureAwait( false );
			foreach ( var item in objectTree )
			{
				await this._itemSerializer.PackToAsync( packer, item, cancellationToken ).ConfigureAwait( false );
			}
		}

		protected internal override async Task<Stack<TItem>> UnpackFromAsyncCore( Unpacker unpacker, CancellationToken cancellationToken )
		{
			if ( !unpacker.IsArrayHeader )
			{
				SerializationExceptions.ThrowIsNotArrayHeader( unpacker );
			}

			return new Stack<TItem>( await this.UnpackItemsInReverseOrderAsync( unpacker, UnpackHelpers.GetItemsCount( unpacker ), cancellationToken ).ConfigureAwait( false ) );
		}

		protected internal override async Task UnpackToAsyncCore( Unpacker unpacker, Stack<TItem> collection, CancellationToken cancellationToken )
		{
			if ( !unpacker.IsArrayHeader )
			{
				SerializationExceptions.ThrowIsNotArrayHeader( unpacker );
			}

			foreach ( var item in await this.UnpackItemsInReverseOrderAsync( unpacker, UnpackHelpers.GetItemsCount( unpacker ), cancellationToken ).ConfigureAwait( false ) )
			{
				collection.Push( item );
			}
		}

		private async Task<IEnumerable<TItem>> UnpackItemsInReverseOrderAsync( Unpacker unpacker, int count, CancellationToken cancellationToken )
		{
			var buffer = new TItem[ count ];

			using ( var subTreeUnpacker = unpacker.ReadSubtree() )
			{
				// Reverse Order
				for ( var i = buffer.Length - 1; i >= 0; i-- )
				{
					if ( !await subTreeUnpacker.ReadAsync( cancellationToken ).ConfigureAwait( false ) )
					{
						SerializationExceptions.ThrowUnexpectedEndOfStream( unpacker );
					}

					buffer[ i ] = await this._itemSerializer.UnpackFromAsync( subTreeUnpacker, cancellationToken ).ConfigureAwait( false );
				}
			}

			return buffer;
		}

#endif // FEATURE_TAP

	}
}


text:
package query.retrieval;

import java.util.ArrayList;

public class Document {
	// The document name -- an easy identifier e.g. "Hamlet"
	public String name;

	// The document content
	public String text;

	// The terms in the document (in sorted order)
	protected ArrayList<String> terms;

	/**
	 * @param name    An easy identifier for the doc e.g. "Hamlet". This is only
	 * 				  for human readability.
	 * @param docText The actual content of the document.
	 */
	public Document(String name, String docText) {
		terms = new ArrayList<String>();
		this.name = name;
		text = docText;
		String[] tokens = docText.split("\\s");

		for (String token : tokens) {
			String cleanToken = token.toLowerCase().replaceAll("\\W", "");
			if (!cleanToken.isEmpty()) {
				terms.add(cleanToken);
			}
		}
	}

	public boolean containsTerm(String term) {
		return terms.contains(term);
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<WindowOpeningMode>LockOwnerWindow</WindowOpeningMode>
	<VerticalScroll>useIfNecessary</VerticalScroll>
	<CommandSet>
		<ExcludedCommand>Copy</ExcludedCommand>
	</CommandSet>
	<AutoCommandBar name="ФормаКоманднаяПанель" id="-1">
		<ChildItems>
			<Button name="ФормаВключитьВозможностьРедактирования" id="15">
				<Type>CommandBarButton</Type>
				<OnlyInAllActions>false</OnlyInAllActions>
				<CommandName>Form.Command.ВключитьВозможностьРедактирования</CommandName>
				<Parameter xsi:nil="true"/>
				<ExtendedTooltip name="ФормаВключитьВозможностьРедактированияExtendedTooltip" id="16"/>
			</Button>
		</ChildItems>
	</AutoCommandBar>
	<Events>
		<Event name="OnCreateAtServer">ПриСозданииНаСервере</Event>
	</Events>
	<ChildItems>
		<InputField name="ПодчиненнаяТаблица" id="1">
			<DataPath>Запись.ПодчиненнаяТаблица</DataPath>
			<ContextMenu name="ПодчиненнаяТаблицаКонтекстноеМеню" id="2"/>
			<ExtendedTooltip name="ПодчиненнаяТаблицаExtendedTooltip" id="17"/>
		</InputField>
		<InputField name="ТипВедущейТаблицы" id="3">
			<DataPath>Запись.ТипВедущейТаблицы</DataPath>
			<ContextMenu name="ТипВедущейТаблицыКонтекстноеМеню" id="4"/>
			<ExtendedTooltip name="ТипВедущейТаблицыExtendedTooltip" id="18"/>
		</InputField>
		<InputField name="ПриПроверкеПраваЧтение" id="7">
			<DataPath>Запись.ПриПроверкеПраваЧтение</DataPath>
			<ContextMenu name="ПриПроверкеПраваЧтениеКонтекстноеМеню" id="8"/>
			<ExtendedTooltip name="ПриПроверкеПраваЧтениеExtendedTooltip" id="19"/>
		</InputField>
		<InputField name="ПриПроверкеПраваДобавление" id="9">
			<DataPath>Запись.ПриПроверкеПраваДобавление</DataPath>
			<ContextMenu name="ПриПроверкеПраваДобавлениеКонтекстноеМеню" id="10"/>
			<ExtendedTooltip name="ПриПроверкеПраваДобавлениеExtendedTooltip" id="20"/>
		</InputField>
		<InputField name="ПриПроверкеПраваИзменение" id="11">
			<DataPath>Запись.ПриПроверкеПраваИзменение</DataPath>
			<ContextMenu name="ПриПроверкеПраваИзменениеКонтекстноеМеню" id="12"/>
			<ExtendedTooltip name="ПриПроверкеПраваИзменениеExtendedTooltip" id="21"/>
		</InputField>
		<InputField name="ПриПроверкеПраваУдаление" id="13">
			<DataPath>Запись.ПриПроверкеПраваУдаление</DataPath>
			<ContextMenu name="ПриПроверкеПраваУдалениеКонтекстноеМеню" id="14"/>
			<ExtendedTooltip name="ПриПроверкеПраваУдалениеExtendedTooltip" id="22"/>
		</InputField>
		<CheckBoxField name="ОтключитьПроверкуПравВедущейТаблицы" id="5">
			<DataPath>Запись.ОтключитьПроверкуПравВедущейТаблицы</DataPath>
			<TitleLocation>Right</TitleLocation>
			<CheckBoxType>Auto</CheckBoxType>
			<ContextMenu name="ОтключитьПроверкуПравВедущейТаблицыКонтекстноеМеню" id="6"/>
			<ExtendedTooltip name="ОтключитьПроверкуПравВедущейТаблицыExtendedTooltip" id="23"/>
		</CheckBoxField>
	</ChildItems>
	<Attributes>
		<Attribute name="Запись" id="1">
			<Type>
				<v8:Type>cfg:InformationRegisterRecordManager.ЗависимостиПравДоступа</v8:Type>
			</Type>
			<MainAttribute>true</MainAttribute>
			<SavedData>true</SavedData>
		</Attribute>
	</Attributes>
	<Commands>
		<Command name="ВключитьВозможностьРедактирования" id="1">
			<Title>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Включить возможность редактирования</v8:content>
				</v8:item>
			</Title>
			<ToolTip>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Включить возможность редактирования только для целей поиска неисправности (требуется углубленное понимание работы механизма)</v8:content>
				</v8:item>
			</ToolTip>
			<Action>ВключитьВозможностьРедактирования</Action>
		</Command>
	</Commands>
</Form>


text:
<?php

namespace Miner\Api;

/**
 * Interface DataModelInterface
 *
 * @api
 */
interface DataModelInterface
{
    /**
     * @param array $data
     *
     * @return void
     */
    public function setModelData(array $data);

    /**
     * @return array
     */
    public function getModelData();
}


text:
using System;
using SaaSPro.Common;
using SaaSPro.Domain;

namespace SaaSPro.Services.ViewModels
{
    public class UsersListModel
    {
        public IPagedList<UserSummary> Users { get; set; }

        public class UserSummary
        {
            public Guid Id { get; set; }
            public string FullName { get; set; }
            public DateTime RegisteredDate { get; set; }
            public DateTime? LastLoginDate { get; set; }
            public string Email { get; set; }
            public string[] Roles { get; set; }
            public UserType UserType { get; set; }
        }
    }
}


text:
subtract/stimulus.cpp
subtract/display.cpp
subtract/subtract.cpp
subtract/main.cpp


text:
"""
Display bluetooth status.

Configuration parameters:
    cache_timeout: refresh interval for this module (default 10)
    device_separator: show separator only if more than one (default '|')
    format: display format for this module (default 'BT[: {format_device}]')
    format_device: display format for bluetooth devices (default '{name}')

Format placeholders:
    {format_device} format for bluetooth devices

format_device placeholders:
    {mac} bluetooth device address
    {name} bluetooth device name

Color options:
    color_bad: No connection
    color_good: Active connection

@author jmdana <https://github.com/jmdana>
@license GPLv3 <http://www.gnu.org/licenses/gpl-3.0.txt>

SAMPLE OUTPUT
{'color': '#00FF00', 'full_text': u'BT: Microsoft Bluetooth Notebook Mouse 5000'}

off
{'color': '#FF0000', 'full_text': u'BT'}
"""

import dbus

DEFAULT_FORMAT = 'BT[: {format_device}]'
STRING_NOT_STARTED = "service isn't running"

def get_connected_devices():
    bus = dbus.SystemBus()
    manager = dbus.Interface(
        bus.get_object("org.bluez", "/"),
        "org.freedesktop.DBus.ObjectManager"
    )

    objects = manager.GetManagedObjects()
    devices = []

    for dev_path, interfaces in objects.items():
        if "org.bluez.Device1" in interfaces.keys():
            properties = objects[dev_path]["org.bluez.Device1"]

            if properties["Connected"] == 1:
                devices.append((properties["Address"], properties["Name"]))

    return devices

class Py3status:
    """
    """
    # available configuration parameters
    cache_timeout = 10
    device_separator = '|'
    format = DEFAULT_FORMAT
    format_device = '{name}'

    def post_config_hook(self):
        # Do deprecation stuff here.  Because of the complexity we can't use
        # the usual deprecation methods
        # THIS IS A SPECIAL CASE DO NOT USE AS EXAMPLE CODE.
        format_prefix = getattr(self, 'format_prefix', None)
        format_no_conn = getattr(self, 'format_no_conn', None)
        format_no_conn_prefix = getattr(self, 'format_no_conn_prefix', None)

        placeholders = set(self.py3.get_placeholders_list(self.format))
        if set(['name', 'mac']) & placeholders:
            # this is an old format so should be format_device
            self.format_device = self.format
            self.format = DEFAULT_FORMAT
            msg = 'DEPRECATION WARNING: your format is using invalid '
            msg += 'placeholders you should update your configuration.'
            self.py3.log(msg)

        if self.format != DEFAULT_FORMAT:
            # The user has set a format using the new style format so we are
            # done here.
            return

        if format_prefix or format_no_conn_prefix or format_no_conn:
            # create a format that will give the expected output
            self.format = u'[\?if=format_device {}{{format_device}}|{}{}]'.format(
                format_prefix or 'BT: ',
                format_no_conn_prefix or 'BT: ',
                format_no_conn or 'OFF'
            )
            msg = 'DEPRECATION WARNING: you are using old style configuration '
            msg += 'parameters you should update to use the new format.'
            self.py3.log(msg)

    def bluetooth(self):
        try:
            devices = get_connected_devices()
        except dbus.DBusException:
            self.py3.error(STRING_NOT_STARTED)

        if devices:
            data = []
            for mac, name in devices:
                data.append(self.py3.safe_format(self.format_device, {'name': name, 'mac': mac}))
            full_text = self.py3.composite_join(self.device_separator, data)
            color = self.py3.COLOR_GOOD
        else:
            full_text = None
            color = self.py3.COLOR_BAD

        return {
            'cached_until': self.py3.time_in(self.cache_timeout),
            'full_text': self.py3.safe_format(self.format, {'format_device': full_text}),
            'color': color,
        }

if __name__ == "__main__":
    """
    Run module in test mode.
    """
    from py3status.module_test import module_test
    module_test(Py3status)


text:
from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'companies/$', views.companies, name='companies'),
    url(r'sites/$', views.sites, name='sites')
]


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.10.29 at 08:42:42 PM BST
//

package ws.biotea.ld2rdf.util.ncbo.annotator.jaxb.generated;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "ontologiesToExpand")
public class OntologiesToExpand {

}


text:
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace Settings
{
	public class UserSetting : INotifyPropertyChanged
	{
		public event PropertyChangedEventHandler PropertyChanged;

		protected virtual void OnPropertyChanged ([CallerMemberName] string propertyName = null)
		{
			if (PropertyChanged != null) {
				PropertyChanged (this, new PropertyChangedEventArgs (propertyName));
			}
		}

		protected bool SetProperty<T> (ref T storage, T value, [CallerMemberName] string propertyName = null)
		{
			if (Object.Equals (storage, value)) {
				return false;
			}

			storage = value;
			OnPropertyChanged (propertyName);
			return true;
		}

		private string _companyName;
		public string companyName
		{
			get { return _companyName; }
			set { SetProperty (ref _companyName, value); }
		}

		private double _pi;
		public double pi
		{
			get { return _pi; }
			set { SetProperty (ref _pi, value); }
		}

		private bool _onOff;
		public bool onOff
		{
			get { return _onOff; }
			set { SetProperty (ref _onOff, value); }
		}
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.adilmughal.demo.yow.searchd.traditional"
    android:versionCode="1"
    android:versionName="1.0" xmlns:tools="http://schemas.android.com/tools">

    <uses-sdk
        android:minSdkVersion="15"
        android:targetSdkVersion="19"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.adilmughal.demo.yow.searchd.traditional.activity.SearchActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


text:
/*
 * File:   queue.h
 * Author: rday
 *
 * Created on November 24, 2015, 2:29 PM
 */

#ifndef QUEUE_H
#define	QUEUE_H

#ifdef	__cplusplus
extern "C" {
#endif

typedef struct queue {
    char *data;
    char *head;
    char *tail;
    size_t max_size;
    size_t items;
} queue;

queue *queue_init(uint8 size);
bool queue_empty(queue* q);
bool queue_full(queue* q);
bool queue_push(queue* q, char ch);
char queue_pop(queue *q);
#ifdef	__cplusplus
}
#endif

#endif	/* QUEUE_H */


text:
@interface AddMemoView : UIView

@property id<DataEntryDelegate>dataDelegate;

-(void)remove;

@end


text:
const assert = require('chai').assert;
var expect = require('chai').expect;
const deck = require('../lib/deck');
const Hand = require('../lib/hand');

describe('Hand', function () {

  it('exists', function () {
    assert(Hand);
  });

  it('returns the correct score for a hand', function () {
    deck.shuffle();
    var hand = new Hand();
    var card1 = { name: "Queen", suit: "Hearts", value: 10 }
    var card2 = { name: "Two", suit: "Hearts", value: 2 }
    hand.receiveCard(card1);
    hand.receiveCard(card2);

    assert.equal(hand.score(), 12);

  })

  it('displays BUST if score is greater than 21', function () {
    deck.shuffle();
    var hand = new Hand();
    var card1 = { name: "Queen", suit: "Hearts", value: 10 }
    var card2 = { name: "King", suit: "Hearts", value: 10 }
    var card3 = { name: "Two", suit: "Hearts", value: 2 }
    hand.receiveCard(card1);
    hand.receiveCard(card2);
    hand.receiveCard(card3);

    assert.equal(hand.score(), 22);
  })

  it('can score an Ace as 11 or 1 if it is a hit card', function (){
    deck.shuffle();
    var hand = new Hand();

    var card1 = { name: "Queen", suit: "Hearts", value: 10 }
    var card2 = { name: "King", suit: "Hearts", value: 10 }
    var hitCard = { name: "Ace",   suit: "Hearts", value: 11}

    hand.receiveCard(card1);
    hand.receiveCard(card2);
    hand.receiveCard(hitCard);

    assert.equal(hand.score(), 21);
  })

  it ('can properly score and Ace as 11 or 1 if it is a hit card', function (){
    deck.shuffle();
    var hand = new Hand();

    var card1 = { name: "Ace", suit: "Hearts", value: 11 }
    var card2 = { name: "Four", suit: "Diamonds", value: 4 }
    var hitCard = { name: "Eight", suit: "Clubs", value: 8 }

    hand.receiveCard(card1);
    hand.receiveCard(card2);
    hand.receiveCard(hitCard);

    assert.equal(hand.score(), 13);
  })
});


text:
pdf: http://www.di.fc.ul.pt/~tjvg/amc/alzheimer/w4a_friendsourcing.pdf
title: Friendsourcing the Unmet Needs of People with Dementia
authors: João Martins, Oliver Schnell, José Carilho, Carlos Duarte, Francisco Couto, Luís Carriço, Tiago Guerreiro
venue: W4A 2014, Seoul, Korea, April, 2014
year: "2014"
doi:
tags: [Healthcare]
---


text:
package org.apache.airavata.persistance.registry.jpa;

import org.apache.airavata.persistance.registry.jpa.resources.*;
import org.junit.After;
import org.junit.Test;

import java.util.List;

import static org.junit.Assert.assertTrue;

public class ExperimentInputResourceTest extends AbstractResourceTest  {
    private ExperimentResource experimentResource;
    private String experimentID = "testExpID";
    ExperimentInputResource experimentInputResource;

    @Override
    public void setUp() throws Exception {
        super.setUp();
        experimentResource = (ExperimentResource) getGatewayResource().create(ResourceType.EXPERIMENT);
        experimentResource.setExpID(experimentID);
        experimentResource.setExecutionUser(getWorkerResource().getUser());
        experimentResource.setProject(getProjectResource());
        experimentResource.setCreationTime(getCurrentTimestamp());
        experimentResource.setApplicationId("testApplication");
        experimentResource.setApplicationVersion("1.0");
        experimentResource.setDescription("Test Application");
        experimentResource.setExpName("TestExperiment");
        experimentResource.save();

        experimentInputResource = (ExperimentInputResource)experimentResource.create(ResourceType.EXPERIMENT_INPUT);
        experimentInputResource.setExperimentResource(experimentResource);
        experimentInputResource.setExperimentKey("testKey");
        experimentInputResource.setValue("testValue");
        experimentInputResource.setInputType("string");
        experimentInputResource.save();
    }

    @Test
    public void testSave() throws Exception {
        assertTrue("Experiment Input saved successfully", experimentResource.isExists(ResourceType.EXPERIMENT_INPUT, experimentID));
    }

    @After
    public void tearDown() throws Exception {
    }

    @Test
    public void testGet () throws Exception {
        List<ExperimentInputResource> experimentInputs = experimentResource.getExperimentInputs();
        System.out.println("input counts : " + experimentInputs.size());
        assertTrue("Experiment input retrieved successfully...", experimentInputs.size() > 0);
    }
}


text:
=begin
#ARTIK Cloud API

#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: 2.0.0

Generated by: https://github.com/swagger-api/swagger-codegen.git

=end

require 'spec_helper'
require 'json'
require 'date'

# Unit tests for ArtikCloud::ExportRequestData
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
# Please update as you see appropriate
describe 'ExportRequestData' do
  before do
    # run before each test
    @instance = ArtikCloud::ExportRequestData.new
  end

  after do
    # run after each test
  end

  describe 'test an instance of ExportRequestData' do
    it 'should create an instact of ExportRequestData' do
      expect(@instance).to be_instance_of(ArtikCloud::ExportRequestData)
    end
  end
  describe 'test attribute "csv_headers"' do
    it 'should work' do
       # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
    end
  end

  describe 'test attribute "end_date"' do
    it 'should work' do
       # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
    end
  end

  describe 'test attribute "export_id"' do
    it 'should work' do
       # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
    end
  end

  describe 'test attribute "format"' do
    it 'should work' do
       # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
    end
  end

  describe 'test attribute "order"' do
    it 'should work' do
       # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
    end
  end

  describe 'test attribute "sdids"' do
    it 'should work' do
       # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
    end
  end

  describe 'test attribute "sdtids"' do
    it 'should work' do
       # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
    end
  end

  describe 'test attribute "start_date"' do
    it 'should work' do
       # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
    end
  end

  describe 'test attribute "trial_id"' do
    it 'should work' do
       # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
    end
  end

  describe 'test attribute "uids"' do
    it 'should work' do
       # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
    end
  end

  describe 'test attribute "url"' do
    it 'should work' do
       # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
    end
  end

end


text:
package org.sindice.siren.search.node;

import static org.sindice.siren.search.AbstractTestSirenScorer.dq;

import java.io.IOException;
import java.util.Arrays;

import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
import org.apache.lucene.index.Term;
import org.apache.lucene.util.automaton.Automaton;
import org.apache.lucene.util.automaton.AutomatonProvider;
import org.apache.lucene.util.automaton.BasicAutomata;
import org.apache.lucene.util.automaton.BasicOperations;
import org.apache.lucene.util.automaton.RegExp;
import org.sindice.siren.analysis.AnyURIAnalyzer;
import org.sindice.siren.analysis.TupleAnalyzer;
import org.sindice.siren.index.codecs.RandomSirenCodec.PostingsFormatType;
import org.sindice.siren.search.node.NodeRegexpQuery;
import org.sindice.siren.util.BasicSirenTestCase;

/**
 * Code taken from {@link TestRegexpQuery} and adapted for SIREn.
 */
public class TestNodeRegexpQuery extends BasicSirenTestCase {

  @Override
  protected void configure() throws IOException {
    this.setAnalyzer(
      new TupleAnalyzer(TEST_VERSION_CURRENT,
        new WhitespaceAnalyzer(TEST_VERSION_CURRENT),
        new AnyURIAnalyzer(TEST_VERSION_CURRENT))
    );
    this.setPostingsFormat(PostingsFormatType.RANDOM);
  }

  @Override
  public void setUp() throws Exception {
    super.setUp();
    this.addDocument("\"the quick brown fox jumps over the lazy ??? dog 493432 49344\"");
  }

  private Term newTerm(final String value) {
    return new Term(DEFAULT_TEST_FIELD, value);
  }

  private int regexQueryNrHits(final String regex) throws IOException {
    final NodeRegexpQuery query = new NodeRegexpQuery(this.newTerm(regex));
    return searcher.search(dq(query), 5).totalHits;
  }

  public void testRegex1() throws IOException {
    assertEquals(1, this.regexQueryNrHits("q.[aeiou]c.*"));
  }

  public void testRegex2() throws IOException {
    assertEquals(0, this.regexQueryNrHits(".[aeiou]c.*"));
  }

  public void testRegex3() throws IOException {
    assertEquals(0, this.regexQueryNrHits("q.[aeiou]c"));
  }

  public void testNumericRange() throws IOException {
    assertEquals(1, this.regexQueryNrHits("<420000-600000>"));
    assertEquals(0, this.regexQueryNrHits("<493433-600000>"));
  }

  public void testRegexComplement() throws IOException {
    assertEquals(1, this.regexQueryNrHits("4934~[3]"));
    // not the empty lang, i.e. match all docs
    assertEquals(1, this.regexQueryNrHits("~#"));
  }

  public void testCustomProvider() throws IOException {
    final AutomatonProvider myProvider = new AutomatonProvider() {
      // automaton that matches quick or brown
      private final Automaton quickBrownAutomaton = BasicOperations.union(Arrays
          .asList(BasicAutomata.makeString("quick"),
          BasicAutomata.makeString("brown"),
          BasicAutomata.makeString("bob")));

      public Automaton getAutomaton(final String name) {
        if (name.equals("quickBrown")) return quickBrownAutomaton;
        else return null;
      }
    };
    final NodeRegexpQuery query = new NodeRegexpQuery(this.newTerm("<quickBrown>"),
      RegExp.ALL, myProvider);
    assertEquals(1, searcher.search(dq(query), 5).totalHits);
  }

  /**
   * Test a corner case for backtracking: In this case the term dictionary has
   * 493432 followed by 49344. When backtracking from 49343... to 4934, its
   * necessary to test that 4934 itself is ok before trying to append more
   * characters.
   */
  public void testBacktracking() throws IOException {
    assertEquals(1, this.regexQueryNrHits("4934[314]"));
  }

}


text:
<!doctype html>
<html>

  <head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta http-equiv="x-ua-compatible" content="ie=edge">

    <title>Chung Antibody Database</title>

    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css">

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- Material Design Bootstrap -->
    <link href="css/mdb.min.css" rel="stylesheet">

    <!-- Your custom styles (optional) -->
    <link href="css/style.css" rel="stylesheet">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/angular-datatables/0.5.4/css/angular-datatables.css">

    <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.6/angular.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.3.1/angular-ui-router.js"></script>
    <script type="text/javascript" src="/angular-tablesort.js"></script>
    <script type="text/javascript" src="/angular-base64-upload.js"></script>
    <script type="text/javascript" src="/vendor/ng-file-upload-shim.js"></script>
    <script type="text/javascript" src="/vendor/ng-file-upload.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/mdb.min.js"></script>
    <script type="text/javascript" src="/scripts.js"></script>

    <!-- Include YT library and this directive -->
<script src="https://www.youtube.com/iframe_api"></script>
<script src="angular-youtube-embed.js"></script>
  </head>

  <body ng-app="mrchung">
    <div ui-view></div>
  </body>

</html>


text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>CodeRay output</title>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104

define.class('$system/base/node', function(require, $ui$, label){
        // The dataset class allows you to share a single "document" between various parts of your application.
        // The dataset provides undo/redo functionality by serializing its contents to a JSON string.
        // To modify a dataset you need to use the "fork" method. The fork method saves the current instance to the undo stack, calls back to your code and then notifies all objects that have this dataset instance bound to them to update themselves.

        this._atConstructor = function(data){
                this.undo_stack = []
                this.redo_stack = []
                this.connected_objects = []
                this.data = data
        }

        // internal, Handles the binding of this dataset to the attribute of something else.
        this.atAttributeAssign = function(obj, key){
                for(var i = 0; i < this.connected_objects.length; i++){
                        var co = this.connected_objects[i];
                        if (co.obj === obj) return;
                }
                this.connected_objects.push({obj:obj, key:key})
        }

        // Fork starts a new modification on a dataset;
        this.fork = function(callback){        // the function that will be called with a modifyable javascript object. DO NOT under any circumstances directly modify this data property!
                this.undo_stack.push(this.stringify(this.data))
                this.redo_stack.length = 0
                callback(this.data)
                this.notifyAssignedAttributes()
        }

        // internal, Silent operates much the same as `fork`, but does not notify listeners bound to this dataset. This can be used in case you are CERTAIN that this object is the only object in your application that listens to your changed property, but you still need to save the state to the undo stack
        // 'callback' the function that will be called with a modifyable javascript object. DO NOT under any circumstances directly modify this data property!
        this.silent = function(callback /*function*/){
                this.undo_stack.push(this.stringify(this.data))
                this.redo_stack.length = 0
                callback(this.data)
                if (this.atChange) this.atChange()
        }

        // internal, Cause objects that have us assigned to reload
        this.notifyAssignedAttributes = function(){
                for(var i = 0; i < this.connected_objects.length; i++){
                        var o = this.connected_objects[i]
                        o.obj[o.key] = this
                }
                if (this.atChange) this.atChange()
        }

        // Convert all javascript binary arrays in to their correct objects.
        // <node> the node to clean up.

        // convert a string in to a meaningful javascript object for this dataset. The default is JSON, but you could use this function to accept any format of choice.
        this.parse = function(stringdata){
                var data = JSON.parse(stringdata)
                data = define.structFromJSON(data);
                return data;
        }

        // convert an object in to a string. Defaults to standard JSON, but you could overload this function to provide a more efficient fileformat. Do not forget to convert the JSONParse function as well.
        this.stringify = function(data /*Object*/) /*String*/ {
                return JSON.stringify(data);
        }

        // Go back to the previous state. All classes that have this dataset bound will get their assignment updated
        this.undo = function(){
                if(!this.undo_stack.length) return
                this.redo_stack.push(this.stringify(this.data))
                this.data = this.parse(this.undo_stack.pop());
                this.notifyAssignedAttributes();
        }

        // Go forward to the next state. All classes that have this dataset bound will get their assignment updated
        this.redo = function(){
                if(!this.redo_stack.length) return
                this.undo_stack.push(this.stringify(this.data))
                this.data = this.parse(this.redo_stack.pop())
                this.notifyAssignedAttributes()
        }

        // Basic dataset modification example:
        var dataset = this.constructor
        this.constructor.examples = {
                Usage:function(){
                        var results = [];

                        var dset = dataset({something:1});

                        results.push(label({fgcolor:'green', text:'Value before fork is: ' + dset.data.something}));

                        dset.fork(function(data){ data.something = "some new value"; });

                        results.push(label({fgcolor:'red', text:'Current value is: ' + dset.data.something}));

                        return results;
                }
        }

})


text:
package net.java.sip.communicator.plugin.contactinfo;

import java.awt.*;
import java.util.*;

import javax.swing.*;
import javax.swing.event.*;

import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.protocol.*;

/**
 * The left side panel of ContactInfoDialog. Display all associated subcontacts
 * and their respective protocols in a JList. If a user is selected, the
 * ContactInfoDetailsPanel will be updated to the current contact.
 *
 * @author Adam Goldstein
 * @author Yana Stamcheva
 */
public class ContactInfoContactPanel
    extends TransparentPanel
{
    /**
     * Serial version UID.
     */
    private static final long serialVersionUID = 0L;

    /**
     * The list of all subcontacts related to the selected contact.
     */
    private JList contactList = new JList();

    /**
     * The scroll pane containing the list of all sub contacts of a selected
     * contact.
     */
    private JScrollPane contactScrollPane = new JScrollPane();

    private DefaultListModel contactListModel = new DefaultListModel();

    /**
     * The parent dialog that makes the connection between the contacts and
     * the details panel.
     */
    private ContactInfoDialog contactInfoDialog;

    /**
     * Create a panel with a list of all sub-contacts associated with the
     * contact that was originally selected. Whenever a sub-contact is picked,
     * notifies the protocolPanel of the change and it will update the displayed
     * details.
     *
     * @param contacts the list of contacts
     * @param dialog the contact info dialog
     */
    public ContactInfoContactPanel( Iterator<Contact> contacts,
                                    ContactInfoDialog dialog)
    {
        super(new BorderLayout());

        this.contactInfoDialog = dialog;

        this.setBorder(BorderFactory.createCompoundBorder(BorderFactory
            .createTitledBorder(Resources.getString("service.gui.CONTACTS")),
            BorderFactory.createEmptyBorder(5, 5, 5, 5)));

        this.contactList.setOpaque(false);
        this.contactList.setModel(contactListModel);
        this.contactList.setCellRenderer(new ContactPanelCellRenderer());
        this.contactList.addListSelectionListener(new ListSelectionListener()
        {
            public void valueChanged(ListSelectionEvent e)
            {
                // When the user release the mouse button and completes the
                // selection, getValueIsAdjusting() becomes false
                if (!e.getValueIsAdjusting())
                {
                    JList list = (JList) e.getSource();

                    Contact selectedContact
                        = (Contact) list.getSelectedValue();

                    contactInfoDialog.loadContactDetails(selectedContact);
                }
            }
        });

        boolean isFirstIter = true;
        while (contacts.hasNext())
        {
            Contact contact = contacts.next();

            this.contactListModel.addElement(contact);

            if (isFirstIter)
            {
                isFirstIter = false;
                contactInfoDialog.loadContactDetails(contact);
                contactList.setSelectedIndex(0);
            }
        }

        this.contactScrollPane.setPreferredSize(new Dimension(100, 200));
        this.contactScrollPane.getViewport().add(contactList);
        this.add(contactScrollPane);
    }

    /**
     * A cell renderer that allows both text and icons in our contactList.
     */
    private static class ContactPanelCellRenderer
        extends DefaultListCellRenderer
    {
        /**
         * Serial version UID.
         */
        private static final long serialVersionUID = 0L;

        private boolean isSelected;

        private Color blueGreyBorderColor = new Color(131, 149, 178);

        private Color selectedColor = new Color(209, 212, 225);

        public ContactPanelCellRenderer()
        {
            this.setOpaque(false);
        }

        /**
         * Renders a <tt>Contact</tt> object in a JList, by visualizing
         * the contact name and the protocol icon.
         *
         * @param list the rendered JList
         * @param value the object to be rendered
         * @param index the index of the object in the list
         * @param isSelected indicates if the rendered object is selected
         * @param cellHasFocus indicates if the rendered object is in a focused
         * cell
         */
        @Override
        public Component getListCellRendererComponent(  JList list,
                                                        Object value,
                                                        int index,
                                                        boolean isSelected,
                                                        boolean cellHasFocus)
        {
            super.getListCellRendererComponent(list, value, index, isSelected,
                cellHasFocus);

            this.isSelected = isSelected;

            Contact contact = (Contact) value;

            this.setIcon(new ImageIcon(contact.getProtocolProvider()
                .getProtocolIcon().getIcon(ProtocolIcon.ICON_SIZE_16x16)));
            this.setText(((Contact) value).getDisplayName());

            return this;
        }

        /**
         * Paint a round blue border and background when a cell is selected.
         */
        @Override
        public void paintComponent(Graphics g)
        {
            if (this.isSelected)
            {
                Graphics2D g2 = (Graphics2D) g.create();

                try
                {
                    AntialiasingManager.activateAntialiasing(g2);

                    int width = getWidth();
                    int height = getHeight();

                    g2.setColor(selectedColor);
                    g2.fillRoundRect(1, 0, width, height, 7, 7);

                    g2.setColor(blueGreyBorderColor);
                    g2.setStroke(new BasicStroke(1.5f));
                    g2.drawRoundRect(1, 0, width - 2, height - 1, 7, 7);
                }
                finally
                {
                    g2.dispose();
                }
            }

            super.paintComponent(g);
        }
    }
}


text:
class TrunkPayload(object):
    """Payload for trunk-related callback registry notifications."""

    def __init__(self, context, trunk_id, current_trunk=None,
                 original_trunk=None, subports=None):
        self.context = context
        self.trunk_id = trunk_id
        self.current_trunk = current_trunk
        self.original_trunk = original_trunk
        self.subports = subports if subports else []

    def __eq__(self, other):
        return (isinstance(other, self.__class__) and
                self.__dict__ == other.__dict__)

    def __ne__(self, other):
        return not self.__eq__(other)