text:
package org.apache.ignite.internal.processors.cache;

import java.util.concurrent.Callable;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.store.CacheStore;
import org.apache.ignite.cache.store.CacheStoreAdapter;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;

import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;

/**
 * Basic store test.
 */
public abstract class GridCacheBasicStoreMultithreadedAbstractTest extends GridCommonAbstractTest {
    /** Cache store. */
    private CacheStore<Integer, Integer> store;

    /**
     *
     */
    protected GridCacheBasicStoreMultithreadedAbstractTest() {
        super(false /*start grid. */);
    }

    /** {@inheritDoc} */
    @Override protected void afterTest() throws Exception {
        IgniteCache<?, ?> cache = jcache();

        if (cache != null)
            cache.clear();

        stopAllGrids();
    }

    /**
     * @return Caching mode.
     */
    protected abstract CacheMode cacheMode();

    /** {@inheritDoc} */
    @SuppressWarnings("unchecked")
    @Override protected final IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
        IgniteConfiguration c = super.getConfiguration(igniteInstanceName);

        TcpDiscoverySpi disco = new TcpDiscoverySpi();

        disco.setIpFinder(new TcpDiscoveryVmIpFinder(true));

        c.setDiscoverySpi(disco);

        CacheConfiguration cc = defaultCacheConfiguration();

        cc.setCacheMode(cacheMode());
        cc.setWriteSynchronizationMode(FULL_SYNC);
        cc.setSwapEnabled(false);

        cc.setCacheStoreFactory(singletonFactory(store));
        cc.setReadThrough(true);
        cc.setWriteThrough(true);
        cc.setLoadPreviousValue(true);

        c.setCacheConfiguration(cc);

        return c;
    }

    /**
     * @throws Exception If failed.
     */
    public void testConcurrentGet() throws Exception {
        final AtomicInteger cntr = new AtomicInteger();

        store = new CacheStoreAdapter<Integer, Integer>() {
            @Override public Integer load(Integer key) {
                return cntr.incrementAndGet();
            }

            /** {@inheritDoc} */
            @Override public void write(javax.cache.Cache.Entry<? extends Integer, ? extends Integer> e) {
                assert false;
            }

            /** {@inheritDoc} */
            @Override public void delete(Object key) {
                assert false;
            }
        };

        startGrid();

        final IgniteCache<Integer, Integer> cache = jcache();

        int threads = 2;

        final CyclicBarrier barrier = new CyclicBarrier(threads);

        multithreaded(new Callable<Object>() {
            @Override public Object call() throws Exception {
                barrier.await();

                cache.get(1);

                return null;
            }
        }, threads, "concurrent-get-worker");

        assertEquals(1, cntr.get());
    }
}


text:
package main

import (
	"bytes"
	"fmt"
	"os"
	"os/exec"
	"testing"

	"github.com/stretchr/testify/assert"
	server "sqlflow.org/sqlflow/go/sqlflowserver"
)

func CasePAIMaxComputeTrainPredictCategoricalFeature(t *testing.T) {
	t.Parallel()
	a := assert.New(t)
	trainSQL := `SELECT cast(sepal_length as int) sepal_length, class
FROM alifin_jtest_dev.sqlflow_test_iris_train
TO TRAIN DNNClassifier WITH
		model.hidden_units = [10, 20], model.n_classes=3
COLUMN EMBEDDING(CATEGORY_ID(sepal_length, 1000), 2, "sum")
LABEL class
INTO e2etest_predict_categorical_feature;`
	_, _, _, err := connectAndRunSQL(trainSQL)
	if err != nil {
		a.Fail("Run trainSQL error: %v", err)
	}

	predSQL := `SELECT cast(sepal_length as int) sepal_length, class FROM alifin_jtest_dev.sqlflow_test_iris_test
TO PREDICT alifin_jtest_dev.pred_catcol.class USING e2etest_predict_categorical_feature;`
	_, _, _, err = connectAndRunSQL(predSQL)
	if err != nil {
		a.Fail("Run predSQL error: %v", err)
	}

	trainSQL = `SELECT cast(sepal_length as int) sepal_length, cast(sepal_width as int) sepal_width, class
FROM alifin_jtest_dev.sqlflow_test_iris_train
TO TRAIN DNNLinearCombinedClassifier WITH
		model.dnn_hidden_units = [10, 20], model.n_classes=3
COLUMN EMBEDDING(CATEGORY_ID(sepal_length, 20), 2, "sum") for dnn_feature_columns
COLUMN EMBEDDING(CATEGORY_ID(sepal_width, 20), 2, "sum") for linear_feature_columns
LABEL class
INTO e2etest_predict_categorical_feature2;`
	_, _, _, err = connectAndRunSQL(trainSQL)
	if err != nil {
		a.Fail("Run trainSQL error: %v", err)
	}

	predSQL = `SELECT cast(sepal_length as int) sepal_length, cast(sepal_width as int) sepal_width, class FROM alifin_jtest_dev.sqlflow_test_iris_test
TO PREDICT alifin_jtest_dev.pred_catcol2.class USING e2etest_predict_categorical_feature2;`
	_, _, _, err = connectAndRunSQL(predSQL)
	if err != nil {
		a.Fail("Run predSQL error: %v", err)
	}
}

func CasePAIMaxComputeTrainDistributed(t *testing.T) {
	t.Parallel()
	a := assert.New(t)
	trainSQL := fmt.Sprintf(`SELECT * FROM %s
TO TRAIN DNNClassifier
WITH
	model.n_classes = 3,
	model.hidden_units = [10, 20],
	train.num_workers=2,
	train.num_ps=2,
	train.save_checkpoints_steps=20,
	train.epoch=10,
	train.batch_size=4,
	train.verbose=1
LABEL class
INTO e2etest_dnn_model_distributed;`, caseTrainTable)
	connectAndRunSQLShouldError(trainSQL)

	trainSQL = fmt.Sprintf(`SELECT * FROM %s
TO TRAIN DNNClassifier
WITH
	model.n_classes = 3,
	model.hidden_units = [10, 20],
	train.num_workers=2,
	train.num_ps=2,
	train.save_checkpoints_steps=20,
	train.epoch=10,
	train.batch_size=4,
	train.verbose=1,
	validation.select="select * from %s"
LABEL class
INTO e2etest_dnn_model_distributed;`, caseTrainTable, caseTestTable)
	_, _, _, err := connectAndRunSQL(trainSQL)
	a.NoError(err)
}

func CasePAIMaxComputeTrainDistributedKeras(t *testing.T) {
	t.Parallel()
	a := assert.New(t)
	trainSQL := fmt.Sprintf(`SELECT * FROM %s
TO TRAIN sqlflow_models.dnnclassifier_functional_model
WITH
	model.n_classes=3,
	train.num_workers=2,
	train.num_ps=2,
	train.epoch=10,
	train.batch_size=4,
	train.verbose=1,
	validation.select="select * from %s",
	validation.metrics="CategoricalAccuracy"
LABEL class
INTO e2etest_keras_dnn_model_distributed;`, caseTrainTable, caseTestTable)
	_, _, _, err := connectAndRunSQL(trainSQL)
	a.NoError(err)
}

func CasePAIMaxComputeTrainPredictDiffColumns(t *testing.T) {
	t.Parallel()
	a := assert.New(t)
	trainSQL := fmt.Sprintf(`SELECT sepal_length, sepal_width, class FROM %s
TO TRAIN DNNClassifier
WITH model.hidden_units=[64,32], model.n_classes=3, train.batch_size=4
LABEL class
INTO e2etest_selected_cols_model;
`, caseTrainTable)
	_, _, _, e := connectAndRunSQL(trainSQL)
	a.NoError(e, "run trainSQL error.")

	predSQL := fmt.Sprintf(`SELECT * FROM %s
	TO PREDICT %s.e2etest_selected_cols_pred.target
	USING e2etest_selected_cols_model;
		`, caseTestTable, caseDB)
	_, _, _, e = connectAndRunSQL(predSQL)
	a.NoError(e, "run predSQL error")

	query := fmt.Sprintf(`SELECT * FROM %s.e2etest_selected_cols_pred LIMIT 1;`, caseDB)
	_, resultRows, _, e := connectAndRunSQL(query)
	a.NoError(e)

	query = fmt.Sprintf(`SELECT * FROM %s LIMIT 1;`, caseTestTable)
	_, predRows, _, e := connectAndRunSQL(query)
	a.NoError(e)
	for idx := range resultRows {
		a.Equal(predRows[0][idx], resultRows[0][idx])
	}
}

func CasePAIMaxComputeTrainXGBDistributed(t *testing.T) {
	t.Parallel()
	a := assert.New(t)
	trainSQL := fmt.Sprintf(`SELECT * FROM %s
	TO TRAIN xgboost.gbtree
	WITH
		objective="multi:softprob",
		train.num_boost_round = 30,
		train.num_workers = 2,
		eta = 0.4,
		num_class = 3,
		train.batch_size=10,
		validation.select="select * from %s"
	LABEL class
	INTO e2etest_xgb_classi_model;`, caseTrainTable, caseTrainTable)
	_, _, _, err := connectAndRunSQL(trainSQL)
	if err != nil {
		a.Fail("Run trainSQL error: %v", err)
	}
}

func CasePAIMaxComputeTrainTFBTDistributed(t *testing.T) {
	t.Parallel()
	a := assert.New(t)
	trainSQL := fmt.Sprintf(`SELECT * FROM %s WHERE class < 2
TO TRAIN BoostedTreesClassifier
WITH
	model.center_bias=True,
	model.n_batches_per_layer=70,
	train.num_workers=2,
	train.num_ps=1,
	train.epoch=10,
	validation.select="select * from %s"
LABEL class
INTO e2etest_tfbt_model_distributed;`, caseTrainTable, caseTestTable)
	_, _, _, err := connectAndRunSQL(trainSQL)
	a.NoError(err)
}

func CaseTrainPAIKMeans(t *testing.T) {
	a := assert.New(t)
	err := dropPAIModel(dbConnStr, caseInto)
	a.NoError(err)

	trainSQL := fmt.Sprintf(`SELECT * FROM %s
	TO TRAIN kmeans
	WITH
		center_count=3,
		idx_table_name=%s,
		excluded_columns=class
	INTO %s;
	`, caseTrainTable, caseTrainTable+"_test_output_idx", caseInto)
	_, _, _, err = connectAndRunSQL(trainSQL)
	if err != nil {
		a.Fail("Run trainSQL error: %v", err)
	}

	predSQL := fmt.Sprintf(`SELECT * FROM %s
	TO PREDICT %s.cluster_index
	USING %s;
	`, caseTestTable, casePredictTable, caseInto)
	_, _, _, err = connectAndRunSQL(predSQL)
	if err != nil {
		a.Fail("Run trainSQL error: %v", err)
	}
}

func dropPAIModel(dataSource, modelName string) error {
	code := fmt.Sprintf(`import subprocess
import runtime.db
driver, dsn = "%s".split("://")
assert driver == "maxcompute"
user, passwd, address, database = runtime.db.parseMaxComputeDSN(dsn)
cmd = "drop offlinemodel if exists %s"
subprocess.run(["odpscmd", "-u", user,
                           "-p", passwd,
                           "--project", database,
                           "--endpoint", address,
                           "-e", cmd],
               check=True)
	`, dataSource, modelName)
	cmd := exec.Command("python", "-u")
	cmd.Stdin = bytes.NewBufferString(code)
	if e := cmd.Run(); e != nil {
		return e
	}
	return nil
}

func CaseTrainPAIRandomForests(t *testing.T) {
	a := assert.New(t)
	err := dropPAIModel(dbConnStr, "my_rf_model")
	a.NoError(err)

	trainSQL := fmt.Sprintf(`SELECT * FROM %s
TO TRAIN randomforests
WITH tree_num = 3
LABEL class
INTO my_rf_model;`, caseTrainTable)
	_, _, _, err = connectAndRunSQL(trainSQL)
	if err != nil {
		a.Fail("Run trainSQL error: %v", err)
	}

	predSQL := fmt.Sprintf(`SELECT * FROM %s
TO PREDICT %s.class
USING my_rf_model;`, caseTestTable, casePredictTable)
	_, _, _, err = connectAndRunSQL(predSQL)
	if err != nil {
		a.Fail("Run trainSQL error: %v", err)
	}

	explainSQL := fmt.Sprintf(`SELECT * FROM %s
TO EXPLAIN my_rf_model
WITH label_column = class
USING TreeExplainer
INTO %s.rf_model_explain;`, caseTestTable, caseDB)
	_, _, _, err = connectAndRunSQL(explainSQL)
	if err != nil {
		a.Fail("Run trainSQL error: %v", err)
	}
}

func CasePAIMaxComputeDNNTrainPredictExplain(t *testing.T) {
	t.Parallel()
	a := assert.New(t)
	trainSQL := fmt.Sprintf(`SELECT * FROM %s
TO TRAIN DNNClassifier
WITH model.n_classes = 3, model.hidden_units = [10, 20],
optimizer.learning_rate=0.01, model.optimizer="AdagradOptimizer"
LABEL class
INTO e2etest_pai_dnn;`, caseTrainTable)
	_, _, _, err := connectAndRunSQL(trainSQL)
	if err != nil {
		a.Fail("Run trainSQL error: %v", err)
	}

	evalSQL := fmt.Sprintf(`SELECT * FROM %s
TO EVALUATE e2etest_pai_dnn
WITH validation.metrics="Accuracy,Recall"
LABEL class
INTO %s.e2etest_pai_dnn_evaluate_result;`, caseTrainTable, caseDB)
	_, _, _, err = connectAndRunSQL(evalSQL)
	if err != nil {
		a.Fail("Run trainSQL error: %v", err)
	}

	predSQL := fmt.Sprintf(`SELECT * FROM %s
TO PREDICT %s.pai_dnn_predict.class
USING e2etest_pai_dnn;`, caseTestTable, caseDB)
	_, _, _, err = connectAndRunSQL(predSQL)
	if err != nil {
		a.Fail("Run predSQL error: %v", err)
	}

	showPred := fmt.Sprintf(`SELECT *
FROM %s.pai_dnn_predict LIMIT 5;`, caseDB)
	_, rows, _, err := connectAndRunSQL(showPred)
	if err != nil {
		a.Fail("Run showPred error: %v", err)
	}

	for _, row := range rows {
		// NOTE: predict result maybe random, only check predicted
		// class >=0, need to change to more flexible checks than
		// checking expectedPredClasses := []int64{2, 1, 0, 2, 0}
		AssertGreaterEqualAny(a, row[4], int64(0))

		// avoiding nil features in predict result
		nilCount := 0
		for ; nilCount < 4 && row[nilCount] == nil; nilCount++ {
		}
		a.False(nilCount == 4)
	}

	explainSQL := fmt.Sprintf(`SELECT * FROM %s
TO EXPLAIN e2etest_pai_dnn
WITH label_col=class
USING TreeExplainer
INTO %s.pai_dnn_explain_result;`, caseTestTable, caseDB)
	_, _, _, err = connectAndRunSQL(explainSQL)
	if err != nil {
		a.Fail("Run predSQL error: %v", err)
	}
}

func CasePAIMaxComputeTrainDenseCol(t *testing.T) {
	t.Parallel()
	a := assert.New(t)
	// Test train and predict using concated columns sepal_length, sepal_width, petal_length, petal_width
	trainSQL := fmt.Sprintf(`SELECT class, CONCAT(sepal_length, ",", sepal_width, ",", petal_length, ",", petal_width) AS f1
FROM %s
TO TRAIN DNNClassifier
WITH model.hidden_units=[64,32], model.n_classes=3, train.batch_size=32
COLUMN DENSE(f1, 4)
LABEL class
INTO e2etest_dense_input;`, caseTrainTable)
	_, _, _, err := connectAndRunSQL(trainSQL)
	if err != nil {
		a.Fail("Run trainSQL error: %v", err)
	}
}

func CasePAIMaxComputeTrainDenseColWithoutIndicatingShape(t *testing.T) {
	t.Parallel()
	a := assert.New(t)

	trainSQL := fmt.Sprintf(`SELECT class, sepal_length, sepal_width, petal_length, petal_width
FROM %s
TO TRAIN DNNClassifier WITH model.hidden_units=[64,32], model.n_classes=3, train.batch_size=32
COLUMN DENSE(sepal_length)
LABEL class
INTO e2etest_dense_input_without_indicating_shape;`, caseTrainTable)

	_, _, _, err := connectAndRunSQL(trainSQL)
	if err != nil {
		a.Fail("Run trainSQL without indicating shape error: %v", err)
	}
}

func CasePAIMaxComputeTrainXGBoost(t *testing.T) {
	t.Parallel()
	a := assert.New(t)
	// train with batch_size to split dmatrix files
	trainSQL := fmt.Sprintf(`SELECT * FROM %s
TO TRAIN xgboost.gbtree
WITH
	objective="multi:softmax",
	train.num_boost_round = 30,
	eta = 0.4,
	num_class = 3,
	train.batch_size=10,
	validation.select="select * from %s"
LABEL class
INTO e2etest_xgb_classi_model;`, caseTrainTable, caseTestTable)
	_, _, _, err := connectAndRunSQL(trainSQL)
	a.NoError(err, "Run trainSQL error.")
	// train without batch_size
	trainSQL = fmt.Sprintf(`SELECT * FROM %s
TO TRAIN xgboost.gbtree
WITH
	objective="multi:softmax",
	train.num_boost_round = 30,
	eta = 0.4,
	num_class = 3,
	validation.select="select * from %s"
LABEL class
INTO e2etest_xgb_classi_model;`, caseTrainTable, caseTestTable)
	_, _, _, err = connectAndRunSQL(trainSQL)
	a.NoError(err, "Run trainSQL error.")

	predSQL := fmt.Sprintf(`SELECT * FROM %s
TO PREDICT %s.pai_xgb_predict.class
WITH
	predict.num_workers=2
USING e2etest_xgb_classi_model;`, caseTestTable, caseDB)
	_, _, _, err = connectAndRunSQL(predSQL)
	a.NoError(err, "Run predSQL error.")

	evalSQL := fmt.Sprintf(`SELECT * FROM %s
TO EVALUATE e2etest_xgb_classi_model
WITH validation.metrics="accuracy_score"
LABEL class
INTO %s.e2etest_xgb_evaluate_result;`, caseTestTable, caseDB)
	_, _, _, err = connectAndRunSQL(evalSQL)
	a.NoError(err, "Run evalSQL error.")

	titanicTrain := fmt.Sprintf(`SELECT * FROM %s.sqlflow_titanic_train
TO TRAIN xgboost.gbtree
WITH objective="binary:logistic"
LABEL survived
INTO e2etest_xgb_titanic;`, caseDB)
	_, _, _, err = connectAndRunSQL(titanicTrain)
	a.NoError(err, "Run titanicTrain error.")

	titanicExplain := fmt.Sprintf(`SELECT * FROM %s.sqlflow_titanic_train
TO EXPLAIN e2etest_xgb_titanic
WITH label_col=survived
INTO %s.e2etest_titanic_explain_result;`, caseDB, caseDB)
	_, _, _, err = connectAndRunSQL(titanicExplain)
	a.NoError(err, "Run titanicExplain error.")
}

func CasePAIMaxComputeTrainCustomModel(t *testing.T) {
	t.Parallel()
	a := assert.New(t)
	trainSQL := fmt.Sprintf(`SELECT * FROM %s
TO TRAIN sqlflow_models.DNNClassifier
WITH model.n_classes = 3, model.hidden_units = [10, 20], validation.select="select * from %s", validation.steps=2
LABEL class
INTO e2etest_keras_dnn;`, caseTrainTable, caseTestTable)
	_, _, _, err := connectAndRunSQL(trainSQL)
	if err != nil {
		a.Fail("run trainSQL error: %v", err)
	}

	predSQL := fmt.Sprintf(`SELECT * FROM %s
TO PREDICT %s.keras_predict.class
USING e2etest_keras_dnn;`, caseTestTable, caseDB)
	_, _, _, err = connectAndRunSQL(predSQL)
	if err != nil {
		a.Fail("run predSQL error: %v", err)
	}
}

func CasePAIMaxComputeWeightedCategory(t *testing.T) {
	t.Parallel()
	a := assert.New(t)

	trainSQL := `SELECT * FROM alifin_jtest_dev.weighted_key_value_train
TO TRAIN DNNClassifier
WITH model.n_classes = 2, model.hidden_units = [64,32],train.batch_size=128,train.epoch=2
COLUMN EMBEDDING(WEIGHTED_CATEGORY(CATEGORY_HASH(SPARSE(feature, 128, ",", "int", ":", "float"), 128)), 32)
LABEL label_col
INTO e2etest_weighted_emb;`
	_, _, _, err := connectAndRunSQL(trainSQL)
	if err != nil {
		a.Fail("run trainSQL error: %v", err)
	}

	predSQL := `SELECT * FROM alifin_jtest_dev.weighted_key_value_train
TO PREDICT alifin_jtest_dev.weighted_emb.label_col
USING e2etest_weighted_emb;`
	_, _, _, err = connectAndRunSQL(predSQL)
	if err != nil {
		a.Fail("run predSQL error: %v", err)
	}
}

// TestEnd2EndMaxComputePAI test cases that runs on PAI. Need to set below
// environment variables to run the test:
// SQLFLOW_submitter=pai
// SQLFLOW_TEST_DB=maxcompute
// SQLFLOW_TEST_DB_MAXCOMPUTE_PROJECT="xxx"
// SQLFLOW_TEST_DB_MAXCOMPUTE_ENDPOINT="xxx"
// SQLFLOW_TEST_DB_MAXCOMPUTE_AK="xxx"
// SQLFLOW_TEST_DB_MAXCOMPUTE_SK="xxx"
// SQLFLOW_OSS_CHECKPOINT_CONFIG="xxx"
// SQLFLOW_OSS_ENDPOINT="xxx"
// SQLFLOW_OSS_AK="xxx"
// SQLFLOW_OSS_SK="xxx"
func TestEnd2EndMaxComputePAI(t *testing.T) {
	testDBDriver := os.Getenv("SQLFLOW_TEST_DB")
	if testDBDriver != "maxcompute" {
		t.Skip("Skipping non maxcompute tests")
	}
	if os.Getenv("SQLFLOW_submitter") != "pai" && os.Getenv("SQLFLOW_submitter") != "pai_local" {
		t.Skip("Skip non PAI tests")
	}
	AK := os.Getenv("SQLFLOW_TEST_DB_MAXCOMPUTE_AK")
	SK := os.Getenv("SQLFLOW_TEST_DB_MAXCOMPUTE_SK")
	endpoint := os.Getenv("SQLFLOW_TEST_DB_MAXCOMPUTE_ENDPOINT")
	dbConnStr = fmt.Sprintf("maxcompute://%s:%s@%s", AK, SK, endpoint)

	tmpDir, caCrt, caKey, err := generateTempCA()
	defer os.RemoveAll(tmpDir)
	if err != nil {
		t.Fatalf("failed to generate CA pair %v", err)
	}

	caseDB = os.Getenv("SQLFLOW_TEST_DB_MAXCOMPUTE_PROJECT")
	if caseDB == "" {
		t.Fatalf("Must set env SQLFLOW_TEST_DB_MAXCOMPUTE_PROJECT")
	}
	caseTrainTable = caseDB + ".sqlflow_test_iris_train"
	caseTestTable = caseDB + ".sqlflow_test_iris_test"
	casePredictTable = caseDB + ".sqlflow_test_iris_predict"
	// write model to current MaxCompute project
	caseInto = "my_dnn_model"

	if err := prepareTestData(dbConnStr); err != nil {
		t.FailNow()
	}

	go start(caCrt, caKey, unitTestPort, false)
	server.WaitPortReady(fmt.Sprintf("localhost:%d", unitTestPort), 0)

	t.Run("group", func(t *testing.T) {
		t.Run("CasePAIMaxComputeDNNTrainPredictExplain", CasePAIMaxComputeDNNTrainPredictExplain)
		t.Run("CasePAIMaxComputeTrainDenseCol", CasePAIMaxComputeTrainDenseCol)
		t.Run("CasePAIMaxComputeTrainDenseColWithoutIndicatingShape", CasePAIMaxComputeTrainDenseColWithoutIndicatingShape)
		t.Run("CasePAIMaxComputeTrainXGBoost", CasePAIMaxComputeTrainXGBoost)
		t.Run("CasePAIMaxComputeTrainCustomModel", CasePAIMaxComputeTrainCustomModel)
		t.Run("CasePAIMaxComputeTrainDistributed", CasePAIMaxComputeTrainDistributed)
		t.Run("CasePAIMaxComputeTrainPredictCategoricalFeature", CasePAIMaxComputeTrainPredictCategoricalFeature)
		t.Run("CasePAIMaxComputeTrainTFBTDistributed", CasePAIMaxComputeTrainTFBTDistributed)
		t.Run("CasePAIMaxComputeTrainDistributedKeras", CasePAIMaxComputeTrainDistributedKeras)
		t.Run("CasePAIMaxComputeTrainPredictDiffColumns", CasePAIMaxComputeTrainPredictDiffColumns)
		t.Run("CasePAIMaxComputeTrainXGBDistributed", CasePAIMaxComputeTrainXGBDistributed)
		// FIXME(typhoonzero): Add this test back when we solve error: model already exist issue on the CI.
		// t.Run("CaseTrainPAIRandomForests", CaseTrainPAIRandomForests)
		t.Run("CaseXGBoostSparseKeyValueColumn", caseXGBoostSparseKeyValueColumn)
		t.Run("CaseEnd2EndXGBoostDenseFeatureColumn", func(t *testing.T) {
			caseEnd2EndXGBoostDenseFeatureColumn(t, true)
		})

		t.Run("CasePAIMaxComputeWeightedCategory", CasePAIMaxComputeWeightedCategory)
		t.Run("CaseOneClassSVMModel", func(t *testing.T) {
			caseOneClassSVMModel(t, nil)
		})
		t.Run("CaseOneClassSVMModelWithScore", func(t *testing.T) {
			caseOneClassSVMModel(t, []string{"score"})
		})
	})
}

redpajama_set_name: RedPajamaGithub


text:
{% extends "structure/base.html" %}

{% block content %}

Tag: {{tag}}

{% for article in articles %}
	{{article.title}}
{% endfor %}
{% endblock %}


text:
package android.test;

import static junit.framework.Assert.*;

import android.view.View;
import android.view.ViewGroup;

/**
 * Some useful assertions about views.
 *
 * @deprecated Use
 * Espresso
 * View Matchers instead. New test should be written using the
 * Android Testing Support Library.
 * For more information about UI testing, take the
 * Espresso UI testing training.
 */
@Deprecated
public class ViewAsserts {

    private ViewAsserts() {}

    /**
     * Assert that view is on the screen.
     * @param origin The root view of the screen.
     * @param view The view.
     */
    static public void assertOnScreen(View origin, View view) {
        int[] xy = new int[2];
        view.getLocationOnScreen(xy);

        int[] xyRoot = new int[2];
        origin.getLocationOnScreen(xyRoot);

        int y = xy[1] - xyRoot[1];

        assertTrue("view should have positive y coordinate on screen",
                y  >= 0);

        assertTrue("view should have y location on screen less than drawing "
                + "height of root view",
                y <= view.getRootView().getHeight());
    }

    /**
     * Assert that view is below the visible screen.
     * @param origin The root view of the screen.
     * @param view The view
     */
    static public void assertOffScreenBelow(View origin, View view) {
        int[] xy = new int[2];
        view.getLocationOnScreen(xy);

        int[] xyRoot = new int[2];
        origin.getLocationOnScreen(xyRoot);

        int y = xy[1] - xyRoot[1];

        assertTrue("view should have y location on screen greater than drawing "
                + "height of origen view (" + y + " is not greater than "
                + origin.getHeight() + ")",
                y > origin.getHeight());
    }

    /**
     * Assert that view is above the visible screen.
     * @param origin Te root view of the screen.
     * @param view The view
     */
    static public void assertOffScreenAbove(View origin, View view) {
        int[] xy = new int[2];
        view.getLocationOnScreen(xy);

        int[] xyRoot = new int[2];
        origin.getLocationOnScreen(xyRoot);

        int y = xy[1] - xyRoot[1];

        assertTrue("view should have y location less than that of origin view",
                y < 0);
    }

    /**
     * Assert that a view has a particular x and y position on the visible screen.
     * @param origin The root view of the screen.
     * @param view The view.
     * @param x The expected x coordinate.
     * @param y The expected y coordinate.
     */
    static public void assertHasScreenCoordinates(View origin, View view, int x, int y) {
        int[] xy = new int[2];
        view.getLocationOnScreen(xy);

        int[] xyRoot = new int[2];
        origin.getLocationOnScreen(xyRoot);

        assertEquals("x coordinate", x, xy[0] - xyRoot[0]);
        assertEquals("y coordinate", y, xy[1] - xyRoot[1]);
    }

    /**
     * Assert that two views are aligned on their baseline, that is that their baselines
     * are on the same y location.
     *
     * @param first The first view
     * @param second The second view
     */
    static public void assertBaselineAligned(View first, View second) {
        int[] xy = new int[2];
        first.getLocationOnScreen(xy);
        int firstTop = xy[1] + first.getBaseline();

        second.getLocationOnScreen(xy);
        int secondTop = xy[1] + second.getBaseline();

        assertEquals("views are not baseline aligned", firstTop, secondTop);
    }

    /**
     * Assert that two views are right aligned, that is that their right edges
     * are on the same x location.
     *
     * @param first The first view
     * @param second The second view
     */
    static public void assertRightAligned(View first, View second) {
        int[] xy = new int[2];
        first.getLocationOnScreen(xy);
        int firstRight = xy[0] + first.getMeasuredWidth();

        second.getLocationOnScreen(xy);
        int secondRight = xy[0] + second.getMeasuredWidth();

        assertEquals("views are not right aligned", firstRight, secondRight);
    }

    /**
     * Assert that two views are right aligned, that is that their right edges
     * are on the same x location, with respect to the specified margin.
     *
     * @param first The first view
     * @param second The second view
     * @param margin The margin between the first view and the second view
     */
    static public void assertRightAligned(View first, View second, int margin) {
        int[] xy = new int[2];
        first.getLocationOnScreen(xy);
        int firstRight = xy[0] + first.getMeasuredWidth();

        second.getLocationOnScreen(xy);
        int secondRight = xy[0] + second.getMeasuredWidth();

        assertEquals("views are not right aligned", Math.abs(firstRight - secondRight), margin);
    }

    /**
     * Assert that two views are left aligned, that is that their left edges
     * are on the same x location.
     *
     * @param first The first view
     * @param second The second view
     */
    static public void assertLeftAligned(View first, View second) {
        int[] xy = new int[2];
        first.getLocationOnScreen(xy);
        int firstLeft = xy[0];

        second.getLocationOnScreen(xy);
        int secondLeft = xy[0];

        assertEquals("views are not left aligned", firstLeft, secondLeft);
    }

    /**
     * Assert that two views are left aligned, that is that their left edges
     * are on the same x location, with respect to the specified margin.
     *
     * @param first The first view
     * @param second The second view
     * @param margin The margin between the first view and the second view
     */
    static public void assertLeftAligned(View first, View second, int margin) {
        int[] xy = new int[2];
        first.getLocationOnScreen(xy);
        int firstLeft = xy[0];

        second.getLocationOnScreen(xy);
        int secondLeft = xy[0];

        assertEquals("views are not left aligned", Math.abs(firstLeft - secondLeft), margin);
    }

    /**
     * Assert that two views are bottom aligned, that is that their bottom edges
     * are on the same y location.
     *
     * @param first The first view
     * @param second The second view
     */
    static public void assertBottomAligned(View first, View second) {
        int[] xy = new int[2];
        first.getLocationOnScreen(xy);
        int firstBottom = xy[1] + first.getMeasuredHeight();

        second.getLocationOnScreen(xy);
        int secondBottom = xy[1] + second.getMeasuredHeight();

        assertEquals("views are not bottom aligned", firstBottom, secondBottom);
    }

    /**
     * Assert that two views are bottom aligned, that is that their bottom edges
     * are on the same y location, with respect to the specified margin.
     *
     * @param first The first view
     * @param second The second view
     * @param margin The margin between the first view and the second view
     */
    static public void assertBottomAligned(View first, View second, int margin) {
        int[] xy = new int[2];
        first.getLocationOnScreen(xy);
        int firstBottom = xy[1] + first.getMeasuredHeight();

        second.getLocationOnScreen(xy);
        int secondBottom = xy[1] + second.getMeasuredHeight();

        assertEquals("views are not bottom aligned", Math.abs(firstBottom - secondBottom), margin);
    }

    /**
     * Assert that two views are top aligned, that is that their top edges
     * are on the same y location.
     *
     * @param first The first view
     * @param second The second view
     */
    static public void assertTopAligned(View first, View second) {
        int[] xy = new int[2];
        first.getLocationOnScreen(xy);
        int firstTop = xy[1];

        second.getLocationOnScreen(xy);
        int secondTop = xy[1];

        assertEquals("views are not top aligned", firstTop, secondTop);
    }

    /**
     * Assert that two views are top aligned, that is that their top edges
     * are on the same y location, with respect to the specified margin.
     *
     * @param first The first view
     * @param second The second view
     * @param margin The margin between the first view and the second view
     */
    static public void assertTopAligned(View first, View second, int margin) {
        int[] xy = new int[2];
        first.getLocationOnScreen(xy);
        int firstTop = xy[1];

        second.getLocationOnScreen(xy);
        int secondTop = xy[1];

        assertEquals("views are not top aligned", Math.abs(firstTop - secondTop), margin);
    }

    /**
     * Assert that the test view is horizontally center aligned
     * with respect to the reference view.
     *
     * @param reference The reference view
     * @param test The view that should be center aligned with the reference view
     */
    static public void assertHorizontalCenterAligned(View reference, View test) {
        int[] xy = new int[2];
        reference.getLocationOnScreen(xy);
        int referenceLeft = xy[0];

        test.getLocationOnScreen(xy);
        int testLeft = xy[0];

        int center = (reference.getMeasuredWidth() - test.getMeasuredWidth()) / 2;
        int delta = testLeft - referenceLeft;

        assertEquals("views are not horizontally center aligned", center, delta);
    }

    /**
     * Assert that the test view is vertically center aligned
     * with respect to the reference view.
     *
     * @param reference The reference view
     * @param test The view that should be center aligned with the reference view
     */
    static public void assertVerticalCenterAligned(View reference, View test) {
        int[] xy = new int[2];
        reference.getLocationOnScreen(xy);
        int referenceTop = xy[1];

        test.getLocationOnScreen(xy);
        int testTop = xy[1];

        int center = (reference.getMeasuredHeight() - test.getMeasuredHeight()) / 2;
        int delta = testTop - referenceTop;

        assertEquals("views are not vertically center aligned", center, delta);
    }

    /**
     * Assert the specified group's integrity. The children count should be >= 0 and each
     * child should be non-null.
     *
     * @param parent The group whose integrity to check
     */
    static public void assertGroupIntegrity(ViewGroup parent) {
        final int count = parent.getChildCount();
        assertTrue("child count should be >= 0", count >= 0);

        for (int i = 0; i < count; i++) {
            assertNotNull("group should not contain null children", parent.getChildAt(i));
            assertSame(parent, parent.getChildAt(i).getParent());
        }
    }

    /**
     * Assert that the specified group contains a specific child once and only once.
     *
     * @param parent The group
     * @param child The child that should belong to group
     */
    static public void assertGroupContains(ViewGroup parent, View child) {
        final int count = parent.getChildCount();
        assertTrue("Child count should be >= 0", count >= 0);

        boolean found = false;
        for (int i = 0; i < count; i++) {
            if (parent.getChildAt(i) == child) {
                if (!found) {
                    found = true;
                } else {
                    assertTrue("child " + child + " is duplicated in parent", false);
                }
            }
        }

        assertTrue("group does not contain " + child, found);
    }

    /**
     * Assert that the specified group does not contain a specific child.
     *
     * @param parent The group
     * @param child The child that should not belong to group
     */
    static public void assertGroupNotContains(ViewGroup parent, View child) {
        final int count = parent.getChildCount();
        assertTrue("Child count should be >= 0", count >= 0);

        for (int i = 0; i < count; i++) {
            if (parent.getChildAt(i) == child) {
                assertTrue("child " + child + " is found in parent", false);
            }
        }
    }
}


text:
package main

import (
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"os/exec"
	"os/user"
	"path/filepath"
	"strings"
)

// trace writes the command in the programs stdout for debug purposes.
// the command is wrapped in xml tags for easy parsing.
func trace(cmd *exec.Cmd) {
	fmt.Printf("+ %s\n", strings.Join(cmd.Args, " "))
}

// helper function returns true if directory dir is empty.
func isDirEmpty(dir string) bool {
	f, err := os.Open(dir)
	if err != nil {
		return true
	}
	defer f.Close()

	_, err = f.Readdir(1)
	return err == io.EOF
}

// helper function returns true if the commit is a pull_request.
func isPullRequest(event string) bool {
	return event == "pull_request"
}

// helper function returns true if the commit is a tag.
func isTag(event, ref string) bool {
	return event == "tag" ||
		strings.HasPrefix(ref, "refs/tags/")
}

// helper function to write a netrc file.
func writeNetrc(machine, login, password string) error {
	if machine == "" {
		return nil
	}
	out := fmt.Sprintf(
		netrcFile,
		machine,
		login,
		password,
	)

	home := "/root"
	u, err := user.Current()
	if err == nil {
		home = u.HomeDir
	}
	path := filepath.Join(home, ".netrc")
	return ioutil.WriteFile(path, []byte(out), 0600)
}

const netrcFile = `
machine %s
login %s
password %s
`


text:
package cz.vsb.resbill.web.dailyImport;

import javax.inject.Inject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import cz.vsb.resbill.exception.DailyImportException;
import cz.vsb.resbill.model.DailyImport;
import cz.vsb.resbill.service.DailyImportService;
import cz.vsb.resbill.util.WebUtils;

/**
 * @author Ing. Radek Liebzeit <radek.liebzeit@vsb.cz>
 *
 */

@Controller
@RequestMapping("/dailyImport/detail")
public class DailyImportDetailController {

	private static final Logger log = LoggerFactory.getLogger(DailyImportListController.class);

	public static final String MODEL_OBJECT_KEY_DAILY_IMPORT = "dailyImport";

	@Inject
	private DailyImportService dailyImportService;

	/**
	 *
	 * @param model
	 * @param msgKey
	 */
	protected static void addGlobalError(ModelMap model, String msgKey) {
		WebUtils.addGlobalError(model, MODEL_OBJECT_KEY_DAILY_IMPORT, msgKey);
	}

	/**
	 *
	 * @param model
	 * @param dailyImportId
	 * @return
	 */
	@RequestMapping(value = "", method = RequestMethod.GET)
	public String view(@RequestParam(value = "dailyImportId", required = true) Integer dailyImportId, ModelMap model) {
		loadDailyImport(dailyImportId, model);

		return "dailyImport/dailyImportDetail";
	}

	/**
	 *
	 * @return
	 */
	protected DailyImport loadDailyImport(Integer dailyImportId, ModelMap model) {

		DailyImport dailyImport = null;

		try {
			dailyImport = dailyImportService.findDailyImport(dailyImportId, true, true);
			model.addAttribute(MODEL_OBJECT_KEY_DAILY_IMPORT, dailyImport);
		} catch (Exception exc) {
			log.error("Cannot load DailyImport with id: " + dailyImportId, exc);

			dailyImport = null;

			model.addAttribute(MODEL_OBJECT_KEY_DAILY_IMPORT, dailyImport);
			addGlobalError(model, "error.load.dailyImport");
		}

		return dailyImport;
	}

	/**
	 *
	 * @param dailyImportId
	 * @param model
	 * @return
	 */
	@RequestMapping(value = "delete", method = RequestMethod.GET)
	public String delete(@RequestParam(value = "dailyImportId", required = true) Integer dailyImportId, ModelMap model) {

		DailyImport dailyImport = loadDailyImport(dailyImportId, model);

		if (dailyImport != null) {
			try {

				dailyImport = dailyImportService.deleteDailyImport(dailyImport.getId());
				return "redirect:/dailyImport";

			} catch (DailyImportException exc) {
				if (exc.getReason() == DailyImportException.Reason.USED_ON_INVOICE) {
					log.error("Cannot delete dailyImport - error.delete.dailyImport.usedOnInvoice: " + dailyImport, exc);
					addGlobalError(model, "error.delete.dailyImport.usedOnInvoice");
				} else {
					log.error("Cannot delete dailyImport: " + dailyImport, exc);
					addGlobalError(model, "error.delete.dailyImport");
				}
			} catch (Exception exc) {
				log.error("Cannot delete dailyImport: " + dailyImport, exc);
				addGlobalError(model, "error.delete.dailyImport");
			}
		}

		return "dailyImport/dailyImportDetail";
	}
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using System.Xml.Linq;
using XRoadLib.Headers;
using XRoadLib.Serialization;
using XRoadLib.Soap;

namespace XRoadLib.Tests.Serialization
{
    public static class ParseXRoadHeaderHelper
    {
        private static readonly IMessageFormatter MessageFormatter = new SoapMessageFormatter();

        public static async Task<Tuple<ISoapHeader, IList<XElement>, IServiceManager>> ParseHeaderAsync(string xml, string ns)
        {
#if NET5_0
            await
#endif
            using var stream = new MemoryStream();

#if NET5_0
            await
#endif
            using var streamWriter = new StreamWriter(stream, XRoadEncoding.Utf8);

            await streamWriter.WriteLineAsync(@"<Envelope xmlns=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:id=""http://x-road.eu/xsd/identifiers"" xmlns:repr=""http://x-road.eu/xsd/representation.xsd"">");
            await streamWriter.WriteLineAsync($"<Header xmlns:xrd=\"{ns}\">");
            await streamWriter.WriteLineAsync(xml);
            await streamWriter.WriteLineAsync(@"</Header>");
            await streamWriter.WriteLineAsync(@"</Envelope>");
            await streamWriter.FlushAsync();

            stream.Position = 0;

            using var reader = new XRoadMessageReader(new DataReader(stream), MessageFormatter, "text/xml; charset=UTF-8", Path.GetTempPath(), new IServiceManager[] { Globals.ServiceManager });
            using var msg = new XRoadMessage();

            await reader.ReadAsync(msg);

            return Tuple.Create(msg.Header, msg.UnresolvedHeaders, msg.ServiceManager);
        }
    }
}


text:
dojo.provide("dojo.widget.RegexpTextbox");

dojo.require("dojo.widget.ValidationTextbox");

dojo.widget.defineWidget(
	"dojo.widget.RegexpTextbox",
	dojo.widget.ValidationTextbox,
	{
		/*
		summary
		  A subclass of ValidationTextbox.
		  Over-rides isValid to test input based on a regular expression.
		  Has a new property that can be specified as attributes in the markup.

		regexp: String
		       The regular expression string to use
		flags: String
		        Flags to pass to the regular expression (e.g. 'i', 'g', etc)
		*/

	    mixInProperties: function(localProperties, frag){
	        // First initialize properties in super-class.
	        dojo.widget.RegexpTextbox.superclass.mixInProperties.apply(this, arguments);

	        // Get properties from markup attibutes, and assign to flags object.
	        if(localProperties.regexp){
	            this.flags.regexp = localProperties.regexp;
	        }
	        if(localProperties.flags){
	            this.flags.flags = localProperties.flags;
	        }
	    },

	    // Over-ride for integer validation
	    isValid: function(){
	        var regexp = new RegExp(this.flags.regexp, this.flags.flags);
	        return regexp.test(this.textbox.value);
	    }
	}
);


text:
FOUNDATION_EXPORT double Pods_FlickrPartyVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_FlickrPartyVersionString[];


text:
package db

import "gopkg.in/mgo.v2"

// Interface for generic data source (e.g. database).
type DataSource interface {
	// Returns collection by name
	C(name string) Collection

	// Returns copy of data source (may be copy of session as well)
	Copy() DataSource

	// Closes data source (it will be runtime error to use it after close)
	Close()
}

// Override Source method of mgo.Session to return wrapper around *mgo.DataSource.
func (s MongoSession) Source(name string) DataSource {
	return &MongoDatabase{Database: s.Session.DB(name)}
}

// Wrapper around *mgo.DataSource.
type MongoDatabase struct {
	*mgo.Database
}

// Override C method of mgo.DataSource to return wrapper around *mgo.Collection
func (d MongoDatabase) C(name string) Collection {
	return &MongoCollection{Collection: d.Database.C(name)}
}

// Returns database associated with copied session
func (d MongoDatabase) Copy() DataSource {
	return MongoDatabase{d.With(d.Session.Copy())}
}

// Closes current session with mongo db
func (d MongoDatabase) Close() {
	d.Database.Session.Close()
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FlightORM.SQL
{
	public class SqlTemplateBuilder
	{
		SqlTableInfo _tableInfo;
		string _columns;
		string _identity;
		//string _skip;
		//string _take;

		public SqlTemplateBuilder(SqlTableInfo tableInfo)
		{
			_columns = tableInfo.ColumnInfo.Select(c => $"[{c.Name}]").Aggregate((a, b) => $"{a}, {b}");
			_tableInfo = tableInfo;
			_identity = tableInfo.ColumnInfo
				.Where(c => c.Identity)
				.Select(c => $"[{c.Name}] = @{c.Name}")
				.Aggregate((a, b) => $"{a} AND {b}");

		}

		public string BuildGetByIdQuery()
		{
			var query = $"SELECT {_columns} FROM [{_tableInfo.Schema}].[{_tableInfo.Name}] WHERE ({_identity});";
			return query;
		}

		public string BuildGetByNameQuery()
		{
			if (!_tableInfo.ColumnInfo.Any(c => c.Name.ToLower() == "name")) return null;
			var query = $"SELECT {_columns} FROM [{_tableInfo.Schema}].[{_tableInfo.Name}] WHERE (name = @name);";
			return query;
		}

		public string BuildGetActiveQuery()
		{
			//TODO: Skip/Take
			if (!_tableInfo.ColumnInfo.Any(c => c.Name.ToLower() == "active")) return null;
			var query = $"SELECT {_columns} FROM [{_tableInfo.Schema}].[{_tableInfo.Name}] WHERE active;";
			return query;
		}

	}
}


text:
package resource;

import java.awt.*;
import java.io.*;
import java.net.*;
import java.util.*;
import javax.swing.*;

/**
 * @version 1.4 2007-04-30
 * @author Cay Horstmann
 */
public class ResourceTest
{
   public static void main(String[] args)
   {
      EventQueue.invokeLater(new Runnable()
         {
            public void run()
            {
               JFrame frame = new ResourceTestFrame();
               frame.setTitle("ResourceTest");
               frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
               frame.setVisible(true);
            }
         });
   }
}

/**
 * A frame that loads image and text resources.
 */
class ResourceTestFrame extends JFrame
{
   private static final int DEFAULT_WIDTH = 300;
   private static final int DEFAULT_HEIGHT = 300;

   public ResourceTestFrame()
   {
      setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
      URL aboutURL = getClass().getResource("about.gif");
      Image img = new ImageIcon(aboutURL).getImage();
      setIconImage(img);

      JTextArea textArea = new JTextArea();
      InputStream stream = getClass().getResourceAsStream("about.txt");
      Scanner in = new Scanner(stream);
      while (in.hasNext())
         textArea.append(in.nextLine() + "\n");
      add(textArea);
   }
}


text:
package com.kickstarter;

public interface IKSApplicationComponent {
  ApplicationGraph getComponent();
}


text:
#nullable disable
using PasPasPas.Globals.Parsing;

namespace PasPasPas.Parsing.SyntaxTree.Standard {

    /// <summary>
    ///     try statement
    /// </summary>
    public class TryStatementSymbol : StandardSyntaxTreeBase {

        /// <summary>
        ///     create a new try statement
        /// </summary>
        /// <param name="trySymbol"></param>
        /// <param name="statements"></param>
        /// <param name="exceptSymbol"></param>
        /// <param name="handlers"></param>
        /// <param name="finallySymbol"></param>
        /// <param name="finallyStatements"></param>
        /// <param name="endSymbol"></param>
        public TryStatementSymbol(Terminal trySymbol, StatementList statements, Terminal exceptSymbol, ExceptHandlersSymbol handlers, Terminal finallySymbol, StatementList finallyStatements, Terminal endSymbol) {
            TrySymbol = trySymbol;
            Try = statements;
            ExceptSymbol = exceptSymbol;
            Handlers = handlers;
            Finally = finallyStatements;
            FinallySymbol = finallySymbol;
            EndSymbol = endSymbol;
        }

        /// <summary>
        ///     finally part
        /// </summary>
        public StatementList Finally { get; }

        /// <summary>
        ///     except handlers
        /// </summary>
        public ExceptHandlersSymbol Handlers { get; }

        /// <summary>
        ///     try part
        /// </summary>
        public StatementList Try { get; }

        /// <summary>
        ///     try symbol
        /// </summary>
        public Terminal TrySymbol { get; }

        /// <summary>
        ///     except symbol
        /// </summary>
        public Terminal ExceptSymbol { get; }

        /// <summary>
        ///     finally symbol
        /// </summary>
        public Terminal FinallySymbol { get; }

        /// <summary>
        ///     end symbol
        /// </summary>
        public Terminal EndSymbol { get; }

        /// <summary>
        ///     accept visitor
        /// </summary>
        /// <param name="visitor">visitor to use</param>
        public override void Accept(IStartEndVisitor visitor) {
            visitor.StartVisit(this);
            AcceptPart(this, TrySymbol, visitor);
            AcceptPart(this, Try, visitor);
            AcceptPart(this, ExceptSymbol, visitor);
            AcceptPart(this, Handlers, visitor);
            AcceptPart(this, FinallySymbol, visitor);
            AcceptPart(this, Finally, visitor);
            AcceptPart(this, EndSymbol, visitor);
            visitor.EndVisit(this);
        }

        /// <summary>
        ///     symbol length
        /// </summary>
        public override int Length
            => TrySymbol.GetSymbolLength() +
                Try.GetSymbolLength() +
                ExceptSymbol.GetSymbolLength() +
                Handlers.GetSymbolLength() +
                FinallySymbol.GetSymbolLength() +
                Finally.GetSymbolLength() +
                EndSymbol.GetSymbolLength();

    }
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Bull. trimest. Soc. mycol. Fr. 53: 37 (1937)

#### Original name
Coleomyces Moreau & M. Moreau

### Remarks
null


text:
<!DOCTYPE html>

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<title>Genesis 25 (ASV)</title>
<link href="../../../build/mobile.css" rel="stylesheet" />

American Standard VersionGenesis 25<
=
>

25

1 And Abraham took another wife, and her name was Keturah.
2 And she bare him Zimran, and Jokshan, and Medan, and Midian, and Ishbak, and Shuah.
3 And Jokshan begat Sheba, and Dedan. And the sons of Dedan were Asshurim, and Letushim, and Leummim.
4 And the sons of Midian: Ephah, and Epher, and Hanoch, and Abida, and Eldaah. All these were the children of Keturah.
5 And Abraham gave all that he had unto Isaac.
6 But unto the sons of the concubines, that Abraham had, Abraham gave gifts; and he sent them away from Isaac his son, while he yet lived, eastward, unto the east country.
7 And these are the days of the years of Abraham's life which he lived, a hundred threescore and fifteen years.
8 And Abraham gave up the ghost, and died in a good old age, an old man, and full of years, and was gathered to his people.
9 And Isaac and Ishmael his sons buried him in the cave of Machpelah, in the field of Ephron the son of Zohar the Hittite, which is before Mamre;
10 the field which Abraham purchased of the children of Heth: there was Abraham buried, and Sarah his wife.
11 And it came to pass after the death of Abraham, that God blessed Isaac his son: and Isaac dwelt by Beer-lahai-roi.

12 Now these are the generations of Ishmael, Abraham's son, whom Hagar the Egyptian, Sarah's handmaid, bare unto Abraham:
13 and these are the names of the sons of Ishmael, by their names, according to their generations: the first-born of Ishmael, Nebaioth; and Kedar, and Adbeel, and Mibsam,
14 and Mishma, and Dumah, and Massa,
15 Hadad, and Tema, Jetur, Naphish, and Kedemah.
16 These are the sons of Ishmael, and these are their names, by their villages, and by their encampments; twelve princes according to their nations.
17 And these are the years of the life of Ishmael, a hundred and thirty and seven years: and he gave up the ghost and died, and was gathered unto his people.
18 And they dwelt from Havilah unto Shur that is before Egypt, as thou goest toward Assyria: he abode over against all his brethren.

19 And these are the generations of Isaac, Abraham's son: Abraham begat Isaac:
20 and Isaac was forty years old when he took Rebekah, the daughter of Bethuel the Syrian of Paddan-aram, the sister of Laban the Syrian, to be his wife.
21 And Isaac entreated Jehovah for his wife, because she was barren: and Jehovah was entreated of him, and Rebekah his wife conceived.
22 And the children struggled together within her: and she said, If it be so, wherefore do I live? And she went to inquire of Jehovah.
23 And Jehovah said unto her,

Two nations are in thy womb,

And two peoples shall be separated from thy bowels:

And the one people shall be stronger than the other people;

And the elder shall serve the younger.

24 And when her days to be delivered were fulfilled, behold, there were twins in her womb.
25 And the first came forth red, all over like a hairy garment; and they called his name Esau.
26 And after that came forth his brother, and his hand had hold on Esau's heel; and his name was called Jacob: and Isaac was threescore years old when she bare them.

27 And the boys grew: and Esau was a skilful hunter, a man of the field; and Jacob was a quiet man, dwelling in tents.
28 Now Isaac loved Esau, because he did eat of his venison: and Rebekah loved Jacob.
29 And Jacob boiled pottage: and Esau came in from the field, and he was faint:
30 and Esau said to Jacob, Feed me, I pray thee, with that same red pottage; for I am faint: therefore was his name called Edom.
31 And Jacob said, Sell me first thy birthright.
32 And Esau said, Behold, I am about to die: and what profit shall the birthright do to me?
33 And Jacob said, Swear to me first; and he sware unto him: and he sold his birthright unto Jacob.
34 And Jacob gave Esau bread and pottage of lentils; and he did eat and drink, and rose up, and went his way: so Esau despised his birthright.

<
=
>


text:
FSC=fsharpc
FSLEX=fslex
FSYACC=fsyacc
FLAGS=-r FSharp.PowerPack.dll --utf8output --debug+ --debug:full
LIBFLAGS=--target:library

Toplevel.exe: Toplevel.fs AST.dll Lexical.dll Grammar.dll Result.dll Induction.dll Typechecker.dll Utils.dll getline.dll
	$(FSC) $(FLAGS) -r Lexical.dll -r Grammar.dll -r AST.dll -r Result.dll -r Typechecker.dll -r Induction.dll -r Utils.dll -r getline.dll -r Gnu.Getopt.dll Toplevel.fs

getline.dll: getline.cs
	gmcs -target:library getline.cs

Nat.dll: Nat.fs
	$(FSC) $(LIBFLAGS) $(FLAGS) Nat.fs

AST.dll: AST.fs Nat.dll Utils.dll
	$(FSC) $(LIBFLAGS) $(FLAGS) -r Nat.dll -r Utils.dll AST.fs

Lexical.fs: Lexical.fsl Grammar.dll
	$(FSLEX) --unicode Lexical.fsl

Lexical.dll: Lexical.fs Grammar.dll
	$(FSC) $(LIBFLAGS) $(FLAGS) -r Grammar.dll Lexical.fs

Grammar.fs: Grammar.fsy
	$(FSYACC) --module Grammar Grammar.fsy

Grammar.dll: Grammar.fs AST.dll Utils.dll
	$(FSC) $(LIBFLAGS) $(FLAGS) -r AST.dll -r Utils.dll Grammar.fs

Result.dll: Result.fs
	$(FSC) $(LIBFLAGS) $(FLAGS) Result.fs

Utils.dll : Utils.fs
	$(FSC) $(LIBFLAGS) $(FLAGS) Utils.fs

Typechecker.dll : Typechecker.fs AST.dll Result.dll Utils.dll Induction.dll
	$(FSC) $(LIBFLAGS) $(FLAGS) -r AST.dll -r Result.dll -r Utils.dll -r Induction.dll Typechecker.fs

Induction.dll: Induction.fs Induction.fsi Utils.dll Nat.dll AST.dll Result.dll Grammar.dll
	 $(FSC) $(LIBFLAGS) $(FLAGS) -r AST.dll -r Result.dll -r Grammar.dll -r Utils.dll -r Nat.dll Induction.fs

clean:
	rm *.dll
	rm *.exe
	rm Grammar.fs
	rm Lexical.fs


text:
==================
Adding a new image
==================

Kolla follows `Best practices for writing Dockerfiles
<https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/>`__
where at all possible.

We use ``jinja2`` templating syntax to help manage the volume and complexity
that comes with maintaining multiple Dockerfiles for multiple different base
operating systems.

Dockerfiles should be placed under the ``docker`` directory. OpenStack services
should inherit from the provided ``openstack-base`` image, and
infrastructure services (for example: ``fluentd``) should inherit from
``base``.

Projects consisting of only one service should be placed in an image named the
same as that service, for example: ``horizon``. Services that consist of
multiple processes generally use a base image and child images, for example:
``cinder-base``, ``cinder-api``, ``cinder-scheduler``, ``cinder-volume``,
``cinder-backup``.

Jinja2 `blocks` are employed throughout the Dockerfiles to help operators
customise various stages of the build (refer to :ref:`Dockerfile Customisation
<dockerfile-customisation>`)

Some of these blocks are free form. However, there is a subset that should be
common to every Dockerfile. The overall structure of a Dockerfiles of an
OpenStack project base image is as follows:

.. code-block:: console

   FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
   {% block labels %}
   LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
   {% endblock %}

   {% block << service >>_header %}{% endblock %}

   {% import "macros.j2" as macros with context %}

   << binary specific steps >>

   << source specific steps >>

   << common steps >>

   {% block << service >>_footer %}{% endblock %}
   {% block footer %}{% endblock %}

.. note::

   The generic footer block ``{% block footer %}{% endblock %}`` should **not** be
   included in base images (for example: ``cinder-base``).

It's probably easiest to identify the most similar service being already
provided, copy its Dockerfile structure and amend it to new needs.

Distribution support
====================

By default, every new image should support all supported distributions (CentOS,
Debian, Ubuntu) and both x86-64 and aarch64 architectures. Sometimes it is not
doable so we have list of `unbuildable images` for that.

Unbuildable images
~~~~~~~~~~~~~~~~~~

In ``kolla/image/build.py`` source file we keep a list of images which cannot
be built for some distribution/architecture/build-type combinations.

.. code-block:: python

   UNBUILDABLE_IMAGES = {
       'aarch64': {
           "bifrost-base",      # someone need to get upstream working first
       },

       'ppc64le': {
           "elasticsearch",     # no binary package
       },

       'binary': {
           "bifrost-base",
           "blazar-base",
       },

       'ubuntu': {
          "qdrouterd",  # There is no qdrouterd package for ubuntu bionic
       },

       'ubuntu+aarch64': {
           "kibana",        # no binary package
       },
   }

If your new image has some unbuildable combinations, please add it into proper
place in this list. If you are not sure, write it in code review comment and
check CI results of your patch.

.. note::
   Please do not overuse this list -- it is meant as last hope solution.


text:
<?php
/**
 * The contents of this file was generated using the WSDLs as provided by eBay.
 *
 * DO NOT EDIT THIS FILE!
 */

namespace DTS\eBaySDK\Trading\Types;

/**
 *
 * @property integer $SaleTemplateID
 * @property \DateTime $ScheduleTime
 * @property \DTS\eBaySDK\Trading\Types\ItemType $Item
 */
class AddItemFromSellingManagerTemplateRequestType extends \DTS\eBaySDK\Trading\Types\AbstractRequestType
{
    /**
     * @var array Properties belonging to objects of this class.
     */
    private static $propertyTypes = [
        'SaleTemplateID' => [
            'type' => 'integer',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'SaleTemplateID'
        ],
        'ScheduleTime' => [
            'type' => 'DateTime',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'ScheduleTime'
        ],
        'Item' => [
            'type' => 'DTS\eBaySDK\Trading\Types\ItemType',
            'repeatable' => false,
            'attribute' => false,
            'elementName' => 'Item'
        ]
    ];

    /**
     * @param array $values Optional properties and values to assign to the object.
     */
    public function __construct(array $values = [])
    {
        list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);

        parent::__construct($parentValues);

        if (!array_key_exists(__CLASS__, self::$properties)) {
            self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
        }

        if (!array_key_exists(__CLASS__, self::$xmlNamespaces)) {
            self::$xmlNamespaces[__CLASS__] = 'xmlns="urn:ebay:apis:eBLBaseComponents"';
        }

        if (!array_key_exists(__CLASS__, self::$requestXmlRootElementNames)) {
            self::$requestXmlRootElementNames[__CLASS__] = 'AddItemFromSellingManagerTemplateRequest';
        }

        $this->setValues(__CLASS__, $childValues);
    }
}


text:
static void display(const char *name, size_t size) {
    printf("%s\t%d\n", name, (int)size);
}

int main(void) {

    display("Slab Stats", sizeof(struct slab_stats));
    display("Thread stats",
            sizeof(struct thread_stats)
            - (200 * sizeof(struct slab_stats)));
    display("Global stats", sizeof(struct stats));
    display("Settings", sizeof(struct settings));
    display("Item (no cas)", sizeof(item));
    display("Item (cas)", sizeof(item) + sizeof(uint64_t));
    display("Libevent thread",
            sizeof(LIBEVENT_THREAD) - sizeof(struct thread_stats));
    display("Connection", sizeof(conn));

    printf("----------------------------------------\n");

    display("libevent thread cumulative", sizeof(LIBEVENT_THREAD));
    display("Thread stats cumulative\t", sizeof(struct thread_stats));

    return 0;
}


text:
title = "Combat information"
print title
print "-" * 40

attack_power = raw_input("What is the attack power? ")
percent_to_hit = raw_input("What is the percent to hit? ")  # this is a string
percent_to_hit = float(percent_to_hit)

print "-" * 40
print "Attack Power:", attack_power, "points"
print "Percent to Hit:", percent_to_hit * 100, "%"
print "-" * 40


text:
namespace mscorlib
{
	namespace System
	{
		namespace Runtime
		{
			namespace CompilerServices
			{

				class MethodImplOptions
				{
				public:
					enum __ENUM__
					{
						Unmanaged = 4,
						NoInlining = 8,
						ForwardRef = 16,
						Synchronized = 32,
						NoOptimization = 64,
						PreserveSig = 128,
						AggressiveInlining = 256,
						InternalCall = 4096,
					};
				};

			}
		}
	}
}
#endif


text:
ActiveRecord::Schema.define(version: 2018_02_01_075759) do

  create_table "active_storage_attachments", force: :cascade do |t|
    t.string "name", null: false
    t.string "record_type", null: false
    t.integer "record_id", null: false
    t.integer "blob_id", null: false
    t.datetime "created_at", null: false
    t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
    t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
  end

  create_table "active_storage_blobs", force: :cascade do |t|
    t.string "key", null: false
    t.string "filename", null: false
    t.string "content_type"
    t.text "metadata"
    t.bigint "byte_size", null: false
    t.string "checksum", null: false
    t.datetime "created_at", null: false
    t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
  end

  create_table "posts", force: :cascade do |t|
    t.string "title"
    t.text "content"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "uploads", force: :cascade do |t|
    t.string "image"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

end


text:
<?php

namespace Box\Spout\Writer\ODS\Internal;

use Box\Spout\Common\Exception\InvalidArgumentException;
use Box\Spout\Common\Exception\IOException;
use Box\Spout\Common\Helper\StringHelper;
use Box\Spout\Writer\Common\Helper\CellHelper;
use Box\Spout\Writer\Common\Internal\WorksheetInterface;

/**
 * Class Worksheet
 * Represents a worksheet within a ODS file. The difference with the Sheet object is
 * that this class provides an interface to write data
 *
 * @package Box\Spout\Writer\ODS\Internal
 */
class Worksheet implements WorksheetInterface
{
    /** @var \Box\Spout\Writer\Common\Sheet The "external" sheet */
    protected $externalSheet;

    /** @var string Path to the XML file that will contain the sheet data */
    protected $worksheetFilePath;

    /** @var \Box\Spout\Common\Escaper\ODS Strings escaper */
    protected $stringsEscaper;

    /** @var \Box\Spout\Common\Helper\StringHelper To help with string manipulation */
    protected $stringHelper;

    /** @var Resource Pointer to the temporary sheet data file (e.g. worksheets-temp/sheet1.xml) */
    protected $sheetFilePointer;

    /** @var int Maximum number of columns among all the written rows */
    protected $maxNumColumns = 1;

    /** @var int Index of the last written row */
    protected $lastWrittenRowIndex = 0;

    /**
     * @param \Box\Spout\Writer\Common\Sheet $externalSheet The associated "external" sheet
     * @param string $worksheetFilesFolder Temporary folder where the files to create the XLSX will be stored
     * @throws \Box\Spout\Common\Exception\IOException If the sheet data file cannot be opened for writing
     */
    public function __construct($externalSheet, $worksheetFilesFolder)
    {
        $this->externalSheet = $externalSheet;
        /** @noinspection PhpUnnecessaryFullyQualifiedNameInspection */
        $this->stringsEscaper = \Box\Spout\Common\Escaper\ODS::getInstance();
        $this->worksheetFilePath = $worksheetFilesFolder . '/sheet' . $externalSheet->getIndex() . '.xml';

        $this->stringHelper = new StringHelper();

        $this->startSheet();
    }

    /**
     * Prepares the worksheet to accept data
     * The XML file does not contain the "<table:table>" node as it contains the sheet's name
     * which may change during the execution of the program. It will be added at the end.
     *
     * @return void
     * @throws \Box\Spout\Common\Exception\IOException If the sheet data file cannot be opened for writing
     */
    protected function startSheet()
    {
        $this->sheetFilePointer = fopen($this->worksheetFilePath, 'w');
        $this->throwIfSheetFilePointerIsNotAvailable();
    }

    /**
     * Checks if the book has been created. Throws an exception if not created yet.
     *
     * @return void
     * @throws \Box\Spout\Common\Exception\IOException If the sheet data file cannot be opened for writing
     */
    protected function throwIfSheetFilePointerIsNotAvailable()
    {
        if (!$this->sheetFilePointer) {
            throw new IOException('Unable to open sheet for writing.');
        }
    }

    /**
     * @return string Path to the temporary sheet content XML file
     */
    public function getWorksheetFilePath()
    {
        return $this->worksheetFilePath;
    }

    /**
     * Returns the table XML root node as string.
     *
     * @return string <table> node as string
     */
    public function getTableElementStartAsString()
    {
        $escapedSheetName = $this->stringsEscaper->escape($this->externalSheet->getName());
        $tableStyleName = 'ta' . ($this->externalSheet->getIndex() + 1);

        $tableElement  = '<table:table table:style-name="' . $tableStyleName . '" table:name="' . $escapedSheetName . '">';
        $tableElement .= '<table:table-column table:default-cell-style-name="ce1" table:style-name="co1" table:number-columns-repeated="' . $this->maxNumColumns . '"/>';

        return $tableElement;
    }

    /**
     * @return \Box\Spout\Writer\Common\Sheet The "external" sheet
     */
    public function getExternalSheet()
    {
        return $this->externalSheet;
    }

    /**
     * @return int The index of the last written row
     */
    public function getLastWrittenRowIndex()
    {
        return $this->lastWrittenRowIndex;
    }

    /**
     * Adds data to the worksheet.
     *
     * @param array $dataRow Array containing data to be written. Cannot be empty.
     *          Example $dataRow = ['data1', 1234, null, '', 'data5'];
     * @param \Box\Spout\Writer\Style\Style $style Style to be applied to the row. NULL means use default style.
     * @return void
     * @throws \Box\Spout\Common\Exception\IOException If the data cannot be written
     * @throws \Box\Spout\Common\Exception\InvalidArgumentException If a cell value's type is not supported
     */
    public function addRow($dataRow, $style)
    {
        // $dataRow can be an associative array. We need to transform
        // it into a regular array, as we'll use the numeric indexes.
        $dataRowWithNumericIndexes = array_values($dataRow);

        $styleIndex = ($style->getId() + 1); // 1-based
        $cellsCount = count($dataRow);
        $this->maxNumColumns = max($this->maxNumColumns, $cellsCount);

        $data = '<table:table-row table:style-name="ro1">';

        $currentCellIndex = 0;
        $nextCellIndex = 1;

        for ($i = 0; $i < $cellsCount; $i++) {
            $currentCellValue = $dataRowWithNumericIndexes[$currentCellIndex];

            // Using isset here because it is way faster than array_key_exists...
            if (!isset($dataRowWithNumericIndexes[$nextCellIndex]) ||
                $currentCellValue !== $dataRowWithNumericIndexes[$nextCellIndex]) {

                $numTimesValueRepeated = ($nextCellIndex - $currentCellIndex);
                $data .= $this->getCellXML($currentCellValue, $styleIndex, $numTimesValueRepeated);

                $currentCellIndex = $nextCellIndex;
            }

            $nextCellIndex++;
        }

        $data .= '</table:table-row>';

        $wasWriteSuccessful = fwrite($this->sheetFilePointer, $data);
        if ($wasWriteSuccessful === false) {
            throw new IOException("Unable to write data in {$this->worksheetFilePath}");
        }

        // only update the count if the write worked
        $this->lastWrittenRowIndex++;
    }

    /**
     * Returns the cell XML content, given its value.
     *
     * @param mixed $cellValue The value to be written
     * @param int $styleIndex Index of the used style
     * @param int $numTimesValueRepeated Number of times the value is consecutively repeated
     * @return string The cell XML content
     * @throws \Box\Spout\Common\Exception\InvalidArgumentException If a cell value's type is not supported
     */
    protected function getCellXML($cellValue, $styleIndex, $numTimesValueRepeated)
    {
        $data = '<table:table-cell table:style-name="ce' . $styleIndex . '"';

        if ($numTimesValueRepeated !== 1) {
            $data .= ' table:number-columns-repeated="' . $numTimesValueRepeated . '"';
        }

        if (CellHelper::isNonEmptyString($cellValue)) {
            $data .= ' office:value-type="string" calcext:value-type="string">';

            $cellValueLines = explode("\n", $cellValue);
            foreach ($cellValueLines as $cellValueLine) {
                $data .= '<text:p>' . $this->stringsEscaper->escape($cellValueLine) . '</text:p>';
            }

            $data .= '</table:table-cell>';
        } else if (CellHelper::isBoolean($cellValue)) {
            $data .= ' office:value-type="boolean" calcext:value-type="boolean" office:boolean-value="' . $cellValue . '">';
            $data .= '<text:p>' . $cellValue . '</text:p>';
            $data .= '</table:table-cell>';
        } else if (CellHelper::isNumeric($cellValue)) {
            $data .= ' office:value-type="float" calcext:value-type="float" office:value="' . $cellValue . '">';
            $data .= '<text:p>' . $cellValue . '</text:p>';
            $data .= '</table:table-cell>';
        } else if (empty($cellValue)) {
            $data .= '/>';
        } else {
            throw new InvalidArgumentException('Trying to add a value with an unsupported type: ' . gettype($cellValue));
        }

        return $data;
    }

    /**
     * Closes the worksheet
     *
     * @return void
     */
    public function close()
    {
        if (!is_resource($this->sheetFilePointer)) {
            return;
        }

        fclose($this->sheetFilePointer);
    }
}


text:
class ApiResponse < ActiveRecord::Base
  # include HTTP request helpers
  include Networkable

  # include CouchDB helpers
  include Couchable

  belongs_to :source
  belongs_to :retrieval_status

  scope :unresolved, -> { where(unresolved: true) }
  scope :filter, ->(id) { where(unresolved: true).where("id <= ?", id) }
  scope :total, ->(duration) { where(created_at: (Time.zone.now.beginning_of_hour - duration.hours)..Time.zone.now.beginning_of_hour) }
  scope :decreasing, ->(source_ids) { where("total < previous_total").where(skipped: false).where(source_id: source_ids) }
  scope :increasing, ->(number, source_ids) { where("update_interval IS NOT NULL").where("((total - previous_total) / update_interval) >= ?", number).where(source_id: source_ids) }
  scope :slow, ->(number) { where("duration >= ?", number * 1000).where(skipped: false) }
  scope :ratio, ->(number) { where("if(pdf, html / pdf, 0) >= ?", number).where(skipped: false) }
  scope :work_not_updated, ->(number) { where("skipped = ?", true).where("update_interval >= ?", number) }
  scope :source_not_updated, ->(number) { where("update_interval >= ?", number) }

  # we need integer division, which is handled differently by MySQL and Postgres. Workaround is to use FLOOR.
  scope :citation_milestone, ->(number, source_ids) {
    if number == 0
      limit(0)
    else
      where("FLOOR(total / ?) > FLOOR(previous_total / ?)", number, number).where("source_id IN (?)", source_ids)
    end
  }
end


text:
"""Smooth Seasonal Model Tests."""

# Dependency imports

import numpy as np
import tensorflow.compat.v1 as tf1
import tensorflow.compat.v2 as tf
from tensorflow_probability.python.distributions import mvn_diag
from tensorflow_probability.python.internal import test_util
from tensorflow_probability.python.sts.components.smooth_seasonal import SmoothSeasonal
from tensorflow_probability.python.sts.components.smooth_seasonal import SmoothSeasonalStateSpaceModel

class _SmoothSeasonalStateSpaceModelTest(object):

  def test_accepts_tensor_valued_period_and_frequency_multipliers(self):

    period = tf.constant(100.)
    frequency_multipliers = tf.constant([1., 3.])
    drift_scale = tf.constant([2.])

    component = SmoothSeasonal(
        period=period, frequency_multipliers=frequency_multipliers)

    ssm = component.make_state_space_model(
        num_timesteps=3, param_vals=[drift_scale])

    self.assertAllEqual(component.latent_size, 4)
    self.assertAllEqual(
        self.evaluate(
            tf.convert_to_tensor(
                ssm.latent_size_tensor()
                )),
        4)

  def test_basic_statistics_no_latent_variance_one_frequency(self):
    # fix the latent variables at the value 1 so the results are deterministic
    num_timesteps = 10
    period = 42
    frequency_multipliers = [3]
    drift_scale = 0.

    initial_state_loc = self._build_placeholder(np.ones([2]))
    initial_state_scale = tf.zeros_like(initial_state_loc)

    initial_state_prior = mvn_diag.MultivariateNormalDiag(
        loc=initial_state_loc, scale_diag=initial_state_scale)

    ssm = SmoothSeasonalStateSpaceModel(
        num_timesteps=num_timesteps,
        period=period,
        frequency_multipliers=frequency_multipliers,
        drift_scale=drift_scale,
        initial_state_prior=initial_state_prior)

    two_pi = 6.283185307179586
    sine_terms = tf.sin(two_pi * 3 * tf.range(
        0, num_timesteps, dtype=tf.float32) / 42)
    cosine_terms = tf.cos(two_pi * 3 * tf.range(
        0, num_timesteps, dtype=tf.float32) / 42)
    predicted_time_series_ = self.evaluate(
        (sine_terms + cosine_terms)[..., tf.newaxis])

    self.assertAllClose(self.evaluate(ssm.mean()), predicted_time_series_)
    self.assertAllClose(*self.evaluate((ssm.stddev(),
                                        tf.zeros_like(predicted_time_series_))))

  def test_matrices_from_component(self):
    num_timesteps = 4
    drift_scale = 1.23
    period = 12
    frequency_multipliers = [1, 3]

    component = SmoothSeasonal(
        period=period, frequency_multipliers=frequency_multipliers)

    ssm = component.make_state_space_model(num_timesteps, [drift_scale])

    frequency_0 = 2 * np.pi * frequency_multipliers[0] / period
    frequency_1 = 2 * np.pi * frequency_multipliers[1] / period

    first_frequency_transition = tf.linalg.LinearOperatorFullMatrix([
        [tf.cos(frequency_0), tf.sin(frequency_0)],
        [-tf.sin(frequency_0), tf.cos(frequency_0)]])

    second_frequency_transition = tf.linalg.LinearOperatorFullMatrix([
        [tf.cos(frequency_1), tf.sin(frequency_1)],
        [-tf.sin(frequency_1), tf.cos(frequency_1)]])

    latents_transition = self.evaluate(tf.linalg.LinearOperatorBlockDiag([
        first_frequency_transition, second_frequency_transition]).to_dense())

    for t in range(num_timesteps):
      observation_matrix = self.evaluate(
          ssm.get_observation_matrix_for_timestep(t).to_dense())

      self.assertAllClose([[1.0, 0.0, 1.0, 0.0]], observation_matrix)

      observation_noise_mean = self.evaluate(
          ssm.get_observation_noise_for_timestep(t).mean())
      observation_noise_covariance = self.evaluate(
          ssm.get_observation_noise_for_timestep(t).covariance())

      self.assertAllClose([0.0], observation_noise_mean)
      self.assertAllClose([[0.0]], observation_noise_covariance)

      transition_matrix = self.evaluate(
          ssm.get_transition_matrix_for_timestep(t).to_dense())

      self.assertAllClose(latents_transition, transition_matrix)

      transition_noise_mean = self.evaluate(
          ssm.get_transition_noise_for_timestep(t).mean())
      transition_noise_covariance = self.evaluate(
          ssm.get_transition_noise_for_timestep(t).covariance())

      self.assertAllClose(np.zeros([4]),
                          transition_noise_mean)
      self.assertAllClose(np.square(drift_scale) * np.eye(4),
                          transition_noise_covariance)

  def _build_placeholder(self, ndarray):
    ndarray = np.asarray(ndarray).astype(self.dtype)
    return tf1.placeholder_with_default(
        ndarray, shape=ndarray.shape if self.use_static_shape else None)

@test_util.test_all_tf_execution_regimes
class SmoothSeasonalStateSpaceModelTestStaticShape32(
    test_util.TestCase, _SmoothSeasonalStateSpaceModelTest):
  dtype = np.float32
  use_static_shape = True

@test_util.test_all_tf_execution_regimes
class SmoothSeasonalStateSpaceModelTestDynamicShape32(
    test_util.TestCase, _SmoothSeasonalStateSpaceModelTest):
  dtype = np.float32
  use_static_shape = False

@test_util.test_all_tf_execution_regimes
class SmoothSeasonalStateSpaceModelTestStaticShape64(
    test_util.TestCase, _SmoothSeasonalStateSpaceModelTest):
  dtype = np.float64
  use_static_shape = True

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


text:
(function () {
    'use strict';

    angular
        .module('fc.common')
        .provider('langSvc', langSvcProvider);

    /* @ngInject */
    function langSvcProvider() {
        // Available in config.
        var cfg = this;
        cfg.languagesUrl = null;
        cfg.languageConfigUrl = null;

        cfg.$get = langSvc;

        langSvc.$inject = ['$http'];

        function langSvc($http) {
            return {
                getActiveLanguages: getActiveLanguages,
                getLanguages: getLanguages
            };

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////

            function getActiveLanguages() {
                return $http.get(cfg.languageConfigUrl).then(function (result) {
                    return result.data;
                });
            }

            function getLanguages() {
                return $http.get(cfg.languagesUrl).then(function (result) {
                    return result.data;
                });
            }
        }
    }
})();


text:
package resource

import (
	"fmt"
	"strings"

	"github.com/gohugoio/hugo/resources/internal"
)

// Resources represents a slice of resources, which can be a mix of different types.
// I.e. both pages and images etc.
type Resources []Resource

// ResourcesConverter converts a given slice of Resource objects to Resources.
type ResourcesConverter interface {
	ToResources() Resources
}

// ByType returns resources of a given resource type (ie. "image").
func (r Resources) ByType(tp string) Resources {
	var filtered Resources

	for _, resource := range r {
		if resource.ResourceType() == tp {
			filtered = append(filtered, resource)
		}
	}
	return filtered
}

// GetMatch finds the first Resource matching the given pattern, or nil if none found.
// See Match for a more complete explanation about the rules used.
func (r Resources) GetMatch(pattern string) Resource {
	g, err := internal.GetGlob(pattern)
	if err != nil {
		return nil
	}

	for _, resource := range r {
		if g.Match(strings.ToLower(resource.Name())) {
			return resource
		}
	}

	return nil
}

// Match gets all resources matching the given base filename prefix, e.g
// "*.png" will match all png files. The "*" does not match path delimiters (/),
// so if you organize your resources in sub-folders, you need to be explicit about it, e.g.:
// "images/*.png". To match any PNG image anywhere in the bundle you can do "**.png", and
// to match all PNG images below the images folder, use "images/**.jpg".
// The matching is case insensitive.
// Match matches by using the value of Resource.Name, which, by default, is a filename with
// path relative to the bundle root with Unix style slashes (/) and no leading slash, e.g. "images/logo.png".
// See https://github.com/gobwas/glob for the full rules set.
func (r Resources) Match(pattern string) Resources {
	g, err := internal.GetGlob(pattern)
	if err != nil {
		return nil
	}

	var matches Resources
	for _, resource := range r {
		if g.Match(strings.ToLower(resource.Name())) {
			matches = append(matches, resource)
		}
	}
	return matches
}

type translatedResource interface {
	TranslationKey() string
}

// MergeByLanguage adds missing translations in r1 from r2.
func (r Resources) MergeByLanguage(r2 Resources) Resources {
	result := append(Resources(nil), r...)
	m := make(map[string]bool)
	for _, rr := range r {
		if translated, ok := rr.(translatedResource); ok {
			m[translated.TranslationKey()] = true
		}
	}

	for _, rr := range r2 {
		if translated, ok := rr.(translatedResource); ok {
			if _, found := m[translated.TranslationKey()]; !found {
				result = append(result, rr)
			}
		}
	}
	return result
}

// MergeByLanguageInterface is the generic version of MergeByLanguage. It
// is here just so it can be called from the tpl package.
func (r Resources) MergeByLanguageInterface(in interface{}) (interface{}, error) {
	r2, ok := in.(Resources)
	if !ok {
		return nil, fmt.Errorf("%T cannot be merged by language", in)
	}
	return r.MergeByLanguage(r2), nil
}

// Source is an internal template and not meant for use in the templates. It
// may change without notice.
type Source interface {
	Publish() error
}


text:
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json.Serialization;
using AureliaAspNetCoreAuth.Connections;
using AureliaAspNetCoreAuth.Providers;
using AureliaAspNetCoreAuth.Models;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
using AspNet.Security.OAuth.Validation;
using Microsoft.Framework.DependencyInjection;
//using Mvc.Server.Extensions;
//using Mvc.Server.Models;
//using Mvc.Server.Providers;

namespace AureliaAspNetCoreAuth
{

    public class Startup
    {

        public Startup(IHostingEnvironment env)
        {

            // Set up configuration sources.
            var builder = new ConfigurationBuilder()
                .SetBasePath(env.ContentRootPath)
                .AddJsonFile("appsettings.json");

            builder.AddEnvironmentVariables();
            Configuration = builder.Build().ReloadOnChanged("appsettings.json");
        }

        public IConfigurationRoot Configuration { get; set; }

        // This method gets called by the runtime. Use this method to add services to the container
        public void ConfigureServices(Microsoft.Extensions.DependencyInjection.IServiceCollection services)
        {
            services.AddAuthentication();

            services.AddSignalR();
            // Add framework services.
            //services.Configure<AppSettings>(Configuration.GetSection("AppSettings"));
            // Add MVC services to the services container.
            services.AddMvc()
              .AddJsonOptions(opts =>
              {
                  opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
              });

        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {

            var configurationSection = Configuration.GetSection("AppSettings");
            //var title = configurationSection.Get<string>("ApplicationTitle");
            //var topItmes = configurationSection.Get<int>("TopItemsOnStart");
            //var showLink = configurationSection.Get<bool>("ShowEditLink");
            //var config = Configuration.GetSection("UriSettings");
            //string serverUri = config.UriSettings.ServerURi;
            //string clientUri = config.UriSettings.ClientUri;

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            // Add a new middleware validating access tokens.
            app.UseOAuthValidation(options =>
            {
                // Automatic authentication must be enabled
                // for SignalR to receive the access token.
                options.AutomaticAuthenticate = true;

                options.Events = new OAuthValidationEvents
                {
                    // Note: for SignalR connections, the default Authorization header does not work,
                    // because the WebSockets JS API doesn't allow setting custom parameters.
                    // To work around this limitation, the access token is retrieved from the query string.
                    OnRetrieveToken = context =>
                    {
                        // Note: when the token is missing from the query string,
                        // context.Token is null and the JWT bearer middleware will
                        // automatically try to retrieve it from the Authorization header.
                        context.Token = context.Request.Query["access_token"];

                        return Task.FromResult(0);
                    }
                };
            });

            app.UseSignalR<RawConnection>("/signalr");
            //app.UseSignalR<SimpleConnection>("/signalr");

            // Add a new middleware issuing access tokens.
            app.UseOpenIdConnectServer(options =>
            {
                options.Provider = new AuthenticationProvider();
                // Enable the authorization, logout, token and userinfo endpoints.
                //options.AuthorizationEndpointPath = "/connect/authorize";
                //options.LogoutEndpointPath = "/connect/logout";
                options.TokenEndpointPath = "/connect/token";
                //options.UserinfoEndpointPath = "/connect/userinfo";

                // Note: if you don't explicitly register a signing key, one is automatically generated and
                // persisted on the disk. If the key cannot be persisted, an exception is thrown.
                //
                // On production, using a X.509 certificate stored in the machine store is recommended.
                // You can generate a self-signed certificate using Pluralsight's self-cert utility:
                // https://s3.amazonaws.com/pluralsight-free/keith-brown/samples/SelfCert.zip
                //
                // options.SigningCredentials.AddCertificate("7D2A741FE34CC2C7369237A5F2078988E17A6A75");
                //
                // Alternatively, you can also store the certificate as an embedded .pfx resource
                // directly in this assembly or in a file published alongside this project:
                //
                // options.SigningCredentials.AddCertificate(
                //     assembly: typeof(Startup).GetTypeInfo().Assembly,
                //     resource: "Nancy.Server.Certificate.pfx",
                //     password: "Owin.Security.OpenIdConnect.Server");

                // Note: see AuthorizationController.cs for more
                // information concerning ApplicationCanDisplayErrors.
                options.ApplicationCanDisplayErrors = true;
                options.AllowInsecureHttp = true;
            });

            //app.UseIISPlatformHandler(options => options.AuthenticationDescriptions.Clear());

            app.UseStaticFiles();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

        }
    }
}


text:
__author__    = 'Viktor Kerkez <alefnula@gmail.com>'
__date__      = '02 January 2013'
__copyright__ = 'Copyright (c) 2013 Viktor Kerkez'

import os

from tea import shell
from samovar.commander import BaseCommand

# samovar imports
from . import const
from . import utils
from .dependency_graph import DependencyGraph

class Command(BaseCommand):
    '''Perform hg fetch of all needed repositories'''

    option_list = BaseCommand.option_list + (
        (const.x86, {
            'action'  : 'store_const',
            'dest'    : 'platform',
            'const'   : const.x86,
            'default' : const.x64,
            'help'    : 'build %s platform' % const.x86,
        }),
        (const.x64, {
            'action'  : 'store_const',
            'dest'    : 'platform',
            'const'   : const.x64,
            'default' : const.x64,
            'help'    : 'build %s platform' % const.x64,
        }),
        (const.Debug.lower(), {
            'action'  : 'store_const',
            'dest'    : 'configuration',
            'const'   : const.Debug,
            'default' : const.Release,
            'help'    : 'build in %s configuration' % const.Debug,
        }),
        (const.Release.lower(), {
            'action'  : 'store_const',
            'dest'    : 'configuration',
            'const'   : const.Release,
            'default' : const.Release,
            'help'    : 'build in %s configuration' % const.Release,
        }),
        ('b, build-number',  {
            'action'  : 'store',
            'default' : '0',
            'help'    : 'Set the build number'
        }),
        ('n, no-deps', {'action': 'store_true', 'help': 'do not build dependencies first'}),
        ('d, delete',  {'action': 'store_true', 'help': 'delete the output folder before build'}),
    )

    def save_log(self, project, data):
        logpath = os.path.join(self.config.logdir,
                               project.path.replace(self.config.active_path, '').strip('\\/'),
                               project.id + '.log')
        if not os.path.isdir(os.path.dirname(logpath)):
            shell.mkdir(os.path.dirname(logpath))
        with open(logpath, 'wb') as f:
            f.write(data)

    def handle(self, platform, configuration, build_number, no_deps, delete, *args, **kwargs):
        repos       = []
        # Build dependency graph, or not
        if no_deps:
            for repo in self.config.repositories:
                b = utils.load_build(repo)
                repos.append(b)
        else:
            all_repos = {}
            for repo in self.config.all_repositories:
                # Remove explicitly skipped
                skipped = self.config.get('options.skipped_repositories') or []
                if repo.name not in skipped:
                    b = utils.load_build(repo)
                    all_repos[b.name] = b
            dg = DependencyGraph(all_repos.values())
            for repo in dg.get_in_order(map(lambda x: all_repos[x.name].id, self.config.repositories), None):
                repos.append(repo)

        config = utils.BuildConfig(self.config, platform, configuration, build_number)

        # if --delete
        if delete and os.path.exists(config.output_path):
            if not shell.remove(config.output_path):
                self.ui.error('Abort: "%s" could not be deleted' % config.output_path)
                return
        # create output path if not exist
        if not os.path.exists(config.output_path):
            shell.mkdir(config.output_path)

        # Build
        for repo in repos:
            self.ui.info(str(repo))
            for project in repo.projects:
                status, output, error = project.build(config)
                self.save_log(project, output + '\n\n\n' + error)
                self.ui.report('  %s' % project, status, {'output': output, 'error': error})


text:
package mundo;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

import javax.swing.JOptionPane;

public class Utilitarias {

	public static String archivoAString(String path) {
		StringBuilder builder = new StringBuilder();

		try {
			BufferedReader br = new BufferedReader(new FileReader(path));
			String linea;

			while ((linea = br.readLine()) != null) {
				builder.append(linea + System.lineSeparator());
			}

			br.close();
		} catch (IOException e) {
			JOptionPane.showMessageDialog(null, "Fallo al intentar cargar el mapa " + path );
		}

		return builder.toString();
	}

	public static int parseInt(String numero) {
		try {
			return Integer.parseInt(numero);
		} catch (NumberFormatException e) {

			return 0;
		}
	}

}


text:
<?php

use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // $this->call(UserTableSeeder::class);
        $this->call(Portfolio::class);
        $this->call(Mask::class);
    }
}


text:
/*jshint globalstrict:false, strict:false, maxlen: 500 */
/*global assertEqual, fail, AQL_EXECUTE */

////////////////////////////////////////////////////////////////////////////////
/// @brief tests for simple attributes
///
/// @file
///
/// DISCLAIMER
///
/// Copyright 2010-2012 triagens GmbH, Cologne, Germany
///
/// 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.
///
/// Copyright holder is triAGENS GmbH, Cologne, Germany
///
/// @author Jan Steemann
/// @author Copyright 2012, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////

var jsunity = require("jsunity");
var internal = require("internal");
var errors = internal.errors;

////////////////////////////////////////////////////////////////////////////////
/// @brief test suite
////////////////////////////////////////////////////////////////////////////////

function ahuacatlSimpleAttributesTestSuite () {

  return {

////////////////////////////////////////////////////////////////////////////////
/// @brief set up
////////////////////////////////////////////////////////////////////////////////

    setUp : function () {
    },

////////////////////////////////////////////////////////////////////////////////
/// @brief tear down
////////////////////////////////////////////////////////////////////////////////

    tearDown : function () {
    },

////////////////////////////////////////////////////////////////////////////////
/// @brief test simple attribute names
////////////////////////////////////////////////////////////////////////////////

    testSimple : function () {
      var expected = { "foo" : "bar", "bar" : 25 };
      var actual = AQL_EXECUTE("LET foo = PASSTHRU('bar') LET bar = PASSTHRU(25) RETURN { foo, bar }");
      assertEqual(expected, actual.json[0]);
    },

////////////////////////////////////////////////////////////////////////////////
/// @brief test simple attribute names
////////////////////////////////////////////////////////////////////////////////

    testSimpleBackticked : function () {
      var expected = { "foo" : "bar", "bar" : 25 };
      var actual = AQL_EXECUTE("LET foo = PASSTHRU('bar') LET bar = PASSTHRU(25) RETURN { `foo`, `bar` }");
      assertEqual(expected, actual.json[0]);
    },

////////////////////////////////////////////////////////////////////////////////
/// @brief test simple attribute names
////////////////////////////////////////////////////////////////////////////////

    testMixed1 : function () {
      var expected = { "foo" : "bar", "bar" : 25, "baz" : "test" };
      var actual = AQL_EXECUTE("LET foo = PASSTHRU('bar') LET bar = PASSTHRU(25) RETURN { foo, bar, baz: 'test' }");
      assertEqual(expected, actual.json[0]);
    },

////////////////////////////////////////////////////////////////////////////////
/// @brief test simple attribute names
////////////////////////////////////////////////////////////////////////////////

    testMixed2 : function () {
      var expected = { "foo" : "bar", "bar" : 25, "baz" : "test", "haxe" : 42 };
      var actual = AQL_EXECUTE("LET foo = PASSTHRU('bar') LET bar = PASSTHRU(25) RETURN { foo, bar, baz: 'test', [ PASSTHRU(CONCAT('h', 'axe')) ] : 42 }");
      assertEqual(expected, actual.json[0]);
    },

////////////////////////////////////////////////////////////////////////////////
/// @brief test simple with undefined variables
////////////////////////////////////////////////////////////////////////////////

    testUndefinedAttributeName1 : function () {
      try {
        AQL_EXECUTE("RETURN { foo }");
        fail();
      }
      catch (e) {
        assertEqual(errors.ERROR_QUERY_VARIABLE_NAME_UNKNOWN.code, e.errorNum);
      }
    },

////////////////////////////////////////////////////////////////////////////////
/// @brief test simple with undefined variables
////////////////////////////////////////////////////////////////////////////////

    testUndefinedAttributeName2 : function () {
      try {
        AQL_EXECUTE("LET baz = PASSTHRU(42) RETURN { foo : 'bar', baz, bar }");
        fail();
      }
      catch (e) {
        assertEqual(errors.ERROR_QUERY_VARIABLE_NAME_UNKNOWN.code, e.errorNum);
      }
    }

  };
}

////////////////////////////////////////////////////////////////////////////////
/// @brief executes the test suite
////////////////////////////////////////////////////////////////////////////////

jsunity.run(ahuacatlSimpleAttributesTestSuite);

return jsunity.done();