text:
package lookoutforvisioniface

import (
	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws"
	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request"
	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/lookoutforvision"
)

// LookoutForVisionAPI provides an interface to enable mocking the
// lookoutforvision.LookoutForVision service client's API operation,
// paginators, and waiters. This make unit testing your code that calls out
// to the SDK's service client's calls easier.
//
// The best way to use this interface is so the SDK's service client's calls
// can be stubbed out for unit testing your code with the SDK without needing
// to inject custom request handlers into the SDK's request pipeline.
//
//	// myFunc uses an SDK service client to make a request to
//	// Amazon Lookout for Vision.
//	func myFunc(svc lookoutforvisioniface.LookoutForVisionAPI) bool {
//	    // Make svc.CreateDataset request
//	}
//
//	func main() {
//	    sess := session.New()
//	    svc := lookoutforvision.New(sess)
//
//	    myFunc(svc)
//	}
//
// In your _test.go file:
//
//	// Define a mock struct to be used in your unit tests of myFunc.
//	type mockLookoutForVisionClient struct {
//	    lookoutforvisioniface.LookoutForVisionAPI
//	}
//	func (m *mockLookoutForVisionClient) CreateDataset(input *lookoutforvision.CreateDatasetInput) (*lookoutforvision.CreateDatasetOutput, error) {
//	    // mock response/functionality
//	}
//
//	func TestMyFunc(t *testing.T) {
//	    // Setup Test
//	    mockSvc := &mockLookoutForVisionClient{}
//
//	    myfunc(mockSvc)
//
//	    // Verify myFunc's functionality
//	}
//
// It is important to note that this interface will have breaking changes
// when the service model is updated and adds new API operations, paginators,
// and waiters. Its suggested to use the pattern above for testing, or using
// tooling to generate mocks to satisfy the interfaces.
type LookoutForVisionAPI interface {
	CreateDataset(*lookoutforvision.CreateDatasetInput) (*lookoutforvision.CreateDatasetOutput, error)
	CreateDatasetWithContext(aws.Context, *lookoutforvision.CreateDatasetInput, ...request.Option) (*lookoutforvision.CreateDatasetOutput, error)
	CreateDatasetRequest(*lookoutforvision.CreateDatasetInput) (*request.Request, *lookoutforvision.CreateDatasetOutput)

	CreateModel(*lookoutforvision.CreateModelInput) (*lookoutforvision.CreateModelOutput, error)
	CreateModelWithContext(aws.Context, *lookoutforvision.CreateModelInput, ...request.Option) (*lookoutforvision.CreateModelOutput, error)
	CreateModelRequest(*lookoutforvision.CreateModelInput) (*request.Request, *lookoutforvision.CreateModelOutput)

	CreateProject(*lookoutforvision.CreateProjectInput) (*lookoutforvision.CreateProjectOutput, error)
	CreateProjectWithContext(aws.Context, *lookoutforvision.CreateProjectInput, ...request.Option) (*lookoutforvision.CreateProjectOutput, error)
	CreateProjectRequest(*lookoutforvision.CreateProjectInput) (*request.Request, *lookoutforvision.CreateProjectOutput)

	DeleteDataset(*lookoutforvision.DeleteDatasetInput) (*lookoutforvision.DeleteDatasetOutput, error)
	DeleteDatasetWithContext(aws.Context, *lookoutforvision.DeleteDatasetInput, ...request.Option) (*lookoutforvision.DeleteDatasetOutput, error)
	DeleteDatasetRequest(*lookoutforvision.DeleteDatasetInput) (*request.Request, *lookoutforvision.DeleteDatasetOutput)

	DeleteModel(*lookoutforvision.DeleteModelInput) (*lookoutforvision.DeleteModelOutput, error)
	DeleteModelWithContext(aws.Context, *lookoutforvision.DeleteModelInput, ...request.Option) (*lookoutforvision.DeleteModelOutput, error)
	DeleteModelRequest(*lookoutforvision.DeleteModelInput) (*request.Request, *lookoutforvision.DeleteModelOutput)

	DeleteProject(*lookoutforvision.DeleteProjectInput) (*lookoutforvision.DeleteProjectOutput, error)
	DeleteProjectWithContext(aws.Context, *lookoutforvision.DeleteProjectInput, ...request.Option) (*lookoutforvision.DeleteProjectOutput, error)
	DeleteProjectRequest(*lookoutforvision.DeleteProjectInput) (*request.Request, *lookoutforvision.DeleteProjectOutput)

	DescribeDataset(*lookoutforvision.DescribeDatasetInput) (*lookoutforvision.DescribeDatasetOutput, error)
	DescribeDatasetWithContext(aws.Context, *lookoutforvision.DescribeDatasetInput, ...request.Option) (*lookoutforvision.DescribeDatasetOutput, error)
	DescribeDatasetRequest(*lookoutforvision.DescribeDatasetInput) (*request.Request, *lookoutforvision.DescribeDatasetOutput)

	DescribeModel(*lookoutforvision.DescribeModelInput) (*lookoutforvision.DescribeModelOutput, error)
	DescribeModelWithContext(aws.Context, *lookoutforvision.DescribeModelInput, ...request.Option) (*lookoutforvision.DescribeModelOutput, error)
	DescribeModelRequest(*lookoutforvision.DescribeModelInput) (*request.Request, *lookoutforvision.DescribeModelOutput)

	DescribeModelPackagingJob(*lookoutforvision.DescribeModelPackagingJobInput) (*lookoutforvision.DescribeModelPackagingJobOutput, error)
	DescribeModelPackagingJobWithContext(aws.Context, *lookoutforvision.DescribeModelPackagingJobInput, ...request.Option) (*lookoutforvision.DescribeModelPackagingJobOutput, error)
	DescribeModelPackagingJobRequest(*lookoutforvision.DescribeModelPackagingJobInput) (*request.Request, *lookoutforvision.DescribeModelPackagingJobOutput)

	DescribeProject(*lookoutforvision.DescribeProjectInput) (*lookoutforvision.DescribeProjectOutput, error)
	DescribeProjectWithContext(aws.Context, *lookoutforvision.DescribeProjectInput, ...request.Option) (*lookoutforvision.DescribeProjectOutput, error)
	DescribeProjectRequest(*lookoutforvision.DescribeProjectInput) (*request.Request, *lookoutforvision.DescribeProjectOutput)

	DetectAnomalies(*lookoutforvision.DetectAnomaliesInput) (*lookoutforvision.DetectAnomaliesOutput, error)
	DetectAnomaliesWithContext(aws.Context, *lookoutforvision.DetectAnomaliesInput, ...request.Option) (*lookoutforvision.DetectAnomaliesOutput, error)
	DetectAnomaliesRequest(*lookoutforvision.DetectAnomaliesInput) (*request.Request, *lookoutforvision.DetectAnomaliesOutput)

	ListDatasetEntries(*lookoutforvision.ListDatasetEntriesInput) (*lookoutforvision.ListDatasetEntriesOutput, error)
	ListDatasetEntriesWithContext(aws.Context, *lookoutforvision.ListDatasetEntriesInput, ...request.Option) (*lookoutforvision.ListDatasetEntriesOutput, error)
	ListDatasetEntriesRequest(*lookoutforvision.ListDatasetEntriesInput) (*request.Request, *lookoutforvision.ListDatasetEntriesOutput)

	ListDatasetEntriesPages(*lookoutforvision.ListDatasetEntriesInput, func(*lookoutforvision.ListDatasetEntriesOutput, bool) bool) error
	ListDatasetEntriesPagesWithContext(aws.Context, *lookoutforvision.ListDatasetEntriesInput, func(*lookoutforvision.ListDatasetEntriesOutput, bool) bool, ...request.Option) error

	ListModelPackagingJobs(*lookoutforvision.ListModelPackagingJobsInput) (*lookoutforvision.ListModelPackagingJobsOutput, error)
	ListModelPackagingJobsWithContext(aws.Context, *lookoutforvision.ListModelPackagingJobsInput, ...request.Option) (*lookoutforvision.ListModelPackagingJobsOutput, error)
	ListModelPackagingJobsRequest(*lookoutforvision.ListModelPackagingJobsInput) (*request.Request, *lookoutforvision.ListModelPackagingJobsOutput)

	ListModelPackagingJobsPages(*lookoutforvision.ListModelPackagingJobsInput, func(*lookoutforvision.ListModelPackagingJobsOutput, bool) bool) error
	ListModelPackagingJobsPagesWithContext(aws.Context, *lookoutforvision.ListModelPackagingJobsInput, func(*lookoutforvision.ListModelPackagingJobsOutput, bool) bool, ...request.Option) error

	ListModels(*lookoutforvision.ListModelsInput) (*lookoutforvision.ListModelsOutput, error)
	ListModelsWithContext(aws.Context, *lookoutforvision.ListModelsInput, ...request.Option) (*lookoutforvision.ListModelsOutput, error)
	ListModelsRequest(*lookoutforvision.ListModelsInput) (*request.Request, *lookoutforvision.ListModelsOutput)

	ListModelsPages(*lookoutforvision.ListModelsInput, func(*lookoutforvision.ListModelsOutput, bool) bool) error
	ListModelsPagesWithContext(aws.Context, *lookoutforvision.ListModelsInput, func(*lookoutforvision.ListModelsOutput, bool) bool, ...request.Option) error

	ListProjects(*lookoutforvision.ListProjectsInput) (*lookoutforvision.ListProjectsOutput, error)
	ListProjectsWithContext(aws.Context, *lookoutforvision.ListProjectsInput, ...request.Option) (*lookoutforvision.ListProjectsOutput, error)
	ListProjectsRequest(*lookoutforvision.ListProjectsInput) (*request.Request, *lookoutforvision.ListProjectsOutput)

	ListProjectsPages(*lookoutforvision.ListProjectsInput, func(*lookoutforvision.ListProjectsOutput, bool) bool) error
	ListProjectsPagesWithContext(aws.Context, *lookoutforvision.ListProjectsInput, func(*lookoutforvision.ListProjectsOutput, bool) bool, ...request.Option) error

	ListTagsForResource(*lookoutforvision.ListTagsForResourceInput) (*lookoutforvision.ListTagsForResourceOutput, error)
	ListTagsForResourceWithContext(aws.Context, *lookoutforvision.ListTagsForResourceInput, ...request.Option) (*lookoutforvision.ListTagsForResourceOutput, error)
	ListTagsForResourceRequest(*lookoutforvision.ListTagsForResourceInput) (*request.Request, *lookoutforvision.ListTagsForResourceOutput)

	StartModel(*lookoutforvision.StartModelInput) (*lookoutforvision.StartModelOutput, error)
	StartModelWithContext(aws.Context, *lookoutforvision.StartModelInput, ...request.Option) (*lookoutforvision.StartModelOutput, error)
	StartModelRequest(*lookoutforvision.StartModelInput) (*request.Request, *lookoutforvision.StartModelOutput)

	StartModelPackagingJob(*lookoutforvision.StartModelPackagingJobInput) (*lookoutforvision.StartModelPackagingJobOutput, error)
	StartModelPackagingJobWithContext(aws.Context, *lookoutforvision.StartModelPackagingJobInput, ...request.Option) (*lookoutforvision.StartModelPackagingJobOutput, error)
	StartModelPackagingJobRequest(*lookoutforvision.StartModelPackagingJobInput) (*request.Request, *lookoutforvision.StartModelPackagingJobOutput)

	StopModel(*lookoutforvision.StopModelInput) (*lookoutforvision.StopModelOutput, error)
	StopModelWithContext(aws.Context, *lookoutforvision.StopModelInput, ...request.Option) (*lookoutforvision.StopModelOutput, error)
	StopModelRequest(*lookoutforvision.StopModelInput) (*request.Request, *lookoutforvision.StopModelOutput)

	TagResource(*lookoutforvision.TagResourceInput) (*lookoutforvision.TagResourceOutput, error)
	TagResourceWithContext(aws.Context, *lookoutforvision.TagResourceInput, ...request.Option) (*lookoutforvision.TagResourceOutput, error)
	TagResourceRequest(*lookoutforvision.TagResourceInput) (*request.Request, *lookoutforvision.TagResourceOutput)

	UntagResource(*lookoutforvision.UntagResourceInput) (*lookoutforvision.UntagResourceOutput, error)
	UntagResourceWithContext(aws.Context, *lookoutforvision.UntagResourceInput, ...request.Option) (*lookoutforvision.UntagResourceOutput, error)
	UntagResourceRequest(*lookoutforvision.UntagResourceInput) (*request.Request, *lookoutforvision.UntagResourceOutput)

	UpdateDatasetEntries(*lookoutforvision.UpdateDatasetEntriesInput) (*lookoutforvision.UpdateDatasetEntriesOutput, error)
	UpdateDatasetEntriesWithContext(aws.Context, *lookoutforvision.UpdateDatasetEntriesInput, ...request.Option) (*lookoutforvision.UpdateDatasetEntriesOutput, error)
	UpdateDatasetEntriesRequest(*lookoutforvision.UpdateDatasetEntriesInput) (*request.Request, *lookoutforvision.UpdateDatasetEntriesOutput)
}

var _ LookoutForVisionAPI = (*lookoutforvision.LookoutForVision)(nil)


text:
package java.lang.reflect;

public class UndeclaredThrowableException
  extends java.lang.RuntimeException{
  // Constructors

  public UndeclaredThrowableException(java.lang.Throwable arg1){
    super();
  }
  public UndeclaredThrowableException(java.lang.Throwable arg1, java.lang.String arg2){
    super();
  }
  // Methods

  public java.lang.Throwable getCause(){
    return (java.lang.Throwable) null;
  }
  public java.lang.Throwable getUndeclaredThrowable(){
    return (java.lang.Throwable) null;
  }
}

redpajama_set_name: RedPajamaGithub


text:
import factory

from core.tests.factories import UserFactory

from bank_accounts.models import Account

class AccountFactory(factory.DjangoModelFactory):
    manager = factory.SubFactory(UserFactory)

    class Meta:
        model = Account


text:
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2005 INRIA
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation;
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
 */

#include "event-impl.h"
#include "log.h"

/**
 * \file
 * \ingroup events
 * ns3::EventImpl definitions.
 */

namespace ns3 {

NS_LOG_COMPONENT_DEFINE ("EventImpl");

EventImpl::~EventImpl ()
{
  NS_LOG_FUNCTION (this);
}

EventImpl::EventImpl ()
  : m_cancel (false)
{
  NS_LOG_FUNCTION (this);
}

void
EventImpl::Invoke (void)
{
  NS_LOG_FUNCTION (this);
  if (!m_cancel)
    {
      Notify ();
    }
}

void
EventImpl::Cancel (void)
{
  NS_LOG_FUNCTION (this);
  m_cancel = true;
}

bool
EventImpl::IsCancelled (void)
{
  NS_LOG_FUNCTION (this);
  return m_cancel;
}

} // namespace ns3


text:
/*
 * @test
 * @bug 4811482 4700777 4905410
 * @summary sun.net.client.defaultConnectTimeout should work with HttpsURLConnection; HTTP client: Connect and read timeouts; Https needs to support new tiger features that went into http
 */

import java.io.*;
import java.net.*;
import javax.net.ssl.*;

public class ReadTimeout {

    /*
     * =============================================================
     * Set the various variables needed for the tests, then
     * specify what tests to run on each side.
     */

    /*
     * Should we run the client or server in a separate thread?
     * Both sides can throw exceptions, but do you have a preference
     * as to which side should be the main thread.
     */
    static boolean separateServerThread = true;

    /*
     * Where do we find the keystores?
     */
    static String pathToStores = "../../../../../../etc";
    static String keyStoreFile = "keystore";
    static String trustStoreFile = "truststore";
    static String passwd = "passphrase";

    /*
     * Is the server ready to serve?
     */
    volatile static boolean serverReady = false;

    /*
     * Turn on SSL debugging?
     */
    static boolean debug = false;

    /*
     * Message posted
     */
    static String postMsg = "Testing HTTP post on a https server";

    /*
     * If the client or server is doing some kind of object creation
     * that the other side depends on, and that thread prematurely
     * exits, you may experience a hang.  The test harness will
     * terminate all hung threads after its timeout has expired,
     * currently 3 minutes by default, but you might try to be
     * smart about it....
     */

    /*
     * Define the server side of the test.
     *
     * If the server prematurely exits, serverReady will be set to true
     * to avoid infinite hangs.
     */
    void doServerSide() throws Exception {
        SSLServerSocketFactory sslssf =
            (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
        SSLServerSocket sslServerSocket =
            (SSLServerSocket) sslssf.createServerSocket(serverPort);
        serverPort = sslServerSocket.getLocalPort();

        /*
         * Signal Client, we're ready for his connect.
         */
        serverReady = true;
        SSLSocket sslSocket = null;
        try {
            sslSocket = (SSLSocket) sslServerSocket.accept();
            InputStream sslIS = sslSocket.getInputStream();
            BufferedReader br = new BufferedReader(new InputStreamReader(sslIS));
            br.readLine();
            while (!finished())  {
                Thread.sleep (2000);
            }
            sslSocket.close();

            reset();
            // doing second test
            sslSocket = (SSLSocket) sslServerSocket.accept();
            sslIS = sslSocket.getInputStream();
            br = new BufferedReader(new InputStreamReader(sslIS));
            br.readLine();
            while (!finished())  {
                Thread.sleep (2000);
            }
            sslSocket.close();
        } catch (Exception e) {
        } finally {
            if (sslServerSocket != null)
                sslServerSocket.close();
        }
    }

    boolean isFinished = false;

    synchronized boolean finished () {
        return (isFinished);
    }
    synchronized void done () {
        isFinished = true;
    }

    synchronized void reset() {
        isFinished = false;
    }

    /*
     * Define the client side of the test.
     *
     * If the server prematurely exits, serverReady will be set to true
     * to avoid infinite hangs.
     */
    void doClientSide() throws Exception {

        /*
         * Wait for server to get started.
         */
        while (!serverReady) {
            Thread.sleep(50);
        }
        HttpsURLConnection http = null;
        try {
            URL url = new URL("https://localhost:"+serverPort);

            // set read timeout through system property
            System.setProperty("sun.net.client.defaultReadTimeout", "2000");
            HttpsURLConnection.setDefaultHostnameVerifier(
                                      new NameVerifier());
            http = (HttpsURLConnection)url.openConnection();

            InputStream is = http.getInputStream ();
        } catch (SocketTimeoutException stex) {
            done();
            http.disconnect();
        }

        try {
            URL url = new URL("https://localhost:"+serverPort);

            HttpsURLConnection.setDefaultHostnameVerifier(
                                      new NameVerifier());
            http = (HttpsURLConnection)url.openConnection();
            // set read timeout through API
            http.setReadTimeout(2000);

            InputStream is = http.getInputStream ();
        } catch (SocketTimeoutException stex) {
            done();
            http.disconnect();
        }

    }

    static class NameVerifier implements HostnameVerifier {
        public boolean verify(String hostname, SSLSession session) {
            return true;
        }
    }

    /*
     * =============================================================
     * The remainder is just support stuff
     */

    // use any free port by default
    volatile int serverPort = 0;

    volatile Exception serverException = null;
    volatile Exception clientException = null;

    public static void main(String[] args) throws Exception {
        String keyFilename =
            System.getProperty("test.src", "./") + "/" + pathToStores +
                "/" + keyStoreFile;
        String trustFilename =
            System.getProperty("test.src", "./") + "/" + pathToStores +
                "/" + trustStoreFile;

        System.setProperty("javax.net.ssl.keyStore", keyFilename);
        System.setProperty("javax.net.ssl.keyStorePassword", passwd);
        System.setProperty("javax.net.ssl.trustStore", trustFilename);
        System.setProperty("javax.net.ssl.trustStorePassword", passwd);

        if (debug)
            System.setProperty("javax.net.debug", "all");

        /*
         * Start the tests.
         */
        new ReadTimeout();
    }

    Thread clientThread = null;
    Thread serverThread = null;

    /*
     * Primary constructor, used to drive remainder of the test.
     *
     * Fork off the other side, then do your work.
     */
    ReadTimeout() throws Exception {
        if (separateServerThread) {
            startServer(true);
            startClient(false);
        } else {
            startClient(true);
            startServer(false);
        }

        /*
         * Wait for other side to close down.
         */
        if (separateServerThread) {
            serverThread.join();
        } else {
            clientThread.join();
        }

        /*
         * When we get here, the test is pretty much over.
         *
         * If the main thread excepted, that propagates back
         * immediately.  If the other thread threw an exception, we
         * should report back.
         */
        if (serverException != null)
            throw serverException;
        if (clientException != null)
            throw clientException;
    }

    void startServer(boolean newThread) throws Exception {
        if (newThread) {
            serverThread = new Thread() {
                public void run() {
                    try {
                        doServerSide();
                    } catch (Exception e) {
                        /*
                         * Our server thread just died.
                         *
                         * Release the client, if not active already...
                         */
                        System.err.println("Server died...");
                        serverReady = true;
                        serverException = e;
                    }
                }
            };
            serverThread.start();
        } else {
            doServerSide();
        }
    }

    void startClient(boolean newThread) throws Exception {
        if (newThread) {
            clientThread = new Thread() {
                public void run() {
                    try {
                        doClientSide();
                    } catch (Exception e) {
                        /*
                         * Our client thread just died.
                         */
                        System.err.println("Client died...");
                        clientException = e;
                    }
                }
            };
            clientThread.start();
        } else {
            doClientSide();
        }
    }
}


text:
package com.intellij.javaee.dataSource;

import com.intellij.openapi.project.Project;

/**
 * author: lesya
 */
public interface DataSourceProvider {
  DataSource createNewDataInstance(Project project, String name);

  String[] loadConfiguredDataSourceNamesFromServer(ServerInstance applicationServerInstance);
}


text:
export default function(measurement) {
  if (!measurement) {
    return;
  }

  switch (measurement.toolType) {
    case 'Bidirectional':
    case 'TargetCR':
    case 'TargetNE':
    case 'TargetUN':
      return `Target ${measurement.lesionNamingNumber}`;
    case 'NonTarget':
      return `Non-Target ${measurement.lesionNamingNumber}`;
  }
}


text:
using System;
using Microsoft.Phone.Info;

namespace PlatInfoSap2
{
    public class PlatformInfo
    {
        public string GetModel()
        {
            return String.Format("{0} {1}", DeviceStatus.DeviceManufacturer,
                                            DeviceStatus.DeviceName);
        }

        public string GetVersion()
        {
            return Environment.OSVersion.ToString();
        }
    }
}


text:
package net.wouterdanes.docker.provider.model;

import org.apache.maven.plugins.annotations.Parameter;

public class ContainerCommitConfiguration {
    @Parameter
    private String id;

    @Parameter
    private String repo;

    @Parameter
    private String tag;

    @Parameter
    private String comment;

    @Parameter
    private String author;

    @Parameter(defaultValue = "false")
    private boolean push;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getRepo() {
        return repo;
    }

    public void setRepo(String repo) {
        this.repo = repo;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public boolean isPush() {
        return push;
    }

    public void setPush(boolean push) {
        this.push = push;
    }

    @Override
    public String toString() {
        return "ContainerCommitConfiguration{" +
                "id='" + id + '\'' +
                ", repo='" + repo + '\'' +
                ", tag='" + tag + '\'' +
                ", comment='" + comment + '\'' +
                ", author='" + author + '\'' +
                ", push=" + push +
                '}';
    }
}


text:
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

require_once($CFG->libdir.'/gradelib.php');

/**
 * Returns new improtcode for current user
 * @return int importcode
 */
function get_new_importcode() {
    global $USER, $DB;

    $importcode = time();
    while ($DB->get_record('grade_import_values', array('importcode' => $importcode, 'importer' => $USER->id))) {
        $importcode--;
    }

    return $importcode;
}

/**
 * given an import code, commits all entries in buffer tables
 * (grade_import_value and grade_import_newitem)
 * If this function is called, we assume that all data collected
 * up to this point is fine and we can go ahead and commit
 * @param int courseid - id of the course
 * @param string importcode - import batch identifier
 * @param feedback print feedback and continue button
 * @return bool success
 */
function grade_import_commit($courseid, $importcode, $importfeedback=true, $verbose=true) {
    global $CFG, $USER, $DB, $OUTPUT;

    $failed = false;
    $executionerrors = false;
    $commitstart = time(); // start time in case we need to roll back
    $newitemids = array(); // array to hold new grade_item ids from grade_import_newitem table, mapping array

    /// first select distinct new grade_items with this batch
    $params = array($importcode, $USER->id);
    if ($newitems = $DB->get_records_sql("SELECT *
                                           FROM {grade_import_newitem}
                                          WHERE importcode = ? AND importer=?", $params)) {

        // instances of the new grade_items created, cached
        // in case grade_update fails, so that we can remove them
        $instances = array();
        foreach ($newitems as $newitem) {
            // get all grades with this item

            $gradeimportparams = array('newgradeitem' => $newitem->id, 'importcode' => $importcode, 'importer' => $USER->id);
            if ($grades = $DB->get_records('grade_import_values', $gradeimportparams)) {
                /// create a new grade item for this - must use false as second param!
                /// TODO: we need some bounds here too
                $gradeitem = new grade_item(array('courseid'=>$courseid, 'itemtype'=>'manual', 'itemname'=>$newitem->itemname), false);
                $gradeitem->insert('import');
                $instances[] = $gradeitem;

                // insert each individual grade to this new grade item
                foreach ($grades as $grade) {
                    if (!$gradeitem->update_final_grade($grade->userid, $grade->finalgrade, 'import', $grade->feedback, FORMAT_MOODLE)) {
                        $failed = true;
                        break 2;
                    }
                }
            }
        }

        if ($failed) {
            foreach ($instances as $instance) {
                $gradeitem->delete('import');
            }
            import_cleanup($importcode);
            return false;
        }
    }

    /// then find all existing items

    if ($gradeitems = $DB->get_records_sql("SELECT DISTINCT (itemid)
                                             FROM {grade_import_values}
                                            WHERE importcode = ? AND importer=? AND itemid > 0",
                                            array($importcode, $USER->id))) {

        $modifieditems = array();

        foreach ($gradeitems as $itemid=>$notused) {

            if (!$gradeitem = new grade_item(array('id'=>$itemid))) {
                // not supposed to happen, but just in case
                import_cleanup($importcode);
                return false;
            }
            // get all grades with this item
            $gradeimportparams = array('itemid' => $itemid, 'importcode' => $importcode, 'importer' => $USER->id);
            if ($grades = $DB->get_records('grade_import_values', $gradeimportparams)) {

                // make the grades array for update_grade
                foreach ($grades as $grade) {
                    if (!$importfeedback) {
                        $grade->feedback = false; // ignore it
                    }
                    if ($grade->importonlyfeedback) {
                        // False means do not change. See grade_itme::update_final_grade().
                        $grade->finalgrade = false;
                    }
                    if (!$gradeitem->update_final_grade($grade->userid, $grade->finalgrade, 'import', $grade->feedback)) {
                        $errordata = new stdClass();
                        $errordata->itemname = $gradeitem->itemname;
                        $errordata->userid = $grade->userid;
                        $executionerrors[] = get_string('errorsettinggrade', 'grades', $errordata);
                        $failed = true;
                        break 2;
                    }
                }
                //$itemdetails -> idnumber = $gradeitem->idnumber;
                $modifieditems[] = $itemid;

            }
        }

        if ($failed) {
            if ($executionerrors && $verbose) {
                echo $OUTPUT->notification(get_string('gradeimportfailed', 'grades'));
                foreach ($executionerrors as $errorstr) {
                    echo $OUTPUT->notification($errorstr);
                }
            }
            import_cleanup($importcode);
            return false;
        }
    }

    if ($verbose) {
        echo $OUTPUT->notification(get_string('importsuccess', 'grades'), 'notifysuccess');
        $unenrolledusers = get_unenrolled_users_in_import($importcode, $courseid);
        if ($unenrolledusers) {
            $list = array();
            foreach ($unenrolledusers as $u) {
                $u->fullname = fullname($u);
                $list[] = get_string('usergrade', 'grades', $u);
            }
            echo $OUTPUT->notification(get_string('unenrolledusersinimport', 'grades', html_writer::alist($list)), 'notifysuccess');
        }
        echo $OUTPUT->continue_button($CFG->wwwroot.'/grade/index.php?id='.$courseid);
    }
    // clean up
    import_cleanup($importcode);

    return true;
}

/**
 * This function returns an array of grades that were included in the import,
 * but where the user does not currently have a graded role on the course. These grades
 * are still stored in the database, but will not be visible in the gradebook unless
 * this user subsequently enrols on the course in a graded roles.
 *
 * The returned objects have fields user firstname, lastname and useridnumber, and gradeidnumber.
 *
 * @param integer $importcode import batch identifier
 * @param integer $courseid the course we are importing to.
 * @return mixed and array of user objects, or false if none.
 */
function get_unenrolled_users_in_import($importcode, $courseid) {
    global $CFG, $DB;

    $coursecontext = context_course::instance($courseid);

    // We want to query both the current context and parent contexts.
    list($relatedctxsql, $relatedctxparams) = $DB->get_in_or_equal($coursecontext->get_parent_context_ids(true), SQL_PARAMS_NAMED, 'relatedctx');

    // Users with a gradeable role.
    list($gradebookrolessql, $gradebookrolesparams) = $DB->get_in_or_equal(explode(',', $CFG->gradebookroles), SQL_PARAMS_NAMED, 'grbr');

    // Enrolled users.
    $context = context_course::instance($courseid);
    list($enrolledsql, $enrolledparams) = get_enrolled_sql($context);
    list($sort, $sortparams) = users_order_by_sql('u');

    $sql = "SELECT giv.id, u.firstname, u.lastname, u.idnumber AS useridnumber,
                   COALESCE(gi.idnumber, gin.itemname) AS gradeidnumber
              FROM {grade_import_values} giv
              JOIN {user} u
                   ON giv.userid = u.id
              LEFT JOIN {grade_items} gi
                        ON gi.id = giv.itemid
              LEFT JOIN {grade_import_newitem} gin
                        ON gin.id = giv.newgradeitem
              LEFT JOIN ($enrolledsql) je
                        ON je.id = u.id
              LEFT JOIN {role_assignments} ra
                        ON (giv.userid = ra.userid AND ra.roleid $gradebookrolessql AND ra.contextid $relatedctxsql)
             WHERE giv.importcode = :importcode
                   AND (ra.id IS NULL OR je.id IS NULL)
          ORDER BY gradeidnumber, $sort";
    $params = array_merge($gradebookrolesparams, $enrolledparams, $sortparams, $relatedctxparams);
    $params['importcode'] = $importcode;

    return $DB->get_records_sql($sql, $params);
}

/**
 * removes entries from grade import buffer tables grade_import_value and grade_import_newitem
 * after a successful import, or during an import abort
 * @param string importcode - import batch identifier
 */
function import_cleanup($importcode) {
    global $USER, $DB;

    // remove entries from buffer table
    $DB->delete_records('grade_import_values', array('importcode' => $importcode, 'importer' => $USER->id));
    $DB->delete_records('grade_import_newitem', array('importcode' => $importcode, 'importer' => $USER->id));
}


text:
require "rubygems"
require "ruby-debug"
require "badgeville_berlin"
require "highline/import"

# We created a shell using the Berlin Gem.  In other words, we have created a terminal for the publisher module.
#
# 1.
#   P: A client needs a list of sites within their network.
#   A: ls /
#
# 2.
#   P: A client needs a list of players within a site.
#   A: cd /staging.widgets.badgeville.com/Player
#   P: To get player details
#   A: ls 4d8bb5e8d0c0b35cd7000002
#
# 3.
#   P: A client may also list leaderboards
#   A: ls

module BerlinShell
  HOST = "hostname"
  APIKEY = "api_key"
  NETWORK_ID = "network_id"
  ENDPOINT = "/api/berlin/"
  SPACER = "\n"
  BadgevilleBerlin::Config.conf(:host_name => 'http://' + HOST + '/', :api_key => APIKEY)
  say "Connected to " + HOST

  @@bv_objs = {
    "Activity" => BadgevilleBerlin::Activity,
    "ActivityDefinition" => BadgevilleBerlin::ActivityDefinition,
    "Group" => BadgevilleBerlin::Group,
    "Leaderboard" => BadgevilleBerlin::Leaderboard,
    "Player" => BadgevilleBerlin::Player,
    "Reward" => BadgevilleBerlin::Reward,
    "RewardDefinition" => BadgevilleBerlin::RewardDefinition,
    "Site" => BadgevilleBerlin::Site,
    "Track" => BadgevilleBerlin::Track,
    "User" => BadgevilleBerlin::User
  }
  @@sites = BadgevilleBerlin::Site.find(:all)
  @@working_path_parts = ["Staging"]
  @@item = nil

  def self.item
    @@item
  end
  def self.item=(item)
    @@item = item
  end

  def self.bv_objs
    @@bv_objs
  end

  def self.sites
    @@sites
  end

  def self.sites=(sites)
    @@sites = sites
  end

  # Site/Object/ID, touch ABC.COM/player/; touch {email: name: etc,}
  def self.working_path_parts
     @@working_path_parts
  end
  def self.working_path_parts=(parts)
    @@working_path_parts = parts
  end

  def self.parse_path (path)
    if path == "/"
      path = "/Staging"
    end

    # Handle ../
    if ((path == "../" || path == "..") && BerlinShell.working_path_parts.length > 1)
      BerlinShell.working_path_parts.pop
      path = ""
    end

    if !path.match /^\// # Relative Path
      path = BerlinShell.working_path_parts.join("/") + "/" + path
    elsif !path.match /^\/Staging/ # Absolute Path w.out /Site
      path = "/Staging" + path
    end

    path = path.sub(/^\/*/,"").sub(/\/$/,"") # Trim /
    parts = path.split("/")

    parts
  end

  def self.find_prefix (prefix, list)
    found = false
    list.each do |item|
      if item.id
        if item.id.match /^ + prefix + /
          return item
        end
      end
    end
  end

  def self.valid_path_parts (parts)
    if parts.length == 1
      return true
    end

    # Validate site
    if !get_site(parts[1])
      return false
    end

    # Validate Object
    if parts[2] && !BerlinShell.bv_objs[parts[2]]
       return false
    end

    # Validate item
    if parts[3]
      # needs to be coded
    end

    return true
  end

  def self.get_site (needle)
    found = false
    BerlinShell.sites.each do |site|
      if site.url == needle || site.id == needle
        found = site
      end
    end
    return found
  end

  class Commands
    def self.ls (path)
      path_parts = (path == nil) ? BerlinShell.working_path_parts : BerlinShell.parse_path(path)
      items = []
      if !BerlinShell.valid_path_parts(path_parts)
        say "Path is not valid."
        return
      end

      case  path_parts.length
        when 1 # List Sites
          page = 1
          while true
            sites = BadgevilleBerlin::Site.find(:all, :params => {:page => page, :per_page => 50 })
            if sites.empty?
              break
            else
              sites.each do|site|
                BerlinShell.sites.push(site)
              end
              page = page + 1
            end
          end

          BerlinShell.sites.each do |site|
            items.push(site.id + " (" + site.url + ")")
          end
        when 2 # List Objects
          BerlinShell.bv_objs.each do |name, obj|
            items.push(name)
          end
        when 3 # List Items

          params = {}
          case path_parts[2]
            when "User"
              puts "ls user"
              page = 1
              while true
                users = BadgevilleBerlin::User.find(:all, :params => {:page => page, :per_page => 50 })
                if users.empty?
                  break
                else
                  users.each do|user|
                    items.push("#{user.attributes["_id"]} (#{user.attributes["email"]}) #{user.attributes["name"]}")
                  end
                  page = page + 1
                end
              end
            else
              params[:site] = path_parts[1]
              BerlinShell.bv_objs[path_parts[2]].find(:all, params).each do |item|
                # Use ID, but try to add email then name if available
                items.push((item.attributes["_id"] || item.attributes["id"]) + (item.attributes["email"] ? " (" + item.attributes["email"] + ")" : (item.attributes["name"] ? " (" + item.attributes["name"] + ")" : "") ))
              end
          end
        when 4 # List Details
          items.push(BerlinShell.bv_objs[path_parts[2]].find(path_parts[3]).to_yaml)
      end

      say items.join(SPACER)
    end

    def self.cd (path)
      if (path == nil)
          say ("Missing argument.")
          return
      end
      path_parts = BerlinShell.parse_path(path)
      if BerlinShell.valid_path_parts(path_parts)
        BerlinShell.working_path_parts = path_parts
      else
        say "Path is not valid."
      end
    end

    def self.touch(args)

      #write touch
      begin
        param_hash = eval(args)
      rescue
        say "Arguments for touch must be a hash (e.g. {\"name\" => \"site\", \"url\" => \"url.com\"})"
        return
      end

      path_parts = BerlinShell.working_path_parts
      part = path_parts[path_parts.length-1]

      merged_hash = {}
      if part == "User" || part == "Site"
        merged_hash = {:network_id => NETWORK_ID}
      elsif part == "Player" || part == "ActivityDefinition" || part == "RewardDefinition"
        merged_hash = {:site_id => path_parts[1]}
      end
      param_hash = param_hash.merge(merged_hash)

      if path_parts.length == 4
        say "You cannot create an attribute on a record"
      elsif path_parts.length == 2
        say "Have to be inside a model dir to create a record."
      else
        begin
          object = "BadgevilleBerlin::#{part}".constantize.new(param_hash)
          success = object.save
        rescue
          say("You passed invalid arguments to create a #{part}.")
          return
        end

        if success
          puts object
          say "Successfully created #{part} with arguments #{args}"
        else
          say "Failed to create #{part}."
        end
      end
    end

    def self.rm (id)
      if (id == nil)
          say ("Missing argument.")
      end

      path_parts = BerlinShell.working_path_parts
      part = path_parts[path_parts.length-1]

      if path_parts.length == 4
        puts "You cannot delete attributes on a record"
      else
        begin
          #check that record still exists remotely (race condition)
          object = "BadgevilleBerlin::#{part}".constantize.find(id)
          valid_id = true
        rescue
          say("You passed in an invalid #{part} id or property.")
        end
        "BadgevilleBerlin::#{part}".constantize.delete(id) unless valid_id.nil?
        puts "Successfully deleted #{part} #{id}" unless valid_id.nil?
      end
    end

    def self.pwd
      say( BerlinShell.working_path_parts.join("/") + "/")
    end

  end

  while true
    inputs = ask("/" + @@working_path_parts.join("/") +  "/ >> " ).split(" ", 2)

    if inputs.empty?
      next
    end

    case inputs[0].downcase
    when "exit"
      abort("Goodbye!")
    when "ls"
      begin
        Commands.ls(inputs[1])
      rescue
        say("Unable to ls.")
      end
    when "cd"
      Commands.cd(inputs[1])
    when "rm"
      Commands.rm(inputs[1])
    when "touch"
      Commands.touch(inputs[1])
    when "pwd"
      Commands.pwd
    else
    end
  end

end


text:
Communicate over ad hoc wifi using Multipeer Connectivity.

## Known Issues
Below is a list of known issues. Pull requests are welcome for any of these issues!

- No support for streams in React Native, so streaming is currently unavailable.
- No support for resource transfers: I want this to work seamlessly with other file resources for other uses, so I'm waiting for those specs to be finalized.

## Getting started

1. `npm install react-native-multipeer@latest --save`
2. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
3. Go to `node_modules` ➜ `react-native-multipeer` and add `RCTMultipeerConnectivity.xcodeproj`
4. In XCode, in the project navigator, select your project. Add `libRCTMultipeerConnectivity.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
5. Click `RCTMultipeerConnectivity.xcodeproj` in the project navigator and go the `Build Settings` tab. Make sure 'All' is toggled on (instead of 'Basic'). Look for `Header Search Paths` and make sure it contains both `$(SRCROOT)/../react-native/React` and `$(SRCROOT)/../../React` - mark both as `recursive`.
5. Run your project (`Cmd+R`)

## Usage

All you need is to `require` the `react-native-multipeer` module and then you can start using the singleton instance.

```javascript
var React = require('react-native');
var {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  TouchableHighlight
} = React;
var MultipeerConnectivity = require('react-native-multipeer');

function getStateFromSources() {
  var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
    return {
      dataSource: ds.cloneWithRows(_.values(MultipeerConnectivity.getAllPeers()))
    };
}

var peerApp = React.createClass({
  getInitialState: function() {
    return getStateFromSources()
  },
  componentDidMount() {
    MultipeerConnectivity.on('peerFound', this._onChange());
    MultipeerConnectivity.on('peerLost', this._onChange());
    MultipeerConnectivity.on('invite', ((event) => {
      // Automatically accept invitations
      MultipeerConnectivity.rsvp(event.invite.id, true);
    }).bind(this));
    MultipeerConnectivity.on('peerConnected', (event) => {
      alert(event.peer.id + ' connected!');
    });
    MultipeerConnectivity.advertise('channel1', { name: 'User-' + Math.round(1e6 * Math.random()) });
    MultipeerConnectivity.browse('channel1');
  },

  renderRow(peer) {
    return (
      <TouchableHighlight onPress={this.invite.bind(this, peer)} style={styles.row}>
        <View>
          <Text>{peer.name}</Text>
        </View>
      </TouchableHighlight>
    );
  },

  render: function() {
    return (
      <View style={styles.container}>
        <ListView
          style={styles.peers}
          dataSource={this.state.dataSource}
          renderRow={this.renderRow}
        />
      </View>
    );
  },

  _invite(peer) {
    MultipeerConnectivity.invite(peer.id);
  },

  _onChange() {
    this.setState(getStateFromSources());
  }
});

var styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: 'transparent',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
  },
});

AppRegistry.registerComponent('peerApp', () => peerApp);
```

## `MultipeerConnectivity` methods

### Channels

#### `advertise(channelId, info)`

Allow discovery of yourself as a peer in a given channel. `channelId` can be any string. `info` is an object containing data which will be passed to other peers when you join the channel.

#### `browse(channelId)`

Browse for peers on a given channel.

#### `getAllPeers()`

Gets all the peers in the current channel.

### Sessions

#### `getConnectedPeers()`

Gets all the peers in the current session.

#### `disconnect([callback])`

Disconnect from the current session.

#### `invite(peerId [, callback])`

Invite a peer from your channel into your session.

#### `rsvp(inviteId, accept [, callback])`

Accept/decline a session invitation.

### Communication

#### `broadcast(data [, callback<err>])`

Send data to all connected peers in the current channel.

#### `send(data, recipients [, callback<err>])`

Send data to specific peers in the current channel. `recipients` is an array of peer IDs or `Peer`s.

### `MultipeerConnectivity` Events

`MultipeerConnectivity` inherits from `EventEmitter` - as such the `.on` method is available for listening to important events. Below is a list of those events.

#### `data`

Event properties: `Peer sender`, `data`

Fired when new data is received from `sender`.

#### `peerFound`

Event properties: `peer`

A new peer was found in the current channel.

#### `peerLost`

Event properties: `peer`

A peer left the current channel.

#### `peerConnected`

Event properties: `peer`

A peer has connected to your session.

#### `peerConnecting`

Event properties: `peer`

A peer is connecting to your session.

#### `peerDisconnected`

Event properties: `peer`

A peer disconnected from your session.

#### `invite`

Event properties: `sender`, `invite`

You have been invited to a session.

## `Peer` methods

### Events

#### `connected`

The peer connected to the current session.

#### `connecting`

The peer is connecting to the current session.

#### `disconnected`

The peer disconnected from the current session.

#### `lost`

The peer left the current channel.

## Todo
These are some features I think would be important/beneficial to have included with this module. Pull requests welcome!

- [ ] Stream support
- [ ] Resource transfers


text:
package ru.job4j;
/**
* Class Calculate to illustrate JavaDoc comments.
* @author rzhedunov
* @since 2017-09-13
* @version 2.0
*/

public class Calculate {

	/**
	* Main method of Calculate class.
	* @param args is first arg.
	*/
	public static void main(String[] args) {
		System.out.println("Hello, world!");
	}

	/**
	* Method echo.
	* @param name is a name of user.
	* @return Echo plus name of user given.
	*/
	public String echo(String name) {
	    return "Echo, echo, echo : " + name;
	}
}


text:
@interface UnmountDMG : Task { }

@property	NSString	*filePath;

@end


text:
package com.greenpepper.confluence;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.Serializable;
import java.util.Properties;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.MappingJsonFactory;
import com.greenpepper.server.configuration.DefaultServerProperties;

/**
 *
GreenPepperServerConfiguration class.

 *
 * @author oaouattara
 * @version $Id: $Id
 */
public class GreenPepperServerConfiguration implements Serializable {

    private static final MappingJsonFactory jsonF = new MappingJsonFactory();

    private static final long serialVersionUID = 1L;

    private boolean isSetupComplete;
	private Properties properties = new DefaultServerProperties();

    /**
     *
isSetupComplete.

     *
     * @return a boolean.
     */
    public boolean isSetupComplete()
	{
		return isSetupComplete;
	}

    /**
     *
setSetupComplete.

     *
     * @param setupComplete a boolean.
     */
    public void setSetupComplete(boolean setupComplete)
	{
		isSetupComplete = setupComplete;
	}

    /**
     *
Getter for the field properties.

     *
     * @return a {@link java.util.Properties} object.
     */
    public Properties getProperties()
	{
		return properties;
	}

    /**
     *
Setter for the field properties.

     *
     * @param properties a {@link java.util.Properties} object.
     */
    public void setProperties(Properties properties)
	{
		this.properties = properties;
	}

	/**
	 * We use this method to store the Configuration as JSON
	 *
	 * @return a {@link java.lang.String} object.
	 */
	public String toString()
	{
	    try {
	        ByteArrayOutputStream out = new ByteArrayOutputStream();
            JsonGenerator createGenerator = jsonF.createGenerator(out);
            createGenerator.writeObject(this);
            createGenerator.flush();
            createGenerator.close();
            String output = new String(out.toByteArray());
            return output;
        } catch (IOException e) {
            throw new RuntimeException("Unable to convert this instance to a JSON using Jackson, fallbacking to manual", e);
        }
	}

	/**
	 *
fromString.

	 *
	 * @param input a {@link java.lang.String} object.
	 * @return a {@link com.greenpepper.confluence.GreenPepperServerConfiguration} object.
	 * @throws com.fasterxml.jackson.core.JsonParseException if any.
	 * @throws java.io.IOException if any.
	 */
	public static GreenPepperServerConfiguration fromString(String input) throws JsonParseException, IOException {
	    JsonParser parser = jsonF.createParser(input);
	    TypeReference<GreenPepperServerConfiguration> ref = new TypeReference<GreenPepperServerConfiguration>() { };
	    return parser.readValueAs(ref);
	}
}


text:
class PackageNode;
class PackageControlsNode;

class RemoveImportedPackageCommand : public QEPackageCommand
{
public:
    RemoveImportedPackageCommand(PackageNode* package, PackageNode* importedPackage);

    void Redo() override;
    void Undo() override;

private:
    DAVA::RefPtr<PackageNode> importedPackage;
    int index = -1;
};


text:
package org.batfish.specifier;

import static com.google.common.base.MoreObjects.firstNonNull;

import com.google.common.base.MoreObjects;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.stream.Collectors;
import org.batfish.datamodel.AclIpSpace;
import org.batfish.datamodel.EmptyIpSpace;
import org.batfish.datamodel.IpSpace;
import org.batfish.datamodel.IpWildcard;
import org.batfish.referencelibrary.AddressGroup;

/**
 * An {@link IpSpaceAssignmentSpecifier} that looks up an {@link AddressGroup} in a {@link
 * org.batfish.referencelibrary.ReferenceBook}.
 */
public final class ReferenceAddressGroupIpSpaceSpecifier implements IpSpaceSpecifier {
  private final String _addressGroupName;
  private final String _bookName;

  public ReferenceAddressGroupIpSpaceSpecifier(String addressGroupName, String bookName) {
    _addressGroupName = addressGroupName;
    _bookName = bookName;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (!(o instanceof ReferenceAddressGroupIpSpaceSpecifier)) {
      return false;
    }
    ReferenceAddressGroupIpSpaceSpecifier other = (ReferenceAddressGroupIpSpaceSpecifier) o;
    return Objects.equals(_addressGroupName, other._addressGroupName)
        && Objects.equals(_bookName, other._bookName);
  }

  @Override
  public int hashCode() {
    return Objects.hash(_addressGroupName, _bookName);
  }

  @Override
  public IpSpace resolve(SpecifierContext ctxt) {
    return computeIpSpace(_addressGroupName, _bookName, ctxt);
  }

  /**
   * Computes the IpSpace in the address group. Returns {@link EmptyIpSpace} if the addressgroup is
   * empty.
   *
   * @throws NoSuchElementException if {@code bookName} does not exist or if {@code
   *     addressGroupName} or one of its descendants do not exist in the Reference Book.
   */
  public static IpSpace computeIpSpace(
      String addressGroupName, String bookName, SpecifierContext ctxt) {
    return firstNonNull(
        AclIpSpace.union(
            ctxt
                .getReferenceBook(bookName)
                .orElseThrow(
                    () -> new NoSuchElementException("ReferenceBook '" + bookName + "' not found"))
                .getAddressesRecursive(addressGroupName)
                .stream()
                .map(IpWildcard::toIpSpace)
                .collect(Collectors.toList())),
        EmptyIpSpace.INSTANCE);
  }

  @Override
  public String toString() {
    return MoreObjects.toStringHelper(getClass())
        .add("addressGroup", _addressGroupName)
        .add("referenceBook", _bookName)
        .toString();
  }
}


text:
<?php

namespace ZfTable\Table\Exception;

interface ExceptionInterface
{

}


text:
package v1

import (
	"github.com/tektoncd/pipeline/pkg/apis/pipeline"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"knative.dev/pkg/kmeta"
)

// +genclient
// +genclient:noStatus
// +genreconciler:krshapedlogic=false
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Task represents a collection of sequential steps that are run as part of a
// Pipeline using a set of inputs and producing a set of outputs. Tasks execute
// when TaskRuns are created that provide the input parameters and resources and
// output resources the Task requires.
//
// +k8s:openapi-gen=true
type Task struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata"`

	// Spec holds the desired state of the Task from the client
	// +optional
	Spec TaskSpec `json:"spec"`
}

var _ kmeta.OwnerRefable = (*Task)(nil)

// GetGroupVersionKind implements kmeta.OwnerRefable.
func (*Task) GetGroupVersionKind() schema.GroupVersionKind {
	return SchemeGroupVersion.WithKind(pipeline.TaskControllerName)
}

// TaskSpec defines the desired state of Task.
type TaskSpec struct {

	// Params is a list of input parameters required to run the task. Params
	// must be supplied as inputs in TaskRuns unless they declare a default
	// value.
	// +optional
	// +listType=atomic
	Params []ParamSpec `json:"params,omitempty"`

	// Description is a user-facing description of the task that may be
	// used to populate a UI.
	// +optional
	Description string `json:"description,omitempty"`

	// Steps are the steps of the build; each step is run sequentially with the
	// source mounted into /workspace.
	// +listType=atomic
	Steps []Step `json:"steps,omitempty"`

	// Volumes is a collection of volumes that are available to mount into the
	// steps of the build.
	// +listType=atomic
	Volumes []corev1.Volume `json:"volumes,omitempty"`

	// StepTemplate can be used as the basis for all step containers within the
	// Task, so that the steps inherit settings on the base container.
	StepTemplate *StepTemplate `json:"stepTemplate,omitempty"`

	// Sidecars are run alongside the Task's step containers. They begin before
	// the steps start and end after the steps complete.
	// +listType=atomic
	Sidecars []Sidecar `json:"sidecars,omitempty"`

	// Workspaces are the volumes that this Task requires.
	// +listType=atomic
	Workspaces []WorkspaceDeclaration `json:"workspaces,omitempty"`

	// Results are values that this Task can output
	// +listType=atomic
	Results []TaskResult `json:"results,omitempty"`
}

// TaskList contains a list of Task
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type TaskList struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Task `json:"items"`
}


text:
package com.googlecode.hibernate.memcached.dangamemcached;

import com.danga.MemCached.ErrorHandler;
import com.danga.MemCached.MemCachedClient;
import com.danga.MemCached.SockIOPool;
import com.googlecode.hibernate.memcached.Memcache;
import com.googlecode.hibernate.memcached.MemcacheClientFactory;
import com.googlecode.hibernate.memcached.PropertiesHelper;
import org.hibernate.cache.CacheException;

/**
 * DOCUMENT ME!
 *
 * @author George Wei
 */
public class DangaMemcacheClientFactory implements MemcacheClientFactory {

    public static final String PROP_PREFIX = "hibernate.memcached.";

    public static final String PROP_COMPRESS_ENABLE = PROP_PREFIX + "compressEnable";
    public static final String PROP_DEFAULT_ENCODING = PROP_PREFIX + "defaultEncoding";
    public static final String PROP_POOL_NAME = PROP_PREFIX + "poolName";
    public static final String PROP_ERROR_HANDLER = PROP_PREFIX + "errorHandler";
    public static final String PROP_SERVERS = PROP_PREFIX + "servers";
    public static final String PROP_WEIGHTS = PROP_PREFIX + "weights";
    public static final String PROP_INIT_CONN = PROP_PREFIX + "initConn";
    public static final String PROP_MIN_CONN = PROP_PREFIX + "minConn";
    public static final String PROP_MAX_CONN = PROP_PREFIX + "maxConn";
    public static final String PROP_MAX_IDLE = PROP_PREFIX + "maxIdle";
    public static final String PROP_MAINT_SLEEP = PROP_PREFIX + "maintSleep";
    public static final String PROP_SOCKET_TIMEOUT = PROP_PREFIX + "socketTimeout";
    public static final String PROP_SOCKET_CONNECT_TIMEOUT = PROP_PREFIX + "socketConnectTimeout";

    public static final boolean DEFAULT_COMPRESS_ENABLE = true;
    public static final String DEFAULT_DEFAULT_ENCODING = "UTF-8";
    public static final String DEFAULT_POOL_NAME = "default";
    public static final String DEFAULT_ERROR_HANDLER = "com.googlecode.hibernate.memcached.dangamemcached.SimpleErrorHandler";
    public static final String DEFAULT_SERVERS = "localhost:11211";
    public static final int DEFAULT_INIT_CONN = 1;
    public static final int DEFAULT_MIN_CONN = 1;
    public static final int DEFAULT_MAX_CONN = 10;
    public static final int DEFAULT_MAX_IDLE = 1000 * 60 * 5; //5 minutes
    public static final int DEFAULT_MAINT_SLEEP = 1000 * 30;     //30 seconds
    public static final int DEFAULT_SOCKET_TIMEOUT = 1000 * 30;     //30 seconds
    public static final int DEFAULT_SOCKET_CONNECT_TIMEOUT = 1000 * 3;      //3 seconds

    private PropertiesHelper properties;

    public DangaMemcacheClientFactory(PropertiesHelper properties) {
        this.properties = properties;
    }

    public Memcache createMemcacheClient() throws Exception {
        String poolName = getPoolName();

        // grab an instance of our connection pool
        SockIOPool pool = SockIOPool.getInstance(poolName);

        // set the servers and the weights
        pool.setServers(getServers());
        pool.setWeights(getWeights());

        // set some basic pool settings
        pool.setInitConn(getInitConn());
        pool.setMinConn(getMinConn());
        pool.setMaxConn(getMaxConn());
        pool.setMaxIdle(getMaxIdle());

        // set the sleep for the maint thread
        // it will wake up every x seconds and
        // maintain the pool size
        pool.setMaintSleep(getMaintSleep());

        // set some TCP settings
        pool.setNagle(false);
        pool.setSocketTO(getSocketTimeout());
        pool.setSocketConnectTO(getSocketConnectTimeout());

        // initialize the connection pool
        pool.initialize();

        MemCachedClient client =
                new MemCachedClient(
                        getClassLoader(),
                        getErrorHandler(),
                        poolName);
        client.setCompressEnable(isCompressEnable());
        client.setDefaultEncoding(getDefaultEncoding());

        return new DangaMemcache(client, poolName);
    }

    public ClassLoader getClassLoader() {
        return Thread.currentThread().getContextClassLoader();
    }

    public boolean isCompressEnable() {
        return properties.getBoolean(PROP_COMPRESS_ENABLE, DEFAULT_COMPRESS_ENABLE);
    }

    public String getDefaultEncoding() {
        return properties.get(PROP_DEFAULT_ENCODING, DEFAULT_DEFAULT_ENCODING);
    }

    public String getPoolName() {
        return properties.get(PROP_POOL_NAME, DEFAULT_POOL_NAME);
    }

    public ErrorHandler getErrorHandler() {
        String errorHandlerName =
                properties.get(PROP_ERROR_HANDLER, DEFAULT_ERROR_HANDLER);

        ErrorHandler errorHandler;
        try {
            errorHandler =
                    (ErrorHandler) Class.forName(errorHandlerName).newInstance();
        } catch (ClassNotFoundException e) {
            throw new CacheException(
                    "Unable to find error handler class [" + errorHandlerName + "]", e);
        } catch (IllegalAccessException e) {
            throw new CacheException(
                    "Illegally accessed error handler class [" + errorHandlerName + "]", e);
        } catch (InstantiationException e) {
            throw new CacheException(
                    "Failed to instantiate error handler class [" + errorHandlerName + "]", e);
        }

        return errorHandler;
    }

    public String[] getServers() {
        return properties.get(PROP_SERVERS, DEFAULT_SERVERS).split(" ");
    }

    public Integer[] getWeights() {
        String[] servers = getServers();
        Integer[] weights = new Integer[servers.length];
        String weightsValue = properties.get(PROP_WEIGHTS);

        if (weightsValue == null || "".equals(weightsValue)) {
            for (int i = 0; i < weights.length; i++)
                weights[i] = 1;
        } else {
            String[] weightsStrings = weightsValue.split(" ");
            if (weightsStrings.length == servers.length) {
                for (int i = 0; i < weights.length; i++)
                    weights[i] = new Integer(weightsStrings[i]);
            } else
                throw new CacheException(
                        "Count of weight number mismatch count of server");
        }

        return weights;
    }

    public int getInitConn() {
        return properties.getInt(PROP_INIT_CONN, DEFAULT_INIT_CONN);
    }

    public int getMinConn() {
        return properties.getInt(PROP_MIN_CONN, DEFAULT_MIN_CONN);
    }

    public int getMaxConn() {
        return properties.getInt(PROP_MAX_CONN, DEFAULT_MAX_CONN);
    }

    public int getMaxIdle() {
        return properties.getInt(PROP_MAX_IDLE, DEFAULT_MAX_IDLE);
    }

    public int getMaintSleep() {
        return properties.getInt(PROP_MAINT_SLEEP, DEFAULT_MAINT_SLEEP);
    }

    public int getSocketTimeout() {
        return properties.getInt(PROP_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
    }

    public int getSocketConnectTimeout() {
        return properties.getInt(PROP_SOCKET_CONNECT_TIMEOUT, DEFAULT_SOCKET_CONNECT_TIMEOUT);
    }
}


text:
root_group = value_for_platform(
  ["openbsd", "freebsd", "mac_os_x"] => { "default" => "wheel" },
  "default" => "root"
)

chef_node_name = Chef::Config[:node_name] == node["fqdn"] ? false : Chef::Config[:node_name]

%w{run_path cache_path backup_path log_dir}.each do |key|
  directory node['chef_client'][key] do
    recursive true
    owner "root"
    group root_group
    mode 0755
  end
end

template "/etc/chef/client.rb" do
  source "client.rb.erb"
  owner "root"
  group root_group
  mode 0644
  variables :chef_node_name => chef_node_name
  notifies :create, "ruby_block[reload_client_config]"
end

ruby_block "reload_client_config" do
  block do
    Chef::Config.from_file("/etc/chef/client.rb")
  end
  action :nothing
end


text:
package com.amazonaws.eclipse.core.plugin;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.Job;

public abstract class AbstractAwsJobWizard extends AbstractAwsWizard {

    protected AbstractAwsJobWizard(String windowTitle) {
        super(windowTitle);
    }

    @Override
    public final boolean performFinish() {

        beforeExecution();

        Job awsJob = new Job(getJobTitle()) {
            @Override
            protected IStatus run(IProgressMonitor monitor) {
                IStatus status = doFinish(monitor);
                afterExecution(status);
                return status;
            }
        };
        awsJob.setUser(true);
        awsJob.schedule();
        return true;
    }
}


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

/**
 * @constructor
 * @extends {WebInspector.SDKModel}
 * @param {!WebInspector.Target} target
 */
WebInspector.AnimationModel = function(target)
{
    WebInspector.SDKModel.call(this, WebInspector.AnimationModel, target);
    this._agent = target.animationAgent();
    target.registerAnimationDispatcher(new WebInspector.AnimationDispatcher(this));
}

WebInspector.AnimationModel.Events = {
    AnimationPlayerCreated: "AnimationPlayerCreated"
}

WebInspector.AnimationModel.prototype = {
    /**
     * @param {!DOMAgent.NodeId} nodeId
     * @param {boolean} showSubtreeAnimations
     * @param {function(?Array.<!WebInspector.AnimationModel.AnimationPlayer>)} userCallback
     */
    getAnimationPlayers: function(nodeId, showSubtreeAnimations, userCallback)
    {
        /**
         * @param {?Protocol.Error} error
         * @param {!Array.<!AnimationAgent.AnimationPlayer>} payloads
         * @this {WebInspector.AnimationModel}
         */
        function resultCallback(error, payloads)
        {
            if (error) {
                userCallback(null);
                return;
            }
            userCallback(payloads.map(WebInspector.AnimationModel.AnimationPlayer.parsePayload.bind(null, this.target())));
        }

        this._agent.getAnimationPlayersForNode(nodeId, showSubtreeAnimations, resultCallback.bind(this));
    },

    /**
     * @param {!AnimationAgent.AnimationPlayer} payload
     * @param {boolean} resetTimeline
     */
    animationPlayerCreated: function(payload, resetTimeline)
    {
        var player = WebInspector.AnimationModel.AnimationPlayer.parsePayload(this.target(), payload);
        this.dispatchEventToListeners(WebInspector.AnimationModel.Events.AnimationPlayerCreated, { "player": player, "resetTimeline": resetTimeline });
    },

    ensureEnabled: function()
    {
        if (this._enabled)
            return;
        this._agent.enable();
        this._enabled = true;
    },

    __proto__: WebInspector.SDKModel.prototype
}

/**
 * @constructor
 * @extends {WebInspector.SDKObject}
 * @param {!WebInspector.Target} target
 * @param {!AnimationAgent.AnimationPlayer} payload
 */
WebInspector.AnimationModel.AnimationPlayer = function(target, payload)
{
    WebInspector.SDKObject.call(this, target);
    this._payload = payload;
    this._source = new WebInspector.AnimationModel.AnimationNode(this.target(), this._payload.source);
}

/**
 * @param {!WebInspector.Target} target
 * @param {!AnimationAgent.AnimationPlayer} payload
 * @return {!WebInspector.AnimationModel.AnimationPlayer}
 */
WebInspector.AnimationModel.AnimationPlayer.parsePayload = function(target, payload)
{
    return new WebInspector.AnimationModel.AnimationPlayer(target, payload);
}

WebInspector.AnimationModel.AnimationPlayer.prototype = {
    /**
     * @return {!AnimationAgent.AnimationPlayer}
     */
    payload: function()
    {
        return this._payload;
    },

    /**
     * @return {string}
     */
    id: function()
    {
        return this._payload.id;
    },

    /**
     * @return {string}
     */
    name: function()
    {
        return this.source().name();
    },

    /**
     * @return {boolean}
     */
    paused: function()
    {
        return this._payload.pausedState;
    },

    /**
     * @return {string}
     */
    playState: function()
    {
        return this._payload.playState;
    },

    /**
     * @return {number}
     */
    playbackRate: function()
    {
        return this._payload.playbackRate;
    },

    /**
     * @return {number}
     */
    startTime: function()
    {
        return this._payload.startTime;
    },

    /**
     * @return {number}
     */
    endTime: function()
    {
        if (!this.source().iterations)
            return Infinity;
        return this.startTime() + this.source().delay() + this.source().duration() * this.source().iterations() + this.source().endDelay();
    },

    /**
     * @return {number}
     */
    currentTime: function()
    {
        return this._payload.currentTime;
    },

    /**
     * @return {!WebInspector.AnimationModel.AnimationNode}
     */
    source: function()
    {
        return this._source;
    },

    /**
     * @return {string}
     */
    type: function()
    {
        return this._payload.type;
    },

    /**
     * @param {!WebInspector.AnimationModel.AnimationPlayer} animation
     * @return {boolean}
     */
    overlaps: function(animation)
    {
        // Infinite animations
        if (!this.source().iterations() || !animation.source().iterations())
            return true;

        var firstAnimation = this.startTime() < animation.startTime() ? this : animation;
        var secondAnimation = firstAnimation === this ? animation : this;
        return firstAnimation.endTime() >= secondAnimation.startTime();
    },

    __proto__: WebInspector.SDKObject.prototype
}

/**
 * @constructor
 * @extends {WebInspector.SDKObject}
 * @param {!WebInspector.Target} target
 * @param {!AnimationAgent.AnimationNode} payload
 */
WebInspector.AnimationModel.AnimationNode = function(target, payload)
{
    WebInspector.SDKObject.call(this, target);
    this._payload = payload;
    if (payload.keyframesRule)
        this._keyframesRule = new WebInspector.AnimationModel.KeyframesRule(target, payload.keyframesRule);
    this._delay = this._payload.delay;
    this._duration = this._payload.duration;
}

WebInspector.AnimationModel.AnimationNode.prototype = {
    /**
     * @return {number}
     */
    delay: function()
    {
        return this._delay;
    },

    /**
     * @param {number} delay
     */
    setDelay: function(delay)
    {
        this._delay = delay;
    },

    /**
     * @return {number}
     */
    endDelay: function()
    {
        return this._payload.endDelay;
    },

    /**
     * @return {number}
     */
    playbackRate: function()
    {
        return this._payload.playbackRate;
    },

    /**
     * @return {number}
     */
    iterationStart: function()
    {
        return this._payload.iterationStart;
    },

    /**
     * @return {number}
     */
    iterations: function()
    {
        return this._payload.iterations || Infinity;
    },

    /**
     * @return {number}
     */
    duration: function()
    {
        return this._duration;
    },

    setDuration: function(duration)
    {
        this._duration = duration;
    },

    /**
     * @return {string}
     */
    direction: function()
    {
        return this._payload.direction;
    },

    /**
     * @return {string}
     */
    fill: function()
    {
        return this._payload.fill;
    },

    /**
     * @return {string}
     */
    name: function()
    {
        return this._payload.name;
    },

    /**
     * @return {!WebInspector.DeferredDOMNode}
     */
    deferredNode: function()
    {
        return new WebInspector.DeferredDOMNode(this.target(), this.backendNodeId());
    },

    /**
     * @return {number}
     */
    backendNodeId: function()
    {
        return this._payload.backendNodeId;
    },

    /**
     * @return {?WebInspector.AnimationModel.KeyframesRule}
     */
    keyframesRule: function()
    {
        return this._keyframesRule;
    },

    /**
     * @return {string}
     */
    easing: function()
    {
        return this._payload.easing;
    },

    __proto__: WebInspector.SDKObject.prototype
}

/**
 * @constructor
 * @extends {WebInspector.SDKObject}
 * @param {!WebInspector.Target} target
 * @param {!AnimationAgent.KeyframesRule} payload
 */
WebInspector.AnimationModel.KeyframesRule = function(target, payload)
{
    WebInspector.SDKObject.call(this, target);
    this._payload = payload;
    this._keyframes = this._payload.keyframes.map(function (keyframeStyle) {
        return new WebInspector.AnimationModel.KeyframeStyle(target, keyframeStyle);
    });
}

WebInspector.AnimationModel.KeyframesRule.prototype = {
    /**
     * @param {!Array.<!AnimationAgent.KeyframeStyle>} payload
     */
    _setKeyframesPayload: function(payload)
    {
        this._keyframes = payload.map(function (keyframeStyle) {
            return new WebInspector.AnimationModel.KeyframeStyle(this._target, keyframeStyle);
        });
    },

    /**
     * @return {string|undefined}
     */
    name: function()
    {
        return this._payload.name;
    },

    /**
     * @return {!Array.<!WebInspector.AnimationModel.KeyframeStyle>}
     */
    keyframes: function()
    {
        return this._keyframes;
    },

    __proto__: WebInspector.SDKObject.prototype
}

/**
 * @constructor
 * @extends {WebInspector.SDKObject}
 * @param {!WebInspector.Target} target
 * @param {!AnimationAgent.KeyframeStyle} payload
 */
WebInspector.AnimationModel.KeyframeStyle = function(target, payload)
{
    WebInspector.SDKObject.call(this, target);
    this._payload = payload;
    this._style = WebInspector.CSSStyleDeclaration.parsePayload(this.target().cssModel, payload.style);
    this._offset = this._payload.offset;
}

WebInspector.AnimationModel.KeyframeStyle.prototype = {
    /**
     * @return {string}
     */
    offset: function()
    {
        return this._offset;
    },

    /**
     * @param {number} offset
     */
    setOffset: function(offset)
    {
        this._offset = offset * 100 + "%";
    },

    /**
     * @return {number}
     */
    offsetAsNumber: function()
    {
        return parseFloat(this._offset) / 100;
    },

    /**
     * @return {!WebInspector.CSSStyleDeclaration}
     */
    style: function()
    {
        return this._style;
    },

    /**
     * @return {string}
     */
    easing: function()
    {
        return this._payload.easing;
    },

    __proto__: WebInspector.SDKObject.prototype
}

/**
 * @constructor
 * @implements {AnimationAgent.Dispatcher}
 */
WebInspector.AnimationDispatcher = function(animationModel)
{
    this._animationModel = animationModel;
}

WebInspector.AnimationDispatcher.prototype = {
    /**
     * @override
     * @param {!AnimationAgent.AnimationPlayer} payload
     * @param {boolean} resetTimeline
     */
    animationPlayerCreated: function(payload, resetTimeline)
    {
        this._animationModel.animationPlayerCreated(payload, resetTimeline);
    }
}


text:
<?= App::$page_title; ?>

            Any questions? You know what to do and how to do it, so get to it.

    <form role="form" method="post" id="contact-form">

            Name
            <input type="text" class="form-control" id="name" name="name" placeholder="Name">

            Email
            <input type="email" class="form-control" id="email" name="email" placeholder="Email">

            Subject
            <input type="text" class="form-control" id="subject" name="subject" placeholder="Subject">

            Message
            <textarea class="form-control" id="message" name="message" rows="5" placeholder="Message"></textarea>

            <input type="submit" name="mail" class="btn btn-lg btn-primary" value="Submit your message!">

    </form>


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="56dp"
    app:cardPreventCornerOverlap="true"
    app:cardUseCompatPadding="true"
    app:cardElevation="@dimen/card_elevation">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:orientation="vertical">

        <TextView
            android:id="@+id/track_date"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            android:ellipsize="end"
            android:singleLine="true"
            android:textColor="@color/body_text_2"
            android:textAppearance="@style/TextAppearance.AppCompat.Small"/>

    </LinearLayout>

    <ProgressBar
        android:id="@+id/motions_loading_progress"
        android:layout_width="24dp"
        android:layout_height="24dp"
        android:layout_gravity="center"
        android:indeterminate="false"
        android:indeterminateDrawable="@drawable/data_syncing_progress"
        android:elevation="8dp"
        android:visibility="invisible" />

</android.support.v7.widget.CardView>


text:
/*-
 * -\-\-
 * rkt-launcher
 * --
 *
 * --
 * 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.
 * -/-/-
 */
package io.honnix.rkt.launcher.command.image;

import static io.honnix.rkt.launcher.command.image.Image.image;

import io.honnix.rkt.launcher.command.CommandWithArgs;
import io.honnix.rkt.launcher.exception.RktUnexpectedOutputException;
import io.honnix.rkt.launcher.model.schema.ImageManifest;
import io.honnix.rkt.launcher.options.Options;
import io.honnix.rkt.launcher.output.image.CatManifestOutput;
import io.honnix.rkt.launcher.util.Json;
import io.norberg.automatter.AutoMatter;
import java.io.IOException;
import java.util.List;
import java.util.Optional;

@AutoMatter
public interface CatManifest extends CommandWithArgs<Options, CatManifestOutput> {

  @Override
  default Optional<Options> options() {
    return Optional.of(Options.NULL);
  }

  @Override
  default List<String> asList() {
    return image(asList("cat-manifest"));
  }

  @Override
  default CatManifestOutput parse(final String output) {
    try {
      return CatManifestOutput.builder()
          .imageManifest(Json.deserialize(output, ImageManifest.class))
          .build();
    } catch (IOException e) {
      throw new RktUnexpectedOutputException("failed parsing JSON output", e);
    }
  }

  static CatManifestBuilder builder() {
    return new CatManifestBuilder();
  }
}


text:
using LibHipChat.Domain.Interfaces;
using LibHipChat.Domain.Services;
using StructureMap.Configuration.DSL;

namespace LibHipChat.Domain.IoC
{
    public class LibHipChatRegistry : Registry
    {
        public LibHipChatRegistry()
        {
            For(typeof (ILogger<>)).Use(typeof (Log4NetLogger<>));
            For(typeof (ILogConfigurator)).Use(typeof (LogConfigurator));
            For(typeof (ILogLocationProvider)).Use(typeof (LogLocationProvider));
            For<IHipChatProxy>().Use<HipChatProxy>();

        }
    }
}


text:
just a project to verify you can embedded slang : http://www.openscore.io/

[![Build Status](https://travis-ci.org/meirwah/test-slang-embedded.svg?branch=master)](https://travis-ci.org/meirwah/test-slang-embedded)


text:
package git

import (
	"bytes"
	"io"
	"path/filepath"
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestGetFormatPatch(t *testing.T) {
	bareRepo1Path := filepath.Join(testReposDir, "repo1_bare")
	clonedPath, err := cloneRepo(t, bareRepo1Path)
	if err != nil {
		assert.NoError(t, err)
		return
	}

	repo, err := openRepositoryWithDefaultContext(clonedPath)
	if err != nil {
		assert.NoError(t, err)
		return
	}
	defer repo.Close()

	rd := &bytes.Buffer{}
	err = repo.GetPatch("8d92fc95^", "8d92fc95", rd)
	if err != nil {
		assert.NoError(t, err)
		return
	}

	patchb, err := io.ReadAll(rd)
	if err != nil {
		assert.NoError(t, err)
		return
	}

	patch := string(patchb)
	assert.Regexp(t, "^From 8d92fc95", patch)
	assert.Contains(t, patch, "Subject: [PATCH] Add file2.txt")
}

func TestReadPatch(t *testing.T) {
	// Ensure we can read the patch files
	bareRepo1Path := filepath.Join(testReposDir, "repo1_bare")
	repo, err := openRepositoryWithDefaultContext(bareRepo1Path)
	if err != nil {
		assert.NoError(t, err)
		return
	}
	defer repo.Close()
	// This patch doesn't exist
	noFile, err := repo.ReadPatchCommit(0)
	assert.Error(t, err)

	// This patch is an empty one (sometimes it's a 404)
	noCommit, err := repo.ReadPatchCommit(1)
	assert.Error(t, err)

	// This patch is legit and should return a commit
	oldCommit, err := repo.ReadPatchCommit(2)
	if err != nil {
		assert.NoError(t, err)
		return
	}

	assert.Empty(t, noFile)
	assert.Empty(t, noCommit)
	assert.Len(t, oldCommit, 40)
	assert.True(t, oldCommit == "6e8e2a6f9efd71dbe6917816343ed8415ad696c3")
}

func TestReadWritePullHead(t *testing.T) {
	// Ensure we can write SHA1 head corresponding to PR and open them
	bareRepo1Path := filepath.Join(testReposDir, "repo1_bare")

	// As we are writing we should clone the repository first
	clonedPath, err := cloneRepo(t, bareRepo1Path)
	if err != nil {
		assert.NoError(t, err)
		return
	}

	repo, err := openRepositoryWithDefaultContext(clonedPath)
	if err != nil {
		assert.NoError(t, err)
		return
	}
	defer repo.Close()

	// Try to open non-existing Pull
	_, err = repo.GetRefCommitID(PullPrefix + "0/head")
	assert.Error(t, err)

	// Write a fake sha1 with only 40 zeros
	newCommit := "feaf4ba6bc635fec442f46ddd4512416ec43c2c2"
	err = repo.SetReference(PullPrefix+"1/head", newCommit)
	if err != nil {
		assert.NoError(t, err)
		return
	}

	// Read the file created
	headContents, err := repo.GetRefCommitID(PullPrefix + "1/head")
	if err != nil {
		assert.NoError(t, err)
		return
	}

	assert.Len(t, headContents, 40)
	assert.True(t, headContents == newCommit)

	// Remove file after the test
	err = repo.RemoveReference(PullPrefix + "1/head")
	assert.NoError(t, err)
}


text:
from django.conf.urls import patterns, url

urlpatterns = patterns(
    'triodia.views',
    url(r'^$', 'query_form', name='query_form'),

)


text:
layout: feature
title: 'Trans'
shortdef: 'Transitivizer'
udver: '2'
---

  Values:
  Yes

`Trans` the transitivizer 'ka' or 'kwa'

### `Yes`: Transitivizer

#### Examples

* _nako kwiɾi tʃã-ka _ "Men are kneading (with a powder) the açaí"

* _en i=wip-ka _ "You made it slide (from the hammock to the floor)"

* _o=atʃino-kwa _ "I sneezed over and over"

## Diffs

### Prague Dependency Treebank

The PDT tagset does not distinguish `Ptan` from `Plur` and `Coll` from `Sing`,
therefore this distinction is not being made in the converted data.