text:
package com.it.fragments;

import android.app.FragmentManager;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;

import com.it.admin.sindhtv.R;

/**
 * Created by admin on 4/26/2016.
 */
public class WebviewHealinesFragment extends Fragment {

    private ProgressBar progress;
    private WebView webView;

    public static WebviewHealinesFragment newInstance(Bundle bundle) {
        WebviewHealinesFragment fragment = new WebviewHealinesFragment();
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // listView = new ListView(getActivity());

        View fakeHeader = inflater.inflate(R.layout.webview_article, null);
        SharedPreferences shp = getActivity().getSharedPreferences("sindhtv", 0);
        String url_webview = shp.getString("url_webview","");

        webView = (WebView)fakeHeader. findViewById(R.id.webView);
        progress = (ProgressBar)fakeHeader.findViewById(R.id.progressScroll);

        webView.getSettings().setAllowFileAccess(true);

        webView.getSettings().setJavaScriptEnabled(true);

        webView.setWebViewClient(new MyWebViewClient());

        webView.loadUrl(url_webview);

        onBack();

        return fakeHeader;
    }

    public  void onBack()
    {

        FragmentManager g = getActivity().getFragmentManager();

        g.popBackStack();
    }

    private class MyWebViewClient extends WebViewClient {

        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);

            return true;
        }

        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            // TODO Auto-generated method stub
            super.onPageStarted(view, url, favicon);

            progress.setVisibility(View.VISIBLE);

        }

        @Override
        public void onPageFinished(WebView view, String url) {
            // TODO Auto-generated method stub
            super.onPageFinished(view, url);

            progress.setVisibility(View.GONE);

        }
    }

    @Override
    public void onPause() {
        // TODO Auto-generated method stub
        super.onPause();

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            if (webView == null) {

            } else {
                webView.onPause();
            }

        }

    }

}


text:
{%- capture title -%}
DependencyParser
{%- endcapture -%}

{%- capture model_description -%}
Unlabeled parser that finds a grammatical relation between two words in a sentence.

Dependency parser provides information about word relationship. For example, dependency parsing can tell you what
the subjects and objects of a verb are, as well as which words are modifying (describing) the subject. This can help
you find precise answers to specific questions.

This is the instantiated model of the DependencyParserApproach.
For training your own model, please see the documentation of that class.

Pretrained models can be loaded with `pretrained` of the companion object:
```
val dependencyParserApproach = DependencyParserModel.pretrained()
  .setInputCols("sentence", "pos", "token")
  .setOutputCol("dependency")
```
The default model is `"dependency_conllu"`, if no name is provided.
For available pretrained models please see the [Models Hub](https://nlp.johnsnowlabs.com/models).

For extended examples of usage, see the [Spark NLP Workshop](https://github.com/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/Certification_Trainings/Public/3.SparkNLP_Pretrained_Models.ipynb)
and the [DependencyParserApproachTestSpec](https://github.com/JohnSnowLabs/spark-nlp/blob/master/src/test/scala/com/johnsnowlabs/nlp/annotators/parser/dep/DependencyParserApproachTestSpec.scala).
{%- endcapture -%}

{%- capture model_input_anno -%}
[String]DOCUMENT, POS, TOKEN
{%- endcapture -%}

{%- capture model_output_anno -%}
DEPENDENCY
{%- endcapture -%}

{%- capture model_python_example -%}
import sparknlp
from sparknlp.base import *
from sparknlp.annotator import *
from pyspark.ml import Pipeline

documentAssembler = DocumentAssembler() \
    .setInputCol("text") \
    .setOutputCol("document")

sentence = SentenceDetector() \
    .setInputCols("document") \
    .setOutputCol("sentence")

tokenizer = Tokenizer() \
    .setInputCols("sentence") \
    .setOutputCol("token")

posTagger = PerceptronModel.pretrained() \
    .setInputCols("sentence", "token") \
    .setOutputCol("pos")

dependencyParser = DependencyParserModel.pretrained() \
    .setInputCols("sentence", "pos", "token") \
    .setOutputCol("dependency")

pipeline = Pipeline().setStages([
    documentAssembler,
    sentence,
    tokenizer,
    posTagger,
    dependencyParser
])

data = spark.createDataFrame([[
    "Unions representing workers at Turner Newall say they are 'disappointed' after talks with stricken parent " +
      "firm Federal Mogul."
]]).toDF("text")
result = pipeline.fit(data).transform(data)

result.selectExpr("explode(arrays_zip(token.result, dependency.result)) as cols") \
    .selectExpr("cols['0'] as token", "cols['1'] as dependency").show(8, truncate = False)
+------------+------------+
|token       |dependency  |
+------------+------------+
|Unions      |ROOT        |
|representing|workers     |
|workers     |Unions      |
|at          |Turner      |
|Turner      |workers     |
|Newall      |say         |
|say         |Unions      |
|they        |disappointed|
+------------+------------+

{%- endcapture -%}

{%- capture model_scala_example -%}
import spark.implicits._
import com.johnsnowlabs.nlp.base.DocumentAssembler
import com.johnsnowlabs.nlp.annotators.Tokenizer
import com.johnsnowlabs.nlp.annotators.parser.dep.DependencyParserModel
import com.johnsnowlabs.nlp.annotators.pos.perceptron.PerceptronModel
import com.johnsnowlabs.nlp.annotators.sbd.pragmatic.SentenceDetector
import org.apache.spark.ml.Pipeline

val documentAssembler = new DocumentAssembler()
  .setInputCol("text")
  .setOutputCol("document")

val sentence = new SentenceDetector()
  .setInputCols("document")
  .setOutputCol("sentence")

val tokenizer = new Tokenizer()
  .setInputCols("sentence")
  .setOutputCol("token")

val posTagger = PerceptronModel.pretrained()
  .setInputCols("sentence", "token")
  .setOutputCol("pos")

val dependencyParser = DependencyParserModel.pretrained()
  .setInputCols("sentence", "pos", "token")
  .setOutputCol("dependency")

val pipeline = new Pipeline().setStages(Array(
  documentAssembler,
  sentence,
  tokenizer,
  posTagger,
  dependencyParser
))

val data = Seq(
  "Unions representing workers at Turner Newall say they are 'disappointed' after talks with stricken parent " +
    "firm Federal Mogul."
).toDF("text")
val result = pipeline.fit(data).transform(data)

result.selectExpr("explode(arrays_zip(token.result, dependency.result)) as cols")
  .selectExpr("cols['0'] as token", "cols['1'] as dependency").show(8, truncate = false)
+------------+------------+
|token       |dependency  |
+------------+------------+
|Unions      |ROOT        |
|representing|workers     |
|workers     |Unions      |
|at          |Turner      |
|Turner      |workers     |
|Newall      |say         |
|say         |Unions      |
|they        |disappointed|
+------------+------------+

{%- endcapture -%}

{%- capture model_api_link -%}
[DependencyParserModel](https://nlp.johnsnowlabs.com/api/com/johnsnowlabs/nlp/annotators/parser/dep/DependencyParserModel)
{%- endcapture -%}

{%- capture model_python_api_link -%}
[DependencyParserModel](/api/python/reference/autosummary/python/sparknlp/annotator/dependency/dependency_parser/index.html#sparknlp.annotator.dependency.dependency_parser.DependencyParserModel)
{%- endcapture -%}

{%- capture model_source_link -%}
[DependencyParserModel](https://github.com/JohnSnowLabs/spark-nlp/tree/master/src/main/scala/com/johnsnowlabs/nlp/annotators/parser/dep/DependencyParserModel.scala)
{%- endcapture -%}

{%- capture approach_description -%}
Trains an unlabeled parser that finds a grammatical relations between two words in a sentence.

For instantiated/pretrained models, see DependencyParserModel.

Dependency parser provides information about word relationship. For example, dependency parsing can tell you what
the subjects and objects of a verb are, as well as which words are modifying (describing) the subject. This can help
you find precise answers to specific questions.

The required training data can be set in two different ways (only one can be chosen for a particular model):
  - Dependency treebank in the [Penn Treebank format](http://www.nltk.org/nltk_data/) set with `setDependencyTreeBank`
  - Dataset in the [CoNLL-U format](https://universaldependencies.org/format.html) set with `setConllU`

Apart from that, no additional training data is needed.

See [DependencyParserApproachTestSpec](https://github.com/JohnSnowLabs/spark-nlp/blob/master/src/test/scala/com/johnsnowlabs/nlp/annotators/parser/dep/DependencyParserApproachTestSpec.scala) for further reference on how to use this API.
{%- endcapture -%}

{%- capture approach_input_anno -%}
DOCUMENT, POS, TOKEN
{%- endcapture -%}

{%- capture approach_output_anno -%}
DEPENDENCY
{%- endcapture -%}

{%- capture approach_python_example -%}
import sparknlp
from sparknlp.base import *
from sparknlp.annotator import *
from pyspark.ml import Pipeline

documentAssembler = DocumentAssembler() \
    .setInputCol("text") \
    .setOutputCol("document")

sentence = SentenceDetector() \
    .setInputCols("document") \
    .setOutputCol("sentence")

tokenizer = Tokenizer() \
    .setInputCols("sentence") \
    .setOutputCol("token")

posTagger = PerceptronModel.pretrained() \
    .setInputCols("sentence", "token") \
    .setOutputCol("pos")

dependencyParserApproach = DependencyParserApproach() \
    .setInputCols("sentence", "pos", "token") \
    .setOutputCol("dependency") \
    .setDependencyTreeBank("src/test/resources/parser/unlabeled/dependency_treebank")

pipeline = Pipeline().setStages([
    documentAssembler,
    sentence,
    tokenizer,
    posTagger,
    dependencyParserApproach
])

# Additional training data is not needed, the dependency parser relies on the dependency tree bank / CoNLL-U only.
emptyDataSet = spark.createDataFrame([[""]]).toDF("text")
pipelineModel = pipeline.fit(emptyDataSet)

{%- endcapture -%}

{%- capture approach_scala_example -%}
import spark.implicits._
import com.johnsnowlabs.nlp.base.DocumentAssembler
import com.johnsnowlabs.nlp.annotators.sbd.pragmatic.SentenceDetector
import com.johnsnowlabs.nlp.annotators.Tokenizer
import com.johnsnowlabs.nlp.annotators.pos.perceptron.PerceptronModel
import com.johnsnowlabs.nlp.annotators.parser.dep.DependencyParserApproach
import org.apache.spark.ml.Pipeline

val documentAssembler = new DocumentAssembler()
  .setInputCol("text")
  .setOutputCol("document")

val sentence = new SentenceDetector()
  .setInputCols("document")
  .setOutputCol("sentence")

val tokenizer = new Tokenizer()
  .setInputCols("sentence")
  .setOutputCol("token")

val posTagger = PerceptronModel.pretrained()
  .setInputCols("sentence", "token")
  .setOutputCol("pos")

val dependencyParserApproach = new DependencyParserApproach()
  .setInputCols("sentence", "pos", "token")
  .setOutputCol("dependency")
  .setDependencyTreeBank("src/test/resources/parser/unlabeled/dependency_treebank")

val pipeline = new Pipeline().setStages(Array(
  documentAssembler,
  sentence,
  tokenizer,
  posTagger,
  dependencyParserApproach
))

// Additional training data is not needed, the dependency parser relies on the dependency tree bank / CoNLL-U only.
val emptyDataSet = Seq.empty[String].toDF("text")
val pipelineModel = pipeline.fit(emptyDataSet)

{%- endcapture -%}

{%- capture approach_api_link -%}
[DependencyParserApproach](https://nlp.johnsnowlabs.com/api/com/johnsnowlabs/nlp/annotators/parser/dep/DependencyParserApproach)
{%- endcapture -%}

{%- capture approach_python_api_link -%}
[DependencyParserApproach](/api/python/reference/autosummary/python/sparknlp/annotator/dependency/dependency_parser/index.html#sparknlp.annotator.dependency.dependency_parser.DependencyParserApproach)
{%- endcapture -%}

{%- capture approach_source_link -%}
[DependencyParserApproach](https://github.com/JohnSnowLabs/spark-nlp/tree/master/src/main/scala/com/johnsnowlabs/nlp/annotators/parser/dep/DependencyParserApproach.scala)
{%- endcapture -%}

{% include templates/approach_model_template.md
title=title
model_description=model_description
model_input_anno=model_input_anno
model_output_anno=model_output_anno
model_python_api_link=model_python_api_link
model_api_link=model_api_link
model_source_link=model_source_link
approach_description=approach_description
approach_input_anno=approach_input_anno
approach_output_anno=approach_output_anno
approach_python_example=approach_python_example
approach_scala_example=approach_scala_example
approach_python_api_link=approach_python_api_link
approach_api_link=approach_api_link
approach_source_link=approach_source_link
%}

redpajama_set_name: RedPajamaGithub


text:
"""
sentry_opsgenie.plugin
~~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2015 by Sentry Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
"""
from __future__ import absolute_import

import logging
import sentry_opsgenie

from django import forms
from django.utils.html import escape

from sentry import http
from sentry.plugins.bases import notify
from sentry.utils import json

class OpsGenieOptionsForm(notify.NotificationConfigurationForm):
    api_key = forms.CharField(
        max_length=255,
        help_text='OpsGenie API key used for authenticating API requests',
        required=True,
    )
    recipients = forms.CharField(
        max_length=255,
        help_text='The user names of individual users or groups (comma seperated)',
        required=False,
    )
    alert_url = forms.CharField(
        max_length=255,
        label='OpsGenie Alert URL',
        widget=forms.TextInput(attrs={'class': 'span6', 'placeholder': 'e.g. https://api.opsgenie.com/v1/json/alert'}),
        help_text='It must be visible to the Sentry server',
        required=True,
    )

class OpsGeniePlugin(notify.NotificationPlugin):
    author = 'Sentry Team'
    author_url = 'https://github.com/getsentry'
    resource_links = (
        ('Bug Tracker', 'https://github.com/getsentry/sentry-opsgenie/issues'),
        ('Source', 'https://github.com/getsentry/sentry-opsgenie'),
    )

    title = 'OpsGenie'
    slug = 'opsgenie'
    description = 'Create OpsGenie alerts out of notifications.'
    conf_key = 'opsgenie'
    version = sentry_opsgenie.VERSION
    project_conf_form = OpsGenieOptionsForm

    logger = logging.getLogger('sentry.plugins.opsgenie')

    def is_configured(self, project):
        return all((
            self.get_option(k, project)
            for k in ('api_key', 'alert_url')
        ))

    def get_form_initial(self, project=None):
        return {
            'alert_url': 'https://api.opsgenie.com/v1/json/alert',
        }

    # TODO(dcramer): this is duplicated from sentry-webhooks
    def get_group_data(self, group, event):
        data = {
            'id': str(group.id),
            'checksum': group.checksum,
            'project': group.project.slug,
            'project_name': group.project.name,
            'logger': group.logger,
            'level': group.get_level_display(),
            'culprit': group.culprit,
            'message': event.message,
            'url': group.get_absolute_url(),
        }
        data['event'] = dict(event.data or {})
        data['event']['tags'] = event.get_tags()
        return data

    def notify_users(self, group, event, fail_silently=False):
        if not self.is_configured(group.project):
            return

        api_key = self.get_option('api_key', group.project)
        recipients = self.get_option('recipients', group.project)
        alert_url = self.get_option('alert_url', group.project)

        message = getattr(group, 'message_short', group.message).encode('utf-8')

        payload = {
           'apiKey': api_key,
           'message': message,
           'source': 'Sentry',
           'details': self.get_group_data(group, event)
        }

        if recipients:
            payload['recipients'] = recipients

        req = http.safe_urlopen(alert_url, json=payload)
        resp = req.json()

        if resp.get('status') != 'successful':
            raise Exception('Unsuccessful response from OpsGenie: %s' % resp)


text:
package io.airlift.sample;

import com.google.common.io.Resources;
import io.airlift.json.JsonCodec;
import org.testng.annotations.Test;

import static io.airlift.json.JsonCodec.jsonCodec;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.testng.Assert.assertEquals;

public class TestPersonRepresentation
{
    private final JsonCodec<PersonRepresentation> codec = jsonCodec(PersonRepresentation.class);

    // TODO: add equivalence test

    @Test
    public void testJsonRoundTrip()
    {
        PersonRepresentation expected = new PersonRepresentation("alice@example.com", "Alice", null);
        String json = codec.toJson(expected);
        PersonRepresentation actual = codec.fromJson(json);
        assertEquals(actual, expected);
    }

    @Test
    public void testJsonDecode()
            throws Exception
    {
        PersonRepresentation expected = new PersonRepresentation("foo@example.com", "Mr Foo", null);

        String json = Resources.toString(Resources.getResource("single.json"), UTF_8);
        PersonRepresentation actual = codec.fromJson(json);

        assertEquals(actual, expected);
    }
}


text:
package com.thinkbiganalytics.feedmgr.nifi.cache;

import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.thinkbiganalytics.nifi.rest.client.NiFiRestClient;

import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicLong;

/**
 * Inspect NiFi collecting all the process groups, processors, connections, etc
 */
public class NiFiFlowInspectorManager {

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

    private NiFiRestClient restClient;

    private Set<String> processGroupsToInspect = new HashSet<>();

    AtomicLong inspectingCount = new AtomicLong(0);

    private boolean running;

    ExecutorService executorService = null;

    private final CountDownLatch latch = new CountDownLatch(1);

    private Map<String, NiFiFlowInspection> flowsInspected = new ConcurrentHashMap<>();

    private Set<String> processGroupsWithErrors = new HashSet<>();

    private NiFiFlowInspectionCallback completionCallback;

    private String startingProcessGroupId;
    private boolean wait;

    private long totalTime = 0L;
    private DateTime started;
    private DateTime finished;

    private static int DEFAULT_THREADS = 10;
    private static int MAX_THREADS = 100;

    private int threadCount = DEFAULT_THREADS;

    private ThreadFactory flowInspectionThreadFactory = new ThreadFactoryBuilder()
        .setNameFormat("NiFi-Flow-Insepction-%d").build();

    public NiFiFlowInspectorManager(NiFiRestClient restClient) {
        this("root", null, 10, true, restClient);
    }

    public NiFiFlowInspectorManager(NiFiFlowInspectionCallback completionCallback, NiFiRestClient restClient, int numOfThreads, boolean wait) {
        this("root", completionCallback, numOfThreads, wait, restClient);
    }

    public NiFiFlowInspectorManager(NiFiFlowInspectionCallback completionCallback, NiFiRestClient restClient, int numOfThreads) {
        this("root", completionCallback, numOfThreads, false, restClient);
    }

    public NiFiFlowInspectorManager(String startingProcessGroupId, NiFiFlowInspectionCallback completionCallback, int numOfThreads, boolean wait, NiFiRestClient restClient) {
        this.restClient = restClient;

        this.executorService = Executors.newFixedThreadPool(numOfThreads > 0 && numOfThreads < MAX_THREADS ? numOfThreads : DEFAULT_THREADS, flowInspectionThreadFactory);
        this.completionCallback = completionCallback;
        this.startingProcessGroupId = StringUtils.isBlank(startingProcessGroupId) ? "root" : startingProcessGroupId;
        this.wait = wait;
        this.threadCount = numOfThreads;
    }

    public static class NiFiFlowInspectorManagerBuilder {

        private NiFiFlowInspectionCallback completionCallback;
        private String startingProcessGroupId;
        private boolean wait;
        private int threadCount = DEFAULT_THREADS;
        private NiFiRestClient restClient;

        public NiFiFlowInspectorManagerBuilder(NiFiRestClient restClient) {
            this.restClient = restClient;
        }

        public NiFiFlowInspectorManagerBuilder completionCallback(NiFiFlowInspectionCallback callback) {
            this.completionCallback = callback;
            return this;
        }

        public NiFiFlowInspectorManagerBuilder startingProcessGroupId(String startingProcessGroupId) {
            this.startingProcessGroupId = startingProcessGroupId;
            return this;
        }

        public NiFiFlowInspectorManagerBuilder waitUntilComplete(boolean wait) {
            this.wait = wait;
            return this;
        }

        public NiFiFlowInspectorManagerBuilder threads(int threadCount) {
            this.threadCount = threadCount;
            return this;
        }

        public NiFiFlowInspectorManager build() {
            return new NiFiFlowInspectorManager(startingProcessGroupId, completionCallback, threadCount, wait, restClient);
        }

        public NiFiFlowInspectorManager buildAndInspect() {
            NiFiFlowInspectorManager mgr = new NiFiFlowInspectorManager(startingProcessGroupId, completionCallback, threadCount, wait, restClient);
            mgr.inspect();
            return mgr;
        }
    }

    private void reset() {
        flowsInspected.clear();
        running = false;
        inspectingCount.set(0);
        processGroupsToInspect.clear();
    }

    public void addGroupToInspect(String groupId, int level, NiFiFlowInspection parent) {
        int nextLevel = level + 1;
        processGroupsToInspect.add(groupId);
        inspectingCount.incrementAndGet();
        NiFiFlowInspector processGroupInspector = new NiFiFlowInspector(groupId, nextLevel, parent, restClient);
        CompletableFuture<NiFiFlowInspection> flowInspection = CompletableFuture.supplyAsync(() -> processGroupInspector.inspect(), executorService);
        flowInspection.thenAcceptAsync(this::flowInspectionComplete);

    }

    public void addGroupWithError(String processGroupId) {
        processGroupsWithErrors.add(processGroupId);
    }

    private void flowInspectionComplete(NiFiFlowInspection flowInspection) {
        flowInspection.getGroupsToInspect().stream().forEach(processGroupId -> addGroupToInspect(processGroupId, flowInspection.getLevel(), flowInspection));
        processGroupsToInspect.remove(flowInspection.getProcessGroupId());
        inspectingCount.decrementAndGet();
        flowsInspected.put(flowInspection.getProcessGroupId(), flowInspection);
        if (!flowInspection.isComplete()) {
            addGroupWithError(flowInspection.getProcessGroupId());
            //short circuit and stop the inspection
            completeInspection();
        }

        if (isFinished()) {
            completeInspection();
        }
    }

    private void completeInspection() {
        if (hasErrors()) {
            log.error("Errors were found while inspecting NiFi process groups.");
        } else {
            log.info("Completed NiFi inspection of process groups");
        }
        running = false;
        finished = DateTime.now();
        totalTime = finished.getMillis() - started.getMillis();
        if (completionCallback != null && !hasErrors()) {
            completionCallback.execute(this);
        }
        if (wait) {
            latch.countDown();
        }
        executorService.shutdown();
    }

    public boolean hasErrors() {
        return !processGroupsWithErrors.isEmpty();
    }

    public boolean isFinished() {
        return inspectingCount.get() == 0;
    }

    /**
     * Start inspecting NiFi
     */
    public void inspect() {
        reset();
        running = true;
        started = DateTime.now();
        addGroupToInspect(startingProcessGroupId, 0, null);
        if (wait) {
            try {
                latch.await();
            } catch (InterruptedException e) {
                log.error("Error waiting for latch", e);
            }
        }

    }

    public long getTotalTime() {
        return totalTime;
    }

    public DateTime getStarted() {
        return started;
    }

    public DateTime getFinished() {
        return finished;
    }

    public Map<String, NiFiFlowInspection> getFlowsInspected() {
        return flowsInspected;
    }

    public int getThreadCount() {
        return threadCount;
    }
}


text:
package net.minecraft.entity.item;

import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.Iterator;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAnvil;
import net.minecraft.block.BlockFalling;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;

public class EntityFallingBlock extends Entity
{
    private IBlockState field_175132_d;
    public int fallTime;
    public boolean shouldDropItem = true;
    private boolean field_145808_f;
    private boolean hurtEntities;
    private int fallHurtMax = 40;
    private float fallHurtAmount = 2.0F;
    public NBTTagCompound tileEntityData;
    private static final String __OBFID = "CL_00001668";

    public EntityFallingBlock(World worldIn)
    {
        super(worldIn);
    }

    public EntityFallingBlock(World worldIn, double p_i45848_2_, double p_i45848_4_, double p_i45848_6_, IBlockState p_i45848_8_)
    {
        super(worldIn);
        this.field_175132_d = p_i45848_8_;
        this.preventEntitySpawning = true;
        this.setSize(0.98F, 0.98F);
        this.setPosition(p_i45848_2_, p_i45848_4_, p_i45848_6_);
        this.motionX = 0.0D;
        this.motionY = 0.0D;
        this.motionZ = 0.0D;
        this.prevPosX = p_i45848_2_;
        this.prevPosY = p_i45848_4_;
        this.prevPosZ = p_i45848_6_;
    }

    /**
     * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
     * prevent them from trampling crops
     */
    protected boolean canTriggerWalking()
    {
        return false;
    }

    protected void entityInit() {}

    /**
     * Returns true if other Entities should be prevented from moving through this Entity.
     */
    public boolean canBeCollidedWith()
    {
        return !this.isDead;
    }

    /**
     * Called to update the entity's position/logic.
     */
    public void onUpdate()
    {
        Block var1 = this.field_175132_d.getBlock();

        if (var1.getMaterial() == Material.air)
        {
            this.setDead();
        }
        else
        {
            this.prevPosX = this.posX;
            this.prevPosY = this.posY;
            this.prevPosZ = this.posZ;
            BlockPos var2;

            if (this.fallTime++ == 0)
            {
                var2 = new BlockPos(this);

                if (this.worldObj.getBlockState(var2).getBlock() == var1)
                {
                    this.worldObj.setBlockToAir(var2);
                }
                else if (!this.worldObj.isRemote)
                {
                    this.setDead();
                    return;
                }
            }

            this.motionY -= 0.03999999910593033D;
            this.moveEntity(this.motionX, this.motionY, this.motionZ);
            this.motionX *= 0.9800000190734863D;
            this.motionY *= 0.9800000190734863D;
            this.motionZ *= 0.9800000190734863D;

            if (!this.worldObj.isRemote)
            {
                var2 = new BlockPos(this);

                if (this.onGround)
                {
                    this.motionX *= 0.699999988079071D;
                    this.motionZ *= 0.699999988079071D;
                    this.motionY *= -0.5D;

                    if (this.worldObj.getBlockState(var2).getBlock() != Blocks.piston_extension)
                    {
                        this.setDead();

                        if (!this.field_145808_f && this.worldObj.canBlockBePlaced(var1, var2, true, EnumFacing.UP, (Entity)null, (ItemStack)null) && !BlockFalling.canFallInto(this.worldObj, var2.offsetDown()) && this.worldObj.setBlockState(var2, this.field_175132_d, 3))
                        {
                            if (var1 instanceof BlockFalling)
                            {
                                ((BlockFalling)var1).onEndFalling(this.worldObj, var2);
                            }

                            if (this.tileEntityData != null && var1 instanceof ITileEntityProvider)
                            {
                                TileEntity var3 = this.worldObj.getTileEntity(var2);

                                if (var3 != null)
                                {
                                    NBTTagCompound var4 = new NBTTagCompound();
                                    var3.writeToNBT(var4);
                                    Iterator var5 = this.tileEntityData.getKeySet().iterator();

                                    while (var5.hasNext())
                                    {
                                        String var6 = (String)var5.next();
                                        NBTBase var7 = this.tileEntityData.getTag(var6);

                                        if (!var6.equals("x") && !var6.equals("y") && !var6.equals("z"))
                                        {
                                            var4.setTag(var6, var7.copy());
                                        }
                                    }

                                    var3.readFromNBT(var4);
                                    var3.markDirty();
                                }
                            }
                        }
                        else if (this.shouldDropItem && !this.field_145808_f && this.worldObj.getGameRules().getGameRuleBooleanValue("doTileDrops"))
                        {
                            this.entityDropItem(new ItemStack(var1, 1, var1.damageDropped(this.field_175132_d)), 0.0F);
                        }
                    }
                }
                else if (this.fallTime > 100 && !this.worldObj.isRemote && (var2.getY() < 1 || var2.getY() > 256) || this.fallTime > 600)
                {
                    if (this.shouldDropItem && this.worldObj.getGameRules().getGameRuleBooleanValue("doTileDrops"))
                    {
                        this.entityDropItem(new ItemStack(var1, 1, var1.damageDropped(this.field_175132_d)), 0.0F);
                    }

                    this.setDead();
                }
            }
        }
    }

    public void fall(float distance, float damageMultiplier)
    {
        Block var3 = this.field_175132_d.getBlock();

        if (this.hurtEntities)
        {
            int var4 = MathHelper.ceiling_float_int(distance - 1.0F);

            if (var4 > 0)
            {
                ArrayList var5 = Lists.newArrayList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox()));
                boolean var6 = var3 == Blocks.anvil;
                DamageSource var7 = var6 ? DamageSource.anvil : DamageSource.fallingBlock;
                Iterator var8 = var5.iterator();

                while (var8.hasNext())
                {
                    Entity var9 = (Entity)var8.next();
                    var9.attackEntityFrom(var7, (float)Math.min(MathHelper.floor_float((float)var4 * this.fallHurtAmount), this.fallHurtMax));
                }

                if (var6 && (double)this.rand.nextFloat() < 0.05000000074505806D + (double)var4 * 0.05D)
                {
                    int var10 = ((Integer)this.field_175132_d.getValue(BlockAnvil.DAMAGE)).intValue();
                    ++var10;

                    if (var10 > 2)
                    {
                        this.field_145808_f = true;
                    }
                    else
                    {
                        this.field_175132_d = this.field_175132_d.withProperty(BlockAnvil.DAMAGE, Integer.valueOf(var10));
                    }
                }
            }
        }
    }

    /**
     * (abstract) Protected helper method to write subclass entity data to NBT.
     */
    protected void writeEntityToNBT(NBTTagCompound tagCompound)
    {
        Block var2 = this.field_175132_d != null ? this.field_175132_d.getBlock() : Blocks.air;
        ResourceLocation var3 = (ResourceLocation)Block.blockRegistry.getNameForObject(var2);
        tagCompound.setString("Block", var3 == null ? "" : var3.toString());
        tagCompound.setByte("Data", (byte)var2.getMetaFromState(this.field_175132_d));
        tagCompound.setByte("Time", (byte)this.fallTime);
        tagCompound.setBoolean("DropItem", this.shouldDropItem);
        tagCompound.setBoolean("HurtEntities", this.hurtEntities);
        tagCompound.setFloat("FallHurtAmount", this.fallHurtAmount);
        tagCompound.setInteger("FallHurtMax", this.fallHurtMax);

        if (this.tileEntityData != null)
        {
            tagCompound.setTag("TileEntityData", this.tileEntityData);
        }
    }

    /**
     * (abstract) Protected helper method to read subclass entity data from NBT.
     */
    protected void readEntityFromNBT(NBTTagCompound tagCompund)
    {
        int var2 = tagCompund.getByte("Data") & 255;

        if (tagCompund.hasKey("Block", 8))
        {
            this.field_175132_d = Block.getBlockFromName(tagCompund.getString("Block")).getStateFromMeta(var2);
        }
        else if (tagCompund.hasKey("TileID", 99))
        {
            this.field_175132_d = Block.getBlockById(tagCompund.getInteger("TileID")).getStateFromMeta(var2);
        }
        else
        {
            this.field_175132_d = Block.getBlockById(tagCompund.getByte("Tile") & 255).getStateFromMeta(var2);
        }

        this.fallTime = tagCompund.getByte("Time") & 255;
        Block var3 = this.field_175132_d.getBlock();

        if (tagCompund.hasKey("HurtEntities", 99))
        {
            this.hurtEntities = tagCompund.getBoolean("HurtEntities");
            this.fallHurtAmount = tagCompund.getFloat("FallHurtAmount");
            this.fallHurtMax = tagCompund.getInteger("FallHurtMax");
        }
        else if (var3 == Blocks.anvil)
        {
            this.hurtEntities = true;
        }

        if (tagCompund.hasKey("DropItem", 99))
        {
            this.shouldDropItem = tagCompund.getBoolean("DropItem");
        }

        if (tagCompund.hasKey("TileEntityData", 10))
        {
            this.tileEntityData = tagCompund.getCompoundTag("TileEntityData");
        }

        if (var3 == null || var3.getMaterial() == Material.air)
        {
            this.field_175132_d = Blocks.sand.getDefaultState();
        }
    }

    public World getWorldObj()
    {
        return this.worldObj;
    }

    public void setHurtEntities(boolean p_145806_1_)
    {
        this.hurtEntities = p_145806_1_;
    }

    /**
     * Return whether this entity should be rendered as on fire.
     */
    public boolean canRenderOnFire()
    {
        return false;
    }

    public void addEntityCrashInfo(CrashReportCategory category)
    {
        super.addEntityCrashInfo(category);

        if (this.field_175132_d != null)
        {
            Block var2 = this.field_175132_d.getBlock();
            category.addCrashSection("Immitating block ID", Integer.valueOf(Block.getIdFromBlock(var2)));
            category.addCrashSection("Immitating block data", Integer.valueOf(var2.getMetaFromState(this.field_175132_d)));
        }
    }

    public IBlockState getBlock()
    {
        return this.field_175132_d;
    }
}


text:
Updated RPCs
------------

- The `listsinceblock`, `listtransactions` and `gettransaction` output now contain a new
  `parent_descs` field for every "receive" entry.
- A new optional `include_change` parameter was added to the `listsinceblock` command.


text:
package org.apache.sshd.sftp.common;

import org.apache.sshd.common.util.GenericUtils;
import org.apache.sshd.util.test.JUnitTestSupport;
import org.apache.sshd.util.test.NoIoTestCase;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runners.MethodSorters;

/**
 * @author Apache MINA SSHD Project
 */
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Category({ NoIoTestCase.class })
public class SftpConstantsTest extends JUnitTestSupport {
    public SftpConstantsTest() {
        super();
    }

    @Test
    public void testRenameModesNotMarkedAsOpcodes() {
        for (int cmd : new int[] {
                SftpConstants.SSH_FXP_RENAME_OVERWRITE,
                SftpConstants.SSH_FXP_RENAME_ATOMIC,
                SftpConstants.SSH_FXP_RENAME_NATIVE
        }) {
            String name = SftpConstants.getCommandMessageName(cmd);
            assertFalse("Mismatched name for " + cmd + ": " + name, name.startsWith("SSH_FXP_RENAME_"));
        }
    }

    @Test
    public void testRealPathModesNotMarkedAsOpcodes() {
        for (int cmd = SftpConstants.SSH_FXP_REALPATH_NO_CHECK; cmd <= SftpConstants.SSH_FXP_REALPATH_STAT_IF; cmd++) {
            String name = SftpConstants.getCommandMessageName(cmd);
            assertFalse("Mismatched name for " + cmd + ": " + name, name.startsWith("SSH_FXP_REALPATH_"));
        }
    }

    @Test
    public void testSubstatusNameResolution() {
        for (int status = SftpConstants.SSH_FX_OK; status <= SftpConstants.SSH_FX_NO_MATCHING_BYTE_RANGE_LOCK; status++) {
            String name = SftpConstants.getStatusName(status);
            assertTrue("Failed to convert status=" + status + ": " + name, name.startsWith("SSH_FX_"));
        }
    }

    @Test
    public void testSubstatusMessageResolution() {
        for (int status = SftpConstants.SSH_FX_OK; status <= SftpConstants.SSH_FX_NO_MATCHING_BYTE_RANGE_LOCK; status++) {
            String message = SftpHelper.resolveStatusMessage(status);
            assertTrue("Missing message for status=" + status, GenericUtils.isNotEmpty(message));
        }
    }
}


text:
/* exported addEvent, removeEvent, getChildren, setAttributes, addClass, removeClass, forEach */
// fn arg can be an object or a function, thanks to handleEvent
// read more at: http://www.thecssninja.com/javascript/handleevent
var addEvent = function (el, evt, fn, bubble) {
    if ("addEventListener" in el) {
      // BBOS6 doesn't support handleEvent, catch and polyfill
      try {
        el.addEventListener(evt, fn, bubble);
      } catch (e) {
        if (typeof fn === "object" && fn.handleEvent) {
          el.addEventListener(evt, function (e) {
            // Bind fn as this and set first arg as event object
            fn.handleEvent.call(fn, e);
          }, bubble);
        } else {
          throw e;
        }
      }
    } else if ("attachEvent" in el) {
      // check if the callback is an object and contains handleEvent
      if (typeof fn === "object" && fn.handleEvent) {
        el.attachEvent("on" + evt, function () {
          // Bind fn as this
          fn.handleEvent.call(fn);
        });
      } else {
        el.attachEvent("on" + evt, fn);
      }
    }
  },

  removeEvent = function (el, evt, fn, bubble) {
    if ("removeEventListener" in el) {
      try {
        el.removeEventListener(evt, fn, bubble);
      } catch (e) {
        if (typeof fn === "object" && fn.handleEvent) {
          el.removeEventListener(evt, function (e) {
            fn.handleEvent.call(fn, e);
          }, bubble);
        } else {
          throw e;
        }
      }
    } else if ("detachEvent" in el) {
      if (typeof fn === "object" && fn.handleEvent) {
        el.detachEvent("on" + evt, function () {
          fn.handleEvent.call(fn);
        });
      } else {
        el.detachEvent("on" + evt, fn);
      }
    }
  },

  getChildren = function (e) {
    if (e.children.length < 1) {
      throw new Error("The Nav container has no containing elements");
    }
    // Store all children in array
    var children = [];
    // Loop through children and store in array if child != TextNode
    for (var i = 0; i < e.children.length; i++) {
      if (e.children[i].nodeType === 1) {
        children.push(e.children[i]);
      }
    }
    return children;
  },

  setAttributes = function (el, attrs) {
    for (var key in attrs) {
      el.setAttribute(key, attrs[key]);
    }
  },

  addClass = function (el, cls) {
    if (el.className.indexOf(cls) !== 0) {
      el.className += " " + cls;
      el.className = el.className.replace(/(^\s*)|(\s*$)/g,"");
    }
  },

  removeClass = function (el, cls) {
    var reg = new RegExp("(\\s|^)" + cls + "(\\s|$)");
    el.className = el.className.replace(reg, " ").replace(/(^\s*)|(\s*$)/g,"");
  },

  // forEach method that passes back the stuff we need
  forEach = function (array, callback, scope) {
    for (var i = 0; i < array.length; i++) {
      callback.call(scope, i, array[i]);
    }
  };


text:
from ccxt.base import errors
from ccxt.pro.base import exchange

# -----------------------------------------------------------------------------

from ccxt.base import decimal_to_precision

from ccxt import BaseError                  # noqa: F401
from ccxt import ExchangeError              # noqa: F401
from ccxt import NotSupported               # noqa: F401
from ccxt import AuthenticationError        # noqa: F401
from ccxt import PermissionDenied           # noqa: F401
from ccxt import AccountSuspended           # noqa: F401
from ccxt import InvalidNonce               # noqa: F401
from ccxt import InsufficientFunds          # noqa: F401
from ccxt import InvalidOrder               # noqa: F401
from ccxt import OrderNotFound              # noqa: F401
from ccxt import OrderNotCached             # noqa: F401
from ccxt import DuplicateOrderId           # noqa: F401
from ccxt import CancelPending              # noqa: F401
from ccxt import NetworkError               # noqa: F401
from ccxt import DDoSProtection             # noqa: F401
from ccxt import RateLimitExceeded          # noqa: F401
from ccxt import RequestTimeout             # noqa: F401
from ccxt import ExchangeNotAvailable       # noqa: F401
from ccxt import OnMaintenance              # noqa: F401
from ccxt import InvalidAddress             # noqa: F401
from ccxt import AddressPending             # noqa: F401
from ccxt import ArgumentsRequired          # noqa: F401
from ccxt import BadRequest                 # noqa: F401
from ccxt import BadResponse                # noqa: F401
from ccxt import NullResponse               # noqa: F401
from ccxt import OrderImmediatelyFillable   # noqa: F401
from ccxt import OrderNotFillable           # noqa: F401

__all__ = exchange.__all__ + decimal_to_precision.__all__ + errors.__all__  # noqa: F405


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using Slp.Evi.Storage.Database;
using Slp.Evi.Storage.Mapping.Representation;
using Slp.Evi.Storage.Query;
using Slp.Evi.Storage.Types;
using TCode.r2rml4net;
using TCode.r2rml4net.Extensions;
using VDS.RDF;

namespace Slp.Evi.Storage.Relational.Query.ValueBinders
{
    /// <summary>
    /// Representation of the base value binder
    /// </summary>
    public class BaseValueBinder
        : IValueBinder
    {
        /// <summary>
        /// The needed variables
        /// </summary>
        private readonly Dictionary<string, ICalculusVariable> _variables;

        /// <summary>
        /// Initializes a new instance of the <see cref="BaseValueBinder"/> class.
        /// </summary>
        /// <param name="variableName">Name of the variable.</param>
        /// <param name="termMap">The term map.</param>
        /// <param name="source">The source.</param>
        /// <param name="typeCache">The type cache.</param>
        public BaseValueBinder(string variableName, ITermMapping termMap, ISqlCalculusSource source, ITypeCache typeCache)
        {
            VariableName = variableName;
            TermMap = termMap;
            _variables = new Dictionary<string, ICalculusVariable>();
            Type = typeCache.GetValueType(termMap);

            if (termMap.IsConstantValued)
            {
                // No columns needed
            }
            else if (termMap.IsColumnValued)
            {
                _variables.Add(termMap.ColumnName, source.GetVariable(termMap.ColumnName));
            }
            else if (termMap.IsTemplateValued)
            {
                var template = termMap.Template;

                var templateProcessor = new TemplateProcessor();
                TemplateParts = templateProcessor.ParseTemplate(template).ToArray();

                _variables = TemplateParts.Where(x => x.IsColumn).Select(x => x.Column).Distinct()
                    .ToDictionary(x => x, source.GetVariable);
            }
            else
            {
                throw new Exception("Mapping can be only constant, column or template valued");
            }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="BaseValueBinder"/> class by copying another <see cref="BaseValueBinder"/>
        /// while replacing some of its columns
        /// </summary>
        /// <param name="baseValueBinder">The other base value binder.</param>
        /// <param name="calculusVariableSelection">The calculus variable selection function.</param>
        public BaseValueBinder(BaseValueBinder baseValueBinder, Func<ICalculusVariable, ICalculusVariable> calculusVariableSelection)
        {
            VariableName = baseValueBinder.VariableName;
            TermMap = baseValueBinder.TermMap;
            TemplateParts = baseValueBinder.TemplateParts;
            Type = baseValueBinder.Type;

            _variables = new Dictionary<string, ICalculusVariable>();

            foreach (var variableName in baseValueBinder._variables.Keys)
            {
                _variables.Add(variableName, calculusVariableSelection(baseValueBinder._variables[variableName]));
            }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="BaseValueBinder"/> class by copying another <see cref="BaseValueBinder"/>
        /// while replacing some of its columns
        /// </summary>
        /// <param name="baseValueBinder">The other base value binder.</param>
        /// <param name="calculusVariableSelection">The calculus variable selection function.</param>
        public BaseValueBinder(BaseValueBinder baseValueBinder, Func<string, ICalculusVariable> calculusVariableSelection)
        {
            VariableName = baseValueBinder.VariableName;
            TermMap = baseValueBinder.TermMap;
            TemplateParts = baseValueBinder.TemplateParts;
            Type = baseValueBinder.Type;

            _variables = new Dictionary<string, ICalculusVariable>();

            foreach (var variableName in baseValueBinder._variables.Keys)
            {
                _variables.Add(variableName, calculusVariableSelection(variableName));
            }
        }

        /// <summary>
        /// Gets the term map.
        /// </summary>
        /// <value>The term map.</value>
        public ITermMapping TermMap { get; }

        /// <summary>
        /// Gets the name of the variable.
        /// </summary>
        /// <value>The name of the variable.</value>
        public string VariableName { get; }

        /// <summary>
        /// Gets the needed calculus variables to calculate the value.
        /// </summary>
        /// <value>The needed calculus variables.</value>
        public IEnumerable<ICalculusVariable> NeededCalculusVariables => _variables.Values.Distinct();

        /// <summary>
        /// Gets the template parts.
        /// </summary>
        /// <value>The template parts.</value>
        public IEnumerable<ITemplatePart> TemplateParts { get; }

        /// <summary>
        /// The type
        /// </summary>
        public IValueType Type { get; }

        /// <summary>
        /// Gets the calculus variable.
        /// </summary>
        /// <param name="columnName">Name of the column.</param>
        public ICalculusVariable GetCalculusVariable(string columnName)
        {
            return _variables[columnName];
        }

        /// <summary>
        /// Accepts the specified visitor.
        /// </summary>
        /// <param name="visitor">The visitor.</param>
        /// <param name="data">The data.</param>
        /// <returns>The returned value from visitor.</returns>
        [DebuggerStepThrough]
        public object Accept(IValueBinderVisitor visitor, object data)
        {
            return visitor.Visit(this, data);
        }

        /// <summary>
        /// Gets the calculus variable.
        /// </summary>
        /// <param name="columnName">The column name.</param>
        /// <exception cref="System.Exception">Cannot get variable that is not requested for evaluation</exception>
        public ICalculusVariable GetVariable(string columnName)
        {
            if (_variables.ContainsKey(columnName))
            {
                return _variables[columnName];
            }
            else
            {
                throw new Exception("Cannot get variable that is not requested for evaluation");
            }
        }

        /// <summary>
        /// Loads the node.
        /// </summary>
        /// <param name="nodeFactory">The node factory.</param>
        /// <param name="rowData">The row data.</param>
        /// <param name="context">The context.</param>
        public INode LoadNode(INodeFactory nodeFactory, IQueryResultRow rowData, IQueryContext context)
        {
            if (TermMap.IsConstantValued)
            {
                return LoadNodeFromConstant(nodeFactory);
            }
            else if (TermMap.IsColumnValued)
            {
                return LoadNodeFromColumn(nodeFactory, rowData, context);
            }
            else if (TermMap.IsTemplateValued)
            {
                return LoadNodeFromTemplate(nodeFactory, rowData, context);
            }
            else
            {
                throw new Exception("Term map must be either constant, column or template valued");
            }
        }

        /// <summary>
        /// Loads the node from template.
        /// </summary>
        /// <param name="nodeFactory">The node factory.</param>
        /// <param name="rowData">The row data.</param>
        /// <param name="context">The context.</param>
        private INode LoadNodeFromTemplate(INodeFactory nodeFactory, IQueryResultRow rowData, IQueryContext context)
        {
            var value = ReplaceColumnReferences(rowData, TermMap.TermType.IsIri, context);
            return TermForValue(nodeFactory, value, context);
        }

        /// <summary>
        /// Replaces the column references.
        /// </summary>
        /// <param name="rowData">The row data.</param>
        /// <param name="isIri">if set to <c>true</c> the value is iri.</param>
        /// <param name="context">The context.</param>
        private string ReplaceColumnReferences(IQueryResultRow rowData, bool isIri, IQueryContext context)
        {
            var sb = new StringBuilder();
            foreach (var templatePart in TemplateParts)
            {
                if (templatePart.IsText)
                {
                    sb.Append(templatePart.Text);
                }
                else if (templatePart.IsColumn)
                {
                    var variable = GetVariable(templatePart.Column);
                    var replaced = ReplaceColumnReference(rowData, variable, isIri, context);
                    if (replaced == null)
                    {
                        return null;
                    }

                    sb.Append(replaced);
                }
                else
                {
                    throw new Exception("Template part has to be either text or column");
                }
            }

            return sb.ToString();
        }

        /// <summary>
        /// Replaces a single column reference.
        /// </summary>
        /// <param name="rowData">The row data.</param>
        /// <param name="variable">The variable.</param>
        /// <param name="isIri">if set to <c>true</c> the value is iri.</param>
        /// <param name="context">The context.</param>
        private string ReplaceColumnReference(IQueryResultRow rowData, ICalculusVariable variable, bool isIri, IQueryContext context)
        {
            var columnName = context.QueryNamingHelpers.GetVariableName(null, variable);
            var dbCol = rowData.GetColumn(columnName);
            var value = dbCol.StringValue;

            if (value == null)
            {
                return null;
            }

            return isIri ? MappingHelper.UrlEncode(value) : value;
        }

        /// <summary>
        /// Creates term for value.
        /// </summary>
        /// <param name="nodeFactory">The node factory.</param>
        /// <param name="value">The value.</param>
        /// <param name="context">The context.</param>
        private INode TermForValue(INodeFactory nodeFactory, string value, IQueryContext context)
        {
            if (value == null)
            {
                return null;
            }

            if (TermMap.TermType.IsIri)
            {
                return UriTermForValue(value, nodeFactory, TermMap.BaseIri);
            }
            else if (TermMap.TermType.IsBlankNode)
            {
                return BlankNodeForValue(value, nodeFactory, context);
            }
            else if (TermMap.TermType.IsLiteral)
            {
                return TermForLiteral(value, nodeFactory);
            }
            else
            {
                throw new Exception("Unhandled term type");
            }
        }

        /// <summary>
        /// Creates the URI term for value.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <param name="factory">The factory.</param>
        /// <param name="baseUri">The base URI.</param>
        private static INode UriTermForValue(string value, INodeFactory factory, Uri baseUri)
        {
            try
            {
                var uri = new Uri(value, UriKind.RelativeOrAbsolute);

                if (!uri.IsAbsoluteUri)
                {
                    uri = ConstructAbsoluteUri(value, baseUri);
                }

                if (uri.IsAbsoluteUri)
                {
                    uri.LeaveDotsAndSlashesEscaped();
                    return factory.CreateUriNode(uri);
                }
                else
                {
                    throw new Exception("Now the uri must be absolute");
                }
            }
            catch (Exception)
            {
                throw new Exception($"Value {value} is invalid uri");
            }
        }

        /// <summary>
        /// Constructs the absolute URI.
        /// </summary>
        /// <param name="relativePart">The relative part.</param>
        /// <param name="baseUri">The base URI.</param>
        private static Uri ConstructAbsoluteUri(string relativePart, Uri baseUri)
        {
            if (relativePart.Split('/').Any(seg => seg == "." || seg == ".."))
                throw new Exception("The relative IRI cannot contain any . or .. parts");

            return new Uri(baseUri + relativePart);
        }

        /// <summary>
        /// Creates the blank node for value.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <param name="nodeFactory">The node factory.</param>
        /// <param name="context">The context.</param>
        private INode BlankNodeForValue(string value, INodeFactory nodeFactory, IQueryContext context)
        {
            return context.GetBlankNodeForValue(nodeFactory, value);
        }

        /// <summary>
        /// Creates the term for literal.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <param name="nodeFactory">The node factory.</param>
        private INode TermForLiteral(string value, INodeFactory nodeFactory)
        {
            if(!(Type is ILiteralValueType literalValueType))
                throw new InvalidOperationException("It is not possible to generate literal for non literal type");

            return literalValueType.CreateLiteralNode(nodeFactory, value);
        }

        /// <summary>
        /// Loads the node from constant.
        /// </summary>
        /// <param name="nodeFactory">The node factory.</param>
        private INode LoadNodeFromConstant(INodeFactory nodeFactory)
        {
            if (TermMap.Iri != null)
            {
                return nodeFactory.CreateUriNode(TermMap.Iri);
            }
            else if (TermMap is IObjectMapping objectMapping)
            {
                if (objectMapping.Literal != null)
                {
                    var value = objectMapping.Literal.Value;
                    return ((ILiteralValueType) Type).CreateLiteralNode(nodeFactory, value);
                }
                else
                {
                    throw new Exception("Object map's value must be IRI or literal.");
                }
            }
            else
            {
                throw new Exception("Constant must be IRI valued or an object map");
            }
        }

        /// <summary>
        /// Loads the node from column.
        /// </summary>
        /// <param name="nodeFactory">The node factory.</param>
        /// <param name="rowData">The row data.</param>
        /// <param name="context">The context.</param>
        private INode LoadNodeFromColumn(INodeFactory nodeFactory, IQueryResultRow rowData, IQueryContext context)
        {
            var column = NeededCalculusVariables.Single();
            var columnName = context.QueryNamingHelpers.GetVariableName(null, column);
            var dbCol = rowData.GetColumn(columnName);
            var val = dbCol.StringValue;

            if (TermMap.TermType.IsLiteral)
            {
                return TermForLiteral(val, nodeFactory);
            }
            else if (TermMap.TermType.IsIri)
            {
                AssertNoIllegalCharacters(new Uri(val));
                return UriTermForValue(val, nodeFactory, TermMap.BaseIri);
            }
            else
            {
                throw new Exception("Cannot generate blank node from column mapping");
            }
        }

        /// <summary>
        /// Asserts the no illegal characters.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <exception cref="System.Exception"></exception>
        private static void AssertNoIllegalCharacters(Uri value)
        {
            var disallowedChars = new List<char>();
            var segments = value.IsAbsoluteUri ? value.Segments : new[] { value.OriginalString };

            foreach (var segment in segments)
            {
                if (segment.Any(chara => !MappingHelper.IsIUnreserved(chara)))
                {
                    disallowedChars.AddRange(segment.Where(chara => chara != '/' && !MappingHelper.IsIUnreserved(chara)));
                }
            }

            if (disallowedChars.Count > 0)
            {
                throw new Exception(
                    $"Column value is not escaped and thus cannot contain these disallowed characters: {string.Join(",", disallowedChars.Distinct().Select(c => $"'{c}'"))}");
            }
        }
    }
}


text:
"""Generic Multi task architecture."""

import copy
from typing import Any, Dict, List, Mapping, Optional, Sequence, Tuple, TypeVar, Generic

import gin

T = TypeVar('T')

class NamedLists(dict, Generic[T]):
  """A generic architecture for multi tasks with potentially several levels."""

  def __init__(self, layers):
    layers = {k: list(v) for k, v in layers.items()}
    super().__init__(layers)

  def __getattr__(self, attr):
    return self[attr]

  @property
  def levels(self):
    return list(self.values())

  @property
  def size(self):
    return sum(len(x) for x in self.values())

  def constant_copy(self, value):
    """Returns a copy of the structure with only the same value everywhere."""
    return NamedLists(
        layers={k: [value for _ in v] for k, v in self.items()})

  def copy(self):
    """Returns a copy of the NamedLists."""
    return NamedLists(copy.deepcopy(super().copy()))

  def pack(self, values, default_value=None):
    """Packs the values in a NamedLists with the same structure as self."""
    result = self.constant_copy(default_value)
    it = result.__iter__()
    for val in values:
      next(it)  # pytype: disable=wrong-arg-types  # dynamic-method-lookup
      it._level[it._idx] = val  # pylint: disable=protected-access  # pytype: disable=unsupported-operands  # dynamic-method-lookup
    return result

  def flatten(self, empty_value=None):
    result = {}
    for name, values in self.items():
      for i, value in enumerate(values):
        result[f'{name}/{i}'] = value
      if not values:  # special case for empty list to keep the structure.
        result[name + '/'] = empty_value
    return result

  @staticmethod
  def unflatten(values):
    """Unflatten a dict of values that have been previously flattened."""
    result = dict()
    for name, value in values.items():
      idx = name.rfind('/')
      key = name[:idx]
      if key not in result:
        result[key] = []
      if idx != len(name) - 1:
        result[key].append(value)
    return NamedLists(result)

  class _Iterator:
    """Iterator on NamedLists."""

    def __init__(self, container):
      self._level_iter = iter(container.values())
      self._level = None
      self._idx = -1

    def __next__(self):
      self._idx += 1
      if self._level is None or self._idx >= len(self._level):
        self._level = next(self._level_iter)  # Might raise StopIteration here.
        self._idx = -1
        return self.__next__()
      return self._level[self._idx]

  def __iter__(self):
    return NamedLists._Iterator(self)

  @property
  def shape(self):
    return tuple(len(level) for level in self.levels)

@gin.configurable
class Backbone(NamedLists, Generic[T]):
  """A specific case of NamedList that is used in sequence alignments."""

  def __init__(self,
               embeddings = (),
               alignments = ()):
    super().__init__(layers=dict(embeddings=embeddings, alignments=alignments))

  @classmethod
  def constant_from_shape(cls, value, shape):
    return cls(
        embeddings=[value for _ in range(shape[0])],
        alignments=[value for _ in range(shape[1])])

@gin.configurable
class SwitchNamedLists(NamedLists[int]):
  """Provides methods to merge N compatible `NamedLists`.

  A `SwitchNamedLists` instance is a `NamedLists[int]` with values in [0, N)
  whose structure matches that of the desired merged `NamedLists` and elements
  indicate from which of the N input `NamedLists` the corresponding output value
  should be taken. That is,
    `output.key[l] = inputs[self.key[l]].key[l]`,
  where `inputs` is a sequence of N `NamedLists`.

  The N input `NamedLists` are assumed to be compatible in the sense that they
  have the same keys and the total number of elements they contain equals the
  number of elements in the `SwitchSeqAlign` instance. That is,
    `self.size == sum(inputs_i.size for inputs_i in inputs)`
  must hold true.
  """

  @property
  def n(self):
    """Returns the number of `NamedLists` being "switched over"."""
    return max(max(l) for l in self.values()) + 1  # Assumes elems in [0, n).

  def filter(self, inputs, i):
    """Removes elements from `NamedLists` not belonging to i-th input.

    Primarily used to remove "dummy" values e.g. from model output.

    Args:
      inputs: a `NamedLists` with structure identical to `self`.
      i: an int between 0 and N-1, both inclusive, where N is the number of
        `NamedLists` to be merged.

    Returns:
      A `NamedLists` defined as
        `output.key = [v for v, j in zip(inputs.key, self.key) if j == i]`.
      That is, for each key, only those elements in the list for which `self`
      takes value `i` at the matching position will be kept.
    """
    flags = self.get_selector(i)
    layers = {}
    for k in self.keys():
      layers[k] = [v for v, flag in zip(inputs[k], flags[k]) if flag]
    return NamedLists(layers)

  def merge(self, inputs):
    """Merges a sequence of N compatible `NamedLists`.

    Args:
      inputs: a sequence of N `NamedLists` with the same keys as `self`
        satisfying `self.size == sum(inputs_i.size for inputs_i in inputs)`.

    Returns:
      a `NamedLists` instance such that
        `output.key[l] = inputs[self.key[l]].key[l]`
      for each key in `self`.
    """
    inputs = [list(inputs_i) for inputs_i in inputs]
    offsets = len(inputs) * [0]
    outputs = []
    for i in list(self):  # Needed to appease AutoGraph?
      outputs.append(inputs[i][offsets[i]])  # pytype: disable=unsupported-operands  # trace-all-classes
      offsets[i] += 1  # pytype: disable=unsupported-operands  # trace-all-classes
    return self.pack(outputs)

  def merge_flattened(
      self,
      inputs,
      empty_value = None,
  ):
    """Merges a sequence of N compatible, flattened `NamedLists`.

    Args:
      inputs: a sequence of N `Mapping[str, T]` corresponding to N `NamedLists`
        that have been flattened. These must have the same keys as `self` and
        satisfy
          `self.size == sum(unflatten(inputs_i).size for inputs_i in inputs)`.
      empty_value: if provided, substitute `None`s by this value.

    Returns:
      a `NamedLists` instance such that
        `output.key[l] = inputs[self.key[l]].key[l]`
      for each key in `self`, flattened to `Mapping[str, T]`.
    """
    return self.merge([Backbone.unflatten(m_i) for m_i in inputs]).flatten(
        empty_value=empty_value)

  def get_selector(self, i):
    """Returns `NamedLists` of bools flagging elements from i-th input.

    Args:
      i: an int between 0 and N - 1, both inclusive, where N is the number of
        `NamedLists` to be merged.

    Returns:
      a `NamedLists[bool]` such that `output.key[l] = self.key[l] == i`.
    """
    return self.pack([j == i for j in self])

@gin.configurable
class SwitchBackbone(SwitchNamedLists):
  """A specific case of SwitchNamedLists that is used in sequence alignments."""

  def __init__(self,
               embeddings = (),
               alignments = ()):
    super().__init__(layers=dict(embeddings=embeddings, alignments=alignments))

  @classmethod
  def constant_like(cls, container, value = 0):
    return cls(
        embeddings=[value for _ in container.embeddings],
        alignments=[value for _ in container.alignments])


text:
<?php
namespace Tabloz\MainBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Form\FormMapper;

class FrameTypeAdmin extends Admin
{
	protected function configureFormFields(FormMapper $formMapper)
	{
		$formMapper
		->with('General')
			->add('title')
			->add('description')
			->add('image', 'sonata_type_model_list', array('required' => false), array('link_parameters' => array('context' => 'frame_type')))
			->add('enable', null, array('required' => false))
		->end()
		;
	}

	protected function configureDatagridFilters(DatagridMapper $datagridMapper)
	{
		$datagridMapper
		->add('title')
		->add('enable')
		;
	}

	protected function configureListFields(ListMapper $listMapper)
	{
		$listMapper
		->addIdentifier('title')
		->add('description')
		->add('enable', 'boolean', array('editable' => true))
		;
	}

	public function validate(ErrorElement $errorElement, $object)
	{
		$errorElement
		->with('title')
		->assertLength(array('max' => 255))
		->end()
		;
	}
}


text:
declare class Point
{
    x: number;
    y: number;
    add(dx: number, dy: number): Point;
    mult(p: Point): Point;
    static origin: Point;
    constructor(x: number, y: number);
}


text:
package org.apache.nifi.nar;

import org.apache.nifi.bundle.Bundle;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;

import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.hasItem;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assume.assumeTrue;

public class TestLoadNativeLibViaSystemProperty extends AbstractTestNarLoader {
    static final String WORK_DIR = "./target/work";
    static final String NAR_AUTOLOAD_DIR = "./target/nars_without_native_lib";
    static final String PROPERTIES_FILE = "./src/test/resources/conf/nifi.nar_without_native_lib.properties";
    static final String EXTENSIONS_DIR = "./src/test/resources/nars_without_native_lib";

    private static String oldJavaLibraryPath;

    @BeforeClass
    public static void setUpClass() {
        assumeTrue("Test only runs on Mac OS", new OSUtil(){}.isOsMac());

        oldJavaLibraryPath = System.getProperty("java.library.path");
        System.setProperty("java.library.path", "./src/test/resources/native");
    }

    @AfterClass
    public static void tearDownSuite() {
        if (oldJavaLibraryPath != null) {
            System.setProperty("java.library.path", oldJavaLibraryPath);
            oldJavaLibraryPath = null;
        }
    }

    @Test
    public void testLoadSameLibraryByNarClassLoaderFromSystemProperty() throws Exception {
        final File extensionsDir = new File(EXTENSIONS_DIR);
        final Path narAutoLoadDir = Paths.get(NAR_AUTOLOAD_DIR);
        for (final File extensionFile : extensionsDir.listFiles()) {
            Files.copy(extensionFile.toPath(), narAutoLoadDir.resolve(extensionFile.getName()), StandardCopyOption.REPLACE_EXISTING);
        }

        final List<File> narFiles = Arrays.asList(narAutoLoadDir.toFile().listFiles());
        assertEquals(1, narFiles.size());

        final NarLoadResult narLoadResult = narLoader.load(narFiles);
        assertNotNull(narLoadResult);

        List<NarClassLoader> narClassLoaders = this.narClassLoaders.getBundles().stream()
                .filter(bundle -> bundle.getBundleDetails().getCoordinate().getCoordinate().contains("nifi-nar_without_native_lib-"))
                .map(Bundle::getClassLoader)
                .filter(NarClassLoader.class::isInstance)
                .map(NarClassLoader.class::cast)
                .collect(Collectors.toList());

        Set<String> actualLibraryLocations = narClassLoaders.stream()
                .map(classLoader -> classLoader.findLibrary("testjni"))
                .collect(Collectors.toSet());

        for (NarClassLoader narClassLoader : narClassLoaders) {
            Class<?> TestJNI = narClassLoader.loadClass("org.apache.nifi.nar.sharedlib.TestJNI");

            Object actualJniMethodReturnValue = TestJNI
                    .getMethod("testJniMethod")
                    .invoke(TestJNI.newInstance());

            assertEquals("calledNativeTestJniMethod", actualJniMethodReturnValue);
        }

        assertEquals(1, actualLibraryLocations.size());
        assertThat(actualLibraryLocations, hasItem(containsString("nifi-nar_without_native_lib-1")));
    }

    @Test
    public void testLoadSameLibraryBy2InstanceClassLoadersFromSystemProperty() throws Exception {
        final File extensionsDir = new File(EXTENSIONS_DIR);
        final Path narAutoLoadDir = Paths.get(NAR_AUTOLOAD_DIR);
        for (final File extensionFile : extensionsDir.listFiles()) {
            Files.copy(extensionFile.toPath(), narAutoLoadDir.resolve(extensionFile.getName()), StandardCopyOption.REPLACE_EXISTING);
        }

        final List<File> narFiles = Arrays.asList(narAutoLoadDir.toFile().listFiles());
        assertEquals(1, narFiles.size());

        final NarLoadResult narLoadResult = narLoader.load(narFiles);
        assertNotNull(narLoadResult);

        Bundle bundleWithNativeLib = this.narClassLoaders.getBundles().stream()
                .filter(bundle -> bundle.getBundleDetails().getCoordinate().getCoordinate().contains("nifi-nar_without_native_lib-"))
                .findFirst().get();

        Class<?> processorClass = bundleWithNativeLib.getClassLoader().loadClass("org.apache.nifi.nar.ModifiesClasspathProcessor");

        List<InstanceClassLoader> instanceClassLoaders = Arrays.asList(
                extensionManager.createInstanceClassLoader(processorClass.getName(), UUID.randomUUID().toString(), bundleWithNativeLib, null),
                extensionManager.createInstanceClassLoader(processorClass.getName(), UUID.randomUUID().toString(), bundleWithNativeLib, null)
        );

        for (InstanceClassLoader instanceClassLoader : instanceClassLoaders) {
            String actualLibraryLocation = instanceClassLoader.findLibrary("testjni");

            Class<?> TestJNI = instanceClassLoader.loadClass("org.apache.nifi.nar.sharedlib.TestJNI");

            Object actualJniMethodReturnValue = TestJNI
                    .getMethod("testJniMethod")
                    .invoke(TestJNI.newInstance());

            assertThat(actualLibraryLocation, containsString(instanceClassLoader.getIdentifier()));
            assertEquals("calledNativeTestJniMethod", actualJniMethodReturnValue);
        }
    }

    @Override
    String getWorkDir() {
        return WORK_DIR;
    }

    @Override
    String getNarAutoloadDir() {
        return NAR_AUTOLOAD_DIR;
    }

    @Override
    String getPropertiesFile() {
        return PROPERTIES_FILE;
    }
}


text:
package com.spotify.styx.model;

import io.norberg.automatter.AutoMatter;
import java.util.Optional;

// The source where the configuration gets managed/deployed from
@AutoMatter
public interface DeploymentSource {
  // organization/repository
  Optional<String> repository();
  // deployment-agent/path/to/file
  // eg:
  // - kubernetes-cluster/namespace/resourceName
  // - some-tool-name/path/to/file
  String source();

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


text:
/*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */
/*global define, $, brackets, window */

/* https://github.com/davidderaedt/tabtospace-extension
   extension to convert indentation to tabs or spaces
   v1.1: + 4-space indentation to tabs */

define(function (require, exports, module) {
    'use strict';

    var CommandManager  = brackets.getModule("command/CommandManager"),
        EditorManager   = brackets.getModule("editor/EditorManager"),
        DocumentManager = brackets.getModule("document/DocumentManager"),
        Menus           = brackets.getModule("command/Menus");

    var TAB2S_COMMAND    = "tabtospace.tabtospace";
    var S2TAB_COMMAND    = "tabtospace.spacetotab";
    var SD2TAB_COMMAND   = "tabtospace.spaceDToTab";
    var TAB2S_MENU_NAME  = "Convert indentation to spaces";
    var S2TAB_MENU_NAME  = "Convert indentation to tabs";
    var SD2TAB_MENU_NAME = "Convert 4-space indentation to tabs";
    var DEFAULT_TAB_WIDTH = 4;
    var INDENTATION_MATCHER = /^[ \t]+/gm;

    function getTabWidth() {
        var editor = EditorManager.getCurrentFullEditor();
        if (editor && editor._codeMirror) {
            return editor._codeMirror.getOption("tabSize");
        }
        console.log("Using default tab width");
        return DEFAULT_TAB_WIDTH;
    }

    function replaceInDocument(re, textOrFunc) {
        var txt = DocumentManager.getCurrentDocument().getText();
        var txt2 = txt.replace(re, textOrFunc);
        DocumentManager.getCurrentDocument().setText(txt2);
    }

    function lengthOfIndentation(string, tabWidth) {
        var length = 0;
        var i;
        for (i = 0; i < string.length; i++) {
            var c = string.charAt(i);
            if (c === '\t') {
                length += (tabWidth - (length % tabWidth));
            } else {
                length += 1;
            }
        }

        return length;
    }

    function testLengthOfIndentation() {
        var tabWidth = getTabWidth();

        console.assert(0            === lengthOfIndentation("",       tabWidth));
        console.assert(tabWidth     === lengthOfIndentation("\t",     tabWidth));

        console.assert(1            === lengthOfIndentation(" ",      tabWidth));
        console.assert(2            === lengthOfIndentation("  ",     tabWidth));
        console.assert(3            === lengthOfIndentation("   ",    tabWidth));
        console.assert(4            === lengthOfIndentation("    ",   tabWidth));

        console.assert(tabWidth + 1 === lengthOfIndentation("\t ",    tabWidth));
        console.assert(tabWidth + 2 === lengthOfIndentation("\t  ",   tabWidth));
        console.assert(tabWidth + 3 === lengthOfIndentation("\t   ",  tabWidth));
        console.assert(tabWidth + 4 === lengthOfIndentation("\t    ", tabWidth));

        console.assert(tabWidth     === lengthOfIndentation(" \t",    tabWidth));
        console.assert(tabWidth     === lengthOfIndentation("  \t",   tabWidth));
        console.assert(tabWidth     === lengthOfIndentation("   \t",  tabWidth));
        console.assert(tabWidth + 4 === lengthOfIndentation("    \t", tabWidth));
    }

    function indentationWithLength(length, tabWidth) {
        var indentation = "";

        // Use tabs if tabWidth is not undefined, null or 0
        if (tabWidth) {
            while (length >= tabWidth) {
                indentation += "\t";
                length -= tabWidth;
            }
        }

        while (length > 0) {
            indentation += " ";
            length -= 1;
        }

        return indentation;
    }

    function testIndentationWithLength() {
        var tabWidth = getTabWidth();
        var i;
        for (i = 0; i < 8; i++) {
            console.assert(i === lengthOfIndentation(indentationWithLength(i, tabWidth), tabWidth));
            console.assert(i === lengthOfIndentation(indentationWithLength(i),           tabWidth));
        }
    }

    function tabToSpaceReplacer(indentation) {
        var length = lengthOfIndentation(indentation, getTabWidth());
        return indentationWithLength(length);
    }

    function tabToSpace() {
        replaceInDocument(INDENTATION_MATCHER, tabToSpaceReplacer);
    }

    function spaceToTabReplacer(indentation) {
        var editorTabWidth = getTabWidth();
        var length = lengthOfIndentation(indentation, editorTabWidth);
        return indentationWithLength(length, editorTabWidth);
    }

    function spaceToTab() {
        replaceInDocument(INDENTATION_MATCHER, spaceToTabReplacer);
    }

    function spaceDefaultToTabReplacer(indentation) {
        var length = lengthOfIndentation(indentation, DEFAULT_TAB_WIDTH);
        return indentationWithLength(length, DEFAULT_TAB_WIDTH);
    }

    function spaceDefaultToTab() {
        replaceInDocument(INDENTATION_MATCHER, spaceDefaultToTabReplacer);
    }

    CommandManager.register(TAB2S_MENU_NAME,  TAB2S_COMMAND,  tabToSpace);
    CommandManager.register(S2TAB_MENU_NAME,  S2TAB_COMMAND,  spaceToTab);
    CommandManager.register(SD2TAB_MENU_NAME, SD2TAB_COMMAND, spaceDefaultToTab);

    var menu = Menus.getMenu(Menus.AppMenuBar.EDIT_MENU);
    menu.addMenuDivider();
    menu.addMenuItem(TAB2S_COMMAND);
    menu.addMenuItem(S2TAB_COMMAND);
    menu.addMenuItem(SD2TAB_COMMAND);

    testLengthOfIndentation();
    testIndentationWithLength();
});


text:
module Reporting
  class Config
    include Singleton

    attr_accessor :output_folder, :outstream, :errstream
    attr_reader :result_files

    def initialize
      @output_folder = Dir.tmpdir
      @result_files = []
    end

    def create_filename *format
      return File.null if @silence

      parts = sim_config.dsl_file.split('.').reject{|p| p =~ /^(rb|dsl)$/ }
      parts += format
      filename = File.join(@output_folder, parts.join('.'))
      @result_files << filename unless @result_files.include?(filename)
      filename
    end

    def runs
      sim_config.runs
    end

    def silence
      @silence = true
    end

    def unsilence
      @silence = false
    end

    private
    def sim_config
      @sim_config ||= Sim::Config.instance
    end
  end
end


text:
module Highstock
  module Rails
    VERSION = "5.0.11"
  end
end


text:
module DivisioneDueCifre
    (
     div2c
    )
where

-- | Struttura dati per i numeri a due cifre
--
-- Rende più facili e chiari i calcoli richiesti dall'algoritmo
data NumeroDueCifre = NDC
    { decina :: Cifra
    , unità  :: Cifra
    } deriving Show

-- Alias di tipo per rendere più esplicite le firme dei metodi
type Numero    = Int
type Cifra     = Int

type Dividendo = Numero
type Divisore  = Numero
type Risultato = Numero
type Resto     = Numero

type CifreDividendo = [Cifra]
type CifreDivisore  = [Cifra]

type DividendoDueCifre = NumeroDueCifre
type DivisoreDueCifre  = NumeroDueCifre

-- | Divisione con divisore a due cifre.
--
div2c :: Dividendo -> Divisore -> (Risultato, Resto)
div2c dividendo divisore = abbassaCifreResidue primoResiduo (primoRisultato, primoResto)
    where
      cifreDivisore                    = dividiInCifre divisore
      cifreDividendo                   = dividiInCifre dividendo
      divisore2c                       = creaDivisoreDueCifre cifreDivisore
      (primoDividendo2c, primoResiduo) = creaDividendoDueCifre cifreDividendo cifreDivisore
      (primoRisultato, primoResto)     = div2cDD primoDividendo2c divisore2c
      --
      -- Completa la divisione, abbassando le cifre residue del dividendo preventivamente
      -- aumentate delle cifre del resto.
      -- Il risultato viene accumulato, il resto è quello dell'ultima divisione.
      abbassaCifreResidue :: CifreDividendo -> (Risultato, Resto) -> (Risultato, Resto)
      abbassaCifreResidue []      rr                 = rr
      abbassaCifreResidue residuo (risultato, resto) = abbassaCifreResidue residuo' (risultato'', resto')
          where
            (dividendo2c, residuo') = creaResiduoDueCifre residuo (dividiInCifre resto)
            (risultato', resto')    = div2cDD dividendo2c divisore2c
            risultato''             = comeDecina risultato + risultato'

-- | Crea il numero a due cifre per il divisore.
--
-- Verifica che il divisore sia esattamente di due cifre.
creaDivisoreDueCifre :: CifreDivisore -> DivisoreDueCifre
creaDivisoreDueCifre (cd1:cd2:[]) = NDC cd1 cd2
creaDivisoreDueCifre _            = error "Il divisore non ha due cifre."

-- | Crea il numero a due cifre per il dividendo.
--
-- Restituisce anche il residuo del dividendo non utilizzato nel numero a due cifre.
-- Da utilizzare per il dividendo completo, dato che controlla se le prime due
-- cifre del dividendo siano sufficienti per il divisore oppure siano necessarie
-- tre cifre.
-- Verifica che il dividendo non sia inferiore al divisore.
creaDividendoDueCifre :: CifreDividendo -> CifreDivisore -> (DividendoDueCifre, CifreDividendo)
creaDividendoDueCifre (cd1:cd2:[])      divisore = if   unisciInNumero [cd1, cd2] >= unisciInNumero divisore
                                                   then (NDC cd1 cd2, [])
                                                   else error "Il dividendo è inferiore al divisore."
creaDividendoDueCifre (cd1:cd2:cd3:cds) divisore = if   unisciInNumero [cd1, cd2] >= unisciInNumero divisore
                                                   then (NDC cd1                         cd2, cd3:cds)
                                                   else (NDC (unisciInNumero [cd1, cd2]) cd3, cds    )
creaDividendoDueCifre _                 _        = error "Il dividendo è inferiore al divisore."

-- | Crea il numero a due cifre per il resto ed il residuo del dividendo.
--
-- Restituisce anche il residuo del dividendo non utilizzato nel numero a due cifre.
-- Verifica che il residuo non sia vuoto.
creaResiduoDueCifre :: CifreDividendo -> CifreDividendo -> (DividendoDueCifre, CifreDividendo)
creaResiduoDueCifre (rd1:rds) res = (NDC (unisciInNumero res) rd1, rds)
creaResiduoDueCifre _         _   = error "Il residuo è vuoto."

-- | Divisione con dividendo e divisore a due cifre
--
-- Formula l'ipotesi iniziale e poi chiama la funzione di cerca risultato.
div2cDD :: DividendoDueCifre -> DivisoreDueCifre -> (Risultato, Resto)
div2cDD dividendo divisore = cercaRisultato ipotesi dividendo divisore
    where
      ipotesi = decina dividendo `div` decina divisore

-- | Cerca il risultato di una divisione con dividendo e divisore a due cifre.
--
-- Verifica la validità dell'ipotesi iniziale:
--
--      * se valida restituisce l'ipotesi/risultato ed il resto
--
--      * se non valida continua la ricerca decrementando l'ipotesi
--
-- L'ipotesi è valida se il numero composto dal prestito e dall'unità del dividendo
-- diviso per l'unità del divisore è maggiore o uguale all'ipotesi. Se l'unità del
-- divisore è uguale a zero, il risultato della divisione è considerato infinito
-- e quindi l'ipotesi è considerata valida.
cercaRisultato :: Risultato -> DividendoDueCifre -> DivisoreDueCifre -> (Risultato, Resto)
cercaRisultato (-1)    _         _        = error "L'ipotesi è diventata negativa."
cercaRisultato ipotesi dividendo divisore = let prestito = decina dividendo - ipotesi * decina divisore
                                                numero   = comeDecina prestito + unità dividendo
                                                verifica = if unità divisore == 0
                                                           then 100 -- Infinito
                                                           else numero `div` unità divisore
                                                resto    = numero - ipotesi * unità divisore
                                            in if   verifica >= ipotesi
                                               then (ipotesi, resto)
                                               else cercaRisultato (ipotesi - 1) dividendo divisore

----------------------
-- Funzioni di utilità
----------------------

-- | Divide un numero nelle cifre che lo compongono
dividiInCifre :: Numero -> [Cifra]
dividiInCifre numero = if   numero == 0
                       then [0]
                       else dividiInCifre' numero
    where
      dividiInCifre' 0 = []
      dividiInCifre' x = dividiInCifre' (x `div` 10) ++ [x `mod` 10]

-- | Unisce le cifre per formare un numero
unisciInNumero :: [Cifra] -> Numero
unisciInNumero = foldl (\numero cifra -> comeDecina numero + cifra) 0

-- | Converte il numero in una decina
comeDecina :: Numero -> Numero
comeDecina = (*) 10


text:
package net.bootsfaces.component.spinner;

import javax.faces.render.FacesRenderer;

import net.bootsfaces.component.iconAwesome.IconAwesomeRenderer;

/** This class generates the HTML code of <b:spinner />. */
@FacesRenderer(componentFamily = "net.bootsfaces.component", rendererType = "net.bootsfaces.component.spinner.Spinner")
public class SpinnerRenderer extends IconAwesomeRenderer {

}


text:
A custom [Sass importer](https://github.com/sass/node-sass#importer--v200---experimental)
that lets you swap import files for overrides if they are available.

For use with Gulp ([for now](#todo)) because of `gutil.log`.

[GitHub](https://github.com/jelmerdemaat/importer-overrides) | [NPM](https://www.npmjs.com/package/importer-overrides) | [@jelmerdemaat](https://twitter.com/jelmerdemaat)

[![Build Status](https://travis-ci.org/jelmerdemaat/importer-overrides.svg?branch=master)](https://travis-ci.org/jelmerdemaat/importer-overrides)
[![bitHound Code](https://www.bithound.io/github/jelmerdemaat/importer-overrides/badges/code.svg)](https://www.bithound.io/github/jelmerdemaat/importer-overrides)
[![bitHound Dependencies](https://www.bithound.io/github/jelmerdemaat/importer-overrides/badges/dependencies.svg)](https://www.bithound.io/github/jelmerdemaat/importer-overrides/master/dependencies/npm)

## Use

Basic setup:

```js
var importer = require('importer-overrides');

sass({
  importer: importer,
  importerOptions: {
    debug: true,                    // or false
    client: 'src/client/folder/',   // required
    base: 'src/base/folder/',       // defaults to Gulpfile dir ('./')
    optional: 'imports'             // filepaths that match string are optional
  }
})
```

## Todo
- [ ] Take out the gutil dependency

## License
MIT © Jelmer de Maat


text:
<?php

namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\Reference;

/**
 * @author Nicolas Grekas <p@tchwork.com>
 */
class CachePoolPass implements CompilerPassInterface
{
    /**
     * {@inheritdoc}
     */
    public function process(ContainerBuilder $container)
    {
        $namespaceSuffix = '';

        foreach (array('name', 'root_dir', 'environment', 'debug') as $key) {
            if ($container->hasParameter('kernel.'.$key)) {
                $namespaceSuffix .= '.'.$container->getParameter('kernel.'.$key);
            }
        }

        $attributes = array(
            'provider',
            'namespace',
            'default_lifetime',
        );
        foreach ($container->findTaggedServiceIds('cache.pool') as $id => $tags) {
            $adapter = $pool = $container->getDefinition($id);
            if ($pool->isAbstract()) {
                continue;
            }
            $tags[0]['namespace'] = $this->getNamespace($namespaceSuffix, isset($tags[0]['namespace']) ? $tags[0]['namespace'] : $id);
            while ($adapter instanceof DefinitionDecorator) {
                $adapter = $container->findDefinition($adapter->getParent());
                if ($t = $adapter->getTag('cache.pool')) {
                    $tags[0] += $t[0];
                }
            }
            if (isset($tags[0]['clearer'])) {
                $clearer = $container->getDefinition($tags[0]['clearer']);
            } else {
                $clearer = null;
            }
            unset($tags[0]['clearer']);

            if (isset($tags[0]['provider']) && is_string($tags[0]['provider'])) {
                $tags[0]['provider'] = new Reference($tags[0]['provider']);
            }
            $i = 0;
            foreach ($attributes as $attr) {
                if (isset($tags[0][$attr])) {
                    $pool->replaceArgument($i++, $tags[0][$attr]);
                }
                unset($tags[0][$attr]);
            }
            if (!empty($tags[0])) {
                throw new \InvalidArgumentException(sprintf('Invalid "cache.pool" tag for service "%s": accepted attributes are "clearer", "provider", "namespace" and "default_lifetime", found "%s".', $id, implode('", "', array_keys($tags[0]))));
            }

            if (null !== $clearer) {
                $clearer->addMethodCall('addPool', array(new Reference($id)));
            }
        }
    }

    private function getNamespace($namespaceSuffix, $id)
    {
        return substr(str_replace('/', '-', base64_encode(md5($id.$namespaceSuffix, true))), 0, 10);
    }
}


text:
using UnityEngine;
using System.Collections;

namespace TMPro.Examples
{

    public class SimpleScript : MonoBehaviour
    {

        private TextMeshPro m_textMeshPro;
        //private TMP_FontAsset m_FontAsset;

        private const string label = "The <#0050FF>count is: </color>{0:2}";
        private float m_frame;

        void Start()
        {
            // Add new TextMesh Pro Component
            m_textMeshPro = gameObject.AddComponent<TextMeshPro>();

            m_textMeshPro.autoSizeTextContainer = true;

            // Load the Font Asset to be used.
            //m_FontAsset = Resources.Load("Fonts & Materials/LiberationSans SDF", typeof(TMP_FontAsset)) as TMP_FontAsset;
            //m_textMeshPro.font = m_FontAsset;

            // Assign Material to TextMesh Pro Component
            //m_textMeshPro.fontSharedMaterial = Resources.Load("Fonts & Materials/LiberationSans SDF - Bevel", typeof(Material)) as Material;
            //m_textMeshPro.fontSharedMaterial.EnableKeyword("BEVEL_ON");

            // Set various font settings.
            m_textMeshPro.fontSize = 48;

            m_textMeshPro.alignment = TextAlignmentOptions.Center;

            //m_textMeshPro.anchorDampening = true; // Has been deprecated but under consideration for re-implementation.
            //m_textMeshPro.enableAutoSizing = true;

            //m_textMeshPro.characterSpacing = 0.2f;
            //m_textMeshPro.wordSpacing = 0.1f;

            //m_textMeshPro.enableCulling = true;
            m_textMeshPro.enableWordWrapping = false;

            //textMeshPro.fontColor = new Color32(255, 255, 255, 255);
        }

        void Update()
        {
            m_textMeshPro.SetText(label, m_frame % 1000);
            m_frame += 1 * Time.deltaTime;
        }

    }
}


text:
package org.araqne.logstorage;

import java.util.List;

public interface WriteFallback {
	int onLockFailure(TableLock lock, List<Log> logs);
}