text:
"""Management command to correctly set the state of a bootcamp application"""
from django.core.management.base import BaseCommand

from applications.api import derive_application_state
from applications.management.utils import fetch_bootcamp_run
from applications.models import BootcampApplication
from profiles.api import fetch_user

class Command(BaseCommand):
    """Correctly set the state of a bootcamp application"""

    help = __doc__

    def add_arguments(self, parser):
        parser.add_argument(
            "--user",
            type=str,
            help="The id, email, or username of the User",
            required=True,
        )
        parser.add_argument(
            "--run",
            type=str,
            help="The id, title, or display title of the bootcamp run",
            required=True,
        )

    def handle(self, *args, **options):
        user = fetch_user(options["user"])
        run_property = options["run"]
        bootcamp_run = fetch_bootcamp_run(run_property)
        bootcamp_app = BootcampApplication.objects.get(
            user=user, bootcamp_run=bootcamp_run
        )
        derived_state = derive_application_state(bootcamp_app)

        if bootcamp_app.state != derived_state:
            previous_state = bootcamp_app.state
            bootcamp_app.state = derived_state
            bootcamp_app.save()
            self.stdout.write(
                self.style.SUCCESS(
                    f"Bootcamp application state changed ({previous_state} -> {bootcamp_app.state})"
                )
            )
        else:
            self.stdout.write(
                self.style.SUCCESS(
                    f"Bootcamp application state unchanged ({bootcamp_app.state})"
                )
            )


text:
package com.sun.tools.xjc;

import java.io.Closeable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * A shabby driver to invoke XJC1 or XJC2 depending on the command line switch.
 *
 * <p>
 * This class is compiled with -source 1.2 so that we can report a nice
 * user-friendly "you require Tiger" error message.
 *
 * @author Kohsuke Kawaguchi
 */
public final class XJCFacade {

    private static final String JDK_REQUIRED = "XJC requires Java SE 8 or later. Please download it from http://www.oracle.com/technetwork/java/javase/downloads";

    private XJCFacade() {}

    public static void main(String[] args) throws Throwable {
        String v = "3.0";      // by default, we go 3.0

        for (int i = 0; i < args.length; i++) {
            if (args[i].equals("-source")) {
                if (i + 1 < args.length) {
                    v = parseVersion(args[i + 1]);
                }
            }
        }

        ClassLoader oldContextCl = SecureLoader.getContextClassLoader();
        try {
            ClassLoader cl = SecureLoader.getClassClassLoader(XJCFacade.class);
            SecureLoader.setContextClassLoader(cl);
            Class<?> driver = cl.loadClass("com.sun.tools.xjc.Driver");
            Method mainMethod = driver.getDeclaredMethod("main", String[].class);
            try {
                mainMethod.invoke(null, new Object[]{args});
            } catch (InvocationTargetException e) {
                if (e.getTargetException() != null) {
                    throw e.getTargetException();
                }
            }
        } catch (UnsupportedClassVersionError e) {
            System.err.println(JDK_REQUIRED);
        } finally {
            ClassLoader cl = SecureLoader.getContextClassLoader();
            SecureLoader.setContextClassLoader(oldContextCl);

            //close/cleanup all classLoaders but the one which loaded this class
            while (cl != null && !oldContextCl.equals(cl)) {
                if (cl instanceof Closeable) {
                    //JDK7+, ParallelWorldClassLoader
                    ((Closeable) cl).close();
                }
                cl = SecureLoader.getParentClassLoader(cl);
            }
        }
    }

    public static String parseVersion(String version) {
        // no other versions supported as of now
        return "3.0";
    }
}

redpajama_set_name: RedPajamaGithub


text: <!doctype html>


text:
#ifndef QGSTREAMERMESSAGE_P_H
#define QGSTREAMERMESSAGE_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include <QMetaType>

#include <gst/gst.h>

QT_BEGIN_NAMESPACE

// Required for QDoc workaround
class QString;

class QGstreamerMessage
{
public:
    QGstreamerMessage();
    QGstreamerMessage(GstMessage* message);
    QGstreamerMessage(QGstreamerMessage const& m);
    ~QGstreamerMessage();

    GstMessage* rawMessage() const;

    QGstreamerMessage& operator=(QGstreamerMessage const& rhs);

private:
    GstMessage* m_message;
};

QT_END_NAMESPACE

Q_DECLARE_METATYPE(QGstreamerMessage);

#endif


text:
using System.IO;
using System.Net;
using System.Web;
using System.Web.Hosting;
using AGO.Core;

namespace AGO.WebApiApp
{
	public class HostingEnvironmentService : AbstractService, IEnvironmentService
	{
		#region Interfaces implementation

		public IPAddress EnvironmentIp { get { return IPAddress.Loopback; } }

		public IPAddress ClientIp
		{
			get
			{
				IPAddress result;
				return IPAddress.TryParse(HttpContext.Current.Request.UserHostAddress ?? string.Empty, out result)
					? result
					: IPAddress.Loopback;
			}
		}

		public string ApplicationPath { get { return Path.Combine(HostingEnvironment.ApplicationPhysicalPath, string.Empty); } }

		public string ApplicationAssembliesPath { get { return Path.Combine(HostingEnvironment.ApplicationPhysicalPath, "bin"); } }

		public bool IsPathRooted(string path)
		{
			path = path.TrimSafe();
			return path.StartsWith("~\\") || path.StartsWith("~/") || Path.IsPathRooted(path);
		}

		public string EnvironmentPath(string virtualPath)
		{
			virtualPath = virtualPath.TrimSafe();

			if (virtualPath.StartsWith("\\") || virtualPath.StartsWith("/"))
				virtualPath = virtualPath.AddPrefix("~");

			return virtualPath;
		}

		public string PhysicalPath(string virtualPath)
		{
			return HostingEnvironment.MapPath(EnvironmentPath(virtualPath));
		}

		#endregion
	}
}


text:
class PythonTest:
    def showMessage(self):
        return "Hello world from Python"


text:
"""Base class for Telegram ReplyMarkup Objects"""

from telegram import TelegramObject

class ReplyMarkup(TelegramObject):
    """Base class for Telegram ReplyMarkup Objects"""

    @staticmethod
    def de_json(data):
        pass


text:
<!doctype html>

  <meta content="IE=edge" http-equiv="X-UA-Compatible">
  <meta charset="utf-8">
  <link href="favicon.ico" rel="icon" type="image/ico" />
  <title>The Cocktail Lambdacto</title>

The Cocktail Lambdacto

  <form id="contact-form">

      Dominio
      <select name="domain">
        <option>the-cocktail.com</option>
        <option>thecocktailventures.com</option>
      </select>

      Nombre de contacto
      <input type="text" name="name" required="required" />

      Empresa
      <input type="text" name="company" required="required" />

      Teléfono
      <input type="number" name="phone" class="phone" required="required" />

      Mail
      <input type="email" name="email" required="required" />

      ¿En qué podemos ayudarte?
      <textarea name="message" required="required"></textarea>

      <input type="checkbox" name="cc" value="1" />
      Quiero recibir una copia

      <button type="submit" class="btn">
        Enviar
      </button>

  </form>


text:
package org.n52.v3d.worldviz.demoapplications.ene.earth;

import java.util.ArrayList;
import java.util.List;

import org.n52.v3d.worldviz.dataaccess.load.DatasetLoader;
import org.n52.v3d.worldviz.dataaccess.load.dataset.XmlDataset;
import org.n52.v3d.worldviz.helper.RelativePaths;
import org.n52.v3d.worldviz.extensions.mappers.MpAttrFeature2AttrSymbol;
import org.n52.v3d.worldviz.extensions.mappers.T3dAttrSymbolInstance;
import org.n52.v3d.worldviz.projections.AxisSwitchTransform;
import org.n52.v3d.worldviz.worldscene.VsCartographicSymbolsOnASphereScene;
import org.n52.v3d.worldviz.worldscene.VsCartographicSymbolsScene;
import org.n52.v3d.triturus.gisimplm.GmPoint;
import org.n52.v3d.triturus.t3dutil.T3dVector;
import org.n52.v3d.triturus.vgis.VgAttrFeature;

public class CartographicSymbolsTest2 {

//	private static String attributeName = "INES scale level";
	private static String dataXML = RelativePaths.COUNTRIES_POINT_XML;
	private static String outputFile = "test/CountriesPointSymbols.x3d";

	private static String latAttr= "Latitude";
	private static String lonAttr= "Longitude";

	public static void main(String[] args) {
		long startTime = System.currentTimeMillis();

		XmlDataset countriesPoint = null;

		DatasetLoader countriesPointLoader = new DatasetLoader(dataXML);

		try {
			countriesPoint = countriesPointLoader.loadDataset();
		} catch (Exception e) {
			e.printStackTrace();
		}

		List<VgAttrFeature> features = countriesPoint.getFeatures();

		MpAttrFeature2AttrSymbol symbolMapper = new MpAttrFeature2AttrSymbol();
		List<T3dAttrSymbolInstance> attrSymbols = new ArrayList<T3dAttrSymbolInstance>(
				features.size());

		AxisSwitchTransform axisSwitch = new AxisSwitchTransform();

		for (VgAttrFeature vgAttrFeature : features) {
			// the geometry in THIS case is a point, thus we may cast it
			// normally an instanceOf-check must be done

			double latitude = Double.parseDouble((String)vgAttrFeature.getAttributeValue(latAttr));
			double longitude = Double.parseDouble((String)vgAttrFeature.getAttributeValue(lonAttr));
			GmPoint gmPoint = new GmPoint(longitude, latitude, 0);

			//point in virtual world (axes need to be switched.)
			T3dVector virtualPoint = axisSwitch.transform(gmPoint);

			attrSymbols.add(symbolMapper.createConeSymbol(vgAttrFeature,
					new GmPoint(virtualPoint.getX(), virtualPoint.getY(), virtualPoint.getZ())));
		}

//		MpValue2ScaledSymbol symbolScaleMapper = new MpValue2ScaledSymbol();
//
//		// set palette
//		double[] inputValues = new double[] { minValue, maxValue };
//		double[] outputFactors = new double[] { 0.5, 5 };
//		symbolScaleMapper.setPalette(inputValues, outputFactors);
//
//		MpValue2ColoredSymbol symbolColorMapper = new MpValue2ColoredSymbol();
//		double[] inputValuesForColor = new double[] { minValue, maxValue };
//		T3dColor[] outputColors = new T3dColor[] { new T3dColor(1, 1, 0),
//				new T3dColor(1, 0, 0) };
//		symbolColorMapper.setPalette(inputValuesForColor, outputColors);

		for (int i = 0; i < features.size(); i++) {
			VgAttrFeature vgAttrFeature = features.get(i);

			T3dAttrSymbolInstance t3dAttrSymbolInstance = attrSymbols.get(i);

//			Object attributeValue = vgAttrFeature
//					.getAttributeValue(attributeName);
//
//			AttributeValuePair attrValuePair = new AttributeValuePair(
//					attributeName, attributeValue);
//
//			// TODO scale parameter anpassen und experimentieren
//			T3dAttrSymbolInstance scaledSymbol = symbolScaleMapper.scaleY(
//					t3dAttrSymbolInstance, attrValuePair);

			// grundrissebene kleiner machen!
			t3dAttrSymbolInstance.setxScale(0.1);
			t3dAttrSymbolInstance.setzScale(0.1);
			t3dAttrSymbolInstance.setyScale(3);

//			T3dAttrSymbolInstance scaledColoredSymbol = symbolColorMapper
//					.transform(scaledSymbol, attrValuePair);

			attrSymbols.set(i, t3dAttrSymbolInstance);
		}

		VsCartographicSymbolsOnASphereScene scene = new VsCartographicSymbolsOnASphereScene(
				outputFile);

//		VsCartographicSymbolsScene scene = new VsCartographicSymbolsScene(
//				outputFile);

		for (T3dAttrSymbolInstance attrSymbol : attrSymbols) {

			scene.addCartographicSymbol(attrSymbol);
		}

		scene.setRadius(10);

		scene.generateScene();

		System.out.println("Success!");
		long endTime = System.currentTimeMillis();

		System.out.println("required time: " + (endTime - startTime) / 1000
				+ "s");

	}

}


text:
'use strict';

// Unidadmedidas controller
angular.module('unidadmedidas').controller('UnidadmedidasController', ['$scope', '$stateParams', '$location', 'Authentication', 'Unidadmedidas',
	function($scope, $stateParams, $location, Authentication, Unidadmedidas) {
		$scope.authentication = Authentication;

		// Create new Unidadmedida
		$scope.create = function() {
			// Create new Unidadmedida object
			var unidadmedida = new Unidadmedidas ({
				name: this.name
			});

			// Redirect after save
			unidadmedida.$save(function(response) {
				$location.path('unidadmedidas/' + response._id);

				// Clear form fields
				$scope.name = '';
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

		// Remove existing Unidadmedida
		$scope.remove = function(unidadmedida) {
			if ( unidadmedida ) {
				unidadmedida.$remove();

				for (var i in $scope.unidadmedidas) {
					if ($scope.unidadmedidas [i] === unidadmedida) {
						$scope.unidadmedidas.splice(i, 1);
					}
				}
			} else {
				$scope.unidadmedida.$remove(function() {
					$location.path('unidadmedidas');
				});
			}
		};

		// Update existing Unidadmedida
		$scope.update = function() {
			var unidadmedida = $scope.unidadmedida;

			unidadmedida.$update(function() {
				$location.path('unidadmedidas/' + unidadmedida._id);
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

		// Find a list of Unidadmedidas
		$scope.find = function() {
			$scope.unidadmedidas = Unidadmedidas.query();
		};

		// Find existing Unidadmedida
		$scope.findOne = function() {
			$scope.unidadmedida = Unidadmedidas.get({
				unidadmedidaId: $stateParams.unidadmedidaId
			});
		};
	}
]);


text:
<?php
/**
 * Created by PhpStorm.
 * User: bin.shen
 * Date: 5/31/16
 * Time: 16:23
 */

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Document extends MY_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->load->model('document_model');
    }

    function _remap($method,$params = array()) {
        if(!$this->session->userdata('login_user_id') || in_array(1,$this->session->userdata('login_position_id_array'))) {
            redirect(site_url('/'));
        } else {
            if(!in_array(4,$this->session->userdata('login_position_id_array'))){
                if($method == 'pass_doc'){
                    redirect(site_url('/document/list_doc'));
                    exit();
                }
                if($method == 'list_doc_nopass'){
                    redirect(site_url('/document/list_doc'));
                    exit();
                }
            }
            $position_id = $this->session->userdata('login_position_id_array');
            $this->assign('position_id', $position_id);
            return call_user_func_array(array($this, $method), $params);
        }
    }

    //$typeid 除了用来判断首次进入页面时需要保留的 资料类别外,-1表示我的收藏,-2表示我的发布
    public function list_doc($page=1,$typeid=null) {
        $type = $this->document_model->get_forum_type();
        $data = $this->document_model->list_doc($page,$typeid);
        $this->assign('typeid', $typeid ? $typeid : $this->input->post('type'));
        $type_name = $this->document_model->get_type_name($typeid ? $typeid : $this->input->post('type'));
        $this->assign('type_name', $type_name);
        $this->assign('title', $this->input->post('title') ? trim($this->input->post('title')) : null);
        $this->assign('list_doc', $data);
        $pager = $this->pagination->getPageLink('/document/list_doc', $data['countPage'], $data['numPerPage']);
        $this->assign('pager', $pager);
        $this->assign('type_list', $type);
        $this->display('online_doc.html');
    }

    //待审核列表没有 我的收藏和发布
    public function list_doc_nopass($page=1,$typeid=null) {
        $type = $this->document_model->get_forum_type();
        $data = $this->document_model->list_doc_nopass($page,$typeid);
        $this->assign('typeid', $typeid ? $typeid : $this->input->post('type'));
        $type_name = $this->document_model->get_type_name($typeid ? $typeid : $this->input->post('type'));
        $this->assign('type_name', $type_name);
        $this->assign('title', $this->input->post('title') ? trim($this->input->post('title')) : null);
        $this->assign('list_doc', $data);
        $pager = $this->pagination->getPageLink('/document/list_doc_nopass', $data['countPage'], $data['numPerPage']);
        $this->assign('pager', $pager);
        $this->assign('type_list', $type);
        $this->display('online_doc_nopass.html');
    }

    public function download_data($id){
        $this->document_model->download($id);
    }

    public function view_doc($id) {
        $data = $this->document_model->view_doc($id);
        $recommend = $this->document_model->recomment_doc();  //推荐的文档/
        $house_likes = $this->document_model->house_likes($id);
        $this->assign('recommend', $recommend);
        $this->assign('house_likes', $house_likes);
        $this->assign('data', $data);
        if($data['user_id'] == $this->session->userdata('login_user_id')){
            $this->assign('mydoc', 1);
        }else{
            $this->assign('mydoc', -1);
        }
        if($data['type']==6){
            //$this->document_model->download($id);
            $this->display('data_view.html');
        }else{
            $this->display('doc_view.html');
        }

    }

    public function publish_doc() {
        $type = $this->document_model->get_forum_type();
        $this->assign('type_list', $type);
        $this->display('publish_doc.html');
    }

    public function upload_data(){

        $this->display('upload_data.html');
    }

    public function save_ticket(){
        $res = $this->document_model->save_ticket();
        if(!$this->input->post('id')){
            redirect(site_url('document/list_doc/1/-2'));
            exit();
        }else{
            if(in_array(4,$this->session->userdata('login_position_id_array'))){
                if($res==1){
                    redirect(site_url('/document/list_doc_nopass'));
                    exit();
                }else{
                    redirect(site_url('document/list_doc'));
                    exit();
                }
            }else{
                redirect(site_url('document/list_doc/1/-2'));
                exit();
            }
        }

    }

    public function likes_one_time($id){
        $res = $this->document_model->likes_doc_one_time($id);
        echo json_encode($res);
    }

    public function house_one_time($id){
        $res = $this->document_model->house_doc_one_time($id);
        echo json_encode($res);
    }

    public function save_file(){
        $res = $this->document_model->save_file();
        if($res == 3){
            $type = $this->document_model->get_forum_type();
            $this->assign('type_list', $type);
            $this->assign('title', $this->input->post('title'));
            $this->assign('type', $this->input->post('type'));
            $this->display('upload_data.html');
        }
        else{
            redirect(site_url('document/list_doc/1/-2'));
        }
    }

    public function del_doc($doc_id) {
        $this->document_model->del_doc($doc_id);
        redirect(site_url('/document/list_doc'));
    }

    public function pass_doc($doc_id) {
        $this->document_model->pass_doc($doc_id);
        redirect(site_url('/document/list_doc_nopass'));
    }

    public function edit_doc($doc_id){
        $type = $this->document_model->get_forum_type();
        $this->assign('type_list', $type);
        $data = array();
        $res = $this->document_model->get_doc($doc_id);
        if($res){
            $data = $res;
        }
        $this->assign('data', $data);
        $this->display('publish_doc.html');
    }
}


text:
using NUnit.Framework;
using Workbench.Core.Models;

namespace Workbench.Core.Tests.Unit.Models
{
    [TestFixture]
    public class WorkspaceTests
    {
        [Test]
        public void CreateWorkspaceWithBlankNameReturnsModelWithBlankName()
        {
            var sut = WorkspaceModelFactory.Create();
            Assert.That(sut.Model.Name.Text, Is.Empty);
        }

        [Test]
        public void Create_Workspace_With_Name_Returns_Model_With_Expected_Name()
        {
            const string ExpectedModelName = "The expected model name";
            var sut = new WorkspaceBuilder(ExpectedModelName)
                                    .AddSingleton("x", "1..10")
                                    .WithConstraintExpression("x > 1")
                                    .Build();
            Assert.That(sut.Model.Name.Text, Is.EqualTo(ExpectedModelName));
        }
    }
}


text:
var BezierEasing = require('bezier-easing');
module.exports = ValueGenerator;

function ValueGenerator(obj) {
    obj = obj || {};
    this.reset(obj);
    this._domain = obj._domain || this._domain;
    this._range = obj._range || this._range;
    this._core = obj._core || this._core
            || toTransformation(BezierEasing.linear);
    return this;
}

ValueGenerator.copy = function(to, from) {
    from = from || this;
    to = to || {};
    for ( var key in from) {
        if (key === 'prototype') {
            continue;
        }
        var val = from[key];
        to[key] = val;
    }
}

ValueGenerator.prototype = {
    reset : function(obj) {
        obj = obj || {};
        this.trim(obj._trimFrom, obj._trimTo);
        this.domain(obj._from, obj._to, obj._domainTransform);
        this.range(obj._fromVal, obj._toVal, obj._rangeTransform);
        this.setCoreTransformation(toTransformation(BezierEasing.linear));
        return this;
    },
    clone : function() {
        return new ValueGenerator(this);
    },
    build : function() {
        var that = this;
        return function(val, args) {
            // Domain transformation // domain value => [0..1] value
            var before = val;
            val = that._domain(val, args);
            // Core transformation [0..1] => [0..1]
            if (val !== undefined) {
                val = Math.max(0, Math.min(val, 1));
                val = that._core(val, args);
            }
            // Range transformation // [0..1] value => range value
            val = that._range(val, args);
            return val;
        };
    },

    bind : function(f, context) {
        var m = this.build();
        return function(val) {
            var r = m(val);
            var args = [ r ];
            for (var i = 0; i < arguments.length; i++) {
                args.push(arguments[i]);
            }
            return f.apply(context, args);
        };
    },

    // ----------------------------------------------------------------------
    // Domain transformations

    setDomainTransformation : function(f) {
        return this._setTransformation('_domain', f);
    },

    trim : function(trimFrom, trimTo) {
        this._trimFrom = !!trimFrom;
        this._trimTo = !!trimTo;
        return this;
    },

    domain : function(from, to, transform) {
        this._from = isNaN(from) ? 0 : from;
        this._to = isNaN(to) ? 1 : to;
        this._domainTransform = transform;
        return this.setDomainTransformation(function(val, args) {
            if (this._domainTransform) {
                val = this._domainTransform(val);
            }
            if (this._to === this._from)
                return 1;
            var p = (val - this._from) / (this._to - this._from);
            if (p < 0 && this._trimFrom) {
                return undefined;
            }
            if (p > 1 && this._trimTo) {
                return undefined;
            }
            return p;
        });
    },

    // ----------------------------------------------------------------------
    // Range transformations

    setRangeTransformation : function(f) {
        return this._setTransformation('_range', f);
    },

    range : function(from, to, transform) {
        if (typeof from === 'function') {
            transform = from;
            from = undefined;
            to = undefined;
        }
        this._fromVal = isNaN(from) ? 0 : from;
        this._toVal = isNaN(to) ? 1 : to;
        this._rangeTransform = transform;
        return this.setRangeTransformation(function(val, args) {
            if (val === undefined)
                return;
            var result = this._fromVal + (this._toVal - this._fromVal) * val;
            if (this._rangeTransform) {
                result = this._rangeTransform(result, val);
            }
            return result;
        });
    },

    // ----------------------------------------------------------------------
    // Core transformations

    setCoreTransformation : function(f) {
        return this._setTransformation('_core', f);
    },

    wrap : function(f) {
        return this._wrapTransformation('_core', f);
    },

    pow : function(n, base) {
        var pow, min, max;
        base = base || 2;
        this.setCoreTransformation(function(val, args){
            if (pow === undefined){
                pow = ((n === undefined) ? (this._to - this._from + 1) : +n) || 5;
                min = Math.pow(base, 0); // 1
                max = Math.pow(base, pow);
            }
            var result = (Math.pow(base, val * pow) - min) / (max - min);
            return result;
        });
        return this;
    },

    bezier : function(mX1, mY1, mX2, mY2) {
        this.setCoreTransformation(toTransformation(//
        BezierEasing(mX1, mY1, mX2, mY2)));
        return this;
    },

    ease : function() {
        this.setCoreTransformation(toTransformation(BezierEasing.ease));
        return this;
    },
    linear : function() {
        this.setCoreTransformation(toTransformation(BezierEasing.linear));
        return this;
    },
    easeIn : function() {
        this.setCoreTransformation(toTransformation(BezierEasing.easeIn));
        return this;
    },
    easeOut : function() {
        this.setCoreTransformation(toTransformation(BezierEasing.easeOut));
        return this;
    },
    easeInOut : function() {
        this.setCoreTransformation(toTransformation(BezierEasing.easeInOut));
        return this;
    },

    // ----------------------------------------------------------------------
    //
    _setTransformation : function(key, f) {
        this[key] = f;
        return this;
    },

    _wrapTransformation : function(key, f) {
        var transform = this[key];
        if (transform) {
            return this._setTransformation(key, function(val) {
                val = transform.call(this, val);
                return f.call(this, val);
            });
        } else {
            return this._setTransformation(f);
        }
    }

};

function toTransformation(bezier){
    return bezier.get.bind(bezier);
}


text:
"""Tests for cpauto."""

import cpauto

def test_entry_points():
    cpauto.core.sessions
    cpauto.core.exceptions
    cpauto.objects.access
    cpauto.objects.network
    cpauto.objects.policy
    cpauto.objects.simplegateway


text:
package lingotek

import (
	"encoding/json"
	"net/url"
)

func (l *Lingotek) GetProjects(communityId string) ([]Project, error) {
	v := url.Values{}
	v.Set("community_id", communityId)

	var projects []Project

	err := l.getEntityCollectionPage("project", &v, &projects)
	return projects, err
}

func (l *Lingotek) ListProjects(community *Community, doneChan <-chan bool) (<-chan Project, <-chan error) {
	resultChan := make(chan Project)
	errChan := make(chan error, 1)

	go func() {
		defer close(resultChan)
		defer close(errChan)

		params := url.Values{}
		params.Set("community_id", community.Property.Id)
		response := l.createDummyResponse("project", &params)

		var projects []Project
		var totalRead = int32(0)

		for {
			resp, err := l.getNextPage(response)
			if err != nil {
				if err != EndOfList {
					errChan <- err
				}
				return
			}

			response = resp

			if response.Properties.Size == 0 {
				return
			}

			err = json.Unmarshal(response.Entities, &projects)
			if err != nil {
				errChan <- err
				return
			}

			for i := 0; i < len(projects); i++ {
				totalRead += 1
				select {
				case <-doneChan:
					return
				default:
					resultChan <- projects[i]
				}
			}

			if totalRead == response.Properties.Total {
				return
			}

		}
	}()
	return resultChan, errChan
}


text:
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)

using System;

using Org.BouncyCastle.Utilities.Encoders;

namespace Org.BouncyCastle.Math.EC.Custom.Sec
{
    internal class SecT571R1Curve
        : AbstractF2mCurve
    {
        private const int SecT571R1_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE;

        protected readonly SecT571R1Point m_infinity;

        internal static readonly SecT571FieldElement SecT571R1_B = new SecT571FieldElement(
            new BigInteger(1, Hex.Decode("02F40E7E2221F295DE297117B7F3D62F5C6A97FFCB8CEFF1CD6BA8CE4A9A18AD84FFABBD8EFA59332BE7AD6756A66E294AFD185A78FF12AA520E4DE739BACA0C7FFEFF7F2955727A")));
        internal static readonly SecT571FieldElement SecT571R1_B_SQRT = (SecT571FieldElement)SecT571R1_B.Sqrt();

        public SecT571R1Curve()
            : base(571, 2, 5, 10)
        {
            this.m_infinity = new SecT571R1Point(this, null, null);

            this.m_a = FromBigInteger(BigInteger.One);
            this.m_b = SecT571R1_B;
            this.m_order = new BigInteger(1, Hex.Decode("03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47"));
            this.m_cofactor = BigInteger.Two;

            this.m_coord = SecT571R1_DEFAULT_COORDS;
        }

        protected override ECCurve CloneCurve()
        {
            return new SecT571R1Curve();
        }

        public override bool SupportsCoordinateSystem(int coord)
        {
            switch (coord)
            {
            case COORD_LAMBDA_PROJECTIVE:
                return true;
            default:
                return false;
            }
        }

        public override ECPoint Infinity
        {
            get { return m_infinity; }
        }

        public override int FieldSize
        {
            get { return 571; }
        }

        public override ECFieldElement FromBigInteger(BigInteger x)
        {
            return new SecT571FieldElement(x);
        }

        protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression)
        {
            return new SecT571R1Point(this, x, y, withCompression);
        }

        protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression)
        {
            return new SecT571R1Point(this, x, y, zs, withCompression);
        }

        public override bool IsKoblitz
        {
            get { return false; }
        }

        /**
         * Decompresses a compressed point P = (xp, yp) (X9.62 s 4.2.2).
         *
         * @param yTilde
         *            ~yp, an indication bit for the decompression of yp.
         * @param X1
         *            The field element xp.
         * @return the decompressed point.
         */
        protected override ECPoint DecompressPoint(int yTilde, BigInteger X1)
        {
            ECFieldElement x = FromBigInteger(X1), y = null;
            if (x.IsZero)
            {
    //            y = B.Sqrt();
                y = SecT571R1_B_SQRT;
            }
            else
            {
                ECFieldElement beta = x.Square().Invert().Multiply(B).Add(A).Add(x);
                ECFieldElement z = SolveQuadraticEquation(beta);
                if (z != null)
                {
                    if (z.TestBitZero() != (yTilde == 1))
                    {
                        z = z.AddOne();
                    }

                    switch (this.CoordinateSystem)
                    {
                    case COORD_LAMBDA_AFFINE:
                    case COORD_LAMBDA_PROJECTIVE:
                    {
                        y = z.Add(x);
                        break;
                    }
                    default:
                    {
                        y = z.Multiply(x);
                        break;
                    }
                    }
                }
            }

            if (y == null)
                throw new ArgumentException("Invalid point compression");

            return this.CreateRawPoint(x, y, true);
        }

        /**
         * Solves a quadratic equation z2 + z = beta(X9.62
         * D.1.6) The other solution is z + 1.
         *
         * @param beta
         *            The value to solve the quadratic equation for.
         * @return the solution for z2 + z = beta or
         *         null if no solution exists.
         */
        private ECFieldElement SolveQuadraticEquation(ECFieldElement beta)
        {
            if (beta.IsZero)
                return beta;

            ECFieldElement zeroElement = FromBigInteger(BigInteger.Zero);

            ECFieldElement z = null;
            ECFieldElement gamma = null;

            Random rand = new Random();
            do
            {
                ECFieldElement t = FromBigInteger(new BigInteger(571, rand));
                z = zeroElement;
                ECFieldElement w = beta;
                for (int i = 1; i < 571; i++)
                {
                    ECFieldElement w2 = w.Square();
                    z = z.Square().Add(w2.Multiply(t));
                    w = w2.Add(beta);
                }
                if (!w.IsZero)
                    return null;
                gamma = z.Square().Add(z);
            }
            while (gamma.IsZero);

            return z;
        }

        public virtual int M
        {
            get { return 571; }
        }

        public virtual bool IsTrinomial
        {
            get { return false; }
        }

        public virtual int K1
        {
            get { return 2; }
        }

        public virtual int K2
        {
            get { return 5; }
        }

        public virtual int K3
        {
            get { return 10; }
        }
    }
}

#endif


text:
package org.elasticsearch.river.arangodb.es;

import static net.swisstech.swissarmyknife.lang.Strings.isBlank;
import static net.swisstech.swissarmyknife.lang.Strings.notBlank;

import java.util.Map;

import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.inject.Singleton;
import org.elasticsearch.river.arangodb.config.ArangoDbConfig;

import com.fasterxml.jackson.databind.JsonNode;

@Singleton
public class ScriptResultProcessor {

	private final String index;
	private final String type;

	@Inject
	public ScriptResultProcessor(ArangoDbConfig config) {
		index = config.getIndexName();
		type = config.getIndexType();
	}

	public void process(Map<String, Object> ctx, EsBulk bulk) {
		String operation = (String) ctx.get("operation");
		if (isBlank(operation) || "SKIP".equals(operation)) {
			return;
		}

		String id = notBlank((String) ctx.get("id"));
		JsonNode doc = (JsonNode) ctx.get("doc");

		if ("DELETE".equals(operation)) {
			DeleteRequest req = new DeleteRequest(index, type, id);
			bulk.add(req);
		}
		else if ("UPDATE".equals(operation)) {
			String json = doc.toString();
			IndexRequest req = new IndexRequest(index, type, id);
			req.source(json);
			bulk.add(req);
		}
		else {
			// TODO something's fishy
		}
	}
}


text:
package com.twentyfive.death_list.proxy;

public class ClientProxy extends CommonProxy
{

}


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.eas.client.updater;

/**
 *
 * @author AB
 */
public class UpdaterConstants {
    public static final String LOGGER_NAME = "main_log";
    //cmd commands
    public static final String CMD_SWITCHS_PREFIX = "-";
    public static final String CMD_LAF_CONFIG = "laf";
    public static final String CMD_URL_CONFIG = "curl";
    public static final String CMD_URL_UPDATE = "uurl";
    public static final String CMD_CONFIG_NAME = "cname";
    public static final String CMD_TMP_UPDATE_NAME = "uname";
    public static final String CMD_CURRENT_PATH = "path";
    public static final String CMD_RUN_COMMAND = "wrun";
    public static final String CMD_IS_SILENT = "silent";

    public static final String ROOT_NAME = "update";
    public static final String VERSION_NAME = "version";
    public static final String FILE_NAME = "file_name";
    public static final String COMMENT = "comment";
    public static final String NEWS = "what_new";
    public static final int EQUALS = 0;
    public static final int BUILD_NOT_EQUALS = 2;
    public static final int MINOR_NOT_EQUALS = 3;
    public static final int MAJOR_NOT_EQUALS = 4;

    public static final byte NOT_NEED_UPDATE = 11;
    public static final byte NEED_UPGRADE = 12;
    public static final byte NEED_UPDATE = 10;
    public static final byte ERROR = 2;

    public static final String UPDATER_FIND_LABEL = "Updater";
    public static final String COMMAND_CHECK_NEW_VERSION = "newversion";
    public static final String COMMAND_DO_UPDATE = "update";
    public static final String TMP_FILE = "tmp.zip";
    public static final String SINGLE_QUOTE = "\'";
    public static final String DOUBLE_QUOTE = "\"";
    public static final char SLASH_CHAR = '/';
    public static final char BACKSLASH_CHAR = '\\';

    public static final int BUFFER_SIZE = 64*1024;

    public static final String ERROR_RUN_COMMAND_FORMAT =
        "Using \"Updater\":java -jar Updater.jar <command> -laf <value> -curl <value> -uurl <value> -cname <value>\n"
        + "                                  -uname <value> -path <value> -wrun <value>\n"
        + "Parameters:\n"
        + "         <command>        [newversion, update] What Updater will do now."
        + "         -laf <value>     UIManager class path.\n"
        + "         -curl <value>    URL to compare files version.\n"
        + "         -uurl <value>    URL to download new files for application.\n"
        + "         -cname <value>   Name of your file containing application version information.\n"
        + "         -uname <value>   Name of file to download to update the application.\n"
        + "         -path <value>    Current directory. Use if Updater located not in application dir.\n"
        + "         -silent <true/false> Is programm runs asks user interaction";
//        + "         -wrun <value>    What run to start platypus. (deprecated)\n";

}


text:
"""Unit tests for the create_unstructured_log_entries binary."""

import unittest
from unittest import mock

from google.auth.transport import requests

from . import create_unstructured_log_entries

class CreateUnstructuredLogEntryTest(unittest.TestCase):

  @mock.patch.object(requests, "AuthorizedSession", autospec=True)
  @mock.patch.object(requests.requests, "Response", autospec=True)
  def test_http_error(self, mock_response, mock_session):
    mock_session.request.return_value = mock_response
    type(mock_response).status_code = mock.PropertyMock(return_value=400)
    mock_response.raise_for_status.side_effect = (
        requests.requests.exceptions.HTTPError())

    with self.assertRaises(requests.requests.exceptions.HTTPError):
      create_unstructured_log_entries.create_logs(
          mock_session, "LOG_TYPE", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          "log1\tlog1\r\nlog2\tlog2")

  @mock.patch.object(requests, "AuthorizedSession", autospec=True)
  @mock.patch.object(requests.requests, "Response", autospec=True)
  def test_happy_path(self, mock_response, mock_session):
    mock_session.request.return_value = mock_response
    type(mock_response).status_code = mock.PropertyMock(return_value=200)

    create_unstructured_log_entries.create_logs(
        mock_session, "LOG_TYPE", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "log1\tlog1\r\nlog2\tlog2")

if __name__ == "__main__":
  unittest.main()


text:
#include "config.h"
#include "core/timing/PerformanceCompositeTiming.h"

#include "core/dom/Document.h"
#include "core/loader/DocumentLoader.h"

namespace blink {

static double monotonicTimeToDocumentMilliseconds(Document* document, double seconds)
{
    ASSERT(seconds >= 0.0);
    return document->loader()->timing().monotonicTimeToZeroBasedDocumentTime(seconds) * 1000.0;
}

PerformanceCompositeTiming::PerformanceCompositeTiming(Document* requestingDocument, unsigned sourceFrame, double startTime)
    : PerformanceEntry(requestingDocument->url().string(), "composite", monotonicTimeToDocumentMilliseconds(requestingDocument, startTime), monotonicTimeToDocumentMilliseconds(requestingDocument, startTime))
    , m_sourceFrame(sourceFrame)
    , m_requestingDocument(requestingDocument)
{
}

PerformanceCompositeTiming::~PerformanceCompositeTiming()
{
}

unsigned PerformanceCompositeTiming::sourceFrame() const
{
    return m_sourceFrame;
}

DEFINE_TRACE(PerformanceCompositeTiming)
{
    visitor->trace(m_requestingDocument);
    PerformanceEntry::trace(visitor);
}

} // namespace blink


text:
import sys

def is_a_tty(stream):
    return hasattr(stream, 'isatty') and stream.isatty()

class Terminal(object):
    terminfo = None
    columns = 80
    lines = 25
    isatty = True
    isCygwin = False

    # output colors
    C_BLACK = 0  # whatever basic terminal color is set at?
    C_RED = 1
    C_GREEN = 2
    C_YELLOW = 3
    C_BLUE = 4
    C_MAGENTA = 5
    C_CYAN = 6
    C_WHITE = 7

    # Offset for things that extend to terminal width terminal.getColumns(),
    # to keep things from being too familiar with right edge
    TERMINAL_WIDTH_OFFSET = 2

    def __init__(self, options = {}):
        if 'terminfo' in options:
            self.terminfo = options['terminfo']
        else:
            from .terminfo import Terminfo
            self.terminfo = Terminfo()

        # Set whether output is a tty
        self.isatty = is_a_tty(sys.stdout)

        # Set the columns and lines
        (self.columns, self.lines) = self._getSize()

    def isatty(self):
        return self.isatty

    def printterm(self, text):
        if self.isatty:
            sys.stdout.write(text)

    def clear(self):
        self.printterm(self.terminfo.clear())
        return self

    def locate(self, row, col):
        self.printterm(self.terminfo.cup(row, col))
        return self

    def boldType(self):
        self.printterm(self.terminfo.bold())
        return self

    def setFgColor(self, num):
        self.printterm(self.terminfo.setaf(num))
        return self

    def setBgColor(self, num):
        self.printterm(self.terminfo.setab(num))
        return self

    def prompt(self, text):
        return raw_input(text)

    def getColumns(self):
        (self.columns, self.lines) = self._getSize()
        return self.columns

    def getLines(self):
        (self.columns, self.lines) = self._getSize()
        return self.lines

    def centerText(self, text):
        # TODO: implement
        return text

    def prettyMessage(self, text, fg=7, bg=4, size_=None, verticalPadding=True):

        if None == size_:
            size_ = self.columns

        length = len(text) + 4

        start = self.setaf(fg) + self.setab(bg)
        end = self.op() + "\n"
        newline = end + start

        if length > size_ or "\n" in text:
            length = size_
            text = self.wordwrap(text, size_-4)
            lines = text.split("\n")
            text = ''
            for line in lines:
                line = "  " + line.strip()
                text = text + line.ljust(size_) + newline
        else:
            text = '  ' + text + '  ' + newline

        if verticalPadding == True:
            padding = ' ' * length
        else:
            padding = ''
            end = end.strip()
            newline = end + start

        out = start \
            + padding + newline \
            + text \
            + padding \
            + end

        print(out)

        return self

    def makeBox(self, y, x, w, h):
        # TODO: implement
        return ''

    def startAltCharsetMode(self):
        self.printterm(chr(27) + chr(40) + chr(48))

    def endAltCharsetMode(self):
        self.printterm(chr(27) + chr(40) + chr(66))

    def __getattr__(self, attr):
        def default_method(*args):
            if not self.isatty:
                return ''
            return self.terminfo.doCapability(attr, *args)
        return default_method

    def wordwrap(self, string, width=80, ind1=0, ind2=0, prefix=''):
        """ word wrapping function.
            string: the string to wrap
            width: the column number to wrap at
            prefix: prefix each line with this string (goes before any indentation)
            ind1: number of characters to indent the first line
            ind2: number of characters to indent the rest of the lines
        """
        string = prefix + ind1 * " " + string
        newstring = ""
        while len(string) > width:
            # find position of nearest whitespace char to the left of "width"
            marker = width - 1
            while not string[marker].isspace():
                marker = marker - 1

            # remove line from original string and add it to the new string
            newline = string[0:marker] + "\n"
            newstring = newstring + newline
            string = prefix + ind2 * " " + string[marker + 1:]

        return newstring + string

    def wordwrapDescription(self, string, width=80, indent=0):
        """ word wrapping function that uses all of the available space
            for the last column
            string: the string to wrap
            width: the column number to wrap at
            indent: number of characters to indent the second line on
        """

        if width < 35:
            # if we don't have that much room for the description column, we'll
            # skip the fancy wrapping
            return string

        newstring = ""
        while len(string) > width:
            # find position of nearest whitespace char to the left of "width"
            marker = width - 1
            while not string[marker].isspace():
                marker = marker - 1
                if marker < 0:
                    # couldn't find any spaces so we'll skip the wrapping on
                    # this one
                    return string

            # remove line from original string and add it to the new string
            newline = string[0:marker] + '\n'
            if newstring != '':
                newstring += indent * ' '
            newstring += newline
            string = string[marker + 1:]

        if newstring != '':
            newstring += indent * ' '

        return newstring + string

    def _getSize(self):
        def ioctl_GWINSZ(fd):
            try:
                import fcntl, termios, struct, os
                cr = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
            except:
                return None
            return cr
        cr = ioctl_GWINSZ(0) or ioctl_GWINSZ(1) or ioctl_GWINSZ(2)
        if not cr:
            try:
                fd = os.open(os.ctermid(), os.O_RDONLY)
                cr = ioctl_GWINSZ(fd)
                os.close(fd)
            except:
                pass
        if not cr:
            try:
                cr = (env['LINES'], env['COLUMNS'])
            except:
                cr = (25, 80)
        return int(cr[1]), int(cr[0])


text:
' Licensed to the .NET Foundation under one or more agreements.
' The .NET Foundation licenses this file to you under the MIT license.
' See the LICENSE file in the project root for more information.

Imports System.Composition
Imports System.Threading
Imports Microsoft.CodeAnalysis.Highlighting
Imports Microsoft.CodeAnalysis.Host.Mef
Imports Microsoft.CodeAnalysis.Text
Imports Microsoft.CodeAnalysis.VisualBasic.Syntax

Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.KeywordHighlighting
    <ExportHighlighter(LanguageNames.VisualBasic), [Shared]>
    Friend Class PropertyBlockHighlighter
        Inherits AbstractKeywordHighlighter(Of SyntaxNode)

        <ImportingConstructor>
        <Obsolete(MefConstruction.ImportingConstructorMessage, True)>
        Public Sub New()
        End Sub

        Protected Overloads Overrides Sub AddHighlights(node As SyntaxNode, highlights As List(Of TextSpan), cancellationToken As CancellationToken)
            Dim propertyBlock = node.GetAncestor(Of PropertyBlockSyntax)()
            If propertyBlock Is Nothing Then
                Return
            End If

            With propertyBlock
                With .PropertyStatement
                    Dim firstKeyword = If(.Modifiers.Count > 0, .Modifiers.First(), .DeclarationKeyword)
                    highlights.Add(TextSpan.FromBounds(firstKeyword.SpanStart, .DeclarationKeyword.Span.End))

                    If .ImplementsClause IsNot Nothing Then
                        highlights.Add(.ImplementsClause.ImplementsKeyword.Span)
                    End If
                End With

                highlights.Add(.EndPropertyStatement.Span)
            End With
        End Sub
    End Class
End Namespace


text:
class CreateNotificationRequests < ActiveRecord::Migration[5.0]
  def change
    create_table :notification_requests do |t|
      t.string :audience
      t.text :message
      t.datetime :sent
      t.string :message_id

      t.timestamps
    end
  end
end


text:
#if HAVE_CONFIG_H
# include <config.h>
#endif

/* Specification.  */
#include "fwriteerror.h"

#include <errno.h>
#include <stdbool.h>

int
fwriteerror (FILE *fp)
{
  /* State to allow multiple calls to fwriteerror (stdout).  */
  static bool stdout_closed = false;

  if (fp == stdout && stdout_closed)
    return 0;

  /* Need to
     1. test the error indicator of the stream,
     2. flush the buffers both in userland and in the kernel, through fclose,
        testing for error again.  */

  /* Clear errno, so that on non-POSIX systems the caller doesn't see a
     wrong value of errno when we return -1.  */
  errno = 0;

  if (ferror (fp))
    {
      if (fflush (fp))
	return -1; /* errno is set here */
      /* The stream had an error earlier, but its errno was lost.  If the
	 error was not temporary, we can get the same errno by writing and
	 flushing one more byte.  We can do so because at this point the
	 stream's contents is garbage anyway.  */
      if (fputc ('\0', fp) == EOF)
	return -1; /* errno is set here */
      if (fflush (fp))
	return -1; /* errno is set here */
      /* Give up on errno.  */
      errno = 0;
      return -1;
    }

  /* If we are closing stdout, don't attempt to do it later again.  */
  if (fp == stdout)
    stdout_closed = true;

  if (fclose (fp))
    return -1; /* errno is set here */

  return 0;
}

#if TEST

/* Name of a file on which writing fails.  On systems without /dev/full,
   you can choose a filename on a full filesystem.  */
#define UNWRITABLE_FILE "/dev/full"

int
main ()
{
  static int sizes[] =
    {
       511,  512,  513,
      1023, 1024, 1025,
      2047, 2048, 2049,
      4095, 4096, 4097,
      8191, 8192, 8193
    };
  static char dummy[8193];
  unsigned int i, j;

  for (i = 0; i < sizeof (sizes) / sizeof (sizes[0]); i++)
    {
      size_t size = sizes[i];

      for (j = 0; j < 2; j++)
	{
	  /* Run a test depending on i and j:
	     Write size bytes and then calls fflush if j==1.  */
	  FILE *stream = fopen (UNWRITABLE_FILE, "w");

	  if (stream == NULL)
	    {
	      fprintf (stderr, "Test %u:%u: could not open file\n", i, j);
	      continue;
	    }

	  fwrite (dummy, 347, 1, stream);
	  fwrite (dummy, size - 347, 1, stream);
	  if (j)
	    fflush (stream);

	  if (fwriteerror (stream) == -1)
	    {
	      if (errno != ENOSPC)
		fprintf (stderr, "Test %u:%u: fwriteerror ok, errno = %d\n",
			 i, j, errno);
	    }
	  else
	    fprintf (stderr, "Test %u:%u: fwriteerror found no error!\n",
		     i, j);
	}
    }

  return 0;
}

#endif


text:
package jsondb.tests;

import static org.junit.Assert.assertEquals;

import java.io.File;
import java.util.HashSet;
import java.util.List;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import com.google.common.io.Files;

import jsondb.InvalidJsonDbApiUsageException;
import jsondb.JsonDBConfig;
import jsondb.JsonDBTemplate;
import jsondb.Util;
import jsondb.crypto.DefaultAESCBCCipher;
import jsondb.crypto.ICipher;
import jsondb.tests.model.Instance;
import jsondb.tests.model.Site;

/**
 * Junit tests for the save() apis
 * @version 1.0 08-Oct-2016
 */
public class SaveTests {
  private String dbFilesLocation = "test/resources/dbfiles/saveTests";
  private File dbFilesFolder = new File(dbFilesLocation);
  private File instancesJson = new File(dbFilesFolder, "instances.json");

  private JsonDBTemplate jsonDBTemplate = null;

  @Rule
  public ExpectedException expectedException = ExpectedException.none();

  @Before
  public void setUp() throws Exception {
    dbFilesFolder.mkdir();
    Files.copy(new File("test/resources/dbfiles/instances.json"), instancesJson);
    ICipher cipher = new DefaultAESCBCCipher("1r8+24pibarAWgS85/Heeg==");
    JsonDBConfig c = new JsonDBConfig(dbFilesLocation, "io.jsondb.tests.model", "pre", cipher, true, null);
    jsonDBTemplate = new JsonDBTemplate(c);
  }

  @After
  public void tearDown() throws Exception {
    Util.delete(dbFilesFolder);
  }

  /**
   * Test to save a new object into a non-existing collection.
   */
  @Test
  public void testSave_IntoNonExistingCollection() {
    expectedException.expect(InvalidJsonDbApiUsageException.class);
    expectedException.expectMessage("Collection by name 'sites' not found. Create collection first");
    jsonDBTemplate.save(new Site(), "sites");
  }

  private class SomeClass {}

  /**
   * Test to save a new object of unknown collection type.
   */
  @Test
  public void testSave_IntoUnknowCollection() {
    expectedException.expect(InvalidJsonDbApiUsageException.class);
    expectedException.expectMessage("Entity 'SomeClass' is not annotated with annotation @Document");
    jsonDBTemplate.save(new SomeClass(), SomeClass.class);
  }

  /**
   * Test to save a null object.
   */
  @Test
  public void testSave_ANullObject() {
    expectedException.expect(InvalidJsonDbApiUsageException.class);
    expectedException.expectMessage("Null Object cannot be updated into DB");
    jsonDBTemplate.save(null, Instance.class);
  }

  /**
   * Test to save a Collection object.
   */
  @Test
  public void testSave_ASingleCollectionObject() {
    expectedException.expect(InvalidJsonDbApiUsageException.class);
    expectedException.expectMessage("Collection object cannot be inserted, removed, updated or upserted as a single object");
    jsonDBTemplate.save(new HashSet<Instance>(), Instance.class);
  }

  /**
   * Test to save a new object that does not exists in the collection
   */
  @Test
  public void testSave_ANewObject() {
    expectedException.expect(InvalidJsonDbApiUsageException.class);
    expectedException.expectMessage("Document with Id: '15' not found in Collection by name 'instances' not found. Insert or Upsert the object first.");

    Instance instance = new Instance();
    instance.setId("15");
    instance.setHostname("ec2-54-191-15");
    jsonDBTemplate.save(instance, Instance.class);
  }

  /**
   * Test to simply save/update a object
   */
  @Test
  public void testSave_Simple() {
    List<Instance> instances = jsonDBTemplate.getCollection(Instance.class);
    int size = instances.size();

    Instance instance = new Instance();
    instance.setId("01");
    instance.setHostname("ec2-54-191-UPDTed");
    jsonDBTemplate.save(instance, Instance.class);

    Instance instance1 = jsonDBTemplate.findById("01", Instance.class);
    assertEquals("ec2-54-191-UPDTed", instance1.getHostname());
    assertEquals(size, instances.size());
  }
}


text:
package com.blackducksoftware.integration.jira.mocks;

import java.io.IOException;
import java.io.Writer;
import java.util.Map;

import com.atlassian.templaterenderer.RenderingException;
import com.atlassian.templaterenderer.TemplateRenderer;

public class TemplateRendererMock implements TemplateRenderer {

    String renderedString;

    public String getRenderedString() {
        return renderedString;
    }

    @Override
    public void render(final String arg0, final Writer arg1) throws RenderingException, IOException {
        renderedString = arg0;
    }

    @Override
    public void render(final String arg0, final Map<String, Object> arg1, final Writer arg2)
            throws RenderingException, IOException {

    }

    @Override
    public String renderFragment(final String arg0, final Map<String, Object> arg1) throws RenderingException {
        return null;
    }

    @Override
    public boolean resolve(final String arg0) {
        return false;
    }

}


text:
package com.vintek.services.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class ReportTree implements Serializable {
	private static final long serialVersionUID = -7974875065774593015L;

	private int id;
	private String label;

	private List<ReportTree> children;

	public ReportTree(int id, String label) {
		super();
		this.id = id;
		this.label = label;
	}

	public int getId() {
		return id;
	}

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

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public List<ReportTree> getChildren() {
		if (children==null) children = new ArrayList<ReportTree>();
		return children;
	}

	public void setChildren(List<ReportTree> children) {
		this.children = children;
	}

}


text:
using System;
using System.Linq;
using System.Net;
using System.Text;
using Cqrs.Projection.Core;
using EventStore.ClientAPI;
using EventStore.ClientAPI.Common.Log;
using EventStore.ClientAPI.SystemData;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace Cqrs.Projection.EventStore
{
    public static class EventStoreProjectionConfigurationExtension
    {
        public static void UseEventStore(this ProjectionGatewayConfiguration projectionGatewayConfiguration, ConnectionSettings connection, IPEndPoint httpEndPoint, IPEndPoint tcpEndPoint)
        {
            var eventStoreConnection = EventStoreConnection.Create(connection, tcpEndPoint);
            ProjectionManager.Configure(projectionGatewayConfiguration, httpEndPoint, connection.DefaultUserCredentials);
            Start(projectionGatewayConfiguration, eventStoreConnection);
        }

        public static void UseEventStore(this ProjectionGatewayConfiguration projectionGatewayConfiguration, ConnectionSettings connection, ClusterSettings clusterSettings, IPEndPoint tcpEndpoint)
        {
            var eventStoreConnection = EventStoreConnection.Create(connection, clusterSettings);
            ProjectionManager.Configure(projectionGatewayConfiguration, tcpEndpoint, connection.DefaultUserCredentials);
            Start(projectionGatewayConfiguration, eventStoreConnection);
        }

        private static void Start(ProjectionGatewayConfiguration projectionGatewayConfiguration, IEventStoreConnection eventStoreConnection)
            //TODO: Need restore point configuration
        {
            projectionGatewayConfiguration.Locator.Register(() => eventStoreConnection);
            eventStoreConnection.ConnectAsync().Wait();

            foreach (var subscription in projectionGatewayConfiguration.Subscriptions)
            {
                var eventHandlers = subscription.Value;
                eventStoreConnection.SubscribeToStreamFrom(
                    stream: subscription.Key + "View",
                    lastCheckpoint: StreamCheckpoint.StreamStart,
                    resolveLinkTos: true,
                    eventAppeared: (upSubscription, @event) =>
                    {
                        var eventType = Type.GetType(@event.Event.EventType);
                        var deserializedEvent = JsonConvert.DeserializeObject(Encoding.UTF8.GetString(@event.Event.Data), eventType);
                        eventHandlers
                            .Single(x => x.EventType == eventType)
                            .EventHandler(deserializedEvent);
                    });
            }
        }

        private static class ProjectionManager
        {
            public static void Configure(ProjectionGatewayConfiguration projectionGatewayConfiguration, IPEndPoint httpEndPoint, UserCredentials credentials)
            {
                var projectionManager = new ProjectionsManager(new ConsoleLogger(), httpEndPoint, new TimeSpan(1, 0, 0, 0));
                var byCategoryProjectionStatus = ((JObject)JsonConvert.DeserializeObject(projectionManager.GetStatusAsync("$by_category", credentials).Result))["status"].ToString();
                var streamByCategoryProjectionStatus = ((JObject)JsonConvert.DeserializeObject(projectionManager.GetStatusAsync("$stream_by_category", credentials).Result))["status"].ToString();

                if (byCategoryProjectionStatus == "Stopped")
                {
                    projectionManager.EnableAsync("$by_category", credentials).Wait();
                }

                if (streamByCategoryProjectionStatus == "Stopped")
                {
                    projectionManager.EnableAsync("$stream_by_category", credentials).Wait();
                }
                const string projectionPattern = @"fromCategory('{0}')
                .foreachStream()
                .whenAny(function(state, event){{
                    linkTo('{1}', event);
                }})";

                foreach (var aggregateRootName in projectionGatewayConfiguration.Subscriptions.Keys)
                {
                    projectionManager.CreateContinuousAsync(
                        string.Format("{0}Projection", aggregateRootName),
                        string.Format(projectionPattern, aggregateRootName, aggregateRootName + "View"), credentials).Wait();
                }
            }
        }
    }
}


text:
package tech.aroma.application.service;

import java.util.function.Function;

import org.apache.thrift.TException;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import tech.aroma.thrift.application.service.*;
import tech.aroma.thrift.authentication.*;
import tech.aroma.thrift.authentication.service.*;
import tech.aroma.thrift.exceptions.InvalidTokenException;
import tech.aroma.thrift.exceptions.OperationFailedException;
import tech.aroma.thrift.functions.TokenFunctions;
import tech.sirwellington.alchemy.test.junit.runners.*;

import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.*;
import static tech.sirwellington.alchemy.generator.AlchemyGenerator.Get.one;
import static tech.sirwellington.alchemy.generator.NumberGenerators.doubles;
import static tech.sirwellington.alchemy.test.junit.ThrowableAssertion.*;
import static tech.sirwellington.alchemy.test.junit.runners.GenerateString.Type.UUID;

/**
 *
 * @author SirWellington
 */
@Repeat(100)
@RunWith(AlchemyTestRunner.class)
public class AuthenticationLayerTest
{

    @Mock
    private AuthenticationService.Iface authenticationService;

    @Mock
    private ApplicationService.Iface delegate;

    @Mock
    private Function<AuthenticationToken, ApplicationToken> tokenMapper;

    @GeneratePojo
    private SendMessageRequest request;

    @GeneratePojo
    private SendMessageResponse response;

    @GeneratePojo
    private ApplicationToken appToken;

    private AuthenticationToken authToken;

    @GenerateString(UUID)
    private String appId;

    private String tokenId;

    private VerifyTokenRequest expectedVerifyRequest;

    private GetTokenInfoRequest expectedGetTokenRequest;

    private AuthenticationLayer instance;

    @Before
    public void setUp() throws TException
    {
        instance = new AuthenticationLayer(authenticationService, delegate, tokenMapper);
        verifyZeroInteractions(authenticationService, delegate);

        setupData();
        setupMocks();
    }

    private void setupData()
    {
        appToken.applicationId = appId;

        authToken = TokenFunctions.appTokenToAuthTokenFunction().apply(appToken);

        request.applicationToken = appToken;

        tokenId = appToken.tokenId;

        expectedVerifyRequest = new VerifyTokenRequest()
            .setTokenId(tokenId)
            .setOwnerId(appId);

        expectedGetTokenRequest = new GetTokenInfoRequest()
            .setTokenId(tokenId)
            .setTokenType(TokenType.APPLICATION);
    }

    private void setupMocks() throws TException
    {
        when(delegate.sendMessage(request)).thenReturn(response);
        when(tokenMapper.apply(authToken)).thenReturn(appToken);
        when(authenticationService.getTokenInfo(expectedGetTokenRequest)).thenReturn(new GetTokenInfoResponse(authToken));
    }

    @DontRepeat
    @Test
    public void testConstructor()
    {
        assertThrows(() -> new AuthenticationLayer(null, delegate, tokenMapper))
            .isInstanceOf(IllegalArgumentException.class);

        assertThrows(() -> new AuthenticationLayer(authenticationService, null, tokenMapper))
            .isInstanceOf(IllegalArgumentException.class);

        assertThrows(() -> new AuthenticationLayer(authenticationService, delegate, null))
            .isInstanceOf(IllegalArgumentException.class);
    }

    @Test
    public void testGetApiVersion() throws Exception
    {
        double expected = one(doubles(10, 1000));
        when(delegate.getApiVersion())
            .thenReturn(expected);

        double result = instance.getApiVersion();
        assertThat(result, is(expected));
        verify(delegate).getApiVersion();

    }

    @Test
    public void testGetApiVersionWhenFails() throws Exception
    {
        when(delegate.getApiVersion())
            .thenThrow(new OperationFailedException());

        assertThrows(() -> instance.getApiVersion())
            .isInstanceOf(OperationFailedException.class);

    }

    @Test
    public void testSendMessage() throws Exception
    {
        SendMessageResponse result = instance.sendMessage(request);

        assertThat(result, is(response));
        verify(delegate).sendMessage(request);

        verify(authenticationService).verifyToken(expectedVerifyRequest);
    }

    @Test
    public void testSendMessageWhenAppIdMissing() throws Exception
    {
        ApplicationToken completeToken = new ApplicationToken(appToken);

        appToken.unsetApplicationId();
        expectedVerifyRequest.unsetOwnerId();

        when(tokenMapper.apply(authToken)).thenReturn(completeToken);

        SendMessageResponse result = instance.sendMessage(request);

        assertThat(result, is(response));

        verify(authenticationService).verifyToken(expectedVerifyRequest);
        verify(authenticationService).getTokenInfo(expectedGetTokenRequest);

        ArgumentCaptor<SendMessageRequest> captor = ArgumentCaptor.forClass(SendMessageRequest.class);
        verify(delegate).sendMessage(captor.capture());

        ApplicationToken expectedToken = new ApplicationToken(appToken).setApplicationId(appId);
        SendMessageRequest capturedRequest = captor.getValue();
        assertThat(capturedRequest.applicationToken, is(expectedToken));
    }

    @Test
    public void testSendMessageWithInvalidToken() throws Exception
    {
        setupForBadToken();

        assertThrows(() -> instance.sendMessage(request))
            .isInstanceOf(InvalidTokenException.class);

        verifyZeroInteractions(delegate);
    }

    @Test
    public void testSendMessageAsync() throws Exception
    {
        instance.sendMessageAsync(request);

        verify(delegate).sendMessageAsync(request);

        verify(authenticationService).verifyToken(expectedVerifyRequest);
    }

    @Test
    public void testSendMessageAsyncWithInvalidToken() throws Exception
    {
        setupForBadToken();

        assertThrows(() -> instance.sendMessageAsync(request))
            .isInstanceOf(InvalidTokenException.class);

        verifyZeroInteractions(delegate);
    }

    private void setupForBadToken() throws InvalidTokenException, TException
    {
        when(authenticationService.verifyToken(expectedVerifyRequest))
            .thenThrow(new InvalidTokenException());
    }

}


text:
package org.kie.workbench.common.stunner.svg.gen.model.impl;

import org.kie.workbench.common.stunner.svg.gen.model.LayoutDefinition;
import org.kie.workbench.common.stunner.svg.gen.model.PrimitiveDefinition;
import org.kie.workbench.common.stunner.svg.gen.model.TransformDefinition;

public abstract class AbstractPrimitiveDefinition<V> implements PrimitiveDefinition<V> {

    private final String id;
    private double x;
    private double y;
    private double alpha;
    private boolean scalable;
    private boolean listening;
    private boolean mainShape;
    private TransformDefinition transformDefinition;
    private LayoutDefinition layoutDefinition;

    protected AbstractPrimitiveDefinition(final String id) {
        this(id,
             1,
             false,
             false,
             false);
    }

    protected AbstractPrimitiveDefinition(final String id,
                                          final double alpha,
                                          final boolean scalable,
                                          final boolean listening,
                                          final boolean mainShape) {
        this.id = id;
        this.alpha = alpha;
        this.listening = listening;
        this.scalable = scalable;
        this.mainShape = mainShape;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public double getX() {
        return x;
    }

    public void setX(final double x) {
        this.x = x;
    }

    @Override
    public double getY() {
        return y;
    }

    public void setY(final double y) {
        this.y = y;
    }

    @Override
    public double getAlpha() {
        return alpha;
    }

    public void setAlpha(final double alpha) {
        this.alpha = alpha;
    }

    @Override
    public boolean isMain() {
        return mainShape;
    }

    public void setMainShape(final boolean mainShape) {
        this.mainShape = mainShape;
    }

    @Override
    public boolean isScalable() {
        return scalable;
    }

    public void setScalable(final boolean scalable) {
        this.scalable = scalable;
    }

    @Override
    public boolean isListening() {
        return listening;
    }

    public void setListening(final boolean listening) {
        this.listening = listening;
    }

    @Override
    public LayoutDefinition getLayoutDefinition() {
        return layoutDefinition;
    }

    public void setLayoutDefinition(final LayoutDefinition layoutDefinition) {
        this.layoutDefinition = layoutDefinition;
    }

    @Override
    public TransformDefinition getTransformDefinition() {
        return transformDefinition;
    }

    public void setTransformDefinition(final TransformDefinition transformDefinition) {
        this.transformDefinition = transformDefinition;
    }
}


text:
<?php

namespace Chamilo\Core\Queue\Exceptions;

/**
 * Indicates that the job has become irrelevant and should not be scheduled for retry
 *
 * @package Chamilo\Core\Queue\Exceptions
 *
 * @author Sven Vanpoucke - Hogeschool Gent
 */
class JobNoLongerValidException extends \Exception
{

}


text:
<?php

namespace Google\Cloud\Samples\Datastore\Tasks;

use DateTime;
use Google\Cloud\Datastore\EntityIterator;
// [START datastore_build_service]
use Google\Cloud\Datastore\DatastoreClient;

/**
 * Create a Cloud Datastore client.
 *
 * @param string $projectId
 * @return DatastoreClient
 */
function build_datastore_service($projectId)
{
    $datastore = new DatastoreClient(['projectId' => $projectId]);
    return $datastore;
}
// [END datastore_build_service]

/**
 * Create a Cloud Datastore client with a namespace.
 *
 * @return DatastoreClient
 */
function build_datastore_service_with_namespace()
{
    $namespaceId = getenv('CLOUD_DATASTORE_NAMESPACE');
    if ($namespaceId === false) {
        return new DatastoreClient();
    }
    return new DatastoreClient(['namespaceId' => $namespaceId]);
}

// [START datastore_add_entity]
/**
 * Create a new task with a given description.
 *
 * @param DatastoreClient $datastore
 * @param $description
 * @return Google\Cloud\Datastore\Entity
 */
function add_task(DatastoreClient $datastore, $description)
{
    $taskKey = $datastore->key('Task');
    $task = $datastore->entity(
        $taskKey,
        [
            'created' => new DateTime(),
            'description' => $description,
            'done' => false
        ],
        ['excludeFromIndexes' => ['description']]
    );
    $datastore->insert($task);
    return $task;
}
// [END datastore_add_entity]

// [START datastore_update_entity]
/**
 * Mark a task with a given id as done.
 *
 * @param DatastoreClient $datastore
 * @param int $taskId
 */
function mark_done(DatastoreClient $datastore, $taskId)
{
    $taskKey = $datastore->key('Task', $taskId);
    $transaction = $datastore->transaction();
    $task = $transaction->lookup($taskKey);
    $task['done'] = true;
    $transaction->upsert($task);
    $transaction->commit();
}
// [END datastore_update_entity]

// [START datastore_delete_entity]
/**
 * Delete a task with a given id.
 *
 * @param DatastoreClient $datastore
 * @param $taskId
 */
function delete_task(DatastoreClient $datastore, $taskId)
{
    $taskKey = $datastore->key('Task', $taskId);
    $datastore->delete($taskKey);
}
// [END datastore_delete_entity]

// [START datastore_retrieve_entities]
/**
 * Return an iterator for all the tasks in ascending order of creation time.
 *
 * @param DatastoreClient $datastore
 * @return EntityIterator<Google\Cloud\Datastore\Entity>
 */
function list_tasks(DatastoreClient $datastore)
{
    $query = $datastore->query()
        ->kind('Task')
        ->order('created');
    return $datastore->runQuery($query);
}
// [END datastore_retrieve_entities]


text:
import { join } from 'path';
import { ArchitectCommandModule } from '../../command-builder/architect-command-module';
import { CommandModuleImplementation } from '../../command-builder/command-module';

export class BuildCommandModule
  extends ArchitectCommandModule
  implements CommandModuleImplementation
{
  multiTarget = false;
  command = 'build [project]';
  aliases = ['b'];
  describe =
    'Compiles an Angular application or library into an output directory named dist/ at the given output path.';
  longDescriptionPath = join(__dirname, 'long-description.md');
}


text:
package com.gurkensalat.osm.entity;

public enum OsmEntityType
{
    NODE("Node"),
    WAY("Way"),
    REL("Relation");

    private final String name;

    private OsmEntityType(String name)
    {
        this.name = name;
    }

    public String toString()
    {
        return name;
    }
}


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.cloudtasks.v2.model;

/**
 * Request message for CreateTask.
 *
 *
 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 Cloud Tasks 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 CreateTaskRequest extends com.google.api.client.json.GenericJson {

  /**
   * The response_view specifies which subset of the Task will be returned.
   *
   * By default response_view is BASIC; not all information is retrieved by default because some
   * data, such as payloads, might be desirable to return only when needed because of its large size
   * or because of the sensitivity of data that it contains.
   *
   * Authorization for FULL requires `cloudtasks.tasks.fullView` [Google
   * IAM](https://cloud.google.com/iam/) permission on the Task resource.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String responseView;

  /**
   * Required.
   *
   * The task to add.
   *
   * Task names have the following format:
   * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. The user can
   * optionally specify a task name. If a name is not specified then the system will generate a
   * random unique task id, which will be set in the task returned in the response.
   *
   * If schedule_time is not set or is in the past then Cloud Tasks will set it to the current time.
   *
   * Task De-duplication:
   *
   * Explicitly specifying a task ID enables task de-duplication.  If a task's ID is identical to
   * that of an existing task or a task that was deleted or executed recently then the call will
   * fail with ALREADY_EXISTS. If the task's queue was created using Cloud Tasks, then another task
   * with the same name can't be created for ~1hour after the original task was deleted or executed.
   * If the task's queue was created using queue.yaml or queue.xml, then another task with the same
   * name can't be created for ~9days after the original task was deleted or executed.
   *
   * Because there is an extra lookup cost to identify duplicate task names, these CreateTask calls
   * have significantly increased latency. Using hashed strings for the task id or for the prefix of
   * the task id is recommended. Choosing task ids that are sequential or have sequential prefixes,
   * for example using a timestamp, causes an increase in latency and error rates in all task
   * commands. The infrastructure relies on an approximately uniform distribution of task ids to
   * store and serve tasks efficiently.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Task task;

  /**
   * The response_view specifies which subset of the Task will be returned.
   *
   * By default response_view is BASIC; not all information is retrieved by default because some
   * data, such as payloads, might be desirable to return only when needed because of its large size
   * or because of the sensitivity of data that it contains.
   *
   * Authorization for FULL requires `cloudtasks.tasks.fullView` [Google
   * IAM](https://cloud.google.com/iam/) permission on the Task resource.
   * @return value or {@code null} for none
   */
  public java.lang.String getResponseView() {
    return responseView;
  }

  /**
   * The response_view specifies which subset of the Task will be returned.
   *
   * By default response_view is BASIC; not all information is retrieved by default because some
   * data, such as payloads, might be desirable to return only when needed because of its large size
   * or because of the sensitivity of data that it contains.
   *
   * Authorization for FULL requires `cloudtasks.tasks.fullView` [Google
   * IAM](https://cloud.google.com/iam/) permission on the Task resource.
   * @param responseView responseView or {@code null} for none
   */
  public CreateTaskRequest setResponseView(java.lang.String responseView) {
    this.responseView = responseView;
    return this;
  }

  /**
   * Required.
   *
   * The task to add.
   *
   * Task names have the following format:
   * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. The user can
   * optionally specify a task name. If a name is not specified then the system will generate a
   * random unique task id, which will be set in the task returned in the response.
   *
   * If schedule_time is not set or is in the past then Cloud Tasks will set it to the current time.
   *
   * Task De-duplication:
   *
   * Explicitly specifying a task ID enables task de-duplication.  If a task's ID is identical to
   * that of an existing task or a task that was deleted or executed recently then the call will
   * fail with ALREADY_EXISTS. If the task's queue was created using Cloud Tasks, then another task
   * with the same name can't be created for ~1hour after the original task was deleted or executed.
   * If the task's queue was created using queue.yaml or queue.xml, then another task with the same
   * name can't be created for ~9days after the original task was deleted or executed.
   *
   * Because there is an extra lookup cost to identify duplicate task names, these CreateTask calls
   * have significantly increased latency. Using hashed strings for the task id or for the prefix of
   * the task id is recommended. Choosing task ids that are sequential or have sequential prefixes,
   * for example using a timestamp, causes an increase in latency and error rates in all task
   * commands. The infrastructure relies on an approximately uniform distribution of task ids to
   * store and serve tasks efficiently.
   * @return value or {@code null} for none
   */
  public Task getTask() {
    return task;
  }

  /**
   * Required.
   *
   * The task to add.
   *
   * Task names have the following format:
   * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. The user can
   * optionally specify a task name. If a name is not specified then the system will generate a
   * random unique task id, which will be set in the task returned in the response.
   *
   * If schedule_time is not set or is in the past then Cloud Tasks will set it to the current time.
   *
   * Task De-duplication:
   *
   * Explicitly specifying a task ID enables task de-duplication.  If a task's ID is identical to
   * that of an existing task or a task that was deleted or executed recently then the call will
   * fail with ALREADY_EXISTS. If the task's queue was created using Cloud Tasks, then another task
   * with the same name can't be created for ~1hour after the original task was deleted or executed.
   * If the task's queue was created using queue.yaml or queue.xml, then another task with the same
   * name can't be created for ~9days after the original task was deleted or executed.
   *
   * Because there is an extra lookup cost to identify duplicate task names, these CreateTask calls
   * have significantly increased latency. Using hashed strings for the task id or for the prefix of
   * the task id is recommended. Choosing task ids that are sequential or have sequential prefixes,
   * for example using a timestamp, causes an increase in latency and error rates in all task
   * commands. The infrastructure relies on an approximately uniform distribution of task ids to
   * store and serve tasks efficiently.
   * @param task task or {@code null} for none
   */
  public CreateTaskRequest setTask(Task task) {
    this.task = task;
    return this;
  }

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

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

}


text:
namespace LASI.Core
{
    /// <summary>
    /// <para>
    /// Defines the role requirements for constructs, generally Actions, which can be modified by
    /// modal words such as "can" or "shalt".
    /// </para>
    /// <para>
    /// Along with the other interfaces in the Syntactic Interfaces Library, the IModalityModifiable
    /// interface provides for cross-axial generalization over lexical types.
    /// </para>
    /// </summary>
    public interface IModalityModifiable
    {
        /// <summary>Gets or sets the ModalAuxilary word which modifies this instance.</summary>
        ModalAuxilary Modality
        {
            get;
            set;
        }
    }
}


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=constant.SDL_HAPTIC_CUSTOM.html">

Redirecting to constant.SDL_HAPTIC_CUSTOM.html...


text:
package com.github.werpu.scalaelresolver.scalaelresolvertest

class BaseBean {
  var hello1 = "hello from basebean"
}