text:
<?php

namespace Oro\Bundle\ReminderBundle\Tests\Unit\Model\WebSocket;

use Oro\Bundle\ReminderBundle\Entity\Reminder;
use Oro\Bundle\ReminderBundle\Model\WebSocket\MessageParamsProvider;
use Oro\Bundle\ReminderBundle\Model\WebSocket\WebSocketSendProcessor;
use Oro\Bundle\SyncBundle\Client\ConnectionChecker;
use Oro\Bundle\SyncBundle\Client\WebsocketClientInterface;
use Oro\Bundle\UserBundle\Entity\User;

class WebSocketSendProcessorTest extends \PHPUnit\Framework\TestCase
{
    /**
     * @var WebSocketSendProcessor
     */
    protected $processor;

    /**
     * @var WebsocketClientInterface|\PHPUnit\Framework\MockObject\MockObject
     */
    protected $websocketClient;

    /**
     * @var ConnectionChecker|\PHPUnit\Framework\MockObject\MockObject
     */
    protected $connectionChecker;

    /**
     * @var MessageParamsProvider|\PHPUnit\Framework\MockObject\MockObject
     */
    protected $messageParamsProvider;

    /**
     * @var \PHPUnit\Framework\MockObject\MockObject
     */
    protected $reminder;

    protected function setUp()
    {
        $this->websocketClient = $this->createMock(WebsocketClientInterface::class);
        $this->connectionChecker = $this->createMock(ConnectionChecker::class);
        $this->messageParamsProvider = $this->createMock(MessageParamsProvider::class);

        $this->processor = new WebSocketSendProcessor(
            $this->websocketClient,
            $this->connectionChecker,
            $this->messageParamsProvider
        );
    }

    public function testPush()
    {
        $fooUserId = 100;
        $fooUser = $this->createUser($fooUserId);
        $barUserId = 200;
        $barUser = $this->createUser($barUserId);

        $fooReminder = $this->createReminder($fooUser);
        $barReminder = $this->createReminder($barUser);
        $bazReminder = $this->createReminder($barUser);

        $this->processor->push($fooReminder);
        $this->processor->push($barReminder);
        $this->processor->push($bazReminder);

        $this->assertAttributeEquals(
            [
                $fooUserId => [$fooReminder],
                $barUserId => [$barReminder, $bazReminder],
            ],
            'remindersByRecipient',
            $this->processor
        );
    }

    public function testProcess()
    {
        $fooUserId = 100;
        $fooUser = $this->createUser($fooUserId);
        $barUserId = 200;
        $barUser = $this->createUser($barUserId);

        $fooReminder = $this->createReminder($fooUser);
        $fooMessage = ['data' => 'foo'];
        $barReminder = $this->createReminder($barUser);
        $barMessage = ['data' => 'bar'];
        $bazReminder = $this->createReminder($barUser);
        $bazMessage = ['data' => 'baz'];

        $this->processor->push($fooReminder);
        $this->processor->push($barReminder);
        $this->processor->push($bazReminder);

        $this->messageParamsProvider->expects($this->exactly(3))
            ->method('getMessageParams')
            ->willReturnMap(
                [
                    [$fooReminder, $fooMessage],
                    [$barReminder, $barMessage],
                    [$bazReminder, $bazMessage]
                ]
            );

        $this->connectionChecker
            ->expects($this->exactly(2))
            ->method('checkConnection')
            ->willReturn(true);

        $this->websocketClient
            ->expects($this->at(0))
            ->method('publish')
            ->with("oro/reminder_remind/{$fooUserId}", [$fooMessage]);

        $this->websocketClient
            ->expects($this->at(1))
            ->method('publish')
            ->with("oro/reminder_remind/{$barUserId}", [$barMessage, $bazMessage]);

        $fooReminder->expects($this->once())
            ->method('setState')
            ->with(Reminder::STATE_REQUESTED);

        $barReminder->expects($this->once())
            ->method('setState')
            ->with(Reminder::STATE_REQUESTED);

        $bazReminder->expects($this->once())
            ->method('setState')
            ->with(Reminder::STATE_REQUESTED);

        $this->processor->process();
    }

    public function testProcessFail()
    {
        $fooUserId = 100;
        $fooUser = $this->createUser($fooUserId);

        $fooReminder = $this->createReminder($fooUser);
        $fooMessage = ['data' => 'foo'];
        $barReminder = $this->createReminder($fooUser);
        $barMessage = ['data' => 'bar'];

        $this->processor->push($fooReminder);
        $this->processor->push($barReminder);

        $this->messageParamsProvider->expects($this->exactly(2))
            ->method('getMessageParams')
            ->will(
                $this->returnValueMap(
                    [
                        [$fooReminder, $fooMessage],
                        [$barReminder, $barMessage]
                    ]
                )
            );

        $exception = new \Exception();

        $this->connectionChecker
            ->expects($this->once())
            ->method('checkConnection')
            ->willReturn(true);

        $this->websocketClient
            ->expects($this->once())
            ->method('publish')
            ->with("oro/reminder_remind/{$fooUserId}", [$fooMessage, $barMessage])
            ->will($this->throwException($exception));

        $fooReminder->expects($this->once())
            ->method('setState')
            ->with(Reminder::STATE_FAIL);

        $fooReminder->expects($this->once())
            ->method('setFailureException')
            ->with($exception);

        $barReminder->expects($this->once())
            ->method('setState')
            ->with(Reminder::STATE_FAIL);

        $barReminder->expects($this->once())
            ->method('setFailureException')
            ->with($exception);

        $this->processor->process();
    }

    public function testProcessNoConnection()
    {
        $fooUserId = 100;
        $fooUser = $this->createUser($fooUserId);

        $fooReminder = $this->createReminder($fooUser);
        $fooMessage = ['data' => 'foo'];

        $this->processor->push($fooReminder);

        $this->messageParamsProvider->expects($this->once())
            ->method('getMessageParams')
            ->with($fooReminder)
            ->willReturn($fooMessage);

        $this->connectionChecker
            ->expects($this->once())
            ->method('checkConnection')
            ->willReturn(false);

        $this->websocketClient
            ->expects($this->never())
            ->method($this->anything());

        $fooReminder->expects($this->once())
            ->method('setState')
            ->with(Reminder::STATE_REQUESTED);

        $this->processor->process();
    }

    public function testGetLabel()
    {
        $this->assertEquals(
            'oro.reminder.processor.web_socket.label',
            $this->processor->getLabel()
        );
    }

    /**
     * @param $recipient
     * @return Reminder|\PHPUnit\Framework\MockObject\MockObject
     */
    protected function createReminder(User $recipient)
    {
        $result = $this->createMock(Reminder::class);
        $result->expects($this->atLeastOnce())
            ->method('getRecipient')
            ->willReturn($recipient);
        return $result;
    }

    /**
     * @param int $userId
     * @return User|\PHPUnit\Framework\MockObject\MockObject
     */
    protected function createUser($userId)
    {
        $result = $this->createMock(User::class);
        $result->expects($this->atLeastOnce())->method('getId')->willReturn($userId);
        return $result;
    }
}


text:
var args = require('optimist').argv;
var byline = require('byline');
var config = require(args.config || '../config.js');
var CRLF = "\r\n";
const okayMessage = JSON.stringify({"method": "okay"}) + CRLF;
var getMiddleware = require('./MethodMiddleware');

function Session(server, socket) {

    var self = this;

    this._socket = socket;

    this._userLocked = false;
    this._authed = false;

    this._server = server;
    this._rooms = [];
    this._usernames = [];

    this.id = null;
    this.currentRoom = null;

    this.methods = getMiddleware(this);
    byline(socket).on('data', this.parseMessage.bind(this));

    socket.on('close', function() {
        // let's remove the userId from the online list
        delete self._server._userList[self.id];
        delete self._server._partyList[self.id];
        self._server.savePartyList();
        if ( self.currentRoom ) {
            self.currentRoom.emit('user_disconnected', { userId:self.id });
        }

        self._rooms.forEach(function(room) {
            room.removeSession(self);
        });
    });
};

Session.prototype.makeMessage = function(method, data) {
    return JSON.stringify({method: method, data: data}) + CRLF;
}

Session.prototype.makeError = function(data) {
    return JSON.stringify({method: "error", data: {message: data}}) + CRLF;
};

module.exports = Session;

Session.prototype.send = function(message) {
    if (!this._socket.destroyed)
        this._socket.write(message);
};

Session.prototype.clientError = function(message) {
    log.error('Client error ('+this._socket.remoteAddress + ', ' + (this.id || 'Unnamed') + '): ' + message);
    this.send(this.makeError(message));
};

Session.prototype.clientOkay = function() {
    this.send(okayMessage);
    log.info("S->C:", okayMessage);
}

Session.validMethods = [
    'logon',
    'subscribe',
    'unsubscribe',
    'enter_room',
    'move',
    'chat',
    'portal',
    'users_online',
    'get_partylist',
];

Session.prototype.parseMessage = function(data) {

    //log.info('C->S: ' + data);

    var payload;

    try {
        payload = JSON.parse(data);
    }
    catch(e) {
        log.info("data: " + data);
        log.info("payload: " + payload);
        return this.clientError('Unable to parse last message');
    }

    if(Session.validMethods.indexOf(payload.method) === -1)
        return this.clientError('Invalid method: ' + payload.method);

    if(payload.method !== 'logon' && !this._authed )
        return this.clientError('You must call "logon" before sending any other commands.');

    if(payload.data === undefined) payload.data = {};
    if(typeof(payload.data)!= "object") payload.data = { "data": payload.data };
    payload.data._userId = this.id;
    payload.data._userList = this._server._userList;
    payload.data._roomEmit = (method, data) => { this.currentRoom.emit(method, data) };
    this.methods[payload.method](payload.data);
};

Session.prototype.get_partylist = function(data) {
    this.send(this.makeMessage('get_partylist', this._server._partyList));
}

redpajama_set_name: RedPajamaGithub


text:
{-# LANGUAGE PolyKinds #-}
module Tagged where

newtype Tagged s b = Tagged b deriving Eq


text:
module Reminders
  class UrlBuilder
    def initialize(access_token)
      @access_token = access_token
    end

    def account_url
      url('accounts', nil)
    end

    def event_url(id=nil)
      url('events', id)
    end

    def event_list_url(id=nil)
      url('event_lists', id)
    end

    def subscriber_url(id=nil)
      url('subscribers', id)
    end

    def subscription_url(id=nil)
      url('subscriptions', id)
    end

    private

    attr_accessor :access_token

    def url(resource_type, id)
      url = endpoint
      url += resource_type
      url += resource(id)
      url += access_token_param
      url
    end

    def endpoint
      'http://localhost:3000/api/v1/'
    end

    def resource(id)
      if id
        "/#{id}"
      else
        ''
      end
    end

    def access_token_param
      "?access_token=#{access_token}"
    end
  end
end


text:
require 'puppet/face'

Puppet::Face.define(:ca, '0.1.0') do
  copyright "Puppet Labs", 2011
  license   "Apache 2 license; see COPYING"

  summary "Local Puppet Certificate Authority management."

  description <<-TEXT
    This provides local management of the Puppet Certificate Authority.

    You can use this subcommand to sign outstanding certificate requests, list
    and manage local certificates, and inspect the state of the CA.
  TEXT

  action :list do
    summary "List certificates and/or certificate requests."

    description <<-TEXT
      This will list the current certificates and certificate signing requests
      in the Puppet CA.  You will also get the fingerprint, and any certificate
      verification failure reported.
    TEXT

    option "--[no-]all" do
      summary "Include all certificates and requests."
    end

    option "--[no-]pending" do
      summary "Include pending certificate signing requests."
    end

    option "--[no-]signed" do
      summary "Include signed certificates."
    end

    option "--digest ALGORITHM" do
      summary "The hash algorithm to use when displaying the fingerprint"
    end

    option "--subject PATTERN" do
      summary "Only list if the subject matches PATTERN."

      description <<-TEXT
        Only include certificates or requests where subject matches PATTERN.

        PATTERN is interpreted as a regular expression, allowing complex
        filtering of the content.
      TEXT
    end

    when_invoked do |options|
      raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
      unless ca = Puppet::SSL::CertificateAuthority.instance
        raise "Unable to fetch the CA"
      end
      Puppet::SSL::Host.ca_location = :only

      pattern = options[:subject].nil? ? nil :
        Regexp.new(options[:subject], Regexp::IGNORECASE)

      pending = options[:pending].nil? ? options[:all] : options[:pending]
      signed  = options[:signed].nil?  ? options[:all] : options[:signed]

      # By default we list pending, so if nothing at all was requested...
      unless pending or signed then pending = true end

      hosts = []

      pending and hosts += ca.waiting?
      signed  and hosts += ca.list

      pattern and hosts = hosts.select {|hostname| pattern.match hostname }

      hosts.sort.map {|host| Puppet::SSL::Host.new(host) }
    end

    when_rendering :console do |hosts, options|
      unless ca = Puppet::SSL::CertificateAuthority.instance
        raise "Unable to fetch the CA"
      end

      length = hosts.map{|x| x.name.length }.max.to_i + 1

      hosts.map do |host|
        name = host.name.ljust(length)
        if host.certificate_request then
          "  #{name} #{host.certificate_request.digest(options[:digest])}"
        else
          begin
            ca.verify(host.name)
            "+ #{name} #{host.certificate.digest(options[:digest])}"
          rescue Puppet::SSL::CertificateAuthority::CertificateVerificationError => e
            "- #{name} #{host.certificate.digest(options[:digest])} (#{e.to_s})"
          end
        end
      end.join("\n")
    end
  end

  action :destroy do
    when_invoked do |host, options|
      raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
      unless ca = Puppet::SSL::CertificateAuthority.instance
        raise "Unable to fetch the CA"
      end
      Puppet::SSL::Host.ca_location = :local

      ca.destroy host
    end
  end

  action :revoke do
    when_invoked do |host, options|
      raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
      unless ca = Puppet::SSL::CertificateAuthority.instance
        raise "Unable to fetch the CA"
      end
      Puppet::SSL::Host.ca_location = :only

      begin
        ca.revoke host
      rescue ArgumentError => e
        # This is a bit naff, but it makes the behaviour consistent with the
        # destroy action.  The underlying tools could be nicer for that sort
        # of thing; they have fairly inconsistent reporting of failures.
        raise unless e.to_s =~ /Could not find a serial number for /
        "Nothing was revoked"
      end
    end
  end

  action :generate do
    option "--dns-alt-names NAMES" do
      summary "Additional DNS names to add to the certificate request"
      description Puppet.settings.setting(:dns_alt_names).desc
    end

    when_invoked do |host, options|
      raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
      unless ca = Puppet::SSL::CertificateAuthority.instance
        raise "Unable to fetch the CA"
      end
      Puppet::SSL::Host.ca_location = :local

      begin
        ca.generate(host, :dns_alt_names => options[:dns_alt_names])
      rescue RuntimeError => e
        if e.to_s =~ /already has a requested certificate/
          "#{host} already has a certificate request; use sign instead"
        else
          raise
        end
      rescue ArgumentError => e
        if e.to_s =~ /A Certificate already exists for /
          "#{host} already has a certificate"
        else
          raise
        end
      end
    end
  end

  action :sign do
    option("--[no-]allow-dns-alt-names") do
      summary "Whether or not to accept DNS alt names in the certificate request"
    end

    when_invoked do |host, options|
      raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
      unless ca = Puppet::SSL::CertificateAuthority.instance
        raise "Unable to fetch the CA"
      end
      Puppet::SSL::Host.ca_location = :only

      begin
        ca.sign(host, options[:allow_dns_alt_names])
      rescue ArgumentError => e
        if e.to_s =~ /Could not find certificate request/
          e.to_s
        else
          raise
        end
      end
    end
  end

  action :print do
    when_invoked do |host, options|
      raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
      unless ca = Puppet::SSL::CertificateAuthority.instance
        raise "Unable to fetch the CA"
      end
      Puppet::SSL::Host.ca_location = :only

      ca.print host
    end
  end

  action :fingerprint do
    option "--digest ALGORITHM" do
      summary "The hash algorithm to use when displaying the fingerprint"
    end

    when_invoked do |host, options|
      raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
      unless Puppet::SSL::CertificateAuthority.instance
        raise "Unable to fetch the CA"
      end
      Puppet::SSL::Host.ca_location = :only

      if cert = (Puppet::SSL::Certificate.indirection.find(host) || Puppet::SSL::CertificateRequest.indirection.find(host))
        cert.digest(options[:digest]).to_s
      else
        nil
      end
    end
  end

  action :verify do
    when_invoked do |host, options|
      raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
      unless ca = Puppet::SSL::CertificateAuthority.instance
        raise "Unable to fetch the CA"
      end
      Puppet::SSL::Host.ca_location = :only

      begin
        ca.verify host
        { :host => host, :valid => true }
      rescue ArgumentError => e
        raise unless e.to_s =~ /Could not find a certificate for/
        { :host => host, :valid => false, :error => e.to_s }
      rescue Puppet::SSL::CertificateAuthority::CertificateVerificationError => e
        { :host => host, :valid => false, :error => e.to_s }
      end
    end

    when_rendering :console do |value|
      if value[:valid]
        nil
      else
        "Could not verify #{value[:host]}: #{value[:error]}"
      end
    end
  end
end


text:
package com.eqot.xray;

import android.content.Context;
import android.support.test.InstrumentationRegistry;

import com.eqot.xray.xray.SampleAndroid$Xray;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static junit.framework.Assert.assertEquals;

@Xray(SampleAndroid.class)
public class SampleAndroidTest {
    private Context mContext;

    @Before
    public void setUp() throws Exception {
        mContext = InstrumentationRegistry.getTargetContext();
    }

    @After
    public void tearDown() throws Exception {
        mContext = null;
    }

    @Test
    public void nop() throws Exception {
        final SampleAndroid$Xray sample = new SampleAndroid$Xray(mContext);
        assertEquals("123", sample.nop("123"));
    }

    @Test
    public void nopWithContext() throws Exception {
        final SampleAndroid$Xray sample = new SampleAndroid$Xray(mContext);
        assertEquals("123", sample.nop(mContext, "123"));
    }
}


text:
package flags

import (
	"fmt"
	"testing"
)

func TestShort(t *testing.T) {
	var opts = struct {
		Value bool `short:"v"`
	}{}

	ret := assertParseSuccess(t, &opts, "-v")

	assertStringArray(t, ret, []string{})

	if !opts.Value {
		t.Errorf("Expected Value to be true")
	}
}

func TestShortTooLong(t *testing.T) {
	var opts = struct {
		Value bool `short:"vv"`
	}{}

	assertParseFail(t, ErrShortNameTooLong, "short names can only be 1 character long, not `vv'", &opts)
}

func TestShortRequired(t *testing.T) {
	var opts = struct {
		Value bool `short:"v" required:"true"`
	}{}

	assertParseFail(t, ErrRequired, fmt.Sprintf("the required flag `%cv' was not specified", defaultShortOptDelimiter), &opts)
}

func TestShortMultiConcat(t *testing.T) {
	var opts = struct {
		V bool `short:"v"`
		O bool `short:"o"`
		F bool `short:"f"`
	}{}

	ret := assertParseSuccess(t, &opts, "-vo", "-f")

	assertStringArray(t, ret, []string{})

	if !opts.V {
		t.Errorf("Expected V to be true")
	}

	if !opts.O {
		t.Errorf("Expected O to be true")
	}

	if !opts.F {
		t.Errorf("Expected F to be true")
	}
}

func TestShortMultiRequiredConcat(t *testing.T) {
	var opts = struct {
		V bool `short:"v" required:"true"`
		O bool `short:"o" required:"true"`
		F bool `short:"f" required:"true"`
	}{}

	ret := assertParseSuccess(t, &opts, "-vo", "-f")

	assertStringArray(t, ret, []string{})

	if !opts.V {
		t.Errorf("Expected V to be true")
	}

	if !opts.O {
		t.Errorf("Expected O to be true")
	}

	if !opts.F {
		t.Errorf("Expected F to be true")
	}
}

func TestShortMultiSlice(t *testing.T) {
	var opts = struct {
		Values []bool `short:"v"`
	}{}

	ret := assertParseSuccess(t, &opts, "-v", "-v")

	assertStringArray(t, ret, []string{})
	assertBoolArray(t, opts.Values, []bool{true, true})
}

func TestShortMultiSliceConcat(t *testing.T) {
	var opts = struct {
		Values []bool `short:"v"`
	}{}

	ret := assertParseSuccess(t, &opts, "-vvv")

	assertStringArray(t, ret, []string{})
	assertBoolArray(t, opts.Values, []bool{true, true, true})
}

func TestShortWithEqualArg(t *testing.T) {
	var opts = struct {
		Value string `short:"v"`
	}{}

	ret := assertParseSuccess(t, &opts, "-v=value")

	assertStringArray(t, ret, []string{})
	assertString(t, opts.Value, "value")
}

func TestShortWithArg(t *testing.T) {
	var opts = struct {
		Value string `short:"v"`
	}{}

	ret := assertParseSuccess(t, &opts, "-vvalue")

	assertStringArray(t, ret, []string{})
	assertString(t, opts.Value, "value")
}

func TestShortArg(t *testing.T) {
	var opts = struct {
		Value string `short:"v"`
	}{}

	ret := assertParseSuccess(t, &opts, "-v", "value")

	assertStringArray(t, ret, []string{})
	assertString(t, opts.Value, "value")
}

func TestShortMultiWithEqualArg(t *testing.T) {
	var opts = struct {
		F     []bool `short:"f"`
		Value string `short:"v"`
	}{}

	assertParseFail(t, ErrExpectedArgument, fmt.Sprintf("expected argument for flag `%cv'", defaultShortOptDelimiter), &opts, "-ffv=value")
}

func TestShortMultiArg(t *testing.T) {
	var opts = struct {
		F     []bool `short:"f"`
		Value string `short:"v"`
	}{}

	ret := assertParseSuccess(t, &opts, "-ffv", "value")

	assertStringArray(t, ret, []string{})
	assertBoolArray(t, opts.F, []bool{true, true})
	assertString(t, opts.Value, "value")
}

func TestShortMultiArgConcatFail(t *testing.T) {
	var opts = struct {
		F     []bool `short:"f"`
		Value string `short:"v"`
	}{}

	assertParseFail(t, ErrExpectedArgument, fmt.Sprintf("expected argument for flag `%cv'", defaultShortOptDelimiter), &opts, "-ffvvalue")
}

func TestShortMultiArgConcat(t *testing.T) {
	var opts = struct {
		F     []bool `short:"f"`
		Value string `short:"v"`
	}{}

	ret := assertParseSuccess(t, &opts, "-vff")

	assertStringArray(t, ret, []string{})
	assertString(t, opts.Value, "ff")
}

func TestShortOptional(t *testing.T) {
	var opts = struct {
		F     []bool `short:"f"`
		Value string `short:"v" optional:"yes" optional-value:"value"`
	}{}

	ret := assertParseSuccess(t, &opts, "-fv", "f")

	assertStringArray(t, ret, []string{"f"})
	assertString(t, opts.Value, "value")
}


text:
        <title>Properties</title>

                    Name
                    Default with <literal>idea</literal> plugin
                    Default with <literal>idea</literal> and <literal>java</literal> plugin

                name
                <literal><replaceable>${project.name}</replaceable> (sometimes prefixed with parts of <replaceable>${project.path}</replaceable> to guarantee uniqeness)</literal>

                sourceDirs
                <literal>[]</literal>
                source dirs from <literal>project.sourceSets.main.allSource</literal>

                scopes
                <literal>[:]</literal>

                    <itemizedlist>
                        <listitem><literal>COMPILE</literal> -> <literal>project.configurations.compile</literal></listitem>
                        <listitem><literal>RUNTIME</literal> -> <literal>project.configurations.runtime - project.configurations.compile</literal></listitem>
                        <listitem><literal>TEST</literal> -> <literal>project.configurations.testRuntime - project.configurations.runtime</literal></listitem>
                        <listitem><literal>PROVIDED</literal></listitem>
                    </itemizedlist>

                generatedSourceDirs
                <literal>[]</literal>

                downloadSources
                <literal>true</literal>

                downloadJavadoc
                <literal>false</literal>

                contentRoot
                <literal>project.projectDir</literal>

                testSourceDirs
                <literal>[]</literal>
                source dirs from <literal>project.sourceSets.test.allSource</literal>

                excludeDirs
                <literal>[project.buildDir, project.file('.gradle')]</literal>

                inheritOutputDirs
                <literal>null</literal>
                <literal>null</literal>

                outputDir
                <literal>null</literal>
                <literal>null</literal>

                testOutputDir
                <literal>null</literal>
                <literal>null</literal>

                jdkName
                <literal>'inherited'</literal>

                languageLevel

                <literal>project.sourceCompatibility</literal>

                targetBytecodeVersion

                <literal>project.targetCompatibility</literal>

                iml

                outputFile
                #name + <literal>'.iml'</literal>

        <title>Methods</title>

                    Name

                iml


text:
- This dashboard is based on built-in prometheus metrics.

|Velero Prometheus|
|:------------------|
|Filename: [velero-prometheus.json](velero-prometheus.json)|
|This dashboard has charts displaying: `Backup Success`, `Backup Failure`, `Snapshot Success`, `Snapshot Failure`, `Restore Success`, `Restore Failure`, `CSI Snapshot Success`, and `CSI Snapshot Failure`|


text:
import React from 'react';
import {
  Header,
  CityList,
  AddCity,
  CityinfoWindow
} from '../containers';

//import React, { Component } from 'react';
//import logo from './logo.svg';
//import { Navbar, Jumbotron, Button } from 'react-bootstrap';
//import './App.css';

const App = () =>
  <div>
    <Header />
    <CityList />
    <AddCity />
    <CityinfoWindow />
  </div>

export default App;


text:
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace Keen.Query
{
    /// <summary>
    /// A pair of dates representing a time interval.
    /// </summary>
    public sealed class QueryAbsoluteTimeframe : IQueryTimeframe
    {
        [JsonProperty(PropertyName = "start")]
        public DateTime Start { get; private set; }

        [JsonProperty(PropertyName = "end")]
        public DateTime End { get; private set; }

        public override string ToString()
        {
            return JObject.FromObject(this).ToString(Formatting.None);
        }

        public override bool Equals(object obj)
        {
            var timeframe = obj as QueryAbsoluteTimeframe;
            return timeframe != null &&
                   Start == timeframe.Start &&
                   End == timeframe.End;
        }

        public override int GetHashCode()
        {
            var hashCode = -1676728671;
            hashCode = hashCode * -1521134295 + Start.GetHashCode();
            hashCode = hashCode * -1521134295 + End.GetHashCode();
            return hashCode;
        }

        public QueryAbsoluteTimeframe(DateTime start, DateTime end)
        {
            if (start >= end)
                throw new ArgumentException("Start date must be before stop date.");

            Start = start;
            End = end;
        }
    }
}


text:
var async = require('async')
var dom = require('./dom')
var fvd = require('fvd')
var util = require('./util')
var Watcher = require('./watcher')

var COMMA_SPLIT_RE = /\s*,\s*/
var COLON_SPLIT_RE = /\s*:\s*/

exports.load = load
exports.parse = parse
exports.stringify = stringify

function load(fonts, callback) {
    callback = util.fn(callback)
    var arr
    try {
        if (!util.isArray(fonts)) throw new Error('load requires a fonts array')
        arr = util.map(fonts, function(font){
            return async.apply(loadFont, font)
        })
    } catch (ex) {
        return util.catcher(ex, callback)
    }
    async.parallel(arr, callback)
}

function loadFont(font, callback) {
    callback = util.fn(callback)
    var arr
    try {
        arr = [
            async.apply(loadStyleSheet, font.css),
            async.apply(watchFamilies, font.families)
        ]
    }
    catch (ex) {
        return util.catcher(ex, callback)
    }
    async.series(arr, callback)
}

function loadStyleSheet(src, callback) {
    callback = util.fn(callback)
    var link = dom.createElement('link', { rel: 'stylesheet', href: src })
    var hasCalled = false
    link.onload = function () {
        if (hasCalled) return
        hasCalled = true
        callback(null)
    }
    link.onerror = function () {
        if (hasCalled) return
        hasCalled = true
        callback(new Error('failed to load CSS: ' + src))
    }
    dom.insert(link, 'head')
}

function watchFamilies(families, callback) {
    callback = util.fn(callback)
    var arr
    try {
        arr = util.map(families, function(family){
            return async.apply(watchFont, parse(family))
        })
    }
    catch (ex) {
        return util.catcher(ex, callback)
    }
    async.parallel(arr, callback)
}

function watchFont(font, callback) {
    callback = util.fn(callback)
    var arr
    try {
        arr = util.map(font.variations, function(variation){
            var watcher = Watcher.create(font.family, variation)
            return watcher.watch.bind(watcher)
        })
    }
    catch (ex) {
        return util.catcher(ex, callback)
    }
    async.parallel(arr, callback)
}

function parse(family) {
    if (typeof family !== 'string' || family.length < 1) return null

    var obj = { family: null, variations: [] }
    var pair = family.split(COLON_SPLIT_RE)
        .filter(function(n){ return typeof n === 'string' && n.trim().length > 0 })
    var variations

    pair.forEach(function(n, i){ return pair[i] = n.trim() })

    obj.family = pair[0]

    if (pair.length < 2) {
        obj.variations.push(fvd.compact())
        return obj
    }

    variations = pair[1].split(COMMA_SPLIT_RE)
        .filter(function(n){ return typeof n === 'string' && n.trim().length > 0 && fvd.expand(n.trim()) })

    variations.forEach(function(n, i){ return variations[i] = n.trim() })

    obj.variations = variations

    return obj
}

function stringify(family) {
    if (typeof family !== 'string' || family.length < 1) return null

    var parsed = parse(family)
    var res = []
    var familyTokens

    if (!parsed) return null

    familyTokens = parsed.family.toLowerCase().split(' ')

    parsed.variations.forEach(function(v){
        res.push(familyTokens.concat(v).join('-'))
    })

    return res
}


text:
require "spec_helper"

module TextRazor
  describe Configuration do
    describe "#secure" do
      it "default value is true" do
        Configuration.new.secure = true
      end
    end

    describe "#secure=" do
      it "can set value" do
        config = Configuration.new
        config.secure = false
        expect(config.secure).to eq(false)
      end
    end
  end

  describe "#use_europe_endpoint" do
    it "default value is false" do
      Configuration.new.use_europe_endpoint = false
    end
  end

  describe "#use_europe_endpoint=" do
    it "can set value" do
      config = Configuration.new
      config.use_europe_endpoint = true
      expect(config.use_europe_endpoint).to eq(true)
    end
  end

  describe "#url" do
    it "right default value" do
      config = Configuration.new
      expect(config.url).to eq("https://api.textrazor.com")
    end

    it "right value when not secure" do
      config = Configuration.new
      config.secure = false
      expect(config.url).to eq("http://api.textrazor.com")
    end

    it "right value when Europe endpoint is forced" do
      config = Configuration.new
      config.use_europe_endpoint = true
      expect(config.url).to eq("https://api-eu.textrazor.com")
    end
  end
end


text:
package com.ihateflyingbugs.kidsm.uploadphoto;

import android.app.Activity;

public class GetPhotoFromLocalActivity extends Activity{

}


text:
import * as THREE from "three";
import OBJLoader from "three/examples/js/loaders/OBJLoader.js";
import MTLLoader from "three/examples/js/loaders/MTLLoader.js";

// The two loaders for material and object files, respectively.
const mtlLoader = new THREE.MTLLoader();
const textureLoader = new THREE.TextureLoader();

THREE.TextureLoader.prototype.crossOrigin = '';

const loadedMaterialAndObject = {};

export function loadObject(materialFile, objectFile, scale, callback) {
    function placeMtlAndObj(loaded) {
        if (callback) {
            const object = loaded.clone();
            callback(object);
        }
    }

    if (loadedMaterialAndObject[objectFile]) {
        placeMtlAndObj(loadedMaterialAndObject[objectFile]);
    } else {
        new Promise((resolve, reject) => {
            if (materialFile) {
                mtlLoader.load(materialFile, materials => {
                    materials.preload();
                    resolve(materials);
                });
            } else {
                resolve(null);
            }
        }).then((materials) => {
            const objLoader = new THREE.OBJLoader();
            if (materials) {
                objLoader.setMaterials(materials);
            }

            objLoader.load(objectFile, loaded => {
                loaded.name = objectFile;
                loaded.scale.set(scale.x, scale.y, scale.z);
                loadedMaterialAndObject[objectFile] = loaded;
                placeMtlAndObj(loaded);
            });
        }).catch(() => {
            console.error("Failed to load object.");
        });
    }
}

export function loadTexture(textureFile, onLoadCallback, onErrorCallback) {
    textureLoader.load(textureFile, onLoadCallback, undefined, onErrorCallback);
}


text:
/**
 @file
 @author  Nicholas Gillian <ngillian@media.mit.edu>
 @version 1.0

 @brief The TrainingDataRecordingTimer is a tool to help record your training data.
 */

/*
 GRT MIT License
 Copyright (c) <2012> <Nicholas Gillian, Media Lab, MIT>

 Permission is hereby granted, free of charge, to any person obtaining a copy of this software
 and associated documentation files (the "Software"), to deal in the Software without restriction,
 including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
 and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
 subject to the following conditions:

 The above copyright notice and this permission notice shall be included in all copies or substantial
 portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

#ifndef GRT_TRAINING_DATA_RECORDING_TIMER_HEADER
#define GRT_TRAINING_DATA_RECORDING_TIMER_HEADER

#include "GRTCommon.h"

namespace GRT{

class TrainingDataRecordingTimer{
public:

	/**
     Default Constructor.
    */
	TrainingDataRecordingTimer();

    /**
     Copy Constructor, copies the TrainingDataRecordingTimer from the rhs instance to this instance

	 @param const TrainingDataRecordingTimer &rhs: another instance of the TrainingDataRecordingTimer class from which the data will be copied to this instance
	*/
	TrainingDataRecordingTimer(const TrainingDataRecordingTimer &rhs);

	/**
     Default Destructor
    */
	~TrainingDataRecordingTimer();

	/**
     Sets the equals operator, copies the data from the rhs instance to this instance

	 @param const TrainingDataRecordingTimer &rhs: another instance of the TrainingDataRecordingTimer class from which the data will be copied to this instance
	 @return a reference to this instance of the TrainingDataRecordingTimer
	*/
	TrainingDataRecordingTimer& operator= (const TrainingDataRecordingTimer &rhs);

    bool startRecording(double prepTime,double recordTime);

    bool stopRecording();

    bool update();

    bool getInPrepMode();

    bool getInRecordingMode();

    bool getRecordingStopped();

    double getSeconds();

protected:
    UINT recordingMode;
    double prepTime;
    double recordTime;
    Timer trainingTimer;

public:
    enum RecordingModes{NOT_RECORDING=0,PREP_COUNTDOWN,RECORDING};

};

} //End of namespace GRT

#endif //GRT_TRAINING_DATA_RECORDING_TIMER_HEADER


text:
// Copyright 2020 Google LLC
//
// 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
//
//     https://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.

namespace Google.Cloud.EntityFrameworkCore.Spanner.IntegrationTests
{
    public class OrderDetail
    {
        public long ProductId { get; set; }
        public long OrderId { get; set; }
        public float UnitPrice { get; set; }
        public int Quantity { get; set; }
        public float Discount { get; set; }
        public Product Product { get; set; }
        public Order Order { get; set; }
    }
}


text:
@echo off

C:\Miniconda-x64\Scripts\conda.exe create -y -n fomod-designer^
 -c m-labs^
 pyqt5=5.5.1 python=3.5.1 lxml=3.5.0
call C:\Miniconda-x64\Scripts\activate.bat fomod-designer

pip install pip -U
pip install setuptools -U --ignore-installed
pip install -r dev\reqs.txt
pip install -r dev\test-reqs.txt

C:\Miniconda\Scripts\conda.exe create -y -n fomod-designer^
 -c m-labs^
 pyqt5=5.5.1 python=3.5.1 lxml=3.5.0
call C:\Miniconda\Scripts\activate.bat fomod-designer

pip install pip -U
pip install setuptools -U --ignore-installed
pip install -r dev\reqs.txt
pip install -r dev\test-reqs.txt


text:
package org.baswell.routes;

import org.junit.Test;

import static org.baswell.routes.RouteByCamelCaseConvention.*;
import static org.junit.Assert.*;

public class CameCaseRouteByConventionTest
{
  @Test
  public void testCamelCase()
  {
    assertEquals(camelCaseToPath("Test"), "test");
    assertEquals(camelCaseToPath("HelloWorld"), "hello/world");
    assertEquals(camelCaseToPath("ThisIsATest"), "this/is/a/test");
    assertEquals(camelCaseToPath(null), "");
    assertEquals(camelCaseToPath(""), "");
  }
}


text:
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Http } from '@angular/http';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot , Router} from '@angular/router';
import 'rxjs/add/operator/map';

import { Store } from '@ngrx/store';
import { LoginResponseModel } from './login-model';
import { StoreModel } from './StoreModel';
import { canActivate, validateUserSuccess, canActivateSuccess} from './actions';
import { UserService } from './user.service';

@Injectable()
export class canActivateGuard implements CanActivate {

    constructor( public store: Store<StoreModel>,
        public userService: UserService,
        public routerMain: Router
    ) {

    }

    canActivate(route: ActivatedRouteSnapshot, router: RouterStateSnapshot): Observable<boolean> {

        // this.store.dispatch(canActivate());

        return this.userService.canActivate()
            .map(data => {

                if (!data.data.isValidUser) {
                    this.routerMain.navigate(['spa', 'login']);
                }

                return data.data.isValidUser;
            });

        //return Observable.of(true);

    }

}


text:
package org.apache.carbondata.spark.vectorreader;

import org.apache.carbondata.core.scan.result.vector.CarbonColumnVector;

import org.apache.spark.sql.execution.vectorized.ColumnVector;
import org.apache.spark.sql.types.Decimal;

class ColumnarVectorWrapper implements CarbonColumnVector {

  private ColumnVector columnVector;

  public ColumnarVectorWrapper(ColumnVector columnVector) {
    this.columnVector = columnVector;
  }

  @Override public void putShort(int rowId, short value) {
    columnVector.putShort(rowId, value);
  }

  @Override public void putShorts(int rowId, int count, short value) {
    columnVector.putShorts(rowId, count, value);
  }

  @Override public void putInt(int rowId, int value) {
    columnVector.putInt(rowId, value);
  }

  @Override public void putInts(int rowId, int count, int value) {
    columnVector.putInts(rowId, count, value);
  }

  @Override public void putLong(int rowId, long value) {
    columnVector.putLong(rowId, value);
  }

  @Override public void putLongs(int rowId, int count, long value) {
    columnVector.putLongs(rowId, count, value);
  }

  @Override public void putDecimal(int rowId, Decimal value, int precision) {
    columnVector.putDecimal(rowId, value, precision);
  }

  @Override public void putDecimals(int rowId, int count, Decimal value, int precision) {
    for (int i = 0; i < count; i++) {
      rowId += i;
      putDecimal(rowId, value, precision);
    }
  }

  @Override public void putDouble(int rowId, double value) {
    columnVector.putDouble(rowId, value);
  }

  @Override public void putDoubles(int rowId, int count, double value) {
    columnVector.putDoubles(rowId, count, value);
  }

  @Override public void putBytes(int rowId, byte[] value) {
    columnVector.putByteArray(rowId, value);
  }

  @Override public void putBytes(int rowId, int count, byte[] value) {
    for (int i = 0; i < count; i++) {
      rowId += i;
      putBytes(rowId, value);
    }
  }

  @Override public void putBytes(int rowId, int offset, int length, byte[] value) {
    columnVector.putByteArray(rowId, value, offset, length);
  }

  @Override public void putNull(int rowId) {
    columnVector.putNull(rowId);
  }

  @Override public void putNulls(int rowId, int count) {
    columnVector.putNulls(rowId, count);
  }

  @Override public boolean isNull(int rowId) {
    return columnVector.isNullAt(rowId);
  }

  @Override public void putObject(int rowId, Object obj) {
    //TODO handle complex types
  }

  @Override public Object getData(int rowId) {
    //TODO handle complex types
    return null;
  }

  @Override public void reset() {
//    columnVector.reset();
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">Camera Capture</string>

</resources>


text:
require 'spec_helper'

describe Aliyun do
  before do
    options = load_options
    options[:service] = :cms
    options[:endpoint_url] = 'http://metrics.cn-beijing.aliyuncs.com/'
    @service = Aliyun::Service.new options
  end

  it 'can create aliyun CMS(metrics) service' do
    expect(@service).to be_instance_of(Aliyun::Service)
    expect(@service.service).to be(Aliyun::CMSConfig)
  end

  it 'can describe metric datum' do
    instanceId = load_ecs_instance_id
    instanceRegion = load_ecs_instance_region
    parameters = {
      Project: 'acs_ecs_dashboard',
      Metric: 'diskusage_utilization',
      StartTime: (Time.now - 180).utc.iso8601,
      Dimensions: "{instanceId:'%s',device:'/dev/xvda1'}" % instanceId,
      RegionId: instanceRegion,
      Length: 1000
    }
    metric_datum = @service.QueryMetricList parameters

    expect(metric_datum).to have_key("Datapoints")
    expect(metric_datum["Datapoints"][0]).to have_key("diskname")
  end
end


text:
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.Optimization
Imports System.Web.UI

Public Module BundleConfig
    ' For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkID=303951
    Public Sub RegisterBundles(bundles As BundleCollection)
        bundles.Add(New ScriptBundle("~/bundles/WebFormsJs").Include(
            "~/Scripts/WebForms/WebForms.js",
            "~/Scripts/WebForms/WebUIValidation.js",
            "~/Scripts/WebForms/MenuStandards.js",
            "~/Scripts/WebForms/Focus.js", "~/Scripts/WebForms/GridView.js",
            "~/Scripts/WebForms/DetailsView.js",
            "~/Scripts/WebForms/TreeView.js",
            "~/Scripts/WebForms/WebParts.js"))

        ' Order is very important for these files to work, they have explicit dependencies
        bundles.Add(New ScriptBundle("~/bundles/MsAjaxJs").Include(
            "~/Scripts/WebForms/MsAjax/MicrosoftAjax.js",
            "~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js",
            "~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js",
            "~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js"))

        ' Use the Development version of Modernizr to develop with and learn from. Then, when you're
        ' ready for production, use the build tool at http://modernizr.com to pick only the tests you need
        bundles.Add(New ScriptBundle("~/bundles/modernizr").Include(
            "~/Scripts/modernizr-*"))

        ScriptManager.ScriptResourceMapping.AddDefinition("respond", New ScriptResourceDefinition() With {
            .Path = "~/Scripts/respond.min.js",
            .DebugPath = "~/Scripts/respond.js"})

    End Sub
End Module


text:
"use strict";

angular.module('appsDirectives', []);

/** Resize page */
angular.module('appsDirectives').directive('load', function() {
    return {
        link:function(scope, element, attrs) {
            $(document).ready(function() {
                function heightWindowDetect(){
                    element.css('height', $(window).height());
                }
                heightWindowDetect();
                $(window).resize(function() {
                    heightWindowDetect();
                });
            });
        }
    }
});

/** Draggable items */
angular.module('appsDirectives').directive('draggable', function() {
    return {
        restrict: 'A',
        scope: {
            callback: '&callback'
        },
        link: function(scope, element, attrs) {
            $(function(){
                element.sortable({
                    revert: true,
                    update: function(event, ui) {
                        var order = element.children('.store-item').map(function(index, el){
                            var n = parseInt($(el).attr('id'), 10);
                            if (!isNaN(n)) return n;
                        });
                        /** Call callback in controller */
                        scope.callback({order: order.get()});

                    }
                })
                element.disableSelection();
            });
        }
    };
});
/** Google maps */
angular.module('appsDirectives').directive('googleMap', function ($window, $rootScope) {
    return {
        restrict: 'A',
        replace: true,
        scope: {
            center         : '=',
            defaults       : '=',
            bounds         : '=',
            markers        : '=',
            addresses      : '='
        },
        link: function(scope, element, attrs) {

            scope.map = null;

            function initialize() {
                scope.geocoder = new google.maps.Geocoder();
                var mapOptions = {
                    center: new google.maps.LatLng(53.90374, 27.55978),
                    zoom: 10,
                    panControl: true,
                    zoomControl: true,
                    scaleControl: true,
                    mapTypeId: google.maps.MapTypeId.ROADMAP
                };
                scope.map = new google.maps.Map(element[0], mapOptions);
            }
            if (scope.map === null) {
                initialize();
            }

            function addMarker() {
                console.log(scope.addresses);
                if (!scope.addresses || !scope.addresses.length) return;
                for (var i = 0; i < scope.addresses.length; i++) {
                    var address = scope.addresses[i].address,
                        name = scope.addresses[i].name;
                    geocoding(address, name);
                }
            }

            function geocoding(address, name) {
                    scope.geocoder.geocode({
                        'address': address
                    }, function(results, status) {
                        if (status == google.maps.GeocoderStatus.OK) {
                            scope.map.setCenter(results[0].geometry.location);
                            var marker = new google.maps.Marker({
                                map: scope.map,
                                position: results[0].geometry.location
                            });
                            var infowindow = new google.maps.InfoWindow({
                                content: name
                            });
                            google.maps.event.addListener(marker, 'click', function() {
                                infowindow.open(scope.map, marker);
                            });

                        } else {
                            console.info('Geocode was not successful for the following reason: ' + status);
                        }
                    });
            }
            addMarker();
        }
    }
});


text:
package com.querydsl.sql.mssql;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import com.querydsl.sql.SQLServerTemplates;
import com.querydsl.sql.domain.QSurvey;

public class SQLServerQueryTest {

    private static final QSurvey survey = QSurvey.survey;

    @Test
    public void TableHints_Single() {
        SQLServerQuery<?> query = new SQLServerQuery<Void>(null, new SQLServerTemplates());
        query.from(survey).tableHints(SQLServerTableHints.NOWAIT).where(survey.name.isNull());
        assertEquals("from SURVEY SURVEY with (NOWAIT)\nwhere SURVEY.NAME is null", query.toString());
    }

    @Test
    public void TableHints_Multiple() {
        SQLServerQuery<?> query = new SQLServerQuery<Void>(null, new SQLServerTemplates());
        query.from(survey).tableHints(SQLServerTableHints.NOWAIT, SQLServerTableHints.NOLOCK).where(survey.name.isNull());
        assertEquals("from SURVEY SURVEY with (NOWAIT, NOLOCK)\nwhere SURVEY.NAME is null", query.toString());
    }

    @Test
    public void TableHints_Multiple2() {
        QSurvey survey2 = new QSurvey("survey2");
        SQLServerQuery<?> query = new SQLServerQuery<Void>(null, new SQLServerTemplates());
        query.from(survey).tableHints(SQLServerTableHints.NOWAIT)
             .from(survey2).tableHints(SQLServerTableHints.NOLOCK)
             .where(survey.name.isNull());
        assertEquals("from SURVEY SURVEY with (NOWAIT), SURVEY survey2 with (NOLOCK)\nwhere SURVEY.NAME is null", query.toString());
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <parent>
        <groupId>net.ripe.db</groupId>
        <artifactId>whois</artifactId>
        <version>1.71-SNAPSHOT</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>net.ripe.db</groupId>
    <artifactId>whois-nrtm</artifactId>
    <version>1.71-SNAPSHOT</version>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>net.sf.jopt-simple</groupId>
            <artifactId>jopt-simple</artifactId>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>net.ripe.db</groupId>
            <artifactId>whois-commons</artifactId>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <dependency>
            <groupId>c3p0</groupId>
            <artifactId>c3p0</artifactId>
        </dependency>

        <!-- testing -->
        <dependency>
            <groupId>net.ripe.db</groupId>
            <artifactId>whois-commons</artifactId>
            <type>test-jar</type>
        </dependency>
    </dependencies>
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/nrtm.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>**/nrtm.properties</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
                <configuration>
                    <aspectLibraries>
                        <aspectLibrary>
                            <groupId>org.springframework</groupId>
                            <artifactId>spring-aspects</artifactId>
                        </aspectLibrary>
                        <aspectLibrary>
                            <groupId>net.ripe.db</groupId>
                            <artifactId>whois-commons</artifactId>
                        </aspectLibrary>
                    </aspectLibraries>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


text:
class CRA::PersonAtAddress
  attr_accessor :first_name, :last_name, :birth_date, :active, :status_text, :gender, :address, :private_number

  def self.extract_date(text)
    DateTime.strptime(text.to_s, '%d/%m/%Y')
    #rescue Exception => ex
  end

  def self.init_with_hash(hash)
    hash = hash['PersonsAtAddress'] || hash
    person = CRA::PersonAtAddress.new
    person.first_name = hash['MD_FIRST']
    person.last_name = hash['MD_LAST']
    person.birth_date = CRA::PersonAtAddress.extract_date(hash['MD_BIRTH_DATE'])
    person.status_text = hash['APPD_STATUS_DESCRIPTION']
    person.active = person.status_text == 'აქტიური'
    person.gender = hash['MD_GENDER_STR']
    person.address = hash['OA_RP_FULL_ADDRESS']
    person.private_number = hash['PN_PRIVATE_NUMBER']
    person
  end

  def self.list_from_hash(hash)
    persons = []
    hash = hash['PersonsAtAddress']
    if hash.is_a? Array
      hash.each do |row|
        persons << CRA::PersonAtAddress.init_with_hash(row)
      end
    else
      persons << CRA::PersonAtAddress.init_with_hash(hash)
    end
    persons
  end

end


text:
goods.controller('NazarCtrl', ['$scope', function($scope){
	// Ctrl code
	$scope.ctrlTitle = "This is Nazar's controller";
}]);


text:
/**
 * Election test command-line handlers.
 */
package org.onosproject.election.cli;


text:
namespace extensions {

class ScriptContext;

// A set of ScriptContexts owned by worker threads. Thread safe.
class WorkerScriptContextSet : public ScriptContextSetIterable,
                               public content::WorkerThread::Observer {
 public:
  WorkerScriptContextSet();

  ~WorkerScriptContextSet() override;

  // ScriptContextSetIterable:
  void ForEach(
      const std::string& extension_id,
      content::RenderFrame* render_frame,
      const base::RepeatingCallback<void(ScriptContext*)>& callback) override;
  // Inserts |context| into the set. Contexts are stored in TLS.
  void Insert(std::unique_ptr<ScriptContext> context);

  // Removes the ScriptContext associated with |v8_context| which was added for
  // |url| (used for sanity checking).
  void Remove(v8::Local<v8::Context> v8_context, const GURL& url);

 private:
  // WorkerThread::Observer:
  void WillStopCurrentWorkerThread() override;

  // Implement thread safety by storing each ScriptContext in TLS.
  base::ThreadLocalPointer<std::vector<std::unique_ptr<ScriptContext>>>
      contexts_tls_;

  DISALLOW_COPY_AND_ASSIGN(WorkerScriptContextSet);
};

}  // namespace extensions

#endif  // EXTENSIONS_RENDERER_WORKER_SCRIPT_CONTEXT_SET_H_


text:
'''
salting.py module of salt specific interfaces to raet

'''
from __future__ import absolute_import
# pylint: skip-file
# pylint: disable=W0611

# Import Python libs
import os

# Import ioflo libs
from ioflo.aid.odicting import odict

from ioflo.base.consoling import getConsole
console = getConsole()

from raet import raeting, nacling
from raet.keeping import Keep

from salt.key import RaetKey

from salt.utils import kinds

class SaltKeep(Keep):
    '''
    RAET protocol estate on road data persistence for a given estate
    road specific data

    road/
        keep/
            stackname/
                local/
                    estate.ext
                remote/
                    estate.name.ext
                    estate.name.ext
    '''
    LocalFields = ['name', 'uid', 'ha', 'iha', 'natted', 'fqdn', 'dyned', 'sid',
                   'puid', 'aha', 'role', 'sighex','prihex']
    LocalDumpFields = ['name', 'uid', 'ha', 'iha', 'natted', 'fqdn', 'dyned', 'sid',
                       'puid', 'aha', 'role']
    RemoteFields = ['name', 'uid', 'fuid', 'ha', 'iha', 'natted', 'fqdn', 'dyned',
                    'sid', 'main', 'kind', 'joined',
                    'role', 'acceptance', 'verhex', 'pubhex']
    RemoteDumpFields = ['name', 'uid', 'fuid', 'ha', 'iha', 'natted', 'fqdn', 'dyned',
                         'sid', 'main', 'kind', 'joined', 'role']
    Auto = raeting.AutoMode.never.value #auto accept

    def __init__(self, opts, prefix='estate', basedirpath='',  auto=None, **kwa):
        '''
        Setup RoadKeep instance
        '''
        basedirpath = basedirpath or os.path.join(opts['cache_dir'], 'raet')
        super(SaltKeep, self).__init__(prefix=prefix, basedirpath=basedirpath, **kwa)
        self.auto = (auto if auto is not None else
                            (raeting.AutoMode.always.value if opts['open_mode'] else
                                (raeting.AutoMode.once.value if opts['auto_accept'] else
                                 raeting.AutoMode.never.value)))
        self.saltRaetKey = RaetKey(opts)

    def clearAllDir(self):
        '''
        Clear all keep directories
        '''
        super(SaltKeep, self).clearAllDir()
        self.clearRoleDir()

    def clearRoleDir(self):
        '''
        Clear the Role directory
        '''
        self.saltRaetKey.delete_pki_dir()

    def loadLocalRoleData(self):
        '''
        Load and return the role data
        '''
        keydata = self.saltRaetKey.read_local()
        if not keydata:
            keydata = odict([('sign', None), ('priv', None)])
        data = odict([('sighex', keydata['sign']),
                     ('prihex', keydata['priv'])])
        return data

    def clearLocalRoleData(self):
        '''
        Clear the local file
        '''
        self.saltRaetKey.delete_local()

    def clearLocalRoleDir(self):
        '''
        Clear the Local Role directory
        '''
        self.saltRaetKey.delete_pki_dir()

    def loadLocalData(self):
        '''
        Load and Return the data from the local estate
        '''
        data = super(SaltKeep, self).loadLocalData()
        if not data:
            return None
        roleData = self.loadLocalRoleData() # if not present defaults None values
        data.update([('sighex', roleData.get('sighex')),
                     ('prihex', roleData.get('prihex'))])
        return data

    def loadRemoteData(self, name):
        '''
        Load and Return the data from the remote file
        '''
        data = super(SaltKeep, self).loadRemoteData(name)
        if not data:
            return None

        mid = data['role']
        for status in [acceptance.name for acceptance in Acceptance]:
            keydata = self.saltRaetKey.read_remote(mid, status)
            if keydata:
                break

        if not keydata:
            data.update([('acceptance', None),
                         ('verhex', None),
                         ('pubhex', None)])
        else:
            data.update(acceptance=raeting.Acceptance[status].value,
                        verhex=keydata['verify'],
                        pubhex=keydata['pub'])

        return data

    def loadAllRemoteData(self):
        '''
        Load and Return the data from the all the remote estate files
        '''
        keeps = super(SaltKeep, self).loadAllRemoteData()
        for name, data in keeps.items():
            keeps[name].update([('acceptance', None),
                                ('verhex', None),
                                ('pubhex', None)])

        for status, mids in self.saltRaetKey.list_keys().items():
            for mid in mids:
                keydata = self.saltRaetKey.read_remote(mid, status)
                if keydata:
                    for name, data in keeps.items():
                        if data['role'] == mid:
                            keeps[name].update(
                                    [('acceptance', raeting.Acceptance[status].value),
                                     ('verhex', keydata['verify']),
                                     ('pubhex', keydata['pub'])])
        return keeps

    def clearRemoteRoleData(self, role):
        '''
        Clear data from the role data file
        '''
        self.saltRaetKey.delete_key(role) #now delete role key file

    def clearAllRemoteRoleData(self):
        '''
        Remove all the role data files
        '''
        self.saltRaetKey.delete_all()

    def clearRemoteRoleDir(self):
        '''
        Clear the Remote Role directory
        '''
        self.saltRaetKey.delete_pki_dir()

    def dumpLocal(self, local):
        '''
        Dump local estate
        '''
        data = odict([
                        ('name', local.name),
                        ('uid', local.uid),
                        ('ha', local.ha),
                        ('iha', local.iha),
                        ('natted', local.natted),
                        ('fqdn', local.fqdn),
                        ('dyned', local.dyned),
                        ('sid', local.sid),
                        ('puid', local.stack.puid),
                        ('aha', local.stack.aha),
                        ('role', local.role),
                    ])
        if self.verifyLocalData(data, localFields =self.LocalDumpFields):
            self.dumpLocalData(data)

        self.saltRaetKey.write_local(local.priver.keyhex, local.signer.keyhex)

    def dumpRemote(self, remote):
        '''
        Dump remote estate
        '''
        data = odict([
                        ('name', remote.name),
                        ('uid', remote.uid),
                        ('fuid', remote.fuid),
                        ('ha', remote.ha),
                        ('iha', remote.iha),
                        ('natted', remote.natted),
                        ('fqdn', remote.fqdn),
                        ('dyned', remote.dyned),
                        ('sid', remote.sid),
                        ('main', remote.main),
                        ('kind', remote.kind),
                        ('joined', remote.joined),
                        ('role', remote.role),
                    ])
        if self.verifyRemoteData(data, remoteFields=self.RemoteDumpFields):
            self.dumpRemoteData(data, remote.name)

        if remote.pubber.keyhex  and remote.verfer.keyhex:
            # kludge to persist the keys since no way to write
            self.saltRaetKey.status(remote.role,
                                remote.pubber.keyhex,
                                remote.verfer.keyhex)

    def statusRemote(self, remote, dump=True):
        '''
        Calls .statusRole on remote role and keys and updates remote.acceptance
        dump indicates if statusRole should update persisted values when
        appropriate.

        Returns status
        Where status is acceptance status of role and keys
        and has value from raeting.acceptances
        '''
        status = self.statusRole(role=remote.role,
                                 verhex=remote.verfer.keyhex,
                                 pubhex=remote.pubber.keyhex,
                                 dump=dump)

        remote.acceptance = status

        return status

    def statusRole(self, role, verhex, pubhex, dump=True):
        '''
        Returns status

        Where status is acceptance status of role and keys
        and has value from raeting.acceptances
        '''
        status = raeting.Acceptance[self.saltRaetKey.status(role,
                                                             pubhex,
                                                             verhex)].value

        return status

    def rejectRemote(self, remote):
        '''
        Set acceptance status to rejected
        '''
        mid = remote.role
        self.saltRaetKey.reject(match=mid, include_accepted=True)
        remote.acceptance = raeting.Acceptance.rejected.value

    def pendRemote(self, remote):
        '''
        Set acceptance status to pending
        '''
        pass

    def acceptRemote(self, remote):
        '''
        Set acceptance status to accepted
        '''
        mid = remote.role
        self.saltRaetKey.accept(match=mid, include_rejected=True)
        remote.acceptance = raeting.Acceptance.accepted.value


text:
package com.gzsll.hupu.util;

import android.content.Context;

/**
 * Created by sll on 2016/3/30.
 */
public class StringUtil {

    public static void copy(Context mContext, String stripped) {
        android.content.ClipboardManager clipboard =
                (android.content.ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
        android.content.ClipData clip = android.content.ClipData.newPlainText("content", stripped);
        clipboard.setPrimaryClip(clip);
        ToastUtil.showToast("复制成功");
    }
}


text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.datalabeling.v1beta1.model;

/**
 * Configuration details used for calculating evaluation metrics and creating an Evaluation.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Data Labeling API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class GoogleCloudDatalabelingV1beta1EvaluationConfig extends com.google.api.client.json.GenericJson {

  /**
   * Only specify this field if the related model performs image object detection
   * (`IMAGE_BOUNDING_BOX_ANNOTATION`). Describes how to evaluate bounding boxes.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudDatalabelingV1beta1BoundingBoxEvaluationOptions boundingBoxEvaluationOptions;

  /**
   * Only specify this field if the related model performs image object detection
   * (`IMAGE_BOUNDING_BOX_ANNOTATION`). Describes how to evaluate bounding boxes.
   * @return value or {@code null} for none
   */
  public GoogleCloudDatalabelingV1beta1BoundingBoxEvaluationOptions getBoundingBoxEvaluationOptions() {
    return boundingBoxEvaluationOptions;
  }

  /**
   * Only specify this field if the related model performs image object detection
   * (`IMAGE_BOUNDING_BOX_ANNOTATION`). Describes how to evaluate bounding boxes.
   * @param boundingBoxEvaluationOptions boundingBoxEvaluationOptions or {@code null} for none
   */
  public GoogleCloudDatalabelingV1beta1EvaluationConfig setBoundingBoxEvaluationOptions(GoogleCloudDatalabelingV1beta1BoundingBoxEvaluationOptions boundingBoxEvaluationOptions) {
    this.boundingBoxEvaluationOptions = boundingBoxEvaluationOptions;
    return this;
  }

  @Override
  public GoogleCloudDatalabelingV1beta1EvaluationConfig set(String fieldName, Object value) {
    return (GoogleCloudDatalabelingV1beta1EvaluationConfig) super.set(fieldName, value);
  }

  @Override
  public GoogleCloudDatalabelingV1beta1EvaluationConfig clone() {
    return (GoogleCloudDatalabelingV1beta1EvaluationConfig) super.clone();
  }

}


text:
using System;
using System.Xml.XPath;

namespace OpenADK.Library.Tools.XPath
{
    public abstract class AbstractNodePointer : INodePointer
    {
        private INodePointer fParentPointer;

        public AbstractNodePointer( INodePointer parent )
        {
            fParentPointer = parent;
        }

        public abstract object GetBaseValue();

        /// <summary>
        /// Gets the value that this NodePointer points to
        /// </summary>
        public virtual object Value
        {
            get
            {
                object val = GetBaseValue();
                if ( val == null )
                {
                    val = Node;
                }
                return val;
            }
        }

        public abstract void SetValue( object value );

        /// <summary>
        /// One of the XPathNodeType values representing the current node.
        /// </summary>
        public abstract XPathNodeType NodeType { get; }

        public virtual INodePointer CreateAttribute( SifXPathContext context, string name )
        {
            throw new InvalidOperationException(
                string.Format(
                    "Cannot create an object for path {0}/{1}. Creating a child is not supported by this type of node: {2}({3})",
                    Name, name, NodeType, GetType().FullName ) );
        }

        /// <summary>
        /// A String that contains the qualified Name of the current node, or String.Empty
        /// if the current node does not have a name (for example, text or comment nodes).
        /// </summary>
        public abstract string Name { get; }

        public virtual INodePointer CreateChild( SifXPathContext context, string name, int i )
        {
            throw new InvalidOperationException( "Cannot create an object for path " + Name + "/" + name +
                                                 ". Creating a child is not supported by this type of node: " +
                                                 NodeType );
        }

        /// <summary>
        /// When overridden in a derived class, gets a value indicating whether the current node
        /// is an empty element without an end element tag.
        /// </summary>
        public abstract bool IsEmptyElement { get; }

        /// <summary>
        /// returns the raw node pointed to by this pointer
        /// </summary>
        public abstract object Node { get; }

        /// <summary>
        /// Returns an INodeIterator that iterates instance representing the first attribute of
        /// the current node; otherwise, <c>Null</c>.
        /// </summary>
        /// <returns></returns>
        public virtual INodeIterator GetAttributes()
        {
            return null;
        }

        /// <summary>
        /// Returns a cloned instance of this NodePointer
        /// </summary>
        /// <returns></returns>
        public abstract INodePointer Clone();

        /// <summary>
        /// Returns an INodeIterator instance that iterates the children
        /// of the current node; otherwise, <c>Null</c>.
        /// </summary>
        /// <returns></returns>
        public virtual INodeIterator GetChildren()
        {
            return null;
        }

        /// <summary>
        /// Returns an INodePointer instance if successful moving to the parent node of the
        /// current node; otherwise, <c>Null</c>.
        /// </summary>
        /// <returns></returns>
        public INodePointer Parent
        {
            get { return fParentPointer; }
        }

        /// <summary>
        /// A String representing the ID value of the node to which you want to move.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public INodePointer GetChildById( string id )
        {
            // Currently looking up elements by ID is not supported
            return null;
        }
    }
}


text:
#include "db_balance.cpp"
#include "db_block.cpp"
#include "db_debug.cpp"
#include "db_getter.cpp"
#include "db_init.cpp"
#include "db_maint.cpp"
#include "db_management.cpp"
#include "db_market.cpp"
#include "db_update.cpp"
#include "db_witness_schedule.cpp"
#include "db_notify.cpp"


text:
namespace Ilwis {
namespace BaseOperations{

typedef std::function<double(double)> UnaryFunction;

class UnaryMath : public OperationImplementation
{
public:
    enum OperationType{otSPATIAL, otTABLE, otNUMBER};
    enum UnaryOperations{uoSIN, uoCOS, uoTAN, uoSQRT, uoASIN, uoACOS, uoATAN, uoLog10, uoLN, uoABS, uoCEIL,
                         uoFLOOR,uoCOSH, uoEXP, uoNEG,uoRND,uoSGN,uoSINH,uoTANH};
    UnaryMath();
    UnaryMath(quint64 metaid, const Ilwis::OperationExpression &expr, const QString& outputdom, UnaryFunction fun);

protected:
    OperationType _case;
    UnaryFunction _unaryFun;
    QString _outputDomain;

};
}
}

#endif // UNARYMATH_H


text: require 'poppins'


text:
package org.jayware.e2.util;

public enum ReferenceType
{
    STRONG,
    WEAK
}


text:
<!doctype html>

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=3.0, user-scalable=yes"/>
    <meta name="HandheldFriendly" content="true" />
    <meta name="apple-mobile-web-app-capable" content="YES" />

    <meta http-equiv="content-type" content="text/html; charset=utf-8" />

    <title>Material Design Iconic Font :: Icons</title>

    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">

    <link rel="stylesheet" href="css/material-design-iconic-font.css">

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                Toggle navigation

            </button>
            Material Design Iconic Font

Get Started

Icons

Examples

Cheatsheet

License

Icons

The complete icons set in Material Design Iconic Font.

                GitHub Project

                Created by Sergey Kupletsky

Icons

            <% for (var glyphIdx = 0; glyphIdx < glyphs.length; glyphIdx++) { var glyph = glyphs[glyphIdx] %>
            <div class="icon col-sm-4 col-xs-6" data-name="<%= glyph %>" data-code="<%= (61697 + glyphIdx).toString(16) %>">
<i class="<%= baseClass %> <%= classPrefix %><%= glyph %> zmd-fw"> <%= glyph %>

            <% } %>

Switch to Cheatsheet

 Icons

                Back to top

Donate: You can support me via PayPal, WebMoney or Gratipay

            GitHub is the best way to build and ship software.

            Powerful collaboration, code review, and code management for open source and private projects.


text:
class Framework;
#endif // Framework

typedef struct FontCache
{
	std::string* Path;
	int Size;
	int Flags;
	double LastAccess;
	ALLEGRO_FONT* Font;
} FontCache;

class FontManager
{
	private:
	  Framework* systemFramework;
		std::vector<FontCache*> Cached;

		void RemoveCached( FontCache* item );

	public:
		double CacheTime;

		FontManager( Framework* FrameworkObject );
		~FontManager();

		ALLEGRO_FONT* GetFont(std::string Filename, int Size, int Flags);

		void Update();
		void Clear();
};


text:
module WikiPku
  class Like < ActiveRecord::Base
    belongs_to :entry
    belongs_to :user
  end
end


text:
package net.wyun.wcrs.wechat.po;

/**
 * ��ʱ��ά����Ϣ
 *
 * @author qikuo
 * @date 2017-2-28
 */
public class WeixinQRCode {
	// ��ȡ�Ķ�ά��ticket
	private String ticket;
	// ��ά�����Чʱ�䣬��λΪ�룬��󲻳���1800
	private int expireSeconds;

	public String getTicket() {
		return ticket;
	}

	public void setTicket(String ticket) {
		this.ticket = ticket;
	}

	public int getExpireSeconds() {
		return expireSeconds;
	}

	public void setExpireSeconds(int expireSeconds) {
		this.expireSeconds = expireSeconds;
	}
}


text:
<?php

/**
 * Generated 2019-10-12T19:39:07+00:00 16.0.19402.12016
 */
namespace Office365\SharePoint\Microfeed;

use Office365\Runtime\ClientValue;

class MicrofeedPostDefinitionNames extends ClientValue
{
}


text:
_Released 04/16/2017_

**Features:**

- You can now run your tests in the
  [Electron browser](/guides/guides/launching-browsers#Electron-Browser) that
  comes built with Cypress. You will see it as an option in the browser
  dropdown. This is the same browser that Cypress uses when running
  `cypress run`. This is useful for debugging issues that only occur during
  headless runs. Addresses
  [#452](https://github.com/cypress-io/cypress/issues/452).
- New traversal commands [`.nextAll()`](/api/commands/nextall),
  [`.nextUntil()`](/api/commands/nextuntil),
  [`.parentsUntil()`](/api/commands/parentsuntil),
  [`.prevAll()`](/api/commands/prevall), and
  [`.prevUntil()`](/api/commands/prevuntil) have been added. Addresses
  [#432](https://github.com/cypress-io/cypress/issues/432).

**Bugfixes:**

- An error is now thrown if an `undefined` value is mistakenly passed into
  [`cy.wait()`](/api/commands/wait). Previously, it would set the command
  timeout to an unimaginably large number of ms. Fixes
  [#332](https://github.com/cypress-io/cypress/issues/332)
- Fixed issue where the contents of `state.json` were emptied, which would cause
  a crash and loss of state information. Fixes
  [#473](https://github.com/cypress-io/cypress/issues/473) and
  [#474](https://github.com/cypress-io/cypress/issues/474).
- We no longer write the chrome extension within `node_modules`, and instead
  write this to the proper OS specific `appData` folder. Fixes
  [#245](https://github.com/cypress-io/cypress/issues/245) and
  [#290](https://github.com/cypress-io/cypress/issues/290).

**Misc:**

- Error handling for invalid arguments passed to
  [`cy.wait()`](/api/commands/wait) have been improved and will now suggest
  valid arguments that are acceptable.
- Browsers in the browser dropdown now have colored icons, which help visually
  distinguish the variants of Chrome.
- Increased timeout for browser to make a connection when running during
  `cypress run` from 10 seconds to 30 seconds.
- Internally refactored how browsers are added and spawned in preparation of us
  adding cross browser support.
- Switching specs in the GUI now closes the browser and respawns it and
  refocuses it.


text:
'''
Created on Dec 8, 2017

@author: prismtech
'''
import unittest
import struct
import countTest

if countTest.count_test == False:
    from SequenceOfSimpleArray.basic.module_SequenceOfSimpleArray import SequenceOfSimpleArray_struct

class TestSequenceOfSimpleArray(unittest.TestCase):

    def testCopyInCopyOut(self):
        data = SequenceOfSimpleArray_struct(
            long1 = 13,
            sequence1 = [[11, 12], [21,22], [31,32]])
        print('data: ' + str(data))

        print('data._get_packing_fmt(): ', data._get_packing_fmt())
        print('data._get_packing_args(): ', data._get_packing_args())
        buffer = data._serialize()
        print('buffer: ', buffer)

        values = struct.unpack(data._get_packing_fmt(), buffer)
        data1 = SequenceOfSimpleArray_struct()
        data1._deserialize(list(values))

        self.assertEqual(data.long1, data1.long1)
        self.assertEqual(len(data.sequence1), len(data1.sequence1))
        for i in range(len(data.sequence1)):
            self.assertEqual(data.sequence1[i], data1.sequence1[i], 'sequence[%d]'%(i))

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'TestSequenceOfSimpleArray.testCopyInCopyOut']
    unittest.main()


text:
package org.ctoolkit.test.appengine;

import com.google.appengine.tools.development.testing.LocalAppIdentityServiceTestConfig;
import com.google.appengine.tools.development.testing.LocalServiceTestHelper;

/**
 * Config for accessing the local app identity service in tests.
 *
 * @author Aurel Medvegy
 */
public abstract class AppIdentityServiceEnvironment
        extends ServiceConfigModule
{
    protected final LocalAppIdentityServiceTestConfig config = new LocalAppIdentityServiceTestConfig();

    public AppIdentityServiceEnvironment()
    {
        construct( new LocalServiceTestHelper( config ) );
    }
}


text:
import { Component } from '@angular/core';
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
import { TabModule } from './tab.module';

const TABS = [
  {
    heading: 'tab1',
    content: 'tab1 content',
    active: true,
    iconClassName: '',
    icon: './assets/images/icon_tabbar.png',
    badge: 8,
  },
  {
    heading: 'tab2',
    content: 'tab2 content',
    active: false,
    iconClassName: '',
    icon: '<img src="./assets/images/icon_tabbar.png">',
    badge: 'dot',
  },
  { heading: 'tab3', content: 'tab3 content', active: false, disabled: true },
  { heading: 'tab4', content: 'tab4 content', active: false, removable: true },
];
const navbar_html = `
  <weui-navbar>
    <weui-tab *ngFor="let item of tabs"
              [heading]="item.heading"
              [disabled]="item.disabled"
              [active]="item.active"
              [iconClassName]="item.iconClassName"
              [icon]="item.icon"
              [badge]="item.badge"
              (select)="_select($event)"
              (deselect)="_deselect($event)"
              (removed)="_removed($event)">{{item.content}}</weui-tab>
  </weui-navbar>
`;
const tabbar_html = `
<weui-tabbar>
    <weui-tab *ngFor="let item of tabs"
              [heading]="item.heading"
              [disabled]="item.disabled"
              [active]="item.active"
              [iconClassName]="item.iconClassName"
              [icon]="item.icon"
              [badge]="item.badge"
              (select)="_select($event)"
              (deselect)="_deselect($event)"
              (removed)="_removed($event)">{{item.content}}</weui-tab>
</weui-tabbar>
`;

function getItems(nativeEl: HTMLElement): NodeListOf<Element> {
  return nativeEl.querySelectorAll('.weui-navbar__item');
}

function getItemsByTabbar(nativeEl: HTMLElement, index: number): HTMLElement {
  return nativeEl.querySelectorAll('.weui-tabbar__item')[index] as HTMLElement;
}

function getContents(nativeEl: HTMLElement): NodeListOf<Element> {
  return nativeEl.querySelectorAll('weui-tab');
}

function expectActiveTabs(nativeEl: HTMLElement, action: boolean[]): void {
  const items = getItems(nativeEl);
  const contents = getContents(nativeEl);

  expect(items.length).toBe(action.length);
  expect(contents.length).toBe(action.length);
  for (let i = 0; i < action.length; i++) {
    if (action[i]) {
      expect(items[i].classList).toContain('weui-bar__item_on');
      expect(contents[i].classList).toContain('active');
    } else {
      expect(items[i].classList).not.toContain('weui-bar__item_on');
      expect(contents[i].classList).not.toContain('active');
    }
  }
}

describe('Component: Tabs', () => {
  let fixture: ComponentFixture<TestTabComponent>;
  let context: TestTabComponent;
  let el: HTMLElement;

  describe('[Navbar]', () => {
    beforeEach(fakeAsync(() => {
      TestBed.configureTestingModule({
        declarations: [TestTabComponent],
        imports: [TabModule],
      });
      TestBed.overrideComponent(TestTabComponent, {
        set: { template: navbar_html },
      });
      fixture = TestBed.createComponent(TestTabComponent);
      context = fixture.componentInstance;
      spyOn(context, '_select');
      spyOn(context, '_deselect');
      spyOn(context, '_removed');
      el = fixture.nativeElement;
      fixture.detectChanges();
      tick();
    }));

    it('should select first tab as active by default', () => {
      expectActiveTabs(el, [true, false, false, false]);
    });

    it('should set tab active', () => {
      (getItems(el)[1] as HTMLElement).click();
      fixture.detectChanges();
      expectActiveTabs(el, [false, true, false, false]);
    });

    it('should set tab heading', () => {
      const newTitle = 'new title';
      context.tabs[0].heading = newTitle;
      fixture.detectChanges();
      expect(getItems(el)[0].innerHTML.trim()).toBe(newTitle);
    });

    it('should set tab disabled', () => {
      expect(getItems(el)[2].classList).toContain('disabled');
    });

    it('should ignore click on disalbed tab', () => {
      (getItems(el)[2] as HTMLElement).click();
      fixture.detectChanges();
      expectActiveTabs(el, [true, false, false, false]);
    });

    it('should emit select event', () => {
      (getItems(el)[1] as HTMLElement).click();
      fixture.detectChanges();

      expect(context._deselect).toHaveBeenCalled();
      expect(context._select).toHaveBeenCalledWith(
        jasmine.objectContaining({
          heading: 'tab2',
        }),
      );
    });
  });

  describe('[Tabbar]', () => {
    beforeEach(fakeAsync(() => {
      TestBed.configureTestingModule({
        declarations: [TestTabComponent],
        imports: [TabModule],
      });
      TestBed.overrideComponent(TestTabComponent, {
        set: { template: tabbar_html },
      });
      fixture = TestBed.createComponent(TestTabComponent);
      context = fixture.componentInstance;
      spyOn(context, '_select');
      spyOn(context, '_deselect');
      spyOn(context, '_removed');
      el = fixture.nativeElement;
      fixture.detectChanges();
      tick();
    }));

    it('should set tab has icon', () => {
      expect(getItemsByTabbar(el, 0).querySelector('.weui-tabbar__icon')).not.toBeNull();
    });

    it('should set tab badge number value', () => {
      expect(getItemsByTabbar(el, 0).querySelector('.weui-badge')!.innerHTML).toBe('8');
    });

    it('should set tab badge dot value', () => {
      expect(getItemsByTabbar(el, 1).querySelector('.weui-badge')!.classList).toContain('weui-badge_dot');
    });

    it('should be support valid image url', () => {
      context.tabs = [{ icon: '1.jpg' }];
      fixture.detectChanges();
      expect(getItemsByTabbar(el, 0).querySelector('.weui-tabbar__icon')).not.toBeNull();
    });

    it('#iconClassName', () => {
      context.tabs = [{ iconClassName: 'aaa' }];
      fixture.detectChanges();
      expect(getItemsByTabbar(el, 0).querySelector('.weui-tabbar__icon')!.classList).toContain('aaa');
    });
  });
});

@Component({ template: `` })
class TestTabComponent {
  tabs: any[] = [...TABS];

  _select(e: TabModule): TabModule {
    return e;
  }

  _deselect(e: TabModule): TabModule {
    return e;
  }

  _removed(e: TabModule): TabModule {
    return e;
  }
}


text:
import {clamp} from '../utils/math';
import {last} from '../utils/misc';
import {AnimationSpec, TransitionSpec} from './defs';
import {easings} from './easing';

interface Interval<T> {
    standby: number;
    start: number;
    end: number;
    spec: TransitionSpec<T>;
    interpolate: (t: number) => T;
}

export class Animation<T = any, R = any> {
    private timeline: Interval<T>[];
    private interpolate: (a: T, b: T) => (t: number) => T;
    private output: (value: T) => R;
    private lastValue: any;
    private startTime: number;
    private isComplete: boolean;
    private callback: (output: R) => void;
    private doneCallback: () => void;

    constructor(spec: AnimationSpec<T, R>, callback: (output: R) => void) {
        if (!spec.interpolate) {
            throw new Error('No interpolator provided');
        }

        this.interpolate = spec.interpolate;
        this.output = spec.output;
        this.callback = callback;
        this.doneCallback = spec.done;

        let total = 0;
        this.timeline = spec.timeline.map((spec) => {
            const standby = total;
            const start = standby + spec.timing.delay;
            const end = start + spec.timing.duration;
            total = end;
            return {standby, start, end, spec, interpolate: null};
        });

        this.isComplete = false;
    }

    tick(time: number) {
        if (this.startTime == null) {
            this.startTime = time;
        }

        const duration = time - this.startTime;
        const {timeline} = this;
        let interval: Interval<T>;
        for (let i = timeline.length - 1; i >= 0; i--) {
            const {standby, end} = timeline[i];
            if (duration >= end || (duration >= standby && duration <= end)) {
                interval = timeline[i];
                break;
            }
        }

        const {start, end, spec} = interval;
        if (interval === last(timeline) && duration >= end) {
            this.isComplete = true;
        }

        if (!interval.interpolate) {
            interval.interpolate = this.interpolate(spec.from, spec.to);
        }

        const ease =
            typeof spec.timing.easing === 'string'
                ? easings[spec.timing.easing]
                : spec.timing.easing;

        const t =
            duration < start
                ? 0
                : start === end
                ? 1
                : clamp((duration - start) / (end - start), 0, 1);
        const eased = ease(t);
        const value = interval.interpolate.call(null, eased);

        this.lastValue = value;

        const output = this.output.call(null, value);
        this.callback.call(null, output);
    }

    value() {
        return this.lastValue;
    }

    complete() {
        return this.isComplete;
    }

    finalize() {
        if (this.doneCallback) {
            this.doneCallback.call(null);
        }
    }
}


text:
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{{ site.name }}{% if page.title and page.url != "/" %} | {{ page.title }}{% endif %}</title>
<meta name="description" content="{{ site.description }}">
<link rel="shortcut icon" href="{{ '/assets/img/favicon.ico' | prepend: site.baseurl | prepend: site.url }}">

<!-- Stylesheets -->
<link rel="stylesheet" href="{{ '/assets/css/main.css' | prepend: site.baseurl | prepend: site.url }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">

<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Proza+Libre:400,400i,700,700i" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Cormorant+Garamond:400,400i,700,700i" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Cousine:400,400i,700&subset=latin-ext" rel="stylesheet" type="text/css">
</head>


text:
package com.sophieher.squaregame;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;

public class BoardView extends View {

	private SquareGameLogic mGame;

	// size of grid
	private int mGridSize;

	private Paint mPaint;

	public BoardView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		init();
	}

	public BoardView(Context context, AttributeSet attrs) {
		super(context, attrs);
		init();
	}

	public BoardView(Context context) {
		super(context);
		init();
	}

	// Initialize the paint to use for drawing here
	public void init() {
		mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
		mGridSize = 4;
	}

	@Override
	protected void onDraw(Canvas canvas){
		// Draw the board with the color specified
		mPaint.setColor(Color.BLACK);
		int w = getWidth();
		int h = w;
		canvas.drawRect(0, 0, w, h, mPaint);

		// Now change the color for the circle grid
		mPaint.setColor(getResources().getColor(R.color.yellow));
		mPaint.setStrokeWidth(24);

		// The following code is just a place holder for the circle grid to be drawn
		// the grid will be drawn dynamically based on getWidth()
		// does not work in landscape mode due to the dependency on getWidth()
		int circleRad = w/20 + 10; // given an offset of 10
		int circleGrid = w/4;
		for(int i = 0; i < mGridSize; ++i){
			//						 cx,                      cy,    radius,  paint
			canvas.drawCircle(circleRad, circleRad+i*4*circleRad, circleRad, mPaint);
			canvas.drawCircle(circleRad+circleGrid, circleRad+i*4*circleRad, circleRad, mPaint);
			canvas.drawCircle(circleRad+2*circleGrid, circleRad+i*4*circleRad, circleRad, mPaint);
			canvas.drawCircle(circleRad+3*circleGrid, circleRad+i*4*circleRad, circleRad, mPaint);

			/* We will draw the dots as each players's colors, and then go through the lines and
			 * connect the dots with the player color who holds that line
			 * lines are either on or off, and if they are off then they have a respective color
			 * See: SquareGameLogic.Line
			 */
			if (mGame != null && mGame.getBoardOccupant(i) != -1){
				// startx, starty, stopx, stopy, paint
				canvas.drawLine(0, 0, 1000, 1000, mPaint);
			}

		}
	}

	protected void setGame(SquareGameLogic game) {
		mGame = game;
	}

	// Want to have grid size for determining which circle is chosen
	public int getBoardGridSize() {
		return getWidth() / mGridSize;
	}
	//
	//protected void getPosition()
}


text:
import { defaultRegistry, MetricRegistry } from '../index';

const metered = (metric: string): any => (target, name, descriptor) => {
  const fn = descriptor.value;

  const decorated = () => {
    defaultRegistry.meter(metric).mark();
    fn.apply(target, arguments);
  };

  descriptor.value = decorated;

  return descriptor;
};

export { metered };