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

{% block title %}Password Reset Request{% endblock %}

{% block content %}

Password Reset Request

{% if success %}

Your password reset request has been successfully received.

   We have sent you an email with instructions on how to set a new password.

Best regards,

	The datatracker login manager service

	(for the IETF Secretariat)

{% else %}
<form action="" method="POST">

  {{ form }}

    <input type="submit" value="Request password reset" />

</form>
{% endif %}

{% endblock %}


text:
=head1 LICENSE

# Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
# Copyright [2016-2017] EMBL-European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

=head1 CONTACT

  Please email comments or questions to the public Ensembl
  developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.

  Questions may also be sent to the Ensembl help desk at
  <http://www.ensembl.org/Help/Contact>.

=cut

=head1 AUTHORS

Dan Andrews <dta@sanger.ac.uk>

=head1 NAME

Bio::EnsEMBL::Analysis::Runnable::BlastMiniBuilder -

=head1 SYNOPSIS

=head1 DESCRIPTION

=head1 METHODS

=head1 APPENDIX

The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _

=cut

# Let the code begin...

package Bio::EnsEMBL::Analysis::Runnable::BlastMiniBuilder;

use warnings ;
use vars qw(@ISA);
use strict;

use Bio::EnsEMBL::Analysis::Runnable;
use Bio::EnsEMBL::Slice;

@ISA = qw(Bio::EnsEMBL::Analysis::Runnable);

=head2 build_runnables

  Args [1]   : @features - list of FeaturePair objects
               constructed from blast align features.  Within
               each FeaturePair, feature1 and feature2 should
               correspond to the genomic sequence and the
               protein/est/cdna sequence.
  Example    : $self->build_runnables(@features);
  Description: Builds the runnable objects for conducting
               BlastMini(Genewise/Est2Genome) runs.  In
               the simplest case this
               method creates a single runnable object.  The
               method itself was written to cope with
               situations where the presence of repeated genes
               means that more than one whole gene of high
               homology is present in a minigenomic sequence.
               This module separates possible repeated genes
               into clusters of exons such that multiple
               minigenomic sequence fragments can be
               generated for passing to genewise/est2genome.
               When this happens this method returns
               multiple runnables that examine smaller
               portions of genomic DNA.
  Returntype : A list of Bio::EnsEMBL::Analysis::Runnable
               - the exact identity of the runnable sub-class
               is determined by the calling class (as the
               actual final runnable construction is done in
               the inheriting class.)
  Exceptions : None.
  Caller     : $self->run

=cut

sub build_runnables {
  my ($self, @features) = @_;

  my @runnables;

  my %unfiltered_partitioned_features;

  my $hseqname;
  foreach my $raw_feat (@features){
    push (@{$unfiltered_partitioned_features{$raw_feat->hseqname}}, $raw_feat);
    $hseqname = $raw_feat->hseqname;
  }

  # We partition the features by sequence id such that we can
  # iterate for each id.  Most ids  will fall through
  # to the simplest case where we make a single runnable with one
  # unique gene per minigenomic sequence fragment.  In cases
  # where multiple similar genes are likely to be present in
  # the minigenomic sequence we switch to the
  # special case algorithm.  When this happens we cluster the
  # likely exons into groups of similar exons, which we then
  # use to make a set of distinct genes.  For each likely gene
  # a minigenomic sequence is made that tightly spans the
  # likely location of the gene - and most probably excludes
  # any similar genes nearby.  With these smaller minigenomic
  # sequence fragments a runnable is made using ALL of the
  # original blast-derived feature pairs.

  my %partitioned_features;

  foreach my $raw_feat (@features){

    # Imporantly, the features are filtered for low identity matches.
    # This is just for the clustering process.  The full set of features
    # are still passed to the runnable at the end.
    if($raw_feat->percent_id >= 80){
	    push (@{$partitioned_features{$raw_feat->hseqname}}, $raw_feat);
    }
  }

  my %runnable_featids;
  foreach my $seqname (keys %partitioned_features){

    # Preliminary check to see whether our filtered features
    # give enough coverage to make it worth continuing.

    my $coverage = $self->check_coverage($seqname, $partitioned_features{$seqname});

    # If only sparse coverage, go home early.
    unless ($coverage > 0.5) {

      my $runnable = $self->make_object($self->genomic_sequence, $unfiltered_partitioned_features{$seqname});
      push (@runnables, $runnable);

      $runnable_featids{$seqname}++;
      next
    }

    # Now, we attempt to cluster our features into groups of
    # similar exons.

     my $clustered_features = $self->cluster_features(\@{$partitioned_features{$seqname}});

    # We have to do a little test to see if the clusters
    # represent the bulk of the features present in the
    # genomic region.  This test helps avoid the situation
    # where a non-repeated gene has exons that are very
    # similar to one another.  If the flag $clusters_seem_real
    # is not set to 1, the the analysis will default to the
    # simplest, non-repeated gene way of doing things.

    my $clusters_seem_real = 0;

    if (@$clustered_features) {
      my $number_of_clustered_features = 0;
      foreach my $cluster (@$clustered_features) {
	foreach my $clust_feat (@$cluster){
	  $number_of_clustered_features++;
	}
      }

      if ($number_of_clustered_features  >= (0.7 * (scalar @{$partitioned_features{$seqname}}))) {
	$clusters_seem_real = 1;
      }
    }

    # If we have clusters in such numbers that it looks like
    # there might be repeated genes, we break the mini genomic
    # sequence into fragments and construct multiple runnables.
    # Otherwise, we default to the normal way of building our
    # runnable.
    if ((@$clustered_features)&&($clusters_seem_real > 0)) {
      # Write to logfile

print "Multi-gene code has turned itself on.\nProtein sequence is $seqname\nGenomic region is " . $self->genomic_sequence->id . "\tLength " . $self->genomic_sequence->length . "\n";

#      print STDERR "Minigenomic sequence could contain a number "
#	. "of highly similar genes.  Fragmenting the minigenomic "
#	  . "sequence to try to resolve these genes individually.\n";

      my $gene_clusters = $self->form_gene_clusters($clustered_features);

      # Determine the extreme start and ends of each gene
      # cluster.  Decide on positions to split the genomic
      # sequence for genomewise - mid-way between
      # ends and starts of neighboring clusters.  The
      # fragments from clusters that don't have the maximum
      # number of members are a problem - these presumably
      # will fall at the ends of the genomic fragment and
      # should just be discarded.

    GENE:
      foreach my $gene_cluster (@$gene_clusters){

	my @sorted_gene_cluster = sort {$a->start <=> $b->start;} @$gene_cluster;

	my $rough_gene_length = $sorted_gene_cluster[-1]->end - $sorted_gene_cluster[0]->start;

	my $padding_length;
	if ($rough_gene_length > 10000) {
	  $padding_length = 10000;
	} else {
	  $padding_length = 1000;
	}

       	my $cluster_start = $sorted_gene_cluster[0]->start - $padding_length;
	my $cluster_end = $sorted_gene_cluster[-1]->end + $padding_length;

        if ($cluster_start < 1) {
	  if ($sorted_gene_cluster[0]->end > 0) {
	    $cluster_start = 1;
	  }
	}
        if ($cluster_end > $self->genomic_sequence->length) {
	  if ($sorted_gene_cluster[0]->start <= $self->genomic_sequence->length) {
	    $cluster_end = $self->genomic_sequence->length;
	  }
	}

	# Here we create our genomic fragment for passing to
	# our runnable.  This is the fragment of genomic sequence
	# that we have calculated should only contain the
	# exons of one single gene.  It is padded with Ns to
        # maintain the coordinate system of the features that
	# may be returned.  Another way of looking at this is
	# that we make a genomic sequence where the regions
	# flanking our gene are masked.
  #	my $string_seq = ('N' x ($cluster_start - 1)) .
  #	         $self->genomic_sequence->subseq($cluster_start, $cluster_end)
  #		 . ('N' x ($self->genomic_sequence->length - ($cluster_end + 1)));

  #print "   Fragmented mini-genomic sequence - Start $cluster_start\tEnd $cluster_end\n";

  #print "Length of string_seq = " . length($string_seq) . "\n";

  #	my $genomic_subseq = Bio::EnsEMBL::Slice->new
  #    (
  #     -seq => $string_seq,
  #     -seq_region_name  => $self->genomic_sequence->seq_region_name,
  #     -start => 1,
  #     -end => length($string_seq),
  #     -coord_system => $self->genomic_sequence->coord_system,
  #    );
  #print STDERR "Have genomic subseq ".$genomic_subseq->name."\n";

  #	my $runnable = $self->make_object($genomic_subseq, $unfiltered_partitioned_features{$seqname});

	my $runnable = $self->make_object($self->genomic_sequence, $unfiltered_partitioned_features{$seqname},
                                          $cluster_start, $cluster_end);

	push (@runnables, $runnable);

	$runnable_featids{$seqname}++;
      }

    }else{
      # This is what we do when we dont have multiple genes
      # in our genomic fragment.  This is "Normal mode".

      my $runnable = $self->make_object($self->genomic_sequence, $unfiltered_partitioned_features{$seqname});
      push (@runnables, $runnable);

      $runnable_featids{$seqname}++;
    }

  }

  # Gah, what if we havent constructed a runnable for each
  # feature id by this late stage?
  # It means that the homology of the blast features for
  # an id was so low that we threw all the features
  # away.  Had better just make a default runnable...

  my %feature_ids;
  foreach my $feature (@features){
    $feature_ids{$feature->hseqname}++;
  }

  foreach my $feature_id (keys %feature_ids){
    unless ($runnable_featids{$feature_id}){
      my $runnable = $self->make_object($self->genomic_sequence, $unfiltered_partitioned_features{$feature_id});

      push (@runnables, $runnable);
    }
  }

  return \@runnables;
}

sub genomic_sequence{
  my $self = shift;
  my $slice = shift;
  if($slice){
    throw("Must pass Runnable::query a Bio::PrimarySeqI not a ".
          $slice) unless($slice->isa('Bio::PrimarySeqI'));
    $self->{'query'} = $slice;
  }
  return $self->{'query'};
}

=head2 cluster_features

  Args [1]   : $features - reference to a list of
               FeaturePairs derived from the align feature
               objects resulting from a blast run.
               Ideally, these features should have been
               filtered to remove garbage - say, filter by
               percent_id > 80.
  Example    : $self->cluster_features($features);
  Description: Takes a list of features from a blast run
               and attempts to cluster these into groups
               of high homology.  If the blast features
               result from matches to a region with several
               highly similar copies of the same gene this
               clustering should produce a series of exon
               clusters.  If this is not the case only a
               couple of grubby clusters will be produced.
  Returntype : A reference to an array of clusters.  Each
               cluster in the array is an array of similar
               features.
  Exceptions : none
  Caller     : self->build_runnables

=cut

sub cluster_features {

  my ($self, $features) = @_;

  # Sort the list of features according to their percent id.
  my @sorted_features = sort { $b->percent_id <=> $a->percent_id;} @$features;

  # With the sorted features, we iteratively check each
  # highest scoring hit against each lesser scoring
  # sequence.  Features that correspond to the same part of
  # the hit sequence (ie, are overlapping) are clustered
  # in an array of 'exons' (and removed from the
  # sorted_features array).

  my @all_feature_clusters;

  while (@sorted_features) {

    my $top_feature = shift @sorted_features;

    my @similar_features;
    push (@similar_features, $top_feature);

    my @subtracted_sorted_features;
    foreach my $lesser_feature (@sorted_features) {

      if ($self->check_overlap($top_feature,$lesser_feature)){
	push (@similar_features, $lesser_feature);

      } else {
	push (@subtracted_sorted_features, $lesser_feature);
      }
    }
    @sorted_features = @subtracted_sorted_features;
    unless ((scalar @similar_features) == 1){
      push (@all_feature_clusters, \@similar_features);
    }
  }

  return \@all_feature_clusters;
}

=head2 form_gene_clusters

  Args [1]   : Array of exon clusters generated by
               $self->cluster_features (an array of arrays,
               each sub-array containing similar blast
               features)
  Example    : $self->for_gene_clusters($exon_clusters);
  Description: Using an array of exons clusters (similar
               blast features) to build genes with a feature
               from each cluster.
  Returntype : A reference to an array of arrays, each sub-
               array containing features that should
               correspond to exons.
  Exceptions : none
  Caller     : $self->build_runnables

=cut

sub form_gene_clusters {

  my ($self, $exon_clusters) = @_;

  # Sort clusters according to their location in our
  # hit sequence.

  my @sorted_by_start = sort {$a->[0]->hstart <=> $b->[0]->hstart} @$exon_clusters;

  my @final_gene_clusters;

  my $total_clustered_exons = 0;
  foreach my $cluster (@sorted_by_start){
    foreach my $exon (@$cluster){
      $total_clustered_exons++;
    }
  }

  my $remaining_unclustered_exons = $total_clustered_exons;

  my @other_clusters = @sorted_by_start;

  while ($remaining_unclustered_exons > (0.2*$total_clustered_exons)) {

    my $this_cluster = shift @other_clusters;

    while (@$this_cluster){

      my $seed_exon = shift @$this_cluster;
      $remaining_unclustered_exons--;

      my @gene_cluster;
      push (@gene_cluster, $seed_exon);

      foreach my $other_cluster (@other_clusters) {

	if (@$other_cluster){

	  my @subtracted_other_cluster;
	  my $closest = 1000000;
	  my $closest_feature;
	  foreach my $candidate_exon (@$other_cluster){

	    my $distance = abs($candidate_exon->start
			       - $seed_exon->start);

	    # The criteria below allows matches so long as the candidate exon
	    # is close enough and that the start of the next exon is greater
	    # than the start of the previous exon (it is desirable to allow
	    # overlapping exons because this clusters features that are fragments
	    # of one another).

	    if(($distance < $closest)&&
	       ($candidate_exon->hstart > $seed_exon->hstart)&&
	       ($distance < 20000)){
	      if (defined $closest_feature){
		push (@subtracted_other_cluster, $closest_feature);
	      }
	      $closest = $distance;
	      $closest_feature = $candidate_exon;
	    } else {
	      push (@subtracted_other_cluster, $candidate_exon);
	    }
	  }
	  @$other_cluster = @subtracted_other_cluster;

	  if (defined $closest_feature) {

	    push (@gene_cluster, $closest_feature);
	    $remaining_unclustered_exons--;
	  }
	  undef $closest_feature;

	}
      }
      push (@final_gene_clusters, \@gene_cluster);
    }
  }

  return \@final_gene_clusters;
}

=head2 make_object

  Args [1]   : minigenomic sequence object
  Args [2]   : reference to a list of FeaturePairs
  Example    : $self->make_object($miniseq, $features);
  Description: This is an interface that must be implemented
               in inheriting classes.  This method handles
               the ultimate creation of the runnable object.
  Returntype : 0
  Exceptions : Throws an error if the class has not been
               implemented by the inheriting class.
  Caller     : self->build_runnables

=cut

sub make_object {
  my ($self) = @_;

  $self->throw("make_object method must be implemented in the inheriting class.");

  # Sample implementation for Runnable::MultiMiniGenewise:
  #
  #  my ($self, $miniseq, $features) = @_;
  #
  #  my $mg      = new Bio::EnsEMBL::Analysis::Runnable::MultiMiniGenewise(
  #	       		       '-genomic'    => $miniseq,
  #	       		       '-features'   => \@newf,
  #	       		       '-seqfetcher' => $self->seqfetcher,
  #	       		       '-endbias'    => $self->endbias
  #	       		      );
  #
  # return $mg;

}

=head2 check_overlap

  Args [1]   : query_feature - any kind of align feature.
  Args [2]   : other feature - another align feature that is
               to be checked for substantial overlap with the
               query feature.
  Example    : $self->check_overlap($query_feature, $other_feature);
  Description: Checks two features for greater than 90% hit overlap.
               Features must be blast-generated align features
               resultant from a blast run against a common hit
               sequence.
  Returntype : 0 or 1
  Exceptions : none
  Caller     : $self->cluster_features

=cut

sub check_overlap {
  my ($self, $query_feature, $other_feature) = @_;

  my $query_start = $query_feature->hstart;
  my $query_end   = $query_feature->hend;

  if ($query_start > $query_end){($query_start, $query_end) = ($query_end, $query_start)}

  my $other_start = $other_feature->hstart;
  my $other_end   = $other_feature->hend;

  if ($other_start > $other_end) {($other_start, $other_end) = ($other_end, $other_start)}

  unless ($query_end < $other_start || $query_start > $other_end){
    # We have overlapping features

    my $query_length = $query_end - $query_start;
    my $other_length = $other_end - $other_start;

    my ($start1, $start2, $end1, $end2) = sort {$a <=> $b} ($query_start, $other_start, $query_end, $other_end);

    my $overlap = $end1 - $start2;

    if (($overlap >= (0.9 * $query_length))&&($overlap >= (0.9 * $other_length))){
      return 1
    }
  }

  return 0;
}

=head2 check_coverage

  Args [1]   : protein id - id used by seqfetcher to retrieve
               protein object.
  Args [2]   : feature listref - reference to list of align features
               that align to parts of the protein specified in Arg [1]
  Example    : $self->check_coverage($seqname, $features);
  Description: Using a protein/est and a list of corresponding align
               features, calculates the percentage of the protein/est
               that the features cover.
  Returntype : A real (e.g. a percentage like 0.80)
  Exceptions : none
  Caller     : $self->make_runnables

=cut

sub check_coverage {
  my ($self, $seqname, $features) = @_;

  my $protein = $self->get_Sequence($seqname);
  my $protein_length = $protein->length;

  my @voider;
  my @score_keeper;

  foreach my $feature (@$features){

    my $start = $feature->hstart;
    my $end = $feature->hend;
    #print STDERR "Have ".$seqname." start ".$start." end ".$end."\n";
    ($start, $end) = sort {$a <=> $b} ($start, $end);

    for (my $j = $start; $j <= $end; $j++){
      $score_keeper[$j] = 1;
    }
  }

  my $tally = 0;

  #print "Have " . scalar(@score_keeper) . " 1s and 0s!\n";
  foreach my $score (@score_keeper){
    $tally++ if $score;
  }

  return ($tally/$protein_length);
}

=head2 check_repeated

    Title   :   check_repeated
    Usage   :   $self->check_repeated(1)
    Function:   Get/Set method for check_repeated
    Returns :   0 (Off) or 1 (On)
    Args    :   0 (Off) or 1 (On)

=cut

sub check_repeated {
  my( $self, $value ) = @_;

  if ($value) {
    $self->{'_check_repeated'} = $value;
  }

  return $self->{'_check_repeated'};
}

return 1;

redpajama_set_name: RedPajamaGithub


text:
package o;

import android.os.Parcelable.Creator;

final class ᐝ$1
  implements Parcelable.Creator<ᐝ>
{
}

/* Location:           /Users/vikas/Documents/Mhacks_Real_app/classes-dex2jar.jar
 * Qualified Name:     o.·êù.1
 * JD-Core Version:    0.6.2
 */


text:
<!doctype html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>SlashCommandPreviewItemType | Rocket.Chat Apps TypeScript Definition</title>
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../assets/css/main.css">

						Search
						<input id="tsd-search-field" type="text" />

Preparing search index...

The search index is not available

					Rocket.Chat Apps TypeScript Definition

						Options

								All

Public

Public/Protected

All

							<input type="checkbox" id="tsd-filter-inherited" checked />
							Inherited
							<input type="checkbox" id="tsd-filter-externals" checked />
							Externals
							<input type="checkbox" id="tsd-filter-only-exported" />
							Only exported

					Menu

					Globals

					SlashCommandPreviewItemType

Enumeration SlashCommandPreviewItemType

Index

Enumeration members

AUDIO

IMAGE

OTHER

TEXT

VIDEO

Enumeration members

AUDIO

AUDIO:  = "audio"

Defined in slashcommands/ISlashCommandPreview.ts:23

Represents audio preview.

IMAGE

IMAGE:  = "image"

Defined in slashcommands/ISlashCommandPreview.ts:19

Represents image preview. Could be png, gif, etc.

OTHER

OTHER:  = "other"

Defined in slashcommands/ISlashCommandPreview.ts:27

As the name says, an unknown type (try not to use).

TEXT

TEXT:  = "text"

Defined in slashcommands/ISlashCommandPreview.ts:25

Represents text preview.

VIDEO

VIDEO:  = "video"

Defined in slashcommands/ISlashCommandPreview.ts:21

Represents video preview.

						Globals

						Slash<wbr>Command<wbr>Preview<wbr>Item<wbr>Type

								AUDIO

								IMAGE

								OTHER

								TEXT

								VIDEO

Legend

Module

Object literal

Variable

Function

Function with type parameter

Index signature

Type alias

Enumeration

Enumeration member

Property

Method

Interface

Interface with type parameter

Constructor

Property

Method

Index signature

Class

Class with type parameter

Constructor

Property

Method

Accessor

Index signature

Inherited constructor

Inherited property

Inherited method

Inherited accessor

Protected property

Protected method

Protected accessor

Private property

Private method

Private accessor

Static property

Static method

Generated using TypeDoc


text:
mkdir -p checkpoints && cd checkpoints

# Download the Tacotron2 and Waveglow checkpoints
if [ ! -f "checkpoints/tacotron2_pyt_ckpt_amp_v19.09.0/nvidia_tacotron2pyt_fp16_20190427" ]; then
    echo "Downloading Tacotron2 checkpoint from NGC"
    ngc registry model download-version nvidia/tacotron2_pyt_ckpt_amp:19.09.0
fi;
if [ ! -f "checkpoints/waveglow_ckpt_amp_256_v19.10.0/nvidia_waveglow256pyt_fp16" ]; then
    echo "Downloading Waveglow checkpoint from NGC"
    ngc registry model download-version nvidia/waveglow_ckpt_amp_256:19.10.0
fi;

cd -


text:
#if defined(_MSC_VER)
#define NOMINMAX
#pragma once
#endif

#ifndef PBRT_TEXTURES_FBM_H
#define PBRT_TEXTURES_FBM_H
#include "stdafx.h"

// textures/fbm.h*
#include "pbrt.h"
#include "texture.h"
#include "paramset.h"

// FBmTexture Declarations
template <typename T>
class FBmTexture : public Texture<T> {
  public:
    // FBmTexture Public Methods
    ~FBmTexture() { delete mapping; }
    FBmTexture(int octaves, Float omega, TextureMapping3D *mapping)
        : omega(omega), octaves(octaves), mapping(mapping) {}
    T Evaluate(const SurfaceInteraction &isect) const {
        Vector3f dpdx, dpdy;
        Point3f P = mapping->Map(isect, &dpdx, &dpdy);
        return FBm(P, dpdx, dpdy, omega, octaves);
    }

  private:
    const Float omega;
    const int octaves;
    const TextureMapping3D *mapping;
};

FBmTexture<Float> *CreateFBmFloatTexture(const Transform &tex2world,
                                         const TextureParams &tp);
FBmTexture<Spectrum> *CreateFBmSpectrumTexture(const Transform &tex2world,
                                               const TextureParams &tp);

#endif  // PBRT_TEXTURES_FBM_H


text:
  width: 100%; }
  #comments .comment {
    padding: 2rem 1rem 0rem; }
    #comments .comment .info-bar {
      padding-top: 0.3rem;
      vertical-align: bottom;
      width: 100%; }
    #comments .comment .vote {
      font-size: 0.8rem;
      vertical-align: middle;
      text-align: right;
      color: #AAA; }
      #comments .comment .vote .md-icon {
        fill: #AAA;
        vertical-align: sub; }
        #comments .comment .vote .md-icon:nth-child(1) {
          padding-right: 1rem; }
      #comments .comment .vote .actived {
        color: #cc0000; }
        #comments .comment .vote .actived .md-icon {
          fill: #cc0000; }


text:
<?php

$arrTableNames[0] = "app_captcha";
$arrTableNames[1] = "app_components";
$arrTableNames[2] = "app_selectvalues";
$arrTableNames[3] = "app_values";
$arrTableNames[4] = "clocks";
$arrTableNames[5] = "comments";
$arrTableNames[6] = "console";
$arrTableNames[7] = "console_members";
$arrTableNames[8] = "consolecategory";
$arrTableNames[9] = "customform";
$arrTableNames[10] = "customform_components";
$arrTableNames[11] = "customform_selectvalues";
$arrTableNames[12] = "customform_submission";
$arrTableNames[13] = "customform_values";
$arrTableNames[14] = "custompages";
$arrTableNames[15] = "diplomacy";
$arrTableNames[16] = "diplomacy_request";
$arrTableNames[17] = "diplomacy_status";
$arrTableNames[18] = "download_extensions";
$arrTableNames[19] = "downloadcategory";
$arrTableNames[20] = "downloads";
$arrTableNames[21] = "emailnotifications_queue";
$arrTableNames[22] = "emailnotifications_settings";
$arrTableNames[23] = "event_reminder";
$arrTableNames[24] = "eventchat";
$arrTableNames[25] = "eventchat_messages";
$arrTableNames[26] = "eventchat_roomlist";
$arrTableNames[27] = "eventmessage_comment";
$arrTableNames[28] = "eventmessages";
$arrTableNames[29] = "eventpositions";
$arrTableNames[30] = "events";
$arrTableNames[31] = "events_members";
$arrTableNames[32] = "failban";
$arrTableNames[33] = "forgotpass";
$arrTableNames[34] = "forum_attachments";
$arrTableNames[35] = "forum_board";
$arrTableNames[36] = "forum_category";
$arrTableNames[37] = "forum_memberaccess";
$arrTableNames[38] = "forum_moderator";
$arrTableNames[39] = "forum_post";
$arrTableNames[40] = "forum_rankaccess";
$arrTableNames[41] = "forum_topic";
$arrTableNames[42] = "forum_topicseen";
$arrTableNames[43] = "freezemedals_members";
$arrTableNames[44] = "gamesplayed";
$arrTableNames[45] = "gamesplayed_members";
$arrTableNames[46] = "gamestats";
$arrTableNames[47] = "gamestats_members";
$arrTableNames[48] = "hitcounter";
$arrTableNames[49] = "iarequest";
$arrTableNames[50] = "iarequest_messages";
$arrTableNames[51] = "imageslider";
$arrTableNames[52] = "ipban";
$arrTableNames[53] = "logs";
$arrTableNames[54] = "medals";
$arrTableNames[55] = "medals_members";
$arrTableNames[56] = "memberapps";
$arrTableNames[57] = "members";
$arrTableNames[58] = "membersonlypage";
$arrTableNames[59] = "menu_category";
$arrTableNames[60] = "menu_item";
$arrTableNames[61] = "menuitem_customblock";
$arrTableNames[62] = "menuitem_custompage";
$arrTableNames[63] = "menuitem_image";
$arrTableNames[64] = "menuitem_link";
$arrTableNames[65] = "menuitem_shoutbox";
$arrTableNames[66] = "news";
$arrTableNames[67] = "notifications";
$arrTableNames[68] = "plugin_config";
$arrTableNames[69] = "plugin_pages";
$arrTableNames[70] = "plugins";
$arrTableNames[71] = "poll_memberaccess";
$arrTableNames[72] = "poll_options";
$arrTableNames[73] = "poll_rankaccess";
$arrTableNames[74] = "poll_votes";
$arrTableNames[75] = "polls";
$arrTableNames[76] = "privatemessage_folders";
$arrTableNames[77] = "privatemessage_members";
$arrTableNames[78] = "privatemessages";
$arrTableNames[79] = "profilecategory";
$arrTableNames[80] = "profileoptions";
$arrTableNames[81] = "profileoptions_select";
$arrTableNames[82] = "profileoptions_values";
$arrTableNames[83] = "rank_privileges";
$arrTableNames[84] = "rankcategory";
$arrTableNames[85] = "ranks";
$arrTableNames[86] = "social";
$arrTableNames[87] = "social_members";
$arrTableNames[88] = "squadapps";
$arrTableNames[89] = "squadinvites";
$arrTableNames[90] = "squadnews";
$arrTableNames[91] = "squadranks";
$arrTableNames[92] = "squads";
$arrTableNames[93] = "squads_members";
$arrTableNames[94] = "tableupdates";
$arrTableNames[95] = "tournament_managers";
$arrTableNames[96] = "tournament_reminder";
$arrTableNames[97] = "tournamentmatch";
$arrTableNames[98] = "tournamentplayers";
$arrTableNames[99] = "tournamentpools";
$arrTableNames[100] = "tournamentpools_teams";
$arrTableNames[101] = "tournaments";
$arrTableNames[102] = "tournamentteams";
$arrTableNames[103] = "websiteinfo";

?>


text:
/* */
'use strict';

var alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')
  , length = 64
  , map = {}
  , seed = 0
  , i = 0
  , prev;

/**
 * Return a string representing the specified number.
 *
 * @param {Number} num The number to convert.
 * @returns {String} The string representation of the number.
 * @api public
 */
function encode(num) {
  var encoded = '';

  do {
    encoded = alphabet[num % length] + encoded;
    num = Math.floor(num / length);
  } while (num > 0);

  return encoded;
}

/**
 * Return the integer value specified by the given string.
 *
 * @param {String} str The string to convert.
 * @returns {Number} The integer value represented by the string.
 * @api public
 */
function decode(str) {
  var decoded = 0;

  for (i = 0; i < str.length; i++) {
    decoded = decoded * length + map[str.charAt(i)];
  }

  return decoded;
}

/**
 * Yeast: A tiny growing id generator.
 *
 * @returns {String} A unique id.
 * @api public
 */
function yeast() {
  var now = encode(+new Date());

  if (now !== prev) return seed = 0, prev = now;
  return now +'.'+ encode(seed++);
}

//
// Map each character to its index.
//
for (; i < length; i++) map[alphabet[i]] = i;

//
// Expose the `yeast`, `encode` and `decode` functions.
//
yeast.encode = encode;
yeast.decode = decode;
module.exports = yeast;


text:
using System;
using AppStudio.Uwp.Controls;
using Windows.UI.Xaml.Controls;

namespace DJNanoShow.Layouts.Detail
{
    public sealed partial class TextDetailLayout : BaseDetailLayout
    {
        public TextDetailLayout()
        {
            InitializeComponent();
        }
    }
}


text:
/**
 * \file
 * \brief RTOS interface.
 * \author Erich Styger, erich.styger@hslu.ch
 *
 * This module the main tasks of the RTOS.
 */

#include "PE_Types.h"

#ifndef RTOS_H_
#define RTOS_H_

void RTOS_AddTask(void (*)(void*), signed char*, uint8_t priority);

void RTOS_Wait(uint16_t ms);

/*! \brief Initializes the RTOS module */
void RTOS_Init(void);

/*! \brief De-Initializes the RTOS module */
void RTOS_Deinit(void);

#endif /* RTOS_H_ */


text:
require 'spec_helper'
require 'jenkins-capistrano/configurator'

describe Jenkins::Capistrano::Configurator do
  subject do
    described_class.new(server_url: 'http://example.org')
  end

  describe '.name_for' do

    [
      { file: 'name.xml'     , expected: 'name' },
      { file: 'name.erb'     , expected: 'name' },
      { file: 'name.xml.erb' , expected: 'name' },
      { file: 'n.a.m.e.xml'  , expected: 'n.a.m.e' },
      { file: 'name.erb.xml' , expected: 'name.erb' }
    ].each do |param|
      it "returns `#{param[:expected]}` when `#{param[:file]}` specified" do
        file = Pathname.new(param[:file])
        expect(subject.send(:name_for, file)).to eql param[:expected]
      end
    end
  end
end


text:
"""Bunch of tools helpful for working with vk api"""
import requests

api_url = 'https://api.vk.com/method/{method_name}?{parameters}&access_token={access_token}'
auth_url = 'https://oauth.vk.com/authorize?client_id={app_id}&scope={scope}&redirect_uri=http://oauth.vk.com/blank.html&display=page&response_type=token'

class VkAPI:
    """The most basic vk API wrapper.

    Usage:
        VkAPI(access_token).method_name(method_argument_name=method_argument_value) -> parsed response json

    Examples:
        vk = VkAPI('face123456789')
        vk.getProfiles(uid=1)
        vk.users.search(q='Vasya Babich')

    Args:
        access_token (str): vk application access token

    Attributes:
        access_token (str): vk application access token
    """

    def __init__(self, access_token):
        self.access_token = access_token

    def __getattr__(self, method_name):
        return Request(method_name, self.access_token)

    def __call__(self, method_name, **method_args):
        return getattr(self, method_name)(**method_args)

class Request:
    """Request handler for VkAPI

    Args:
        method_name: name of vk API method to be called
        access_token: vk application access token

    Attributes:
        method_name: name of vk API method to be called
        access_token: vk application access token
    """

    def __init__(self, method_name, access_token):
        self.method_name = method_name
        self.access_token = access_token

    def __getattr__(self, method_name):
        return Request(self.method_name + '.' + method_name, self.access_token)

    def __call__(self, **method_args):
        data = requests.get(self.format_url(**method_args))
        return data.json()

    def format_url(self, **method_args):
        """Formats url for vk api. E.g https://api.vk.com/method/getProfiles?uid=1&access_token=face123456789

        Args:
            method_args (dict): dictionary containing method arguments name:value pair
        """
        return api_url.format(method_name=self.method_name, parameters=Request.format_parameters(method_args),
                              access_token=self.access_token)

    @staticmethod
    def format_parameters(method_args):
        """Formats method arguments for request url

        Args:
            method_args (dict): method arguments
        """
        if len(method_args) > 0:
            return ('{}={},'.format(*method_args.popitem()) + Request.format_parameters(method_args)).rstrip(',')
        else:
            return ''

    @staticmethod
    def format_scope(scope):
        """Formats scope arguments for auth url

        Args:
            scope (list): requested scope list
        """
        if len(scope) > 0:
            return ('{},'.format(scope.pop()) + Request.format_scope(scope)).rstrip(',')
        else:
            return ''

    @staticmethod
    def generate_auth_token_url(app_id, scope):
        """Generates url to get auth token for application

        Args:
            app_id (int): vk application id
            scope (list): requested scope list
        """
        return auth_url.format(app_id=app_id, scope=Request.format_scope(scope))

if __name__ == '__main__':
    pass


text:
<?php

namespace UserTest\Controller;

use Application\Model\AbstractDoctrinePHPUnitTestCase;

class StudentControllerTest extends AbstractDoctrinePHPUnitTestCase {

    protected $traceError  = true;

   public function testIndexAction()
   {
        $this->mockLogin('Student');

        $this->dispatch('/user/student/index');
        $this->assertModuleName('User');
        $this->assertControllerName('User\Controller\Student');
        $this->assertControllerClass('StudentController');
        $this->assertActionName('index');
   }

    public function testDetailAction()
   {
        $this->mockLogin('Student');

        $this->dispatch('/user/student/detail/1');
        $this->assertModuleName('User');
        $this->assertControllerName('User\Controller\Student');
        $this->assertControllerClass('StudentController');
        $this->assertActionName('detail');
   }

}


text:
package org.eclipse.bpel.ui.editparts.figures;

import org.eclipse.bpel.ui.editparts.borders.CollapsableBorder;
import org.eclipse.bpel.ui.editparts.borders.ContainerBorder;
import org.eclipse.draw2d.Label;
import org.eclipse.swt.graphics.Image;

/**
 * A collapsable container figure has a collapsable border, as well as an
 * image and text for the border.
 */
public class CollapsableContainerFigure extends GradientFigure {

	protected CollapsableBorder border;
	protected Image borderImage;
	protected String borderText;

	public CollapsableContainerFigure(Object modelObject, Image image, String text) {
		super(modelObject);
		this.borderImage = image;
		this.borderText = text;
		initializeBorder();
		this.setBorder(border);
	}

	/**
	 * Subclasses may override.
	 */
	protected void initializeBorder() {
		this.border = new ContainerBorder(this, borderImage, borderText);
	}

	public Label getNameLabel() {
		return border.getLabel();
	}

	public void setName(String name) {
		border.setName(name);
		invalidate();
	}

	@Override
	public void invalidate() {
		border.invalidate();
		super.invalidate();
	}

	public void setCollapsed(boolean collapsed) {
		border.setCollapsed(collapsed);
		invalidate();
	}

	public boolean isCollapsed() {
		return border.isCollapsed();
	}

	public boolean isPointInCollapseImage(int i, int j) {
		return border.isPointInCollapseImage(i,j);
	}
}


text:
<?php

namespace app\models;

use dektrium\user\models\Token;

class User extends \dektrium\user\models\User
{

    /**
     * @inheritdoc
     */
    public static function findIdentityByAccessToken($token, $type = null)
    {
		/*
		echo base64_encode('quafpgeAt9EXMd7aRV73JNHd3bYLnaHn:');
		*/
		$token = Token::find()->where(['code'=>$token])->one();

		if($token!==null){
			$user = \app\modules\api\models\User::find()->where(['id'=>$token->user_id])->one();
			return $user;
		} else{
			return null;
		}
        return null;
    }
}


text:
package org.conqat.engine.core.core;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation for string constants used as keys. May only be used only on static
 * final fields of type String. This annotation is evaluated for
 * documentation generation, so the user of a processor knows the names of the
 * relevant keys for this processor.
 *

 * Details on the annoations used for ConQAT can be found in the package
 * documentation {@link org.conqat.engine.core.core} and the ConQAT manual.
 *
 * @author Florian Deissenboeck
 * @author $Author: kinnen $
 *
 * @version $Rev: 41751 $
 * @ConQAT.Rating GREEN Hash: 8B90E4FE792C351E42B56D2C779571B7
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface AConQATKey {

	/**
	 * Description of this key.
	 */
	String description();

	/**
	 * Type of objects stored under this key. The type is implemented as String
	 * in order to be able to express generic types.
	 */
	String type();
}


text:
BEGAN fork from

https://github.com/carpedm20/BEGAN-tensorflow

with batched FID evaluation

Needs fid.py from TTUR root directory. Please copy it here.

Precalculated real world / training data statistics can be downloaded
from here. Be sure to use the batched versions.

http://bioinf.jku.at/research/ttur/ttur.html

see sh/run.sh for options

Fixed random seeds are removed.


text:
package org.elasticsearch.action.support.nodes;

import org.elasticsearch.Version;
import org.elasticsearch.action.FailedNodeException;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.PlainActionFuture;
import org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeActionTests;
import org.elasticsearch.cluster.ClusterName;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.DummyTransportAddress;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.transport.CapturingTransport;
import org.elasticsearch.threadpool.TestThreadPool;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReferenceArray;
import java.util.function.Supplier;

import static org.elasticsearch.test.ClusterServiceUtils.createClusterService;
import static org.elasticsearch.test.ClusterServiceUtils.setState;
import static org.mockito.Mockito.mock;

public class TransportNodesActionTests extends ESTestCase {

    private static ThreadPool THREAD_POOL;
    private static ClusterName CLUSTER_NAME = new ClusterName("test-cluster");

    private ClusterService clusterService;
    private CapturingTransport transport;
    private TransportService transportService;

    public void testRequestIsSentToEachNode() throws Exception {
        TransportNodesAction action = getTestTransportNodesAction();
        TestNodesRequest request = new TestNodesRequest();
        PlainActionFuture<TestNodesResponse> listener = new PlainActionFuture<>();
        action.new AsyncAction(null, request, listener).start();
        Map<String, List<CapturingTransport.CapturedRequest>> capturedRequests = transport.getCapturedRequestsByTargetNodeAndClear();
        int numNodes = clusterService.state().getNodes().getSize();
        // check a request was sent to the right number of nodes
        assertEquals(numNodes, capturedRequests.size());
    }

    public void testNodesSelectors() {
        TransportNodesAction action = getTestTransportNodesAction();
        int numSelectors = randomIntBetween(1, 5);
        Set<String> nodeSelectors = new HashSet<>();
        for (int i = 0; i < numSelectors; i++) {
            nodeSelectors.add(randomFrom(NodeSelector.values()).selector);
        }
        int numNodeIds = randomIntBetween(0, 3);
        String[] nodeIds = clusterService.state().nodes().getNodes().keys().toArray(String.class);
        for (int i = 0; i < numNodeIds; i++) {
            String nodeId = randomFrom(nodeIds);
            nodeSelectors.add(nodeId);
        }
        String[] finalNodesIds = nodeSelectors.toArray(new String[nodeSelectors.size()]);
        TestNodesRequest request = new TestNodesRequest(finalNodesIds);
        action.new AsyncAction(null, request, new PlainActionFuture<>()).start();
        Map<String, List<CapturingTransport.CapturedRequest>> capturedRequests = transport.getCapturedRequestsByTargetNodeAndClear();
        assertEquals(clusterService.state().nodes().resolveNodesIds(finalNodesIds).length, capturedRequests.size());
    }

    public void testNewResponseNullArray() {
        TransportNodesAction action = getTestTransportNodesAction();
        expectThrows(NullPointerException.class, () -> action.newResponse(new TestNodesRequest(), null));
    }

    public void testNewResponse() {
        TestTransportNodesAction action = getTestTransportNodesAction();
        TestNodesRequest request = new TestNodesRequest();
        List<TestNodeResponse> expectedNodeResponses = mockList(TestNodeResponse.class, randomIntBetween(0, 2));
        expectedNodeResponses.add(new TestNodeResponse());
        List<BaseNodeResponse> nodeResponses = new ArrayList<>(expectedNodeResponses);
        // This should be ignored:
        nodeResponses.add(new OtherNodeResponse());
        List<FailedNodeException> failures = mockList(FailedNodeException.class, randomIntBetween(0, 2));

        List<Object> allResponses = new ArrayList<>(expectedNodeResponses);
        allResponses.addAll(failures);

        Collections.shuffle(allResponses, random());

        AtomicReferenceArray<?> atomicArray = new AtomicReferenceArray<>(allResponses.toArray());

        TestNodesResponse response = action.newResponse(request, atomicArray);

        assertSame(request, response.request);
        // note: I shuffled the overall list, so it's not possible to guarantee that it's in the right order
        assertTrue(expectedNodeResponses.containsAll(response.getNodes()));
        assertTrue(failures.containsAll(response.failures()));
    }

    public void testFiltering() throws Exception {
        TransportNodesAction action = getFilteringTestTransportNodesAction(transportService);
        TestNodesRequest request = new TestNodesRequest();
        PlainActionFuture<TestNodesResponse> listener = new PlainActionFuture<>();
        action.new AsyncAction(null, request, listener).start();
        Map<String, List<CapturingTransport.CapturedRequest>> capturedRequests = transport.getCapturedRequestsByTargetNodeAndClear();
        // check requests were only sent to data nodes
        for (String nodeTarget : capturedRequests.keySet()) {
            assertTrue(clusterService.state().nodes().get(nodeTarget).isDataNode());
        }
        assertEquals(clusterService.state().nodes().getDataNodes().size(), capturedRequests.size());
    }

    private <T> List<T> mockList(Class<T> clazz, int size) {
        List<T> failures = new ArrayList<>(size);
        for (int i = 0; i < size; ++i) {
            failures.add(mock(clazz));
        }
        return failures;
    }

    private enum NodeSelector {
        LOCAL("_local"), ELECTED_MASTER("_master"), MASTER_ELIGIBLE("master:true"), DATA("data:true"), CUSTOM_ATTRIBUTE("attr:value");

        private final String selector;

        NodeSelector(String selector) {
            this.selector = selector;
        }
    }

    @BeforeClass
    public static void startThreadPool() {
        THREAD_POOL = new TestThreadPool(TransportBroadcastByNodeActionTests.class.getSimpleName());
    }

    @AfterClass
    public static void destroyThreadPool() {
        ThreadPool.terminate(THREAD_POOL, 30, TimeUnit.SECONDS);
        // since static must set to null to be eligible for collection
        THREAD_POOL = null;
    }

    @Before
    public void setUp() throws Exception {
        super.setUp();
        transport = new CapturingTransport();
        clusterService = createClusterService(THREAD_POOL);
        transportService = new TransportService(transport, THREAD_POOL, clusterService.state().getClusterName());
        transportService.start();
        transportService.acceptIncomingRequests();
        int numNodes = randomIntBetween(3, 10);
        DiscoveryNodes.Builder discoBuilder = DiscoveryNodes.builder();
        List<DiscoveryNode> discoveryNodes = new ArrayList<>();
        for (int i = 0; i < numNodes; i++) {
            Map<String, String> attributes = new HashMap<>();
            Set<DiscoveryNode.Role> roles = new HashSet<>(randomSubsetOf(Arrays.asList(DiscoveryNode.Role.values())));
            if (frequently()) {
                attributes.put("custom", randomBoolean() ? "match" : randomAsciiOfLengthBetween(3, 5));
            }
            final DiscoveryNode node = newNode(i, attributes, roles);
            discoBuilder = discoBuilder.put(node);
            discoveryNodes.add(node);
        }
        discoBuilder.localNodeId(randomFrom(discoveryNodes).getId());
        discoBuilder.masterNodeId(randomFrom(discoveryNodes).getId());
        ClusterState.Builder stateBuilder = ClusterState.builder(CLUSTER_NAME);
        stateBuilder.nodes(discoBuilder);
        ClusterState clusterState = stateBuilder.build();
        setState(clusterService, clusterState);
    }

    @After
    public void tearDown() throws Exception {
        super.tearDown();
        clusterService.close();
        transport.close();
    }

    public TestTransportNodesAction getTestTransportNodesAction() {
        return new TestTransportNodesAction(
                Settings.EMPTY,
                THREAD_POOL,
                clusterService,
                transportService,
                new ActionFilters(Collections.emptySet()),
                TestNodesRequest::new,
                TestNodeRequest::new,
                ThreadPool.Names.SAME
        );
    }

    public FilteringTestTransportNodesAction getFilteringTestTransportNodesAction(TransportService transportService) {
        return new FilteringTestTransportNodesAction(
            Settings.EMPTY,
            THREAD_POOL,
            clusterService,
            transportService,
            new ActionFilters(Collections.emptySet()),
            TestNodesRequest::new,
            TestNodeRequest::new,
            ThreadPool.Names.SAME
        );
    }

    private static DiscoveryNode newNode(int nodeId, Map<String, String> attributes, Set<DiscoveryNode.Role> roles) {
        String node = "node_" + nodeId;
        return new DiscoveryNode(node, node, DummyTransportAddress.INSTANCE, attributes, roles, Version.CURRENT);
    }

    private static class TestTransportNodesAction
        extends TransportNodesAction<TestNodesRequest, TestNodesResponse, TestNodeRequest, TestNodeResponse> {

        TestTransportNodesAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService
                transportService, ActionFilters actionFilters, Supplier<TestNodesRequest> request,
                                 Supplier<TestNodeRequest> nodeRequest, String nodeExecutor) {
            super(settings, "indices:admin/test", CLUSTER_NAME, threadPool, clusterService, transportService, actionFilters,
                    null, request, nodeRequest, nodeExecutor, TestNodeResponse.class);
        }

        @Override
        protected TestNodesResponse newResponse(TestNodesRequest request,
                                                List<TestNodeResponse> responses, List<FailedNodeException> failures) {
            return new TestNodesResponse(request, responses, failures);
        }

        @Override
        protected TestNodeRequest newNodeRequest(String nodeId, TestNodesRequest request) {
            return new TestNodeRequest();
        }

        @Override
        protected TestNodeResponse newNodeResponse() {
            return new TestNodeResponse();
        }

        @Override
        protected TestNodeResponse nodeOperation(TestNodeRequest request) {
            return new TestNodeResponse();
        }

        @Override
        protected boolean accumulateExceptions() {
            return false;
        }
    }

    private static class FilteringTestTransportNodesAction
        extends TestTransportNodesAction {

        FilteringTestTransportNodesAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService
            transportService, ActionFilters actionFilters, Supplier<TestNodesRequest> request,
                                          Supplier<TestNodeRequest> nodeRequest, String nodeExecutor) {
            super(settings, threadPool, clusterService, transportService, actionFilters, request, nodeRequest, nodeExecutor);
        }

        @Override
        protected String[] filterNodeIds(DiscoveryNodes nodes, String[] nodesIds) {
            return nodes.getDataNodes().keys().toArray(String.class);
        }
    }

    private static class TestNodesRequest extends BaseNodesRequest<TestNodesRequest> {
        TestNodesRequest(String... nodesIds) {
            super(nodesIds);
        }
    }

    private static class TestNodesResponse extends BaseNodesResponse<TestNodeResponse> {

        private final TestNodesRequest request;

        TestNodesResponse(TestNodesRequest request, List<TestNodeResponse> nodeResponses, List<FailedNodeException> failures) {
            super(CLUSTER_NAME, nodeResponses, failures);
            this.request = request;
        }

        @Override
        protected List<TestNodeResponse> readNodesFrom(StreamInput in) throws IOException {
            return in.readStreamableList(TestNodeResponse::new);
        }

        @Override
        protected void writeNodesTo(StreamOutput out, List<TestNodeResponse> nodes) throws IOException {
            out.writeStreamableList(nodes);
        }
    }

    private static class TestNodeRequest extends BaseNodeRequest { }

    private static class TestNodeResponse extends BaseNodeResponse { }

    private static class OtherNodeResponse extends BaseNodeResponse { }

}


text:
/**
 * Singly-linked list sequential allocation with malloc.
 */

#include <sys/queue.h>
#include <stdlib.h>

#include "test.h"
#include "slist.h"

BEGIN_TEST_SUIT("malloc_slist_seq")

long start_time;
Slist slist;
Slist_item *item;
SLIST_INIT(&slist);

BEGIN_TEST_CASE("primary_allocation", long, "%ld")
{
  for (int i = 0; i < TEST_MULTIPLIER; i++)
  {
    start_time = get_cpu_time();
    item = xmalloc(sizeof(Slist_item));
    SLIST_INSERT_HEAD(&slist, item, entries);
    metric += get_cpu_time() - start_time;
  }
}
END_TEST_CASE

BEGIN_TEST_CASE("primary_deallocation", long, "%ld")
{
  while (!SLIST_EMPTY(&slist))
  {
    start_time = get_cpu_time();
    item = SLIST_FIRST(&slist);
    SLIST_REMOVE_HEAD(&slist, entries);
    free(item);
    metric += get_cpu_time() - start_time;
  }
}
END_TEST_CASE

BEGIN_TEST_CASE("secondary_allocation", long, "%ld")
{
  for (int i = 0; i < TEST_MULTIPLIER; i++)
  {
    start_time = get_cpu_time();
    item = xmalloc(sizeof(Slist_item));
    SLIST_INSERT_HEAD(&slist, item, entries);
    metric += get_cpu_time() - start_time;
  }
}
END_TEST_CASE

BEGIN_TEST_CASE("secondary_deallocation", long, "%ld")
{
  while (!SLIST_EMPTY(&slist))
  {
    start_time = get_cpu_time();
    item = SLIST_FIRST(&slist);
    SLIST_REMOVE_HEAD(&slist, entries);
    free(item);
    metric += get_cpu_time() - start_time;
  }
}
END_TEST_CASE

END_TEST_SUIT


text:
package db

import (
	"database/sql"
	"github.com/Gazillion-Platform-Team/revel"
)

var (
	Db     *sql.DB
	Driver string
	Spec   string
)

func Init() {
	// Read configuration.
	var found bool
	if Driver, found = revel.Config.String("db.driver"); !found {
		revel.ERROR.Fatal("No db.driver found.")
	}
	if Spec, found = revel.Config.String("db.spec"); !found {
		revel.ERROR.Fatal("No db.spec found.")
	}

	// Open a connection.
	var err error
	Db, err = sql.Open(Driver, Spec)
	if err != nil {
		revel.ERROR.Fatal(err)
	}
}

type Transactional struct {
	*revel.Controller
	Txn *sql.Tx
}

// Begin a transaction
func (c *Transactional) Begin() revel.Result {
	txn, err := Db.Begin()
	if err != nil {
		panic(err)
	}
	c.Txn = txn
	return nil
}

// Rollback if it's still going (must have panicked).
func (c *Transactional) Rollback() revel.Result {
	if c.Txn != nil {
		if err := c.Txn.Rollback(); err != nil {
			if err != sql.ErrTxDone {
				panic(err)
			}
		}
		c.Txn = nil
	}
	return nil
}

// Commit the transaction.
func (c *Transactional) Commit() revel.Result {
	if c.Txn != nil {
		if err := c.Txn.Commit(); err != nil {
			if err != sql.ErrTxDone {
				panic(err)
			}
		}
		c.Txn = nil
	}
	return nil
}

func init() {
	revel.InterceptMethod((*Transactional).Begin, revel.BEFORE)
	revel.InterceptMethod((*Transactional).Commit, revel.AFTER)
	revel.InterceptMethod((*Transactional).Rollback, revel.FINALLY)
}


text:
package com.google.api.ads.adwords.jaxws.v201502.cm;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for AppConversion.AppConversionType.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="AppConversion.AppConversionType">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     <enumeration value="NONE"/>
 *     <enumeration value="DOWNLOAD"/>
 *     <enumeration value="IN_APP_PURCHASE"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "AppConversion.AppConversionType")
@XmlEnum
public enum AppConversionAppConversionType {

    NONE,
    DOWNLOAD,
    IN_APP_PURCHASE;

    public String value() {
        return name();
    }

    public static AppConversionAppConversionType fromValue(String v) {
        return valueOf(v);
    }

}


text:
<?php
/**
 * Created by PhpStorm.
 * User: alex
 * Date: 20/01/15
 * Time: 11:27
 */

namespace At21\EBoxOfficeBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use At21\EBoxOfficeBundle\Entity\Session;

class LoadSessionData extends AbstractFixture implements OrderedFixtureInterface
{
    /**
     * {@inheritDoc}
     */
    public function load(ObjectManager $manager)
    {
        $date = new \DateTime('today');
        $date2 = clone $date;
        $date2->add(new \DateInterval('PT5H'));
        $date3 = clone $date;
        $date3->add(new \DateInterval('PT10H'));
        $session1 = new Session();
        $session1
            ->setDate($date)
            ->setPlay($this->getReference('play1'))
            ->setTheatre($this->getReference('theatre1'))
            ->setPrice(25.60)
            ->initializeSeats();
        $session2 = new Session();
        $session2
            ->setDate($date2)
            ->setPlay($this->getReference('play1'))
            ->setTheatre($this->getReference('theatre1'))
            ->setPrice(25.60)
            ->initializeSeats();
        $session3 = new Session();
        $session3
            ->setDate($date3)
            ->setPlay($this->getReference('play1'))
            ->setTheatre($this->getReference('theatre1'))
            ->setPrice(25.60)
            ->initializeSeats();

        $session4 = new Session();
        $session4
            ->setDate($date)
            ->setPlay($this->getReference('play2'))
            ->setTheatre($this->getReference('theatre2'))
            ->setPrice(25.60)
            ->initializeSeats();
        $session5 = new Session();
        $session5
            ->setDate($date2)
            ->setPlay($this->getReference('play2'))
            ->setTheatre($this->getReference('theatre2'))
            ->setPrice(25.60)
            ->initializeSeats();
        $session6 = new Session();
        $session6
            ->setDate($date3)
            ->setPlay($this->getReference('play2'))
            ->setTheatre($this->getReference('theatre2'))
            ->setPrice(25.60)
            ->initializeSeats();

        $session7 = new Session();
        $session7
            ->setDate($date)
            ->setPlay($this->getReference('play3'))
            ->setTheatre($this->getReference('theatre3'))
            ->setPrice(25.60)
            ->initializeSeats();
        $session8 = new Session();
        $session8
            ->setDate($date2)
            ->setPlay($this->getReference('play3'))
            ->setTheatre($this->getReference('theatre3'))
            ->setPrice(25.60)
            ->initializeSeats();
        $session9 = new Session();
        $session9
            ->setDate($date3)
            ->setPlay($this->getReference('play3'))
            ->setTheatre($this->getReference('theatre3'))
            ->setPrice(25.60)
            ->initializeSeats();

        $manager->persist($session1);
        $manager->persist($session2);
        $manager->persist($session3);
        $manager->persist($session4);
        $manager->persist($session5);
        $manager->persist($session6);
        $manager->persist($session7);
        $manager->persist($session8);
        $manager->persist($session9);
        $manager->flush();
    }

    /**
     * Get the order of this fixture
     *
     * @return integer
     */
    function getOrder()
    {
        return 3;
    }
}


text:
package com.datastax.dse.driver.internal.core.graph;

import com.datastax.oss.driver.shaded.guava.common.collect.Sets;
import java.util.List;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * List of predicates for geolocation usage with DseGraph and Search indexes. Should not be accessed
 * directly but through the {@link com.datastax.dse.driver.api.core.graph.predicates.Search} static
 * methods.
 */
public enum SearchPredicate implements DsePredicate {
  /** Whether the text contains a given term as a token in the text (case insensitive). */
  token {
    @Override
    public boolean test(Object value, Object condition) {
      preEvaluate(condition);
      return value != null && evaluate(value.toString(), (String) condition);
    }

    boolean evaluate(String value, String terms) {
      Set<String> tokens = Sets.newHashSet(tokenize(value.toLowerCase()));
      terms = terms.trim();
      List<String> tokenTerms = tokenize(terms.toLowerCase());
      if (!terms.isEmpty() && tokenTerms.isEmpty()) {
        return false;
      }
      for (String term : tokenTerms) {
        if (!tokens.contains(term)) {
          return false;
        }
      }
      return true;
    }

    @Override
    public boolean isValidCondition(Object condition) {
      return condition != null && isNotBlank((String) condition);
    }

    @Override
    public String toString() {
      return "token";
    }
  },

  /** Whether the text contains a token that starts with a given term (case insensitive). */
  tokenPrefix {
    @Override
    public boolean test(Object value, Object condition) {
      preEvaluate(condition);
      return value != null && evaluate(value.toString(), (String) condition);
    }

    boolean evaluate(String value, String prefix) {
      for (String token : tokenize(value.toLowerCase())) {
        if (token.startsWith(prefix.toLowerCase().trim())) {
          return true;
        }
      }
      return false;
    }

    @Override
    public boolean isValidCondition(Object condition) {
      return condition != null;
    }

    @Override
    public String toString() {
      return "tokenPrefix";
    }
  },

  /** Whether the text contains a token that matches a regular expression (case insensitive). */
  tokenRegex {
    @Override
    public boolean test(Object value, Object condition) {
      preEvaluate(condition);
      return value != null && evaluate(value.toString(), (String) condition);
    }

    boolean evaluate(String value, String regex) {
      Pattern compiled = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
      for (String token : tokenize(value.toLowerCase())) {
        if (compiled.matcher(token).matches()) {
          return true;
        }
      }
      return false;
    }

    @Override
    public boolean isValidCondition(Object condition) {
      return condition != null && isNotBlank((String) condition);
    }

    @Override
    public String toString() {
      return "tokenRegex";
    }
  },

  /**
   * Whether some token in the text is within a given edit distance from the given term (case
   * insensitive).
   */
  tokenFuzzy {
    @Override
    public boolean test(Object value, Object condition) {
      preEvaluate(condition);
      if (value == null) {
        return false;
      }

      EditDistance fuzzyCondition = (EditDistance) condition;

      for (String token : tokenize(value.toString().toLowerCase())) {
        if (SearchUtils.getOptimalStringAlignmentDistance(token, fuzzyCondition.query.toLowerCase())
            <= fuzzyCondition.distance) {
          return true;
        }
      }

      return false;
    }

    @Override
    public boolean isValidCondition(Object condition) {
      return condition != null;
    }

    @Override
    public String toString() {
      return "tokenFuzzy";
    }
  },

  /** Whether the text starts with a given prefix (case sensitive). */
  prefix {
    @Override
    public boolean test(Object value, Object condition) {
      preEvaluate(condition);
      return value != null && value.toString().startsWith(((String) condition).trim());
    }

    @Override
    public boolean isValidCondition(Object condition) {
      return condition != null;
    }

    @Override
    public String toString() {
      return "prefix";
    }
  },

  /** Whether the text matches a regular expression (case sensitive). */
  regex {
    @Override
    public boolean test(Object value, Object condition) {
      preEvaluate(condition);
      return value != null
          && Pattern.compile((String) condition, Pattern.DOTALL)
              .matcher(value.toString())
              .matches();
    }

    @Override
    public boolean isValidCondition(Object condition) {
      return condition != null && isNotBlank((String) condition);
    }

    @Override
    public String toString() {
      return "regex";
    }
  },

  /** Whether the text is within a given edit distance from the given term (case sensitive). */
  fuzzy {
    @Override
    public boolean test(Object value, Object condition) {
      preEvaluate(condition);
      if (value == null) {
        return false;
      }
      EditDistance fuzzyCondition = (EditDistance) condition;
      return SearchUtils.getOptimalStringAlignmentDistance(value.toString(), fuzzyCondition.query)
          <= fuzzyCondition.distance;
    }

    @Override
    public boolean isValidCondition(Object condition) {
      return condition != null;
    }

    @Override
    public String toString() {
      return "fuzzy";
    }
  },

  /**
   * Whether tokenized text contains a given phrase, optionally within a given proximity (case
   * insensitive).
   */
  phrase {
    @Override
    public boolean test(Object value, Object condition) {
      preEvaluate(condition);
      if (value == null) {
        return false;
      }

      EditDistance phraseCondition = (EditDistance) condition;

      List<String> valueTokens = tokenize(value.toString().toLowerCase());
      List<String> phraseTokens = tokenize(phraseCondition.query.toLowerCase());

      int valuePosition = 0;
      int phrasePosition = 0;
      int distance = 0;

      // Look for matches while phrase/value tokens and distance budget remain
      while (phrasePosition < phraseTokens.size()
          && valuePosition < valueTokens.size()
          && distance <= phraseCondition.distance) {

        if (phraseTokens.get(phrasePosition).equals(valueTokens.get(valuePosition))) {
          // Early return-true when we've matched the whole phrase (within the specified distance)
          if (phrasePosition == phraseTokens.size() - 1) {
            return true;
          }
          phrasePosition++;
        } else if (0 < phrasePosition) {
          // We've previously found at least one matching token in the input string,
          // but the current token does not match the phrase.  Increment distance.
          distance++;
        }

        valuePosition++;
      }

      return false;
    }

    @Override
    public boolean isValidCondition(Object condition) {
      return condition != null;
    }

    @Override
    public String toString() {
      return "phrase";
    }
  };

  private static boolean isNotBlank(String str) {
    if (str == null || str.isEmpty()) {
      return false;
    }
    int strLen = str.length();
    for (int i = 0; i < strLen; i++) {
      if (!Character.isWhitespace(str.charAt(i))) {
        return true;
      }
    }
    return false;
  }

  // Match anything that is not either:
  // 1) a unicode letter, regardless of subcategory (same as Character.isLetter), or
  // 2) a unicode decimal digit number (same as Character.isDigit)
  private static final Pattern TOKEN_SPLIT_PATTERN = Pattern.compile("[^\\p{L}\\p{Nd}]");

  static List<String> tokenize(String str) {
    String[] rawTokens = TOKEN_SPLIT_PATTERN.split(str); // could contain empty strings
    return Stream.of(rawTokens).filter(t -> 0 < t.length()).collect(Collectors.toList());
  }
}


text:
package net.xeraa.morphia_demo.persistence;

import net.xeraa.morphia_demo.config.MongoDB;
import net.xeraa.morphia_demo.entities.CompanyEntity;
import net.xeraa.morphia_demo.entities.EmployeeEntity;
import net.xeraa.morphia_demo.entities.ManagerEntity;
import net.xeraa.morphia_demo.entities.WorkerEntity;

import org.bson.types.ObjectId;
import org.mongodb.morphia.Datastore;
import org.mongodb.morphia.query.Query;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

/**
 * The Persistence implementation, showing how to do an upsert, various queries, clearing the
 * database,...
 */
public class MongodbPersistence {

  private final Datastore mongoDatastore;

  public MongodbPersistence() {
    mongoDatastore = MongoDB.instance().getDatabase();
  }

  public ObjectId persistCompanyEntity(CompanyEntity company) {
    mongoDatastore.save(company);
    return company.getId();
  }

  public ObjectId persistManagerEntity(ManagerEntity manager) {
    mongoDatastore.save(manager);
    return manager.getId();
  }

  public ObjectId persistWorkerEntity(WorkerEntity worker) {
    mongoDatastore.save(worker);
    return worker.getId();
  }

  public void clearData() {
    mongoDatastore.delete(mongoDatastore.createQuery(CompanyEntity.class));
    mongoDatastore.delete(mongoDatastore.createQuery(ManagerEntity.class));
    mongoDatastore.delete(mongoDatastore.createQuery(WorkerEntity.class));
  }

  public List<CompanyEntity> getAllCompanies() {
    return mongoDatastore.createQuery(CompanyEntity.class).asList();
  }

  public List<EmployeeEntity> getAllEmployees() {
    return mongoDatastore.find(EmployeeEntity.class).asList();
  }

  public List<ManagerEntity> getAllManagers() {
    return mongoDatastore.find(ManagerEntity.class)
	// Disable validation when querying an implicit attribute to avoid warnings
	.disableValidation()
	.field("className").equal(ManagerEntity.class.getName()).asList();
  }

  public List<WorkerEntity> getAllWorkers() {
    return mongoDatastore.find(WorkerEntity.class)
	// Disable validation when querying an implicit attribute to avoid warnings
	.disableValidation()
	.field("className").equal(WorkerEntity.class.getName()).asList();
  }

  public EmployeeEntity findByEmail(final String email) {
    if ((email == null) || email.isEmpty()) {
      return null;
    }
    // Don't do this in production, this is slow
    Pattern regexp = Pattern.compile("^" + email + "$", Pattern.CASE_INSENSITIVE);
    return mongoDatastore.find(EmployeeEntity.class).filter("email", regexp).get();
  }

  public List<CompanyEntity> findCompanyByCountry(final String country) {
    if ((country == null) || country.isEmpty()) {
      return new ArrayList<>();
    }
    return mongoDatastore.createQuery(CompanyEntity.class).filter("address.country =", country)
	.asList();
  }

  public List<EmployeeEntity> findBySalary(final BigDecimal minimum, final BigDecimal maximum) {

    /**
     * Check that the minimum is not negative and that the maximum is not
     * smaller than the minimum.
     */
    if (((minimum != null) && (minimum.compareTo(BigDecimal.ZERO) < 0))
	|| ((minimum != null) && (maximum != null) && (maximum.compareTo(minimum) < 0))) {
      return new ArrayList<>();
    }
    Query<EmployeeEntity> query = mongoDatastore.find(EmployeeEntity.class);
    if (minimum != null) {
      BigDecimal minimumScale = minimum.setScale(2, BigDecimal.ROUND_HALF_UP);
      query.filter("salaryString >=", minimumScale.toPlainString());
    }
    if (maximum != null) {
      BigDecimal maximumScale = maximum.setScale(2, BigDecimal.ROUND_HALF_UP);
      query.filter("salaryString <=", maximumScale.toPlainString());
    }
    return query.asList();
  }

  public List<EmployeeEntity> findBySalaryFluent(final BigDecimal minimum,
						 final BigDecimal maximum) {
    if (((minimum != null) && (minimum.compareTo(BigDecimal.ZERO) < 0))
	|| ((minimum != null) && (maximum != null) && (maximum.compareTo(minimum) < 0))) {
      return new ArrayList<>();
    }
    Query<EmployeeEntity> query = mongoDatastore.find(EmployeeEntity.class);
    if (minimum != null) {
      BigDecimal minimumScale = minimum.setScale(2, BigDecimal.ROUND_HALF_UP);
      query.field("salary").greaterThanOrEq(minimumScale.toPlainString());
    }
    if (maximum != null) {
      BigDecimal maximumScale = maximum.setScale(2, BigDecimal.ROUND_HALF_UP);
      query.field("salary").lessThanOrEq(maximumScale.toPlainString());
    }
    return query.asList();
  }

  public List<EmployeeEntity> findCompanyEmployees(final String companyName) {
    if ((companyName == null) || companyName.isEmpty()) {
      return new ArrayList<>();
    }
    CompanyEntity company = mongoDatastore.find(CompanyEntity.class).field("name").equal(companyName).get();

    if(company == null){
      return new ArrayList<>();
    }
    return mongoDatastore.find(EmployeeEntity.class).field("company").equal(mongoDatastore.getKey(company))
            .asList();
  }

  public void workingFor(EmployeeEntity employee, CompanyEntity company) {
    if (employee.getId() == null) {
      mongoDatastore.save(employee);
    }
    if (company.getId() == null) {
      persistCompanyEntity(company);
    }
    employee.setCompany(company);
    mongoDatastore.save(employee);
    company.addEmployee(employee);
    persistCompanyEntity(company);
  }

}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

#nullable enable

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

namespace IronPython.Compiler.Ast {
    public class JoinedStringExpression : Expression {
        public JoinedStringExpression(IReadOnlyList<Expression>? values) {
            _values = values?.ToArray() ?? Array.Empty<Expression>();
        }

        private Expression[] _values;
        public IReadOnlyList<Expression> Values => _values;

        private static readonly MethodInfo concat = ((Func<string[], string>)string.Concat).Method;

        public override System.Linq.Expressions.Expression Reduce()
            => Expression.Call(concat, NewArrayInit(typeof(string), ToExpressionArray<string>(_values)));

        public override void Walk(PythonWalker walker) {
            if (walker.Walk(this)) {
                foreach (var arg in Values) {
                    arg.Walk(walker);
                }
            }
            walker.PostWalk(this);
        }
    }
}


text:
/*
 * Escreva a descrição da classe ComparadorMotoristaDesvioMaximo aqui.
 *
 * @author (seu nome)
 * @version (número de versão ou data)
 */
import java.util.Comparator;
public class ComparadorMotoristaDesvioMaximo implements Comparator<Motorista>
{
    public int compare(Motorista m1, Motorista m2){
        int aux = 0;
        double dMAX1 = 0;
        double dMAX2 = 0;
        try{
            dMAX1 = m1.maiorDesvio().getDesvio();
        }
        catch(NenhumaViagemException e){aux++;}

        try{
            dMAX2 = m2.maiorDesvio().getDesvio();
            //So chegamos neste patamar se a exceção não tiver sido lançada.
            //Se aux == 1 então o motorista m1 tem uma posição maior que m2.
            if(aux == 1) {
				return 1;
			}
        }
        catch(NenhumaViagemException e){aux++;}

        //Se chegarmos neste patamar e aux == 1, então o motorista m1 tem uma posição menor que m2.
        if(aux == 1) {
			return (-1);
		} else if(aux == 2) return 0; //Se nenhum dos motoristas tiver feito uma viagem, consideramos "iguais".

        return dMAX1 > dMAX2 ? -1 : (dMAX1 < dMAX2 ? 1 : 0);
    }
}


text:
/* global module, require */

var notify = require('gulp-notify');

module.exports = function() {
  "use strict";

  notify.onError({
    title: 'Compile Error',
    message: "<%= error %>"
  }).apply(this, arguments);

  this.emit('end');
};


text:
/*
 * ----------------------------------------
 *      Nutrient Usage Tracking System
 * ----------------------------------------
 *          Produced by Dan Grew
 *                 2017
 * ----------------------------------------
 */
package uk.dangrew.nuts.graphics.table.tree;

import uk.dangrew.kode.concept.Concept;
import uk.dangrew.kode.javafx.table.controller.ConceptTableController;

/**
 * {@link ConceptTreeTableController} provides a controller interface for a {@link DayPlanTreeTable}.
 */
public interface ConceptTreeTableController< TypeT extends Concept > extends ConceptTableController< TypeT >{

   public void associate( DayPlanTreeTable table );

}//End Interface


text:
package com.google.template.soy.pysrc.internal;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.truth.Truth.assertAbout;
import static com.google.common.truth.Truth.assertThat;
import static com.google.template.soy.testing.SharedTestUtils.untypedTemplateBodyForExpression;

import com.google.common.base.Supplier;
import com.google.common.collect.ImmutableList;
import com.google.common.truth.FailureMetadata;
import com.google.common.truth.Subject;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.template.soy.error.ErrorReporter;
import com.google.template.soy.exprtree.ExprNode;
import com.google.template.soy.exprtree.Operator;
import com.google.template.soy.internal.i18n.BidiGlobalDir;
import com.google.template.soy.pysrc.internal.GenPyExprsVisitor.GenPyExprsVisitorFactory;
import com.google.template.soy.pysrc.restricted.PyExpr;
import com.google.template.soy.pysrc.restricted.PyExprUtils;
import com.google.template.soy.shared.SoyGeneralOptions;
import com.google.template.soy.soytree.PrintNode;
import com.google.template.soy.soytree.SoyFileSetNode;
import com.google.template.soy.soytree.SoyNode;
import com.google.template.soy.testing.SharedTestUtils;
import com.google.template.soy.testing.SoyFileSetParserBuilder;
import java.util.List;
import java.util.Map;

/**
 * Truth assertion which compiles the provided soy code and asserts that the generated PyExprs match
 * the expected expressions. This subject is only valid for soy code which can be represented as one
 * or more Python expressions.
 */
public final class SoyExprForPySubject extends Subject {

  private final String actual;
  private final SoyGeneralOptions opts = new SoyGeneralOptions();

  private final LocalVariableStack localVarExprs;

  private ImmutableList<String> experimentalFeatures = ImmutableList.of();

  private SoyExprForPySubject(FailureMetadata failureMetadata, String expr) {
    super(failureMetadata, expr);
    this.actual = expr;
    localVarExprs = new LocalVariableStack();
  }

  /**
   * Adds a frame of local variables to the top of the {@link LocalVariableStack}.
   *
   * @param localVarFrame one frame of local variables
   * @return the current subject for chaining
   */
  @CanIgnoreReturnValue
  public SoyExprForPySubject with(Map<String, PyExpr> localVarFrame) {
    localVarExprs.pushFrame();
    for (Map.Entry<String, PyExpr> entry : localVarFrame.entrySet()) {
      localVarExprs.addVariable(entry.getKey(), entry.getValue());
    }
    return this;
  }

  @CanIgnoreReturnValue
  public SoyExprForPySubject withExperimentalFeatures(ImmutableList<String> experimetalFeatures) {
    this.experimentalFeatures = experimetalFeatures;
    return this;
  }

  /**
   * Asserts the subject compiles to the correct PyExpr.
   *
   * @param expectedPyExpr the expected result of compilation
   */
  public void compilesTo(PyExpr expectedPyExpr) {
    compilesTo(ImmutableList.of(expectedPyExpr));
  }

  /**
   * Asserts the subject compiles to the correct list of PyExprs.
   *
   * <p>The given Soy expr is wrapped in a full body of a template. The actual result is replaced
   * with ids for ### so that tests don't break when ids change.
   *
   * @param expectedPyExprs the expected result of compilation
   */
  public void compilesTo(List<PyExpr> expectedPyExprs) {
    SoyFileSetNode soyTree =
        SoyFileSetParserBuilder.forTemplateContents(actual)
            .enableExperimentalFeatures(experimentalFeatures)
            .runAutoescaper(true)
            .parse()
            .fileSet();
    SoyNode node = SharedTestUtils.getNode(soyTree, 0);

    final IsComputableAsPyExprVisitor isComputableAsPyExprs = new IsComputableAsPyExprVisitor();
    final PythonValueFactoryImpl pluginValueFactory =
        new PythonValueFactoryImpl(ErrorReporter.exploding(), BidiGlobalDir.LTR);
    // There is a circular dependency between the GenPyExprsVisitorFactory and GenPyCallExprVisitor
    // here we resolve it with a mutable field in a custom provider
    class PyCallExprVisitorSupplier implements Supplier<GenPyCallExprVisitor> {
      GenPyExprsVisitorFactory factory;

      @Override
      public GenPyCallExprVisitor get() {
        return new GenPyCallExprVisitor(
            isComputableAsPyExprs, pluginValueFactory, checkNotNull(factory));
      }
    }
    PyCallExprVisitorSupplier provider = new PyCallExprVisitorSupplier();
    GenPyExprsVisitorFactory genPyExprsFactory =
        new GenPyExprsVisitorFactory(isComputableAsPyExprs, pluginValueFactory, provider);
    provider.factory = genPyExprsFactory;
    GenPyExprsVisitor genPyExprsVisitor =
        genPyExprsFactory.create(localVarExprs, ErrorReporter.exploding());
    List<PyExpr> actualPyExprs = genPyExprsVisitor.exec(node);

    assertThat(actualPyExprs).hasSize(expectedPyExprs.size());
    for (int i = 0; i < expectedPyExprs.size(); i++) {
      PyExpr expectedPyExpr = expectedPyExprs.get(i);
      PyExpr actualPyExpr = actualPyExprs.get(i);
      assertThat(actualPyExpr.getText().replaceAll("\\([0-9]+", "(###"))
          .isEqualTo(expectedPyExpr.getText());
      assertThat(actualPyExpr.getPrecedence()).isEqualTo(expectedPyExpr.getPrecedence());
    }
  }

  /**
   * Asserts the subject translates to the expected PyExpr.
   *
   * @param expectedPyExpr the expected result of translation
   */
  public void translatesTo(PyExpr expectedPyExpr) {
    translatesTo(expectedPyExpr, null);
  }

  public void translatesTo(String expr, Operator precedence) {
    translatesTo(new PyExpr(expr, PyExprUtils.pyPrecedenceForOperator(precedence)));
  }

  public void translatesTo(String expr, int precedence) {
    translatesTo(new PyExpr(expr, precedence));
  }

  /**
   * Asserts the subject translates to the expected PyExpr including verification of the exact
   * PyExpr class (e.g. {@code PyStringExpr.class}).
   *
   * @param expectedPyExpr the expected result of translation
   * @param expectedClass the expected class of the resulting PyExpr
   */
  public void translatesTo(PyExpr expectedPyExpr, Class<? extends PyExpr> expectedClass) {

    SoyFileSetNode soyTree =
        SoyFileSetParserBuilder.forTemplateContents(untypedTemplateBodyForExpression(actual))
            .options(opts)
            // disable optimizer for backwards compatibility
            .runOptimizer(false)
            .parse()
            .fileSet();
    PrintNode node = (PrintNode) SharedTestUtils.getNode(soyTree, 0);
    ExprNode exprNode = node.getExpr();

    PyExpr actualPyExpr =
        new TranslateToPyExprVisitor(
                localVarExprs,
                new PythonValueFactoryImpl(ErrorReporter.exploding(), BidiGlobalDir.LTR),
                node,
                ErrorReporter.exploding())
            .exec(exprNode);
    assertThat(actualPyExpr.getText()).isEqualTo(expectedPyExpr.getText());
    assertThat(actualPyExpr.getPrecedence()).isEqualTo(expectedPyExpr.getPrecedence());

    if (expectedClass != null) {
      assertThat(actualPyExpr.getClass()).isEqualTo(expectedClass);
    }
  }

  // -----------------------------------------------------------------------------------------------
  // Public static functions for starting a SoyExprForPySubject test.

  public static SoyExprForPySubject assertThatSoyExpr(String expr) {
    return assertAbout(SoyExprForPySubject::new).that(expr);
  }
}