text:
angular.module('bucketList.controllers', [])
    .controller('SignInCtrl', [
        '$scope', '$rootScope', '$firebaseAuth', '$window',
        function($scope, $rootScope, $firebaseAuth, $window) {
            // check session
            $rootScope.checkSession();

            $scope.user = {
                email: "",
                password: ""
            };
            $scope.validateUser = function() {
                $rootScope.show('Please wait.. Authenticating');
                var email = this.user.email;
                var password = this.user.password;
                if (!email || !password) {
                    $rootScope.notify("Please enter valid credentials");
                    return false;
                }

                $rootScope.auth.$login('password', {
                    email: email,
                    password: password
                }).then(function(user) {
                    $rootScope.hide();
                    $rootScope.userEmail = user.email;
                    $window.location.href = ('#/bucket/list');
                }, function(error) {
                    $rootScope.hide();
                    if (error.code == 'INVALID_EMAIL') {
                        $rootScope.notify('Invalid Email Address');
                    } else if (error.code == 'INVALID_PASSWORD') {
                        $rootScope.notify('Invalid Password');
                    } else if (error.code == 'INVALID_USER') {
                        $rootScope.notify('Invalid User');
                    } else {
                        $rootScope.notify('Oops something went wrong. Please try again later');
                    }
                });
            }
        }
    ])

    .controller('SignUpCtrl', [
        '$scope', '$rootScope', '$firebaseAuth', '$window',
        function($scope, $rootScope, $firebaseAuth, $window) {

            $scope.user = {
                email: "",
                password: ""
            };
            $scope.createUser = function() {
                var email = this.user.email;
                var password = this.user.password;
                if (!email || !password) {
                    $rootScope.notify("Please enter valid credentials");
                    return false;
                }
                $rootScope.show('Please wait.. Registering');

                $rootScope.auth.$createUser(email, password, function(error, user) {
                    if (!error) {
                        $rootScope.hide();
                        $rootScope.userEmail = user.email;
                        $window.location.href = ('#/bucket/list');
                    } else {
                        $rootScope.hide();
                        if (error.code == 'INVALID_EMAIL') {
                            $rootScope.notify('Invalid Email Address');
                        } else if (error.code == 'EMAIL_TAKEN') {
                            $rootScope.notify('Email Address already taken');
                        } else {
                            $rootScope.notify('Oops something went wrong. Please try again later');
                        }
                    }
                });
            }
        }
    ])

    .controller('myListCtrl', function($rootScope, $scope, $window, $ionicModal, $firebase) {
        $rootScope.show("Please wait... Processing");
        $scope.list = [];
        var bucketListRef = new Firebase($rootScope.baseUrl + escapeEmailAddress($rootScope.userEmail));
        bucketListRef.on('value', function(snapshot) {
            var data = snapshot.val();
            $scope.list = [];
            for (var key in data) {
                if (data.hasOwnProperty(key)) {
                    if (data[key].isCompleted == false) {
                        data[key].key = key;
                        $scope.list.push(data[key]);
                    }
                }
            }

            if ($scope.list.length == 0) {
                $scope.noData = true;
            } else {
                $scope.noData = false;
            }
            $rootScope.hide();
        });

        $ionicModal.fromTemplateUrl('templates/newItem.html', function(modal) {
            $scope.newTemplate = modal;
        });

        $scope.newTask = function() {
            $scope.newTemplate.show();
        };

        $scope.markCompleted = function(key) {
            $rootScope.show("Please wait... Updating List");
            var itemRef = new Firebase($rootScope.baseUrl + escapeEmailAddress($rootScope.userEmail) + '/' + key);
            itemRef.update({
                isCompleted: true
            }, function(error) {
                if (error) {
                    $rootScope.hide();
                    $rootScope.notify('Oops! something went wrong. Try again later');
                } else {
                    $rootScope.hide();
                    $rootScope.notify('Successfully updated');
                }
            });
        };

        $scope.deleteItem = function(key) {
            $rootScope.show("Please wait... Deleting from List");
            var itemRef = new Firebase($rootScope.baseUrl + escapeEmailAddress($rootScope.userEmail));
            bucketListRef.child(key).remove(function(error) {
                if (error) {
                    $rootScope.hide();
                    $rootScope.notify('Oops! something went wrong. Try again later');
                } else {
                    $rootScope.hide();
                    $rootScope.notify('Successfully deleted');
                }
            });
        };
    })

    .controller('newCtrl', function($rootScope, $scope, $window, $firebase) {
        $scope.data = {
            item: ""
        };

        $scope.close = function() {
            $scope.modal.hide();
        };

        $scope.createNew = function() {
            var item = this.data.item;
            if (!item) return;
            $scope.modal.hide();
            $rootScope.show();

            $rootScope.show("Please wait... Creating new");

            var form = {
                item: item,
                isCompleted: false,
                created: Date.now(),
                updated: Date.now()
            };

            var bucketListRef = new Firebase($rootScope.baseUrl + escapeEmailAddress($rootScope.userEmail));
            $firebase(bucketListRef).$add(form);
            $rootScope.hide();

        };
    })

    .controller('completedCtrl', function($rootScope, $scope, $window, $firebase) {
        $rootScope.show("Please wait... Processing");
        $scope.list = [];

        var bucketListRef = new Firebase($rootScope.baseUrl + escapeEmailAddress($rootScope.userEmail));
        bucketListRef.on('value', function(snapshot) {
            $scope.list = [];
            var data = snapshot.val();

            for (var key in data) {
                if (data.hasOwnProperty(key)) {
                    if (data[key].isCompleted == true) {
                        data[key].key = key;
                        $scope.list.push(data[key]);
                    }
                }
            }
            if ($scope.list.length == 0) {
                $scope.noData = true;
            } else {
                $scope.noData = false;
            }

            $rootScope.hide();
        });

        $scope.deleteItem = function(key) {
            $rootScope.show("Please wait... Deleting from List");
            var itemRef = new Firebase($rootScope.baseUrl + escapeEmailAddress($rootScope.userEmail));
            bucketListRef.child(key).remove(function(error) {
                if (error) {
                    $rootScope.hide();
                    $rootScope.notify('Oops! something went wrong. Try again later');
                } else {
                    $rootScope.hide();
                    $rootScope.notify('Successfully deleted');
                }
            });
        };
    });

function escapeEmailAddress(email) {
    if (!email) return false
    // Replace '.' (not allowed in a Firebase key) with ','
    email = email.toLowerCase();
    email = email.replace(/\./g, ',');
    return email.trim();
}


text:
from django.core.management.base import BaseCommand
from django.conf import settings

from aspc.activityfeed.models import Activity, TwitterActivity

class Command(BaseCommand):
    help = 'clears recent tweets (for testing)'

    def handle(self, *args, **options):
        self.stdout.write("Deleting all Twitter SocialMediaActivity objects\n")
        self.stdout.flush()
        tweets = TwitterActivity.objects.all()
        activities = Activity.objects.filter(category="twitter")
        self.stdout.write("Deleting %i tweets, %i activity instances.\n" % (len(tweets), len(activities)))
        self.stdout.flush()
        tweets.delete()
        activities.delete()

redpajama_set_name: RedPajamaGithub


text:
;(function(Agent) {

  Agent.isNativeFunction = function(func) {
    var funcStr = func.toString();
    return funcStr.match(/native code/) || funcStr.match(/function bound()/);
  };

}(Agent));


text:
namespace Snippets3.Serialization
{
    using NServiceBus;

    public class JsonSerializerUsage
    {
        public void Simple()
        {

            #region JsonSerialization

            Configure configure = Configure.With();
            configure.JsonSerializer();

            #endregion

        }

    }
}


text:
package ru.mail.park.chat.activities.interfaces;

/**
 * Created by Михаил on 12.08.2016.
 */
public interface IUploadListener {
    void onUploadComplete(String name);
}


text:
from __future__ import annotations

from dynaconf import settings
from dynaconf.loaders.toml_loader import write

# Get the potato
original = str(settings.POTATO)  # str() to force a copy
modern = "Modern Potato"
print("Original data:", original)
assert settings.POTATO == settings.get("potato") == original

# Change the Toml file
print("Change POTATO to `Modern Potato` in settings.toml file...")
write(settings.path_for("settings.toml"), {"default": {"potato": modern}})

# Print the original
print("Dynaconf knows:", settings.POTATO)
assert settings.POTATO == settings.get("potato") == original

# Get it freshly
print("Read it freshly to get changed value...")
print("Changed data:", settings.get_fresh("POTATO"))
assert settings.POTATO == settings.get_fresh("potato") == modern

# Get it again
print("Now read again without the get_fresh method")
print("Still the new value no?", settings.POTATO)
assert settings.POTATO == settings.get("potato") == modern

# Restore it
write(settings.path_for("settings.toml"), {"default": {"potato": original}})


text:
package com.univocity.parsers.common.fields;

import com.univocity.parsers.common.*;

import java.util.*;

/**
 * A FieldSelector capable of deselecting fields by their name in a record.
 *
 *
 This selector stores undesired fields and will return the indexes of those fields that are not part of the selection.
 *
 * @see FieldSelector
 * @see FieldSet
 *
 * @author uniVocity Software Pty Ltd - parsers@univocity.com
 *
 */
public class ExcludeFieldNameSelector extends FieldSet<String> implements FieldSelector {

	/**
	 * Returns the indexes of any that are part of a sequence of headers but not part of the selection.
	 * @param headers the sequence of headers that might have some elements selected by this FieldSelector
	 * @return the positions of all elements which were not selected.
	 */
	@Override
	public int[] getFieldIndexes(String[] headers) {
		headers = ArgumentUtils.normalize(headers);

		// removes duplicates if any
		Set<String> chosenFields = new HashSet<String>(this.get());
		ArgumentUtils.normalize(chosenFields);

		Object[] unknownFields = ArgumentUtils.findMissingElements(headers, chosenFields);
		if (unknownFields.length > 0) {
			throw new IllegalStateException("Unknown field names: " + Arrays.toString(unknownFields));
		}

		int[] out = new int[headers.length - chosenFields.size()];

		int j = 0;
		for (int i = 0; i < headers.length; i++) {
			if (!chosenFields.contains(headers[i])) {
				out[j++] = i;
			}
		}

		return out;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public String describe() {
		return "undesired " + super.describe();
	}
}


text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>Simple Test</title>

  <link rel="stylesheet" type="text/css" href="../jquery.jqplot.css" />
  <link rel="stylesheet" type="text/css" href="examples.css" />

<?php include "nav.inc"; ?>

The following charts demonstrate some options of the EnhancedLegendRendrer. Some of the enhancements are:

Control of number of rows and/or columns.

Clickable swatches and labels to toggle series on/off.

Placement of legend inside or outside of the plot (this has since been added to the default legend functionality).

Ability to hide legend swatches and or labels.

The first plot has legend labels in 3 columns.  They are clickable.

The second chart has legend labels in 2 columns placed outside of the plot.  The showLabels option is false, but the labels are still clickable.

The legend renderer's "seriesToggle" option has been set to 900 to produce a slow, 900 ms fade.  You can set this to a number or to 'fast', 'normal' or 'slow'.

Also, the disableIEFading option is set to false to allow fading on IE (as opposed to simple show/hide).  In IE, series will be toggled with a show()/hide() method by default as opposed to fadeIn()/fadeOut() because of poor performance on some machines.

The third plot has legend labels in 1 row outside and below the chart area.  The showSwatches option is false, but the labels are still clickable.

The fourth chart is a pie plot.  Pie plots use their own legend renderer, since a pie plot is only 1 series.  The pie legend renderer has also been updated to handle custom rows/columns, although it is not clickable.


text:
'''
Culls the unique IDs and Newsgroup listings for
newsgroup, stores them in a dictionary,
then inputs to .csv for analysis.
'''

import mailbox
import csv
from string import whitespace

crosspost = {}

def ngcount(message):
    msg = str(message['Message-ID']).replace("#1/1", "").translate(None, whitespace)
    #collects Message-ID and cleans it up a bit
    ng = str(message['Newsgroups']).translate(None, whitespace).split(',')
    #Alphabetizes list for uniformity. You can omit the
    #next two lines if you want to get the lists "as is."
    ngs = sorted(ng)
    nglist = ';'.join(ngs)
    #Sets ID as key, with Alpha Newsgroups as value
    crosspost[msg] = nglist

def main():
    mbox = mailbox.mbox(raw_input("What is the mailbox you want to work with? (Please include file extension.) "))
    csvf = raw_input("What is the name of the csv file it should output to? ")

    print "Reading file..."

    for message in mbox:
        ngcount(message)

    with open("%s.csv" % csvf, 'wb') as csv_file:
        print "Writing To File..."
        writer = csv.writer(csv_file, delimiter=',', quoting=csv.QUOTE_MINIMAL, quotechar=' ', skipinitialspace=False, escapechar='\\')
        writer.writerow(["Message ID"] + ["Newsgroups"])
        for key, value in crosspost.iteritems():
            #writes row with Message ID and
            #list of Newsgroups, 1 newsgroup per cell
            writer.writerow([key] + [value])
        print "Writing Complete!"

if __name__=="__main__":
    main()


text:
package org.kares.math.frec.core;

import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.Set;

import org.kares.math.frec.util.GenFile;
import org.kares.math.frec.util.RandomHelper;

/**
 * Genetix represents the computation "engine" that
 * manages the whole genetic programming thing performed over
 * FunctionTree instances.
 *
 * This class is an abstract base designed to provide some default
 * genetic algorithm scheme. Concrete implementations are required
 * to implement the initialization and the iteration logic.
 */
public abstract class Genetix implements Runnable {

    /**
     * The (actual) generation (includes the fitness).
     */
    private GenetixFunction[] currentGeneration;

    /**
     * The size of one generation, default is 100.
     */
    private int generationSize = 100;

    /** How many generations have been created so far. */
    private int generationCounter = 0;

    /**
     * How many generations will be created before computing ends, default = 100.
     */
    private int generationLimit = 100;

    private boolean arbitraryMutations = false;
    private boolean arbitraryCrossings = false;

    /**
     * The approximated sample data.
     */
    private double[] dataX, dataY;

    private float mutationProbability = 0.03f;
    private float crossingProbability = 0.90f;

    private long instancesCreated = 0; // UNUSED

    private double bestFitness = -1;

    /** This indicates whether saving is enabled (running in application mode). */
    private boolean isSaving = false;
    private GenFile genFile;

    /**
     * An empty constructor.
     */
    protected Genetix() {
        // NOOP
    }

    /**
     * Get the available genetix implementations.
     * @return Set of {@link Genetix} classes.
     */
    public static Set getGenetixModels() {
        Set genetixClasses = new LinkedHashSet();
        genetixClasses.add(GYModelGenetix.class);
        genetixClasses.add(GPModelGenetix.class);
        genetixClasses.add(GAModelGenetix.class);
        return genetixClasses;
    }

    /**
     * @see GenetixFunction#getFunctionCodeMinLength()
     */
    public static int getMinFunctionLength() {
    	return GenetixFunction.getFunctionCodeMinLength();
    }

    /**
     * Sets the minimal length of functions that will be created.
     * The length here corresponds to Read's code length.
     * @see GenetixFunction#setFunctionCodeMinLength(int)
     */
    public static void setMinFunctionLength(int min_len) {
    	GenetixFunction.setFunctionCodeMinLength(min_len);
    }

    /**
     * @see GenetixFunction#getFunctionCodeMaxLength()
     */
    public static int getMaxFunctionLength() {
    	return GenetixFunction.getFunctionCodeMaxLength();
    }

    /**
     * Sets the maximal length of functions that will be created.
     * The length here corresponds to Read's code length.
     * @see GenetixFunction#setFunctionCodeMaxLength(int)
     */
    public static void setMaxFunctionLength(int max_len) {
        GenetixFunction.setFunctionCodeMaxLength(max_len);
    }

    /**
     * Start the computation.
     * @see #compute()
     * @see #notifyComputed()
     */
    public void run() {
        compute();
        if ( computeStopped() ) computing = null;
        else notifyComputed();
    }

    /**
     * Compute this genetix.
     * Performs initialization {@link #computeInit()} and then
     * iterates to the next generation {@link #computeNext()}.
     * This is repeated until the {@link #getGenerationLimit()}
     * is reached.
     */
    public void compute() {
        computing = Boolean.TRUE;
        computeInit();
        while (generationCounter < generationLimit) {
            if ( computeStopped() ) return;
            if ( isSaving ) saveGeneration();
            computeNext();
            //debugGeneration( System.out );
            generationCounter++;
        }
        computing = null;
    }

    /**
     * Performs the initial computation (initialize the first generation).
     */
    protected abstract void computeInit() ;

    /**
     * Perform the next iteration (a full generation lifecycle).
     */
    protected abstract void computeNext() ;

    private volatile Boolean computing = null;

    private boolean computeStopped() {
        if ( computing == null ) return false;
        return ! computing.booleanValue();
    }

    /**
     * Halt the computation (if it's happening).
     * NOTE: It won't stop immediately but when the current iteration finishes.
     */
    public void stopCompute() {
        computing = Boolean.FALSE;
    }

    /**
     * Generate some "random" population instances.
     * @param size The size of instances to generate.
     * @return The generated functions.
     */
    protected GenetixFunction[] generateFunctions(int size) {
        instancesCreated += size;
        return GenetixFunction.generate(size);
    }

    /**
     * Generate some "random" population instances.
     * @param size The size of instances to generate.
     * @param length The code length of the generated functions.
     * @return The generated functions.
     */
    protected GenetixFunction[] generateFunctions(int size, int length) {
        instancesCreated += size;
        return GenetixFunction.generate(size, length);
    }

    /**
     * Generate some "random" population instances.
     * @param size The size of instances to generate.
     * @param shorter A flag whether "shorter" functions should be preffered.
     * @return The generated functions.
     */
    protected GenetixFunction[] generateFunctions(int size, boolean shorter) {
        instancesCreated += size;
        return GenetixFunction.generate(size, shorter);
    }

    /**
     * Sets the current generation with random functions
     * and computes the fitness values.
     */
    protected void initializeGeneration() {
        setCurrentGeneration( generateFunctions(generationSize) );
        computeFitness();
    }

    /**
     * Sets the current generation with random functions
     * and computes the fitness values.
     * @param length Length of the functions forming the initial generation.
     */
    protected void initializeGeneration(final int length) {
        setCurrentGeneration( generateFunctions(generationSize, length) );
        computeFitness();
    }

    /**
     * Compute the fitness values for the current generation of functions.
     */
    protected void computeFitness() {
        computeFitness( getCurrentGeneration() );
    }

    /**
     * Check for invalid fitness values in the current generation
     * and keep only the valid functions.
     */
    protected void checkFitnessErrors() {
        final GenetixFunction[] currentGeneration = getCurrentGeneration();
        int size = 0;
        int[] index = new int[currentGeneration.length];
        for ( int i=0; i<currentGeneration.length; i++ ) {
            if ( currentGeneration[i].isFitnessValid() ) index[size++] = i;
        }
        if ( size == currentGeneration.length ) return;
        GenetixFunction[] validGeneration = new GenetixFunction[size];
        for (int i=0; i<size; i++) {
            validGeneration[i] = currentGeneration[index[i]];
        }
        setCurrentGeneration( validGeneration );
    }

    /**
     * Performs various function error checks on the current generation.
     * @see GenetixFunction#checkFunction()
     */
    protected void checkPopulationErrors() {
        final GenetixFunction[] currentGeneration = getCurrentGeneration();
        final int[] index = new int[currentGeneration.length];
        int invalidSize = 0;

        for (int i=0; i<currentGeneration.length; i++) {
            final boolean valid = currentGeneration[i].checkFunction();
            if ( ! valid ) {
                index[i] = -1;
                invalidSize++;
            }
        }

        for (int i=0; i<currentGeneration.length; i++) {
            if ( index[i] == -1 ) continue;
            for (int j=i+1; j<currentGeneration.length; j++) {
                if ( index[j] == -1 ) continue;
                if ( currentGeneration[i].equals(currentGeneration[j]) ) {
                    index[j] = -1;
                    invalidSize++;
                }
            }
        }

        if ( invalidSize > 0 ) {
            final int size = currentGeneration.length - invalidSize;
            GenetixFunction[] validGeneration = new GenetixFunction[size];
            int j = 0;
            for (int i=0; i<size; i++) {
                while ( index[j] == -1 ) j++;
                validGeneration[i] = currentGeneration[j++];
            }
            setCurrentGeneration(validGeneration);
        }
    }

    /**
     * This method selects the best functions from the current generation.
     * @param limit The limit of functions to be selected.
     */
    protected void selectBest(int limit) {
        final GenetixFunction[] currentGeneration = getCurrentGeneration();
        if ( currentGeneration.length < limit ) {
            limit = currentGeneration.length;
        }
        if ( limit <= 0 ) return;
        Arrays.sort( currentGeneration );
        GenetixFunction[] selected = new GenetixFunction[limit];
        System.arraycopy(currentGeneration, 0, selected, 0, limit);
        setCurrentGeneration(selected);
        bestFitness = selected[0].getFitness();
    }

    /**
     * Performs mutation on the actual generation.
     * All functions might be mutated, the mutation process is
     * decided using a mutation probability.
     */
    protected void mutateGeneration() {
       for (int i=0; i<currentGeneration.length; i++) {
           final GenetixFunction fx = currentGeneration[i];
           if ( RandomHelper.randomBoolean(mutationProbability) ) {
               if (fx.getFitness() > 3 * bestFitness) {
                   GenetixFunction org = (GenetixFunction) fx.clone();
                   fx.mutateFunction(arbitraryMutations);
                   if ( ! computeFitness(fx) ) currentGeneration[i] = org;
               }
           }
       }
    }

    /**
     * Crosses the functions of the actual generation among each other.
     * The crossing is implemented in a standard fashion - parents do not
     * necessarily make it to the new generation if they were selected to
     * be crossed. This is probably not wise and  concrete implemenations
     * are welcome to define their own crossing scheme.
     */
    protected void crossGeneration() {
        final float prob = getCrossingProbability();
        final GenetixFunction[] currentGeneration = getCurrentGeneration();
        final int len = currentGeneration.length;
        for (int i = 0; i < len; i++) {
            if ( RandomHelper.randomBoolean(prob) ) {
                int rnd = RandomHelper.randomInt(len);
                while (rnd == i) rnd = RandomHelper.randomInt(len);
                GenetixFunction f1 = currentGeneration[i];
                GenetixFunction f2 = currentGeneration[rnd];
                f1.crossFunctions(f2, isArbitraryCrossings());
            }
        }
        setCurrentGeneration(currentGeneration);
    }

    /**
     * NOTE: NOT USED !
     */
    void saveGeneration() {
        if ( true ) return; // TODO saving disabled !
        if (genFile == null) throw new IllegalStateException("no gen file");
        final GenetixFunction[] currentGeneration = getCurrentGeneration();
        for (int i=0; i<currentGeneration.length; i++) {
            genFile.write( currentGeneration[i].getFunctionTree() );
        }
    }

    /**
     * @param outStream
     * NOTE: NOT USED !
     */
    void printGeneration(final PrintWriter outStream) {
        outStream.println("GENERATION " + generationCounter);
        final GenetixFunction[] currentGeneration = getCurrentGeneration();
        for (int i=0; i<currentGeneration.length; i++) {
            outStream.println( currentGeneration[i].formatFunction() );
        }
    }

    /**
     * @param outStream
     * NOTE: NOT USED !
     */
    void printGeneration(final PrintStream outStream) {
        outStream.println("GENERATION " + generationCounter);
        final GenetixFunction[] currentGeneration = getCurrentGeneration();
        for (int i=0; i<currentGeneration.length; i++) {
            outStream.println( currentGeneration[i].formatFunction() );
        }
    }

    /**
     * @param outStream
     * NOTE: NOT USED !
     */
    void debugGeneration(final PrintStream outStream) {
        outStream.println("GENERATION " + generationCounter);
        final GenetixFunction[] currentGeneration = getCurrentGeneration();
        for (int i=0; i<currentGeneration.length; i++) {
            outStream.println( currentGeneration[i] );
        }
    }

    /**
     * This method adds (randomly generated) functions to the current generation.
     * @param limit The size of the functions added to the current generation.
     */
    protected void addNewToGeneration(int limit) {
        if (currentGeneration.length + limit > generationSize) {
            limit = generationSize - currentGeneration.length;
        }
        GenetixFunction[] randomGeneration = generateFunctions(limit, true);
        computeFitness(randomGeneration);

        int len = currentGeneration.length + limit;
        GenetixFunction[] newGeneration = new GenetixFunction[len];
        len = currentGeneration.length;
        System.arraycopy(currentGeneration, 0, newGeneration, 0, len);
        System.arraycopy(randomGeneration, 0, newGeneration, len, limit);
        setCurrentGeneration(newGeneration);
    }

    /**
     * Computes (and sets) the fitness for the given function.
     * @param fx
     * @return Trues if the fitness is valid.
     */
    public strictfp boolean computeFitness(final GenetixFunction fx) {
        // dataY and the funcY values (based on dataX)
        double arithmeticDiff = 0;
        for ( int j=0; j<dataX.length; j++ ) {
            double funcYj = fx.getFunctionValue( dataX[j] );
            if ( Double.isNaN(funcYj) ) {
                arithmeticDiff = Double.NaN;
                break;
            }
            arithmeticDiff += Math.abs(dataY[j] - funcYj);
        }
        return fx.setFitness( arithmeticDiff );
        //return arithmeticDiff;
    }

    /**
     * @see #computeFitness(GenetixFunction)
     */
    public void computeFitness(final GenetixFunction[] fxs) {
        for (int i=0; i<fxs.length; i++) {
            computeFitness(fxs[i]);
        }
    }

    /**
     * @return The current generation.
     */
    public GenetixFunction[] getCurrentGeneration() {
        return this.currentGeneration;
    }

    protected GenetixFunction.Tuple getCurrentGenerationAsTuple() {
        return new GenetixFunction.Tuple(this.currentGeneration);
    }

    protected void setCurrentGeneration(GenetixFunction[] gen) {
        this.currentGeneration = gen;
    }

    protected void setCurrentGeneration(GenetixFunction.Tuple tuple) {
        this.currentGeneration = tuple.snapshot();
    }

    /**
     * Sets the training data. The training data represent
     * the aproximated function.
     *
     * @param dataX The x (real) values of the training data.
     * @param dataY The y values (f(x) values) of the training data.
     */
    public void setApproximatingData(double[] dataX, double[] dataY) {
        if (dataX == null) dataX = new double[0];
        if (dataY == null) dataY = new double[0];
        final int len = dataX.length;
        if (len != dataY.length) {
            throw new IllegalArgumentException(
                    "dataX.length (" + dataX.length + ") != " +
                    "dataY.length (" + dataY.length + ")");
        }
        double[] _dataX = new double[len];
        double[] _dataY = new double[len];
        for (int i=0; i<len; i++) {
            _dataX[i] = dataX[i];
            _dataY[i] = dataY[i];
        }
        this.dataX = _dataX;
        this.dataY = _dataY;
    }

    /**
     * @see #setApproximatingData(double[], double[])
     */
    public void setApproximatingData(float[] dataX, float[] dataY) {
        if (dataX == null) dataX = new float[0];
        if (dataY == null) dataY = new float[0];
        final int len = dataX.length;
        if (len != dataY.length) {
            throw new IllegalArgumentException(
                    "dataX.length (" + dataX.length + ") != " +
                    "dataY.length (" + dataY.length + ")");
        }
        double[] _dataX = new double[len];
        double[] _dataY = new double[len];
        for (int i=0; i<len; i++) {
            _dataX[i] = dataX[i];
            _dataY[i] = dataY[i];
        }
        this.dataX = _dataX;
        this.dataY = _dataY;
    }

    /**
     * @return The x values of the training data.
     */
    public double[] getApproximatingDataX() {
        return dataX;
    }

    /**
     * @return The f(x) values of the training data.
     */
    public double[] getApproximatingDataY() {
        return dataY;
    }

    /**
     * Returns the current value of the generation counter.
     */
    public int getGenerationCounter() {
        return generationCounter;
    }

    /**
     * Resets the generation counter to zero.
     */
    public void resetGenerationCounter() {
        generationCounter = 0;
    }

    /**
     * Returns the current size of the generation.
     */
    public int getGenerationSize() {
        return generationSize;
    }

    /**
     * Sets the size of the generation.
     */
    public void setGenerationSize(int size) {
        this.generationSize = size;
    }

    /**
     * @return The generation limit
     * (how many generations should the genetic iteration create).
     */
    public int getGenerationLimit() {
        return generationLimit;
    }

    /**
     * Sets the generation limit
     * (how many generations should the genetic iteration create).
     */
    public void setGenerationLimit(int max) {
        this.generationLimit = max;
    }

    /**
     * Returns the mutation probability.
     */
    public float getMutationProbability() {
        return mutationProbability;
    }

    /**
     * Sets the mutation probability.
     */
    public void setMutationProbability(float prob) {
        this.mutationProbability = prob;
    }

    /**
     * Returns the crossing probability.
     */
    public float getCrossingProbability() {
        return crossingProbability;
    }

    /**
     * Sets the crossing probability.
     */
    public void setCrossingProbability(float prob) {
        this.crossingProbability = prob;
    }

    public boolean isArbitraryMutations() {
        return this.arbitraryMutations;
    }

    public void setArbitraryMutations(boolean flag) {
        this.arbitraryMutations = flag;
    }

    public boolean isArbitraryCrossings() {
        return this.arbitraryCrossings;
    }

    public void setArbitraryCrossings(boolean flag) {
        this.arbitraryCrossings = flag;
    }

    public void setSavingMode(boolean mode) {
        isSaving = mode;
        //if (isSaving && genFile==null) genFile = new GenFile();
    }

    private ComputedCallback computedCallback;

    /**
     * Notify computed.
     */
    protected void notifyComputed() {
        if ( computedCallback != null ) computedCallback.onComputed();
    }

    /**
     * Set a notifications callback to be invoked when computation ends.
     * @param computedCallback
     */
    public void setComputedCallback(ComputedCallback computedCallback) {
        this.computedCallback = computedCallback;
    }

    public static interface ComputedCallback {
        void onComputed();
    }

    /**
     * Returns the best functions of the last generation.
     * Should be considered as the computation result.
     *
     * @param size The size of the array to be returned.
     */
    public GenetixFunction[] getBestFunctions(int size) {
        //selectBest(size);
        if (currentGeneration.length < size) size = currentGeneration.length;
        Arrays.sort(currentGeneration);
        final GenetixFunction[] bestFunctions = new GenetixFunction[size];
        for (int i=0; i<size; i++) {
            bestFunctions[i] = currentGeneration[i];
        }
        return bestFunctions;
    }

    /**
     * @see #getBestFunctions(int)
     * @see GenetixFunction#formatFunction()
     */
    public String[] getBestFunctionsFormatted(int size) {
        final GenetixFunction[] bestFunctions = getBestFunctions(size);
        final String[] formatted = new String[bestFunctions.length];
        for (int i=0; i<size; i++) {
            formatted[i] = bestFunctions[i].formatFunction();
        }
        return formatted;
    }

    /**
     * @return The best fitness there is in the current generation.
     */
    public double getBestFitness() {
        if ( bestFitness < 0 ) {
            throw new IllegalStateException("not available");
        }
        return bestFitness;
    }

    /**
     * Method used to get a statistical report over the total instances created.
     * @return the instance counter
     */
    /*
    public long getFunctionsCreated() {
        return instancesCreated;
    }
	*/

}


text:
package org.apache.camel.model.dataformat;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import org.apache.camel.CamelContext;
import org.apache.camel.model.DataFormatDefinition;
import org.apache.camel.spi.DataFormat;
import org.apache.camel.spi.Label;

/**
 * Represents a avro DataFormat {@link org.apache.camel.spi.DataFormat}
 *
 * @version
 */
@Label("dataformat,transformation")
@XmlRootElement(name = "avro")
@XmlAccessorType(XmlAccessType.FIELD)
public class AvroDataFormat extends DataFormatDefinition {
    @XmlAttribute
    private String instanceClassName;
    @XmlTransient
    private Object schema;

    public AvroDataFormat() {
        super("avro");
    }

    public AvroDataFormat(String instanceClassName) {
        this();
        setInstanceClassName(instanceClassName);
    }

    public String getInstanceClassName() {
        return instanceClassName;
    }

    public void setInstanceClassName(String instanceClassName) {
        this.instanceClassName = instanceClassName;
    }

    public Object getSchema() {
        return schema;
    }

    public void setSchema(Object schema) {
        this.schema = schema;
    }

    @Override
    protected void configureDataFormat(DataFormat dataFormat, CamelContext camelContext) {
        if (this.instanceClassName != null) {
            setProperty(camelContext, dataFormat, "instanceClass", instanceClassName);
        }
        if (this.schema != null) {
            setProperty(camelContext, dataFormat, "schema", schema);
        }
    }
}


text:
using CodedSelenium.Selectors;

namespace CodedSelenium.HtmlControls
{
    public class HtmlTextControl : HtmlControl
    {
        protected HtmlTextControl()
            : base()
        {
        }

        protected HtmlTextControl(UITestControl parent)
          : base(parent)
        {
            RulesDictionary.Add(HtmlTextArea.PropertyNames.LabeledBy, ByLabeledBy);
        }

        public string Text
        {
            get
            {
                return GetAttribute(HtmlTextArea.PropertyNames.ValueAttribute);
            }

            set
            {
                WebElement.Clear();
                WebElement.SendKeys(value);

                Wait.Until((d) => { return this.Text == value; });
            }
        }

        public virtual string LabeledBy
        {
            get
            {
                return GetAttribute(HtmlTextArea.PropertyNames.LabeledBy);
            }
        }

        public virtual bool ReadOnly
        {
            get
            {
                return GetAttribute(HtmlTextArea.PropertyNames.ReadOnly).Equals(HtmlTextArea.PropertyNames.ReadOnly);
            }
        }

        private SelectorPart ByLabeledBy(PropertyExpression propertyExpression)
        {
            if (propertyExpression.PropertyOperator == PropertyExpressionOperator.Contains)
            {
                string selector = string.Format(".prev(\"label:contains({0})\").next(\"textarea\")", propertyExpression.PropertyValue);
                return new SelectorPart(selector, SelectorPart.FilterType.Method);
            }
            else
            {
                string selector = string.Format(
                    ".prev().filter(function() {{ return $(this).text() === \"{0}\";}}).next(\"textarea\")",
                    propertyExpression.PropertyValue);
                return new SelectorPart(selector, SelectorPart.FilterType.Method);
            }
        }

        public abstract new class PropertyNames : HtmlControl.PropertyNames
        {
            public static readonly string Text = HtmlControl.PropertyNames.InnerText;
            public static readonly string LabeledBy = "labeledby";
            public static readonly string ReadOnly = "readonly";
        }
    }
}


text:
<?php include "templates/include/header.php" ?>

Welcome to Admin Panel

You are logged in as <?php echo htmlspecialchars( $_SESSION['username']) ?>. Log out

All Events and News

<?php if ( isset( $results['errorMessage'] ) ) { ?>

<?php echo $results['errorMessage'] ?>

<?php } ?>

<?php if ( isset( $results['statusMessage'] ) ) { ?>

<?php echo $results['statusMessage'] ?>

<?php } ?>

Date

Event / News

<?php foreach ( $results['articles'] as $article ) { ?>

<?php echo date('Y-m-d', $article->publicationDate)?>

<a href="admin.php?action=editArticle&articleId=<?php echo $article->id?>"><?php echo $article->title?>

<?php } ?>

<?php echo $results['totalRows']?> article<?php echo ( $results['totalRows'] != 1 ) ? 's' : '' ?> in total.

Add a New Event / News

<?php include "templates/include/footer.php" ?>


text:
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/file_system/file_system_url_loader_factory.h"

#include <algorithm>
#include <map>
#include <memory>
#include <utility>
#include <vector>

#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/string_piece.h"
#include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
#include "build/build_config.h"
#include "components/services/filesystem/public/mojom/types.mojom.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/child_process_host.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/data_pipe_producer.h"
#include "mojo/public/cpp/system/string_data_source.h"
#include "net/base/completion_repeating_callback.h"
#include "net/base/directory_listing.h"
#include "net/base/io_buffer.h"
#include "net/base/mime_sniffer.h"
#include "net/base/mime_util.h"
#include "net/http/http_byte_range.h"
#include "net/http/http_util.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/self_deleting_url_loader_factory.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "storage/browser/file_system/file_stream_reader.h"
#include "storage/browser/file_system/file_system_context.h"
#include "storage/browser/file_system/file_system_operation_runner.h"
#include "storage/browser/file_system/file_system_request_info.h"
#include "storage/browser/file_system/file_system_url.h"
#include "storage/common/file_system/file_system_util.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "url/gurl.h"
#include "url/origin.h"

using filesystem::mojom::DirectoryEntry;
using storage::FileStreamReader;
using storage::FileSystemContext;
using storage::FileSystemOperation;
using storage::FileSystemURL;
using storage::VirtualPath;

namespace content {
namespace {

struct FactoryParams {
  int render_process_host_id;
  int frame_tree_node_id;
  scoped_refptr<FileSystemContext> file_system_context;
  std::string storage_domain;
  blink::StorageKey storage_key;
};

constexpr size_t kDefaultFileSystemUrlPipeSize = 65536;

// Implementation sniffs the first file chunk to determine the mime-type.
static_assert(kDefaultFileSystemUrlPipeSize >= net::kMaxBytesToSniff,
              "Default file data pipe size must be at least as large as a "
              "MIME-type sniffing buffer.");

scoped_refptr<net::HttpResponseHeaders> CreateHttpResponseHeaders(
    int response_code) {
  std::string raw_headers;
  raw_headers.append(base::StringPrintf("HTTP/1.1 %d OK", response_code));

  // Tell WebKit never to cache this content.
  raw_headers.append(1, '\0');
  raw_headers.append(net::HttpRequestHeaders::kCacheControl);
  raw_headers.append(": no-cache");

  raw_headers.append(2, '\0');
  return base::MakeRefCounted<net::HttpResponseHeaders>(raw_headers);
}

bool GetMimeType(const FileSystemURL& url, std::string* mime_type) {
  DCHECK(url.is_valid());
  base::FilePath::StringType extension = url.path().Extension();
  if (!extension.empty())
    extension = extension.substr(1);
  return net::GetWellKnownMimeTypeFromExtension(extension, mime_type);
}

// Common implementation shared between the file and directory URLLoaders.
class FileSystemEntryURLLoader
    : public network::mojom::URLLoader,
      public base::SupportsWeakPtr<FileSystemEntryURLLoader> {
 public:
  explicit FileSystemEntryURLLoader(FactoryParams params)
      : params_(std::move(params)) {}

  FileSystemEntryURLLoader(const FileSystemEntryURLLoader&) = delete;
  FileSystemEntryURLLoader& operator=(const FileSystemEntryURLLoader&) = delete;

  // network::mojom::URLLoader:
  void FollowRedirect(
      const std::vector<std::string>& removed_headers,
      const net::HttpRequestHeaders& modified_headers,
      const net::HttpRequestHeaders& modified_cors_exempt_headers,
      const absl::optional<GURL>& new_url) override {}
  void SetPriority(net::RequestPriority priority,
                   int32_t intra_priority_value) override {}
  void PauseReadingBodyFromNet() override {}
  void ResumeReadingBodyFromNet() override {}

 protected:
  virtual void FileSystemIsMounted() = 0;

  void Start(const network::ResourceRequest& request,
             mojo::PendingReceiver<network::mojom::URLLoader> loader,
             mojo::PendingRemote<network::mojom::URLLoaderClient> client_remote,
             scoped_refptr<base::SequencedTaskRunner> io_task_runner) {
    io_task_runner->PostTask(
        FROM_HERE,
        base::BindOnce(&FileSystemEntryURLLoader::StartOnIOThread, AsWeakPtr(),
                       request, std::move(loader), std::move(client_remote)));
  }

  void MaybeDeleteSelf() {
    if (!receiver_.is_bound() && !client_.is_bound())
      delete this;
  }

  void OnClientComplete(network::URLLoaderCompletionStatus status) {
    client_->OnComplete(status);
    client_.reset();
    MaybeDeleteSelf();
  }

  void OnClientComplete(base::File::Error file_error) {
    OnClientComplete(net::FileErrorToNetError(file_error));
  }

  void OnClientComplete(net::Error net_error) {
    OnClientComplete(network::URLLoaderCompletionStatus(net_error));
  }

  mojo::Receiver<network::mojom::URLLoader> receiver_{this};
  mojo::Remote<network::mojom::URLLoaderClient> client_;
  FactoryParams params_;
  std::unique_ptr<mojo::DataPipeProducer> data_producer_;
  net::HttpByteRange byte_range_;
  FileSystemURL url_;

 private:
  void StartOnIOThread(
      const network::ResourceRequest& request,
      mojo::PendingReceiver<network::mojom::URLLoader> loader,
      mojo::PendingRemote<network::mojom::URLLoaderClient> client_remote) {
    receiver_.Bind(std::move(loader));
    receiver_.set_disconnect_handler(base::BindOnce(
        &FileSystemEntryURLLoader::OnMojoDisconnect, base::Unretained(this)));

    client_.Bind(std::move(client_remote));

    if (!request.url.is_valid()) {
      OnClientComplete(net::ERR_INVALID_URL);
      return;
    }

    // If the requested URL is not commitable in the current process, block the
    // request.  This prevents one origin from fetching filesystem: resources
    // belonging to another origin, see https://crbug.com/964245.
    if (params_.render_process_host_id != ChildProcessHost::kInvalidUniqueID &&
        !ChildProcessSecurityPolicyImpl::GetInstance()->CanCommitURL(
            params_.render_process_host_id, request.url)) {
      DVLOG(1) << "Denied unauthorized request for "
               << request.url.possibly_invalid_spec();
      OnClientComplete(net::ERR_INVALID_URL);
      return;
    }

    std::string range_header;
    if (request.headers.GetHeader(net::HttpRequestHeaders::kRange,
                                  &range_header)) {
      std::vector<net::HttpByteRange> ranges;
      if (net::HttpUtil::ParseRangeHeader(range_header, &ranges)) {
        if (ranges.size() == 1) {
          byte_range_ = ranges[0];
        } else {
          // We don't support multiple range requests in one single URL request.
          // TODO(adamk): decide whether we want to support multiple range
          // requests.
          OnClientComplete(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE);
          return;
        }
      }
    }
    url_ =
        params_.file_system_context->CrackURL(request.url, params_.storage_key);
    if (!url_.is_valid()) {
      const storage::FileSystemRequestInfo request_info = {
          request.url, params_.storage_domain, params_.frame_tree_node_id,
          params_.storage_key};
      params_.file_system_context->AttemptAutoMountForURLRequest(
          request_info,
          base::BindOnce(&FileSystemEntryURLLoader::DidAttemptAutoMount,
                         AsWeakPtr(), request));
      return;
    }
    FileSystemIsMounted();
  }

  void DidAttemptAutoMount(const network::ResourceRequest& request,
                           base::File::Error result) {
    if (result != base::File::Error::FILE_OK) {
      OnClientComplete(result);
      return;
    }
    url_ =
        params_.file_system_context->CrackURL(request.url, params_.storage_key);
    if (!url_.is_valid()) {
      OnClientComplete(net::ERR_FILE_NOT_FOUND);
      return;
    }
    FileSystemIsMounted();
  }

  void OnMojoDisconnect() {
    receiver_.reset();
    MaybeDeleteSelf();
  }
};

class FileSystemDirectoryURLLoader : public FileSystemEntryURLLoader {
 public:
  static void CreateAndStart(
      const network::ResourceRequest& request,
      mojo::PendingReceiver<network::mojom::URLLoader> loader,
      mojo::PendingRemote<network::mojom::URLLoaderClient> client_remote,
      FactoryParams params,
      scoped_refptr<base::SequencedTaskRunner> io_task_runner) {
    // Owns itself. Will live as long as its URLLoader and URLLoaderClient
    // bindings are alive - essentially until either the client gives up or all
    // file directory has been sent to it.
    auto* filesystem_loader =
        new FileSystemDirectoryURLLoader(std::move(params));
    filesystem_loader->Start(request, std::move(loader),
                             std::move(client_remote), io_task_runner);
  }

  FileSystemDirectoryURLLoader(const FileSystemDirectoryURLLoader&) = delete;
  FileSystemDirectoryURLLoader& operator=(const FileSystemDirectoryURLLoader&) =
      delete;

 private:
  explicit FileSystemDirectoryURLLoader(FactoryParams params)
      : FileSystemEntryURLLoader(params) {}

  void FileSystemIsMounted() override {
    DCHECK(url_.is_valid());
    if (!params_.file_system_context->CanServeURLRequest(url_)) {
      // In incognito mode the API is not usable and there should be no data.
      if (VirtualPath::IsRootPath(url_.virtual_path())) {
        // Return an empty directory if the filesystem root is queried.
        DidReadDirectory(base::File::FILE_OK, std::vector<DirectoryEntry>(),
                         /*has_more=*/false);
        return;
      }
      // In incognito mode the API is not usable and there should be no data.
      OnClientComplete(net::ERR_FILE_NOT_FOUND);
      return;
    }
    params_.file_system_context->operation_runner()->ReadDirectory(
        url_,
        base::BindRepeating(&FileSystemDirectoryURLLoader::DidReadDirectory,
                            base::AsWeakPtr(this)));
  }

  void DidReadDirectory(base::File::Error result,
                        std::vector<DirectoryEntry> entries,
                        bool has_more) {
    if (result != base::File::FILE_OK) {
      net::Error rv = net::ERR_FILE_NOT_FOUND;
      if (result == base::File::FILE_ERROR_INVALID_URL)
        rv = net::ERR_INVALID_URL;
      OnClientComplete(rv);
      return;
    }

    if (data_.empty()) {
      base::FilePath relative_path = url_.path();
#if BUILDFLAG(IS_POSIX)
      relative_path =
          base::FilePath(FILE_PATH_LITERAL("/") + relative_path.value());
#endif
      const std::u16string& title = relative_path.LossyDisplayName();
      data_.append(net::GetDirectoryListingHeader(title));
    }

    entries_.insert(entries_.end(), entries.begin(), entries.end());

    if (!has_more) {
      if (entries_.size())
        GetMetadata(/*index=*/0);
      else
        WriteDirectoryData();
    }
  }

  void GetMetadata(size_t index) {
    const DirectoryEntry& entry = entries_[index];
    const FileSystemURL entry_url =
        params_.file_system_context->CreateCrackedFileSystemURL(
            url_.storage_key(), url_.type(),
            url_.path().Append(base::FilePath(entry.name)));
    DCHECK(entry_url.is_valid());
    params_.file_system_context->operation_runner()->GetMetadata(
        entry_url,
        FileSystemOperation::GET_METADATA_FIELD_SIZE |
            FileSystemOperation::GET_METADATA_FIELD_LAST_MODIFIED,
        base::BindOnce(&FileSystemDirectoryURLLoader::DidGetMetadata,
                       base::AsWeakPtr(this), index));
  }

  void DidGetMetadata(size_t index,
                      base::File::Error result,
                      const base::File::Info& file_info) {
    if (result != base::File::FILE_OK) {
      OnClientComplete(result);
      return;
    }

    const DirectoryEntry& entry = entries_[index];
    const std::u16string& name = base::FilePath(entry.name).LossyDisplayName();
    data_.append(net::GetDirectoryListingEntry(
        name, std::string(),
        entry.type == filesystem::mojom::FsFileType::DIRECTORY, file_info.size,
        file_info.last_modified));

    if (index < entries_.size() - 1)
      GetMetadata(index + 1);
    else
      WriteDirectoryData();
  }

  void WriteDirectoryData() {
    MojoCreateDataPipeOptions options;
    options.struct_size = sizeof(MojoCreateDataPipeOptions);
    options.flags = MOJO_CREATE_DATA_PIPE_FLAG_NONE;
    options.element_num_bytes = 1;
    options.capacity_num_bytes = kDefaultFileSystemUrlPipeSize;

    mojo::ScopedDataPipeProducerHandle producer_handle;
    mojo::ScopedDataPipeConsumerHandle consumer_handle;
    MojoResult rv =
        mojo::CreateDataPipe(&options, producer_handle, consumer_handle);
    if (rv != MOJO_RESULT_OK) {
      OnClientComplete(net::ERR_FAILED);
      return;
    }

    auto head = network::mojom::URLResponseHead::New();
    head->mime_type = "text/html";
    head->charset = "utf-8";
    head->content_length = data_.size();
    head->headers = CreateHttpResponseHeaders(200);

    client_->OnReceiveResponse(std::move(head), std::move(consumer_handle),
                               absl::nullopt);

    data_producer_ =
        std::make_unique<mojo::DataPipeProducer>(std::move(producer_handle));

    data_producer_->Write(
        std::make_unique<mojo::StringDataSource>(
            base::StringPiece(data_), mojo::StringDataSource::AsyncWritingMode::
                                          STRING_STAYS_VALID_UNTIL_COMPLETION),
        base::BindOnce(&FileSystemDirectoryURLLoader::OnDirectoryWritten,
                       base::Unretained(this)));
  }

  void OnDirectoryWritten(MojoResult result) {
    // All the data has been written now. Close the data pipe. The consumer will
    // be notified that there will be no more data to read from now.
    data_producer_.reset();
    directory_data_ = nullptr;
    entries_.clear();
    data_.clear();

    OnClientComplete(result == MOJO_RESULT_OK ? net::OK : net::ERR_FAILED);
  }

  std::string data_;
  std::vector<DirectoryEntry> entries_;
  scoped_refptr<net::IOBuffer> directory_data_;
};

class FileSystemFileURLLoader : public FileSystemEntryURLLoader {
 public:
  static void CreateAndStart(
      const network::ResourceRequest& request,
      mojo::PendingReceiver<network::mojom::URLLoader> loader,
      mojo::PendingRemote<network::mojom::URLLoaderClient> client_remote,
      FactoryParams params,
      scoped_refptr<base::SequencedTaskRunner> io_task_runner) {
    // Owns itself. Will live as long as its URLLoader and URLLoaderClient
    // bindings are alive - essentially until either the client gives up or all
    // file data has been sent to it.
    auto* filesystem_loader =
        new FileSystemFileURLLoader(std::move(params), request, io_task_runner);

    filesystem_loader->Start(request, std::move(loader),
                             std::move(client_remote), io_task_runner);
  }

  FileSystemFileURLLoader(const FileSystemFileURLLoader&) = delete;
  FileSystemFileURLLoader& operator=(const FileSystemFileURLLoader&) = delete;

 private:
  FileSystemFileURLLoader(
      FactoryParams params,
      const network::ResourceRequest& request,
      scoped_refptr<base::SequencedTaskRunner> io_task_runner)
      : FileSystemEntryURLLoader(std::move(params)),
        original_request_(request),
        io_task_runner_(io_task_runner) {}

  void FileSystemIsMounted() override {
    DCHECK(url_.is_valid());
    if (!params_.file_system_context->CanServeURLRequest(url_)) {
      // In incognito mode the API is not usable and there should be no data.
      OnClientComplete(net::ERR_FILE_NOT_FOUND);
      return;
    }
    params_.file_system_context->operation_runner()->GetMetadata(
        url_,
        FileSystemOperation::GET_METADATA_FIELD_IS_DIRECTORY |
            FileSystemOperation::GET_METADATA_FIELD_SIZE,
        base::BindOnce(&FileSystemFileURLLoader::DidGetMetadata,
                       base::AsWeakPtr(this)));
  }

  void DidGetMetadata(base::File::Error error_code,
                      const base::File::Info& file_info) {
    if (error_code != base::File::FILE_OK) {
      OnClientComplete(error_code == base::File::FILE_ERROR_INVALID_URL
                           ? net::ERR_INVALID_URL
                           : net::ERR_FILE_NOT_FOUND);
      return;
    }

    if (!byte_range_.ComputeBounds(file_info.size)) {
      OnClientComplete(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE);
      return;
    }

    if (file_info.is_directory) {
      // Redirect to the directory URLLoader.
      GURL::Replacements replacements;
      std::string new_path = original_request_.url.path();
      new_path.push_back('/');
      replacements.SetPathStr(new_path);
      const GURL directory_url =
          original_request_.url.ReplaceComponents(replacements);

      net::RedirectInfo redirect_info;
      redirect_info.new_method = "GET";
      redirect_info.status_code = 301;
      head_->headers = CreateHttpResponseHeaders(redirect_info.status_code);
      redirect_info.new_url =
          original_request_.url.ReplaceComponents(replacements);
      head_->encoded_data_length = 0;
      client_->OnReceiveRedirect(redirect_info, std::move(head_));
      return;
    }

    remaining_bytes_ = byte_range_.last_byte_position() -
                       byte_range_.first_byte_position() + 1;
    DCHECK_GE(remaining_bytes_, 0);

    DCHECK(!reader_.get());
    reader_ = params_.file_system_context->CreateFileStreamReader(
        url_, byte_range_.first_byte_position(), remaining_bytes_,
        base::Time());

    MojoCreateDataPipeOptions options;
    options.struct_size = sizeof(MojoCreateDataPipeOptions);
    options.flags = MOJO_CREATE_DATA_PIPE_FLAG_NONE;
    options.element_num_bytes = 1;
    options.capacity_num_bytes = kDefaultFileSystemUrlPipeSize;

    mojo::ScopedDataPipeProducerHandle producer_handle;
    MojoResult rv =
        mojo::CreateDataPipe(&options, producer_handle, consumer_handle_);
    if (rv != MOJO_RESULT_OK) {
      OnClientComplete(net::ERR_FAILED);
      return;
    }

    head_->mime_type = "text/html";  // Will sniff file and possibly override.
    head_->charset = "utf-8";
    head_->content_length = remaining_bytes_;
    head_->headers = CreateHttpResponseHeaders(200);

    data_producer_ =
        std::make_unique<mojo::DataPipeProducer>(std::move(producer_handle));

    size_t bytes_to_read = std::min(
        static_cast<int64_t>(kDefaultFileSystemUrlPipeSize), remaining_bytes_);
    file_data_ = base::MakeRefCounted<net::IOBuffer>(bytes_to_read);
    ReadMoreFileData();
  }

  void ReadMoreFileData() {
    if (remaining_bytes_ == 0) {
      if (consumer_handle_.is_valid()) {
        // This was an empty file; make sure to call OnReceiveResponse
        // regardless.
        client_->OnReceiveResponse(std::move(head_),
                                   std::move(consumer_handle_), absl::nullopt);
      }
      OnFileWritten(net::OK);
      return;
    }
    const int64_t bytes_to_read = std::min(
        static_cast<int64_t>(kDefaultFileSystemUrlPipeSize), remaining_bytes_);
    net::CompletionRepeatingCallback read_callback = base::BindRepeating(
        &FileSystemFileURLLoader::DidReadMoreFileData, base::AsWeakPtr(this));
    const int rv =
        reader_->Read(file_data_.get(), bytes_to_read, read_callback);
    if (rv == net::ERR_IO_PENDING) {
      // async callback will be called.
      return;
    }
    std::move(read_callback).Run(rv);
  }

  void DidReadMoreFileData(int result) {
    if (result < 0) {
      OnFileWritten(static_cast<net::Error>(result));
      return;
    }
    if (result == 0) {
      // If `remaining_bytes_` is 0, then we should've called OnFileWritten in
      // ReadMoreFileData.
      DCHECK_NE(remaining_bytes_, 0);
      OnFileWritten(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE);
      return;
    }

    if (consumer_handle_.is_valid()) {
      if (byte_range_.first_byte_position() == 0) {
        // Only sniff for mime-type in the first block of the file.
        std::string type_hint;
        GetMimeType(url_, &type_hint);
        SniffMimeType(base::StringPiece(file_data_->data(), result),
                      url_.ToGURL(), type_hint,
                      net::ForceSniffFileUrlsForHtml::kDisabled,
                      &head_->mime_type);
        head_->did_mime_sniff = true;
      }

      client_->OnReceiveResponse(std::move(head_), std::move(consumer_handle_),
                                 absl::nullopt);
    }
    remaining_bytes_ -= result;
    DCHECK_GE(remaining_bytes_, 0);

    WriteFileData(result);
  }

  void WriteFileData(int bytes_read) {
    data_producer_->Write(
        std::make_unique<mojo::StringDataSource>(
            base::StringPiece(file_data_->data(), bytes_read),
            mojo::StringDataSource::AsyncWritingMode::
                STRING_STAYS_VALID_UNTIL_COMPLETION),
        base::BindOnce(&FileSystemFileURLLoader::OnFileDataWritten,
                       base::AsWeakPtr(this)));
  }

  void OnFileDataWritten(MojoResult result) {
    if (result != MOJO_RESULT_OK) {
      OnFileWritten(net::ERR_FAILED);
      return;
    }
    ReadMoreFileData();
  }

  void OnFileWritten(net::Error net_error) {
    // All the data has been written now. Close the data pipe. The consumer will
    // be notified that there will be no more data to read from now.
    data_producer_.reset();
    file_data_ = nullptr;

    OnClientComplete(net_error);
  }

  int64_t remaining_bytes_ = 0;
  mojo::ScopedDataPipeConsumerHandle consumer_handle_;
  std::unique_ptr<FileStreamReader> reader_;
  scoped_refptr<net::IOBuffer> file_data_;
  network::mojom::URLResponseHeadPtr head_ =
      network::mojom::URLResponseHead::New();
  const network::ResourceRequest original_request_;
  scoped_refptr<base::SequencedTaskRunner> io_task_runner_;
};

// A URLLoaderFactory used for the filesystem:// scheme used when the Network
// Service is enabled.
class FileSystemURLLoaderFactory
    : public network::SelfDeletingURLLoaderFactory {
 public:
  FileSystemURLLoaderFactory(
      FactoryParams params,
      scoped_refptr<base::SequencedTaskRunner> io_task_runner,
      mojo::PendingReceiver<network::mojom::URLLoaderFactory> factory_receiver)
      : network::SelfDeletingURLLoaderFactory(std::move(factory_receiver)),
        params_(std::move(params)),
        io_task_runner_(io_task_runner) {}

  FileSystemURLLoaderFactory(const FileSystemURLLoaderFactory&) = delete;
  FileSystemURLLoaderFactory& operator=(const FileSystemURLLoaderFactory&) =
      delete;

  ~FileSystemURLLoaderFactory() override = default;

 private:
  void CreateLoaderAndStart(
      mojo::PendingReceiver<network::mojom::URLLoader> loader,
      int32_t request_id,
      uint32_t options,
      const network::ResourceRequest& request,
      mojo::PendingRemote<network::mojom::URLLoaderClient> client,
      const net::MutableNetworkTrafficAnnotationTag& traffic_annotation)
      override {
    DVLOG(1) << "CreateLoaderAndStart: " << request.url;

    const std::string path = request.url.path();

    // If the path ends with a /, we know it's a directory. If the path refers
    // to a directory and gets dispatched to FileSystemFileURLLoader, that class
    // will redirect to FileSystemDirectoryURLLoader.
    if (!path.empty() && path.back() == '/') {
      FileSystemDirectoryURLLoader::CreateAndStart(request, std::move(loader),
                                                   std::move(client), params_,
                                                   io_task_runner_);
      return;
    }

    FileSystemFileURLLoader::CreateAndStart(request, std::move(loader),
                                            std::move(client), params_,
                                            io_task_runner_);
  }

  const FactoryParams params_;
  scoped_refptr<base::SequencedTaskRunner> io_task_runner_;
};

}  // anonymous namespace

mojo::PendingRemote<network::mojom::URLLoaderFactory>
CreateFileSystemURLLoaderFactory(
    int render_process_host_id,
    int frame_tree_node_id,
    scoped_refptr<FileSystemContext> file_system_context,
    const std::string& storage_domain,
    const blink::StorageKey& storage_key) {
  mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_remote;
  FactoryParams params = {render_process_host_id, frame_tree_node_id,
                          file_system_context, storage_domain, storage_key};

  // The FileSystemURLLoaderFactory will delete itself when there are no more
  // receivers - see the network::SelfDeletingURLLoaderFactory::OnDisconnect
  // method.
  new FileSystemURLLoaderFactory(
      std::move(params), GetIOThreadTaskRunner({}),
      pending_remote.InitWithNewPipeAndPassReceiver());

  return pending_remote;
}

}  // namespace content


text:
package com.meltmedia.cadmium.cli;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;

/**
 * Creates branches in git.
 *
 *
 * @author John McEntire
 * @author Brian Barr
 *
 */
@Parameters(commandDescription = "Sets up new branches with a command given basename.", separators="=")
public class NewBranchCommand implements CliCommand {
  private final Logger log = LoggerFactory.getLogger(getClass());

  @Parameter(names={"--repo","-r"}, description="Repository URI", required=true)
  private String repo;

  @Parameter(names={"--empty","-e"}, description="Create empty branches.")
  private boolean empty = false;

  @Parameter(description="<newBranchName>", required=true)
  private List<String> basename;

  public void execute() throws Exception {
    BranchCreator creator = new BranchCreator(repo);
    try {
      for(String name : basename) {
        creator.createNewBranches(name, empty, log);
      }
    } finally {
      creator.closeAndRemoveLocal();
    }
  }

  @Override
  public String getCommandName() {
    return "branch";
  }

}


text:
/**
 *
 */
package org.devgateway.ocds.persistence.mongo.flags.preconditions;

/**
 * @author mpostelnicu
 *
 */
public final class VietnamFlaggedReleasePredicates {

    private VietnamFlaggedReleasePredicates() {

    }

}


text:
from unittest import TestCase

from sdiff.compare import diff_links, diff_struct
from sdiff.model import List
from .fixtures import trees

class TestLinks(TestCase):

    def test_no_links(self):
        _, _, actual = diff_links(trees.pt(), trees.pt())
        self.assertEqual([], actual)

    def test_equal_links(self):
        _, _, actual = diff_links(trees.pa(), trees.pa())
        self.assertEqual([], actual)

    def test_not_equal_links(self):
        _, _, actual = diff_links(trees.pa(), trees.paa())
        self.assertEqual('dummy link 2', actual[0].node.text)

class TestEqual(TestCase):

    def test_single_header(self):
        _, _, errors = diff_struct(trees.r2t(), trees.r2t())
        self.assertEqual([], errors)

    def test_single_paragraph(self):
        _, _, errors = diff_struct(trees.pt(), trees.pt())
        self.assertEqual([], errors)

    def test_link_in_paragraph(self):
        _, _, errors = diff_struct(trees.ptat(), trees.ptat())
        self.assertEqual([], errors)

    def test_header_in_list(self):
        _, _, errors = diff_struct(trees.lm2tm2t(), trees.lm2tm2t())
        self.assertEqual([], errors)

    def test_concatenate_text_nodes_when_element_in_middle_ignored(self):
        _, _, errors = diff_struct(trees.ptat(), trees.pt())
        self.assertEqual([], errors)

class TestDifferent(TestCase):

    def test_no_header(self):
        _, _, errors = diff_struct(trees.r2t(), trees.pt())
        self.assertEqual('del', errors[0].node.meta['style'])
        self.assertEqual(2, errors[0].node.level)
        self.assertEqual('ins', errors[1].node.meta['style'])

    def test_different_header(self):
        _, _, errors = diff_struct(trees.r2t(), trees.r4t())
        self.assertEqual(2, errors[0].node.level)
        self.assertEqual('del', errors[0].node.meta['style'])
        self.assertEqual(4, errors[1].node.level)
        self.assertEqual('ins', errors[1].node.meta['style'])

    def test_missing_new_line(self):
        _, _, errors = diff_struct(trees.pt(), trees.ptnt())
        self.assertEqual('n', errors[0].node.symbol)
        self.assertEqual('text', errors[1].node.text)

    def test_different_lists(self):
        unordered = trees.lm2tm2t(False)
        ordered = trees.lm2tm2t(True)
        _, _, errors = diff_struct(unordered, ordered)

        with self.subTest('missing unordered list'):
            actual = errors[0].node
            self.assertEqual(actual, List(ordered=False))
            self.assertEqual(actual.meta.get('style'), 'del')
        with self.subTest('additional ordered list'):
            actual = errors[1].node
            self.assertEqual(actual, List(ordered=True))
            self.assertEqual(actual.meta.get('style'), 'ins')


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>footer (Chart Faces Tag Library Ducumentation)</title>
<meta name="keywords" content="$title">
<link rel="stylesheet" type="text/css" href="../stylesheet.css"
	title="Style">

JavaScript is disabled on your browser.

Overview

Library

Tag

Help

					Frames

 No Frames

All Tags

cf

Tag footer

Description:

The footer of the chart.

							Component Information

								Info
								Value

								Component Type
								org.javaq.chartfaces.chart.part.footer

								Display Name
								None

								Handler Class
								None

								Renderer Type
								None

								Description
								None

							Attributes

								Name
								Required
								Type
								Description

								height
								 false
								java.lang.Object
								The height of the footer.

								style
								 false
								java.lang.Object
								The style of the footer.

								value
								 false
								java.lang.Object
								The footer text to display.

Overview

Library

Tag

Help

					Frames

 No Frames

All Tags

		Output generated by Vdldoc View Declaration Language Documentation
		Generator.


text:
ACCEPTED

#### According to
Integrated Taxonomic Information System

#### Published in
Great Basin Naturalist 30:125. 1970

#### Original name
null

### Remarks
null


text:
<?php

if($action == "meta_product_trash") try {

  $meta_product_id = $_POST['meta_product_id'];
  $meta_product = $meta_products_list[$meta_product_id];
  if(!$meta_product)
    throw rbx::error("Vous n'avez pas le droit de détruire ce meta produit");

  $res = $meta_product->sql_delete();
  if(!$res)
      throw rbx::error("Impossible de détruire ce meta produit");

}catch(rbx $e) {}


text:
@interface TSOthersViewController : UITableViewController

@end


text:
#ifndef GrD3DPipelineStateDataManager_DEFINED
#define GrD3DPipelineStateDataManager_DEFINED

#include "src/gpu/GrUniformDataManager.h"

#include "include/gpu/d3d/GrD3DTypes.h"
#include "src/gpu/GrSPIRVUniformHandler.h"

class GrD3DConstantRingBuffer;
class GrD3DGpu;

class GrD3DPipelineStateDataManager : public GrUniformDataManager {
public:
    typedef GrSPIRVUniformHandler::UniformInfoArray UniformInfoArray;

    GrD3DPipelineStateDataManager(const UniformInfoArray&,
                                  uint32_t uniformSize);

    D3D12_GPU_VIRTUAL_ADDRESS uploadConstants(GrD3DGpu* gpu);

private:
    D3D12_GPU_VIRTUAL_ADDRESS fConstantBufferAddress;

    using INHERITED = GrUniformDataManager;
};

#endif


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var scrollBarWidth = void 0;

var getScrollBarWidth = exports.getScrollBarWidth = function getScrollBarWidth() {
  if (scrollBarWidth !== undefined) return scrollBarWidth;

  var outer = document.createElement('div');
  outer.style.visibility = 'hidden';
  outer.style.width = '100px';
  outer.style.position = 'absolute';
  outer.style.top = '-9999px';
  document.body.appendChild(outer);

  var widthNoScroll = outer.offsetWidth;
  outer.style.overflow = 'scroll';

  var inner = document.createElement('div');
  inner.style.width = '100%';
  outer.appendChild(inner);

  var widthWithScroll = inner.offsetWidth;
  outer.parentNode.removeChild(outer);

  return widthNoScroll - widthWithScroll;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(scrollBarWidth, 'scrollBarWidth', 'src/table/utils.js');

  __REACT_HOT_LOADER__.register(getScrollBarWidth, 'getScrollBarWidth', 'src/table/utils.js');
}();

;


text:
#region BSD License

#endregion

namespace IntegrationPackage
{
    using Clide;
    using Microsoft.VisualStudio.Shell;
    using System;
    using System.ComponentModel.Composition;

    [Export(typeof(IShellComponent))]
    public class ShellComponent : IShellComponent
    {
        private IServiceProvider serviceProvider;

        [ImportingConstructor]
        public ShellComponent([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider)
        {
            // Force the load of the package.
            this.serviceProvider = serviceProvider.GetLoadedPackage<ClideIntegrationPackage>();
        }

        public IDevEnv DevEnv { get { return Clide.DevEnv.Get(serviceProvider); } }
    }
}


text:
require 'spec_helper'

Chef::Knife::UserCreate.load_deps

describe Chef::Knife::UserCreate do
  before(:each) do
    @knife = Chef::Knife::UserCreate.new

    @stdout = StringIO.new
    @stderr = StringIO.new
    @knife.ui.stub(:stdout).and_return(@stdout)
    @knife.ui.stub(:stderr).and_return(@stderr)

    @knife.name_args = [ 'a_user' ]
    @knife.config[:user_password] = "foobar"
    @user = Chef::User.new
    @user.name "a_user"
    @user_with_private_key = Chef::User.new
    @user_with_private_key.name "a_user"
    @user_with_private_key.private_key 'private_key'
    @user.stub(:create).and_return(@user_with_private_key)
    Chef::User.stub(:new).and_return(@user)
    Chef::User.stub(:from_hash).and_return(@user)
    @knife.stub(:edit_data).and_return(@user.to_hash)
  end

  it "creates a new user" do
    Chef::User.should_receive(:new).and_return(@user)
    @user.should_receive(:create)
    @knife.run
    @stderr.string.should match /created user.+a_user/i
  end

  it "sets the password" do
    @knife.config[:user_password] = "a_password"
    @user.should_receive(:password).with("a_password")
    @knife.run
  end

  it "exits with an error if password is blank" do
    @knife.config[:user_password] = ''
    lambda { @knife.run }.should raise_error SystemExit
    @stderr.string.should match /You must specify a non-blank password/
  end

  it "sets the user name" do
    @user.should_receive(:name).with("a_user")
    @knife.run
  end

  it "sets the public key if given" do
    @knife.config[:user_key] = "/a/filename"
    File.stub(:read).with(File.expand_path("/a/filename")).and_return("a_key")
    @user.should_receive(:public_key).with("a_key")
    @knife.run
  end

  it "allows you to edit the data" do
    @knife.should_receive(:edit_data).with(@user)
    @knife.run
  end

  it "writes the private key to a file when --file is specified" do
    @knife.config[:file] = "/tmp/a_file"
    filehandle = double("filehandle")
    filehandle.should_receive(:print).with('private_key')
    File.should_receive(:open).with("/tmp/a_file", "w").and_yield(filehandle)
    @knife.run
  end
end


text:
package com.intellij.compiler.cache.client;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.io.StreamUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.io.HttpRequests;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.zip.GZIPInputStream;

public final class CompilerCachesServerClient {
  private static final Logger LOG = Logger.getInstance(CompilerCachesServerClient.class);
  private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

  @NotNull
  public static Map<String, Set<String>> getCacheKeysPerRemote(@NotNull Project project, @NotNull String serverUrl) {
    Map<String, List<String>> response = doGetRequest(project, serverUrl);
    if (response == null) return Collections.emptyMap();
    Map<String, Set<String>> result = new HashMap<>();
    response.forEach((key, value) -> {
      String[] splittedRemoteUrl = key.split("/");
      result.put(splittedRemoteUrl[splittedRemoteUrl.length - 1], new HashSet<>(value));
    });
    return result;
  }

  private static @Nullable Map<String, List<String>> doGetRequest(@NotNull Project project, @NotNull String serverUrl) {
    Map<String, String> headers = CompilerCacheServerAuthUtil.getRequestHeaders(project);
    if (headers.isEmpty()) return null;
    try {
      return HttpRequests.request(serverUrl + "/commit_history.json")
        .tuner(tuner -> headers.forEach((k, v) -> tuner.addRequestProperty(k, v)))
        .connect(it -> {
          URLConnection connection = it.getConnection();
          if (connection instanceof HttpURLConnection) {
            HttpURLConnection httpConnection = (HttpURLConnection)connection;
            if (httpConnection.getResponseCode() == 200) {
              return OBJECT_MAPPER.readValue(getInputStream(httpConnection), new TypeReference<>() {
              });
            }
            else {
              String statusLine = httpConnection.getResponseCode() + ' ' + httpConnection.getRequestMethod();
              String errorText = StreamUtil.readText(new InputStreamReader(httpConnection.getErrorStream(), StandardCharsets.UTF_8));
              LOG.info("Request: " + httpConnection.getRequestMethod() + httpConnection.getURL() + " : Error " + statusLine + " body: " + errorText);
            }
          }
          return null;
        });
    }
    catch (IOException e) {
      LOG.warn("Failed request to cache server", e);
    }
    return null;
  }

  private static InputStream getInputStream(HttpURLConnection httpConnection) throws IOException {
    String contentEncoding = httpConnection.getContentEncoding();
    InputStream inputStream = httpConnection.getInputStream();
    if (contentEncoding != null && StringUtil.toLowerCase(contentEncoding).contains("gzip")) {
      return new GZIPInputStream(inputStream);
    }
    return inputStream;
  }
}


text:
package io.grpc.auth;

import com.google.auth.Credentials;

import io.grpc.CallCredentials;
import io.grpc.ExperimentalApi;

/**
 * A utility class that converts other types of credentials to {@link CallCredentials}.
 */
@ExperimentalApi("https//github.com/grpc/grpc-java/issues/1914")
public final class MoreCallCredentials {
  /**
   * Converts a Google Auth Library {@link Credentials} to {@link CallCredentials}.
   */
  public static CallCredentials from(Credentials creds) {
    return new GoogleAuthLibraryCallCredentials(creds);
  }

  private MoreCallCredentials() {
  }
}


text:
using System;
using System.ComponentModel;
using System.Drawing.Design;
using System.Linq;

namespace $rootnamespace$
{
    /// <summary>
    /// A custom UI editor for displaying values.
    /// </summary>
    /// <remarks>See <see cref="UITypeEditor"/> for more details.</remarks>
    [DisplayName("$safeitemname$ Custom UI Editor")]
    [Category("General")]
    [Description("Edits a value with a custom UI designer.")]
    [CLSCompliant(false)]
    public class $safeitemname$ : UITypeEditor
    {
        /// <summary>
        /// Returns the editor style.
        /// </summary>
        public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
        {
            return base.GetEditStyle(context);
        }

        /// <summary>
        /// Gets a value determining whether the editor drop down is resizable.
        /// </summary>
        public override bool IsDropDownResizable
        {
            get
            {
                return base.IsDropDownResizable;
            }
        }

        /// <summary>
        /// Called to display the custom user interface for the current value.
        /// </summary>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            return base.EditValue(context, provider, value);
        }
    }
}


text:
galpy.df.streamdf.__call__
===========================

.. automethod:: galpy.df.streamdf.__call__


text:
// Copyright 2017 David Holmes.  All Rights Reserved.
// Copyright 2016 Erik Neumann.  All Rights Reserved.
//
// 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.

import { SubjectEvent } from './SubjectEvent';

/**
 * @hidden
 */
export interface Observer {
    observe(event: SubjectEvent): void;
}