text:
package CSE346Project;

import javafx.geometry.Pos;
import javafx.scene.chart.LineChart;
import javafx.scene.chart.NumberAxis;
import javafx.scene.control.ScrollPane;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

/**
 *
 * @author Luming
 */
public class UI extends BorderPane{
    private LineChart<Number, Number> AChart;
    private LineChart<Number, Number> CChart;
    public UI(Stage primaryStage){
        ScrollPane scrollPane = new ScrollPane();
        setCenter(scrollPane);

        VBox _vbox = new VBox();
        scrollPane.setContent(_vbox);
        _vbox.setAlignment(Pos.CENTER);
        _vbox.setSpacing(50);

        NumberAxis throughputA = new NumberAxis();
        throughputA.setLabel("Probability");
        NumberAxis probabilityA = new NumberAxis();
        probabilityA.setLabel("Throughput");
        AChart = new LineChart<Number,Number>(throughputA, probabilityA);
        AChart.setPrefSize(600, 600);
        _vbox.getChildren().add(AChart);

        NumberAxis throughputC = new NumberAxis();
        throughputC.setLabel("Probability");
        NumberAxis probabilityC = new NumberAxis();
        probabilityC.setLabel("Throughput");
        CChart = new LineChart<Number,Number>(throughputC, probabilityC);
        CChart.setPrefSize(600, 600);
        _vbox.getChildren().add(CChart);
    }

    public LineChart getA(){
        return AChart;
    }

    public LineChart getC(){
        return CChart;
    }

}


text:
package handler

import (
	"k8s.io/client-go/util/workqueue"
	"sigs.k8s.io/controller-runtime/pkg/client"
	"sigs.k8s.io/controller-runtime/pkg/event"
	"sigs.k8s.io/controller-runtime/pkg/reconcile"
	"sigs.k8s.io/controller-runtime/pkg/runtime/inject"
)

// MapFunc is the signature required for enqueueing requests from a generic function.
// This type is usually used with EnqueueRequestsFromMapFunc when registering an event handler.
type MapFunc func(client.Object) []reconcile.Request

// EnqueueRequestsFromMapFunc enqueues Requests by running a transformation function that outputs a collection
// of reconcile.Requests on each Event.  The reconcile.Requests may be for an arbitrary set of objects
// defined by some user specified transformation of the source Event.  (e.g. trigger Reconciler for a set of objects
// in response to a cluster resize event caused by adding or deleting a Node)
//
// EnqueueRequestsFromMapFunc is frequently used to fan-out updates from one object to one or more other
// objects of a differing type.
//
// For UpdateEvents which contain both a new and old object, the transformation function is run on both
// objects and both sets of Requests are enqueue.
func EnqueueRequestsFromMapFunc(fn MapFunc) EventHandler {
	return &enqueueRequestsFromMapFunc{
		toRequests: fn,
	}
}

var _ EventHandler = &enqueueRequestsFromMapFunc{}

type enqueueRequestsFromMapFunc struct {
	// Mapper transforms the argument into a slice of keys to be reconciled
	toRequests MapFunc
}

// Create implements EventHandler.
func (e *enqueueRequestsFromMapFunc) Create(evt event.CreateEvent, q workqueue.RateLimitingInterface) {
	reqs := map[reconcile.Request]empty{}
	e.mapAndEnqueue(q, evt.Object, reqs)
}

// Update implements EventHandler.
func (e *enqueueRequestsFromMapFunc) Update(evt event.UpdateEvent, q workqueue.RateLimitingInterface) {
	reqs := map[reconcile.Request]empty{}
	e.mapAndEnqueue(q, evt.ObjectOld, reqs)
	e.mapAndEnqueue(q, evt.ObjectNew, reqs)
}

// Delete implements EventHandler.
func (e *enqueueRequestsFromMapFunc) Delete(evt event.DeleteEvent, q workqueue.RateLimitingInterface) {
	reqs := map[reconcile.Request]empty{}
	e.mapAndEnqueue(q, evt.Object, reqs)
}

// Generic implements EventHandler.
func (e *enqueueRequestsFromMapFunc) Generic(evt event.GenericEvent, q workqueue.RateLimitingInterface) {
	reqs := map[reconcile.Request]empty{}
	e.mapAndEnqueue(q, evt.Object, reqs)
}

func (e *enqueueRequestsFromMapFunc) mapAndEnqueue(q workqueue.RateLimitingInterface, object client.Object, reqs map[reconcile.Request]empty) {
	for _, req := range e.toRequests(object) {
		_, ok := reqs[req]
		if !ok {
			q.Add(req)
			reqs[req] = empty{}
		}
	}
}

// EnqueueRequestsFromMapFunc can inject fields into the mapper.

// InjectFunc implements inject.Injector.
func (e *enqueueRequestsFromMapFunc) InjectFunc(f inject.Func) error {
	if f == nil {
		return nil
	}
	return f(e.toRequests)
}

redpajama_set_name: RedPajamaGithub


text:
package com.getbase.android.db.fluentsqlite;

public interface InsertTableSelector {
  InsertFormSelector into(String table);
}


text:
/**
 * Initializing main module and setting up the routes.
 * Note that in most cases controllers should be assigned here for views
 * e.g. LocationController.
 *
 * @author Vato Maskhulia
 */

(function() {
  'use strict';

  /**
   * Get main module and set up routing.
   */
  var module = angular.module('freeUniTaxiApp', [
      'ngRoute']);

  module.config(function($locationProvider, $routeProvider) {
    $routeProvider
      .when('/', {
        redirectTo: '/orders'
      }).when('/home', {
        templateUrl: 'partials/home.html'
      }).when('/orders', {
        controller: 'OrdersController',
        templateUrl: 'partials/orders.html'
      }).when('/driver', {
        controller: 'DriverController',
        templateUrl: 'partials/driver.html'
      }).when('/location', {
        controller: 'LocationController',
        templateUrl: 'partials/location.html'
      }).when('/test', {
        templateUrl: 'partials/test.html'
      })
      .otherwise({ redirectTo: '/' });

    // $locationProvider.html5Mode(true);
    });
}());


text:
class PDFEbookPresenter < ApplicationPresenter
  def initialize(pdf_ebook)
    @pdf_ebook = pdf_ebook
  end

  def id
    @pdf_ebook.id
  end

  def multi_rendition?
    false
  end

  def intervals?
    return true if EbookTableOfContentsCache.find_by(noid: @pdf_ebook.id).present?
    @pdf_ebook&.intervals&.count&.positive?
  end

  def intervals
    @intervals ||= begin
      record = EbookTableOfContentsCache.find_by(noid: @pdf_ebook.id)
      if record.present?
        JSON.parse(record.toc).map { |i| EBookIntervalPresenter.new(i.symbolize_keys) }
      else
        Rails.logger.error("[FIXME ERROR PDFEbookPresenter: EbookTableOfContentsCache] No Cached TOC for #{@pdf_ebook.id}")
        @pdf_ebook.intervals.map { |interval| RemoveMeEPubIntervalPresenter.new(interval) }
      end
    end
  end
end


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Portafolios - Jorge Pino</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/freelancer.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Jorge Pino

                        Portafolio

                        Acerca de mí

                        Jorge Pino

                      Analista Programador -  Diseñador Web

Portafolio

Acerca de mí

Analista Programador Computacional, con experiencia en Ingeniería de software (Toma de requerimientos para crear historias de usuarios, modelo de dominio, diagramas de bloques, diseño de interfaz de usuarios), diseño web, administración de sistemas operativos (Windows Server 2008, Linux RedHat), desarrollo backend y frontend.

 CONOCIMIENTOS TECNICOS

Web:                    HTML5, CSS3, JavaScript, PHP, ASP.Net, JavaEE.

Programación:              C#, Java.

DBA (BBDD):              Oracle 11g, MySql, Sql Server 2008.

Control de versiones:              SVN, Git.

                         Descargar CV

Sigueme

                        Copyright © Jorge Pino 2016

Telefónica del Sur

En este sitio me encargue de la mantención grafica y comunicación visual, atreves de la agencia fusiona.

Cliente:
                                  Telefónica del Sur

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

GTD Manquehue

En este sitio me encargue de la mantención grafica y comunicación visual, atreves de la agencia fusiona.

Cliente:
                                    GTD Manquehue

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Mundo Lider

fui un integrante del grupo conformado por la agencia fusiona para la creación de la comunicación visual del sitio mundo lider.cl que posteriormente cambio su nombre a lider.cl

Cliente:
                                    Mundo Lider

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Movistar Chile

En este sitio me encargue de la mantención grafica y comunicación visual, atreves de la agencia fusiona.

Cliente:
                                    Movistar Chile

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

CORDEP

En este sitio me encargue de la mantención grafica y comunicación visual, atreves de la agencia fusiona.

Cliente:
                                    CORDEP

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Indra Argentina

Diseñe la campaña comunicacional interna para el cliente indra argentina.

Cliente:
                                    Indra Argentina

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>


text:
import swiftclient

import subprocess as sp
import json

output = sp.check_output("radosgw-admin user info --uid=alex", shell=True)
keyinfo = json.loads( output )
secret_key = ""

for user in  keyinfo["swift_keys"]:
        if user["user"] == "alex:swift":
                secret_key = user["secret_key"]

user = 'alex:swift'
# access_key = 'UPfCwzqdaNz7bXSUE1LPOqMK1NNe4MNhFKn6GREW'
url = 'http://salt-master/auth'

print ( 'Connect to the obj-store with swiftclient' )
connect = swiftclient.Connection(
        user=user,
        key=secret_key,
        authurl=url,
)

new_container_name = 'new-container'
print ( 'Create a container :' + new_container_name )
connect.put_container( new_container_name )

hello_obj = 'hello.txt'

print ( 'Put a file {' + hello_obj + '} into ' + new_container_name )
with open( hello_obj, 'r') as hello_file:
	connect.put_object( new_container_name, hello_obj,
		contents= hello_file.read(),
		content_type='text/plain' )

print ( 'List all the container that I own ' )
for container in connect.get_account()[1]:
        print ( 'Container name :' + container['name'] )

for data in connect.get_container( new_container_name )[1]:
        print ( '{0}\t{1}\t{2}'.format( data['name'], data['bytes'], data['last_modified']) )

new_hello = 'new_hello.txt'
print ( 'Write out the data from {' + hello_obj + '} of container ' + new_container_name  + ' into a new file ' + new_hello )
obj_data = connect.get_object( new_container_name, hello_obj )
with open( new_hello, 'w' ) as my_hello:
        my_hello.write( obj_data[1] )

with open( hello_obj, 'r') as hello_file:
	connect.put_object( new_container_name, hello_obj,
		contents= hello_file.read(),
		content_type='text/plain' )

print ( 'Create a container : video' )
try:
	connect.put_container( 'video' )
except:
	print ( 'Container {video} cannot be created' )

video_name = 'SUSE Enterprise Storage Fundamentals (Ceph) 中文字幕.mp4'
video_path = '/home/ceph/Videos'
print ( 'Put a video file {' + video_name + '} into container {video}' )
with open( video_path + '/' + video_name, 'r') as video_file:
	connect.put_object( 'video' , 'suse.mp4',
		contents= video_file.read(),
		content_type='video/mp4' )

print ( 'Remote object {' + hello_obj + '} of container' )
connect.delete_object( new_container_name, hello_obj )
print ( 'Remote container {' + new_container_name + '}' )
connect.delete_container( new_container_name )


text:
/*csslint box-model:false*/
/*
Box-model set to false because we're setting a height on select elements, which
also have border and padding. This is done because some browsers don't render
the padding. We explicitly set the box-model for select elements to border-box,
so we can ignore the csslint warning.
*/

.pure-form input[type="text"],
.pure-form input[type="password"],
.pure-form input[type="email"],
.pure-form input[type="url"],
.pure-form input[type="date"],
.pure-form input[type="month"],
.pure-form input[type="time"],
.pure-form input[type="datetime"],
.pure-form input[type="datetime-local"],
.pure-form input[type="week"],
.pure-form input[type="number"],
.pure-form input[type="search"],
.pure-form input[type="tel"],
.pure-form input[type="color"],
.pure-form select,
.pure-form textarea {
    padding: 0.5em 0.6em;
    display: inline-block;
    border: 1px solid #ccc;
    box-shadow: inset 0 1px 3px #ddd;
    border-radius: 4px;
    vertical-align: middle;
    box-sizing: border-box;
}

/*
Need to separate out the :not() selector from the rest of the CSS 2.1 selectors
since IE8 won't execute CSS that contains a CSS3 selector.
*/
.pure-form input:not([type]) {
    padding: 0.5em 0.6em;
    display: inline-block;
    border: 1px solid #ccc;
    box-shadow: inset 0 1px 3px #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Chrome (as of v.32/34 on OS X) needs additional room for color to display. */
/* May be able to remove this tweak as color inputs become more standardized across browsers. */
.pure-form input[type="color"] {
    padding: 0.2em 0.5em;
}

.pure-form input[type="text"]:focus,
.pure-form input[type="password"]:focus,
.pure-form input[type="email"]:focus,
.pure-form input[type="url"]:focus,
.pure-form input[type="date"]:focus,
.pure-form input[type="month"]:focus,
.pure-form input[type="time"]:focus,
.pure-form input[type="datetime"]:focus,
.pure-form input[type="datetime-local"]:focus,
.pure-form input[type="week"]:focus,
.pure-form input[type="number"]:focus,
.pure-form input[type="search"]:focus,
.pure-form input[type="tel"]:focus,
.pure-form input[type="color"]:focus,
.pure-form select:focus,
.pure-form textarea:focus {
    outline: 0;
    border-color: #129FEA;
}

/*
Need to separate out the :not() selector from the rest of the CSS 2.1 selectors
since IE8 won't execute CSS that contains a CSS3 selector.
*/
.pure-form input:not([type]):focus {
    outline: 0;
    border-color: #129FEA;
}

.pure-form input[type="file"]:focus,
.pure-form input[type="radio"]:focus,
.pure-form input[type="checkbox"]:focus {
    outline: thin solid #129FEA;
    outline: 1px auto #129FEA;
}
.pure-form .pure-checkbox,
.pure-form .pure-radio {
    margin: 0.5em 0;
    display: block;
}

.pure-form input[type="text"][disabled],
.pure-form input[type="password"][disabled],
.pure-form input[type="email"][disabled],
.pure-form input[type="url"][disabled],
.pure-form input[type="date"][disabled],
.pure-form input[type="month"][disabled],
.pure-form input[type="time"][disabled],
.pure-form input[type="datetime"][disabled],
.pure-form input[type="datetime-local"][disabled],
.pure-form input[type="week"][disabled],
.pure-form input[type="number"][disabled],
.pure-form input[type="search"][disabled],
.pure-form input[type="tel"][disabled],
.pure-form input[type="color"][disabled],
.pure-form select[disabled],
.pure-form textarea[disabled] {
    cursor: not-allowed;
    background-color: #eaeded;
    color: #cad2d3;
}

/*
Need to separate out the :not() selector from the rest of the CSS 2.1 selectors
since IE8 won't execute CSS that contains a CSS3 selector.
*/
.pure-form input:not([type])[disabled] {
    cursor: not-allowed;
    background-color: #eaeded;
    color: #cad2d3;
}
.pure-form input[readonly],
.pure-form select[readonly],
.pure-form textarea[readonly] {
    background-color: #eee; /* menu hover bg color */
    color: #777; /* menu text color */
    border-color: #ccc;
}

.pure-form input:focus:invalid,
.pure-form textarea:focus:invalid,
.pure-form select:focus:invalid {
    color: #b94a48;
    border-color: #e9322d;
}
.pure-form input[type="file"]:focus:invalid:focus,
.pure-form input[type="radio"]:focus:invalid:focus,
.pure-form input[type="checkbox"]:focus:invalid:focus {
    outline-color: #e9322d;
}
.pure-form select {
    /* Normalizes the height; padding is not sufficient. */
    height: 2.25em;
    border: 1px solid #ccc;
    background-color: white;
}
.pure-form select[multiple] {
    height: auto;
}
.pure-form label {
    margin: 0.5em 0 0.2em;
}
.pure-form fieldset {
    margin: 0;
    padding: 0.35em 0 0.75em;
    border: 0;
}
.pure-form legend {
    display: block;
    width: 100%;
    padding: 0.3em 0;
    margin-bottom: 0.3em;
    color: #333;
    border-bottom: 1px solid #e5e5e5;
}

.pure-form-stacked input[type="text"],
.pure-form-stacked input[type="password"],
.pure-form-stacked input[type="email"],
.pure-form-stacked input[type="url"],
.pure-form-stacked input[type="date"],
.pure-form-stacked input[type="month"],
.pure-form-stacked input[type="time"],
.pure-form-stacked input[type="datetime"],
.pure-form-stacked input[type="datetime-local"],
.pure-form-stacked input[type="week"],
.pure-form-stacked input[type="number"],
.pure-form-stacked input[type="search"],
.pure-form-stacked input[type="tel"],
.pure-form-stacked input[type="color"],
.pure-form-stacked input[type="file"],
.pure-form-stacked select,
.pure-form-stacked label,
.pure-form-stacked textarea {
    display: block;
    margin: 0.25em 0;
}

/*
Need to separate out the :not() selector from the rest of the CSS 2.1 selectors
since IE8 won't execute CSS that contains a CSS3 selector.
*/
.pure-form-stacked input:not([type]) {
    display: block;
    margin: 0.25em 0;
}
.pure-form-aligned input,
.pure-form-aligned textarea,
.pure-form-aligned select,
/* NOTE: pure-help-inline is deprecated. Use .pure-form-message-inline instead. */
.pure-form-aligned .pure-help-inline,
.pure-form-message-inline {
    display: inline-block;
    *display: inline;
    *zoom: 1;
    vertical-align: middle;
}
.pure-form-aligned textarea {
    vertical-align: top;
}

/* Aligned Forms */
.pure-form-aligned .pure-control-group {
    margin-bottom: 0.5em;
}
.pure-form-aligned .pure-control-group label {
    text-align: right;
    display: inline-block;
    vertical-align: middle;
    width: 10em;
    margin: 0 1em 0 0;
}
.pure-form-aligned .pure-controls {
    margin: 1.5em 0 0 11em;
}

/* Rounded Inputs */
.pure-form input.pure-input-rounded,
.pure-form .pure-input-rounded {
    border-radius: 2em;
    padding: 0.5em 1em;
}

/* Grouped Inputs */
.pure-form .pure-group fieldset {
    margin-bottom: 10px;
}
.pure-form .pure-group input,
.pure-form .pure-group textarea {
    display: block;
    padding: 10px;
    margin: 0 0 -1px;
    border-radius: 0;
    position: relative;
    top: -1px;
}
.pure-form .pure-group input:focus,
.pure-form .pure-group textarea:focus {
    z-index: 3;
}
.pure-form .pure-group input:first-child,
.pure-form .pure-group textarea:first-child {
    top: 1px;
    border-radius: 4px 4px 0 0;
    margin: 0;
}
.pure-form .pure-group input:first-child:last-child,
.pure-form .pure-group textarea:first-child:last-child {
    top: 1px;
    border-radius: 4px;
    margin: 0;
}
.pure-form .pure-group input:last-child,
.pure-form .pure-group textarea:last-child {
    top: -2px;
    border-radius: 0 0 4px 4px;
    margin: 0;
}
.pure-form .pure-group button {
    margin: 0.35em 0;
}

.pure-form .pure-input-1 {
    width: 100%;
}
.pure-form .pure-input-3-4 {
    width: 75%;
}
.pure-form .pure-input-2-3 {
    width: 66%;
}
.pure-form .pure-input-1-2 {
    width: 50%;
}
.pure-form .pure-input-1-3 {
    width: 33%;
}
.pure-form .pure-input-1-4 {
    width: 25%;
}

/* Inline help for forms */
/* NOTE: pure-help-inline is deprecated. Use .pure-form-message-inline instead. */
.pure-form .pure-help-inline,
.pure-form-message-inline {
    display: inline-block;
    padding-left: 0.3em;
    color: #666;
    vertical-align: middle;
    font-size: 0.875em;
}

/* Block help for forms */
.pure-form-message {
    display: block;
    color: #666;
    font-size: 0.875em;
}

@media only screen and (max-width : 480px) {
    .pure-form button[type="submit"] {
        margin: 0.7em 0 0;
    }

    .pure-form input:not([type]),
    .pure-form input[type="text"],
    .pure-form input[type="password"],
    .pure-form input[type="email"],
    .pure-form input[type="url"],
    .pure-form input[type="date"],
    .pure-form input[type="month"],
    .pure-form input[type="time"],
    .pure-form input[type="datetime"],
    .pure-form input[type="datetime-local"],
    .pure-form input[type="week"],
    .pure-form input[type="number"],
    .pure-form input[type="search"],
    .pure-form input[type="tel"],
    .pure-form input[type="color"],
    .pure-form label {
        margin-bottom: 0.3em;
        display: block;
    }

    .pure-group input:not([type]),
    .pure-group input[type="text"],
    .pure-group input[type="password"],
    .pure-group input[type="email"],
    .pure-group input[type="url"],
    .pure-group input[type="date"],
    .pure-group input[type="month"],
    .pure-group input[type="time"],
    .pure-group input[type="datetime"],
    .pure-group input[type="datetime-local"],
    .pure-group input[type="week"],
    .pure-group input[type="number"],
    .pure-group input[type="search"],
    .pure-group input[type="tel"],
    .pure-group input[type="color"] {
        margin-bottom: 0;
    }

    .pure-form-aligned .pure-control-group label {
        margin-bottom: 0.3em;
        text-align: left;
        display: block;
        width: 100%;
    }

    .pure-form-aligned .pure-controls {
        margin: 1.5em 0 0 0;
    }

    /* NOTE: pure-help-inline is deprecated. Use .pure-form-message-inline instead. */
    .pure-form .pure-help-inline,
    .pure-form-message-inline,
    .pure-form-message {
        display: block;
        font-size: 0.75em;
        /* Increased bottom padding to make it group with its related input element. */
        padding: 0.2em 0 0.8em;
    }
}


text:
<?php
declare(strict_types = 1);
/**
 * /tests/Integration/EventSubscriber/JWTDecodedSubscriberTest.php
 *
 * @author TLe, Tarmo Leppänen <tarmo.leppanen@pinja.com>
 */

namespace App\Tests\Integration\EventSubscriber;

use App\EventSubscriber\JWTDecodedSubscriber;
use Lexik\Bundle\JWTAuthenticationBundle\Event\JWTDecodedEvent;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use function array_values;
use function hash;
use function implode;

/**
 * Class JWTDecodedSubscriberTest
 *
 * @package App\Tests\Integration\EventSubscriber
 * @author TLe, Tarmo Leppänen <tarmo.leppanen@pinja.com>
 */
class JWTDecodedSubscriberTest extends KernelTestCase
{
    public function testThatJwtIsMarkedInvalidIfChecksumDiffers(): void
    {
        $logger = $this->getMockBuilder(LoggerInterface::class)->getMock();

        // Create RequestStack and push pure Request to it
        $requestStack = new RequestStack();
        $requestStack->push(new Request());

        // Create custom payload for JWTDecodedEvent
        $payload = [
            'checksum' => 'foobar',
        ];

        // Create event for subscriber
        $event = new JWTDecodedEvent($payload);

        // Create subscriber and call actual process method
        (new JWTDecodedSubscriber($requestStack, $logger))
            ->onJWTDecoded($event);

        self::assertFalse($event->isValid(), 'JWTDecodedEvent did not mark event as invalid.');
    }

    public function testThatJwtIsNotMarkedInvalidIfChecksumMatches(): void
    {
        $logger = $this->getMockBuilder(LoggerInterface::class)->getMock();

        // Server parameters for new Request
        $server = [
            'REMOTE_ADDR' => '123.123.123.123',
            'HTTP_USER_AGENT' => 'foobar',
        ];

        // Create RequestStack and push pure Request to it
        $requestStack = new RequestStack();
        $requestStack->push(new Request([], [], [], [], [], $server));

        // Create custom payload for JWTDecodedEvent - this one is expected one
        $payload = [
            'checksum' => hash('sha512', implode('|', array_values($server))),
        ];

        // Create event for subscriber
        $event = new JWTDecodedEvent($payload);

        // Create subscriber and call actual process method
        (new JWTDecodedSubscriber($requestStack, $logger))
            ->onJWTDecoded($event);

        self::assertTrue($event->isValid(), 'JWTDecodedEvent did mark event as invalid.');
    }

    public function testThatEventIsMarkedInvalidIfRequestDoesNotExist(): void
    {
        $logger = $this->getMockBuilder(LoggerInterface::class)->getMock();

        // Create event for subscriber
        $event = new JWTDecodedEvent([]);

        // Create subscriber and call actual process method
        (new JWTDecodedSubscriber(new RequestStack(), $logger))
            ->onJWTDecoded($event);

        self::assertFalse($event->isValid(), 'JWTDecodedEvent did not mark event as invalid.');
    }

    public function testThatEventIsNotTouchedIfItHasAlreadyBeenMarkedInvalid(): void
    {
        $logger = $this->getMockBuilder(LoggerInterface::class)->getMock();

        // Create event for subscriber
        $event = new JWTDecodedEvent([]);
        $event->markAsInvalid();

        $expectedEvent = clone $event;

        // Create subscriber and call actual process method
        (new JWTDecodedSubscriber(new RequestStack(), $logger))
            ->onJWTDecoded($event);

        self::assertSame($expectedEvent->getPayload(), $event->getPayload());
        self::assertFalse($event->isValid());
    }

    public function testThatLoggerIsCalledAndEventIsMarkedInvalidIfThereIsNoRequest(): void
    {
        $logger = $this->getMockBuilder(LoggerInterface::class)->getMock();

        $logger
            ->expects(self::once())
            ->method('error')
            ->with('Request not available');

        $event = new JWTDecodedEvent([]);

        (new JWTDecodedSubscriber(new RequestStack(), $logger))
            ->onJWTDecoded($event);

        self::assertFalse($event->isValid());
    }
}


text:
package org.elasticsearch.common.util;

import com.google.common.collect.ImmutableList;
import org.elasticsearch.common.inject.AbstractModule;
import org.elasticsearch.common.inject.Module;
import org.elasticsearch.common.inject.SpawnModules;
import org.elasticsearch.common.settings.Settings;

import static org.elasticsearch.common.inject.Modules.createModule;

/**
 */
public class BigArraysModule extends AbstractModule implements SpawnModules {

    public static final String IMPL = "common.util.big_arrays_impl";

    private final Settings settings;

    public BigArraysModule(Settings settings) {
        this.settings = settings;
    }

    @Override
    protected void configure() {
    }

    @Override
    public Iterable<? extends Module> spawnModules() {
        return ImmutableList.of(createModule(settings.getAsClass(IMPL, DefaultBigArraysModule.class), settings));
    }
}


text:
package dk.dma.dmiweather.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import dk.dma.common.dto.GeoCoordinate;
import dk.dma.common.dto.JSonWarning;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.Instant;
import java.util.List;

/**
 * @author Klaus Groenbaek
 *         Created 29/03/17.
 */
@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GridResponse {
    private Instant forecastDate;
    /**
     * Date information about each of the data sets which provided data for the forecast
     */
    private List<ForecastInfo> forecasts;
    private Instant queryTime;
    private List<GridDataPoint> points;
    private JSonWarning warning;
    // values below are optional and only included when gridMetrics=true is on the URL
    private Double dx;
    private Double dy;
    private Integer Nx;
    private Integer Ny;
    private GeoCoordinate northWest;
    private GeoCoordinate southEast;

}


text:
require 'bourne'
require 'parslet/rig/rspec'

Dir[File.expand_path('../support/**/*.rb', __FILE__)].each do |path|
  require path
end

RSpec.configure do |config|
  config.mock_with :mocha
end


text:
package org.gradle.composite.internal;

import org.gradle.StartParameter;
import org.gradle.api.internal.artifacts.ImmutableModuleIdentifierFactory;
import org.gradle.api.internal.composite.CompositeBuildContext;
import org.gradle.api.internal.initialization.ScriptClassPathInitializer;
import org.gradle.api.internal.tasks.TaskReferenceResolver;
import org.gradle.initialization.BuildIdentity;
import org.gradle.initialization.layout.BuildLayoutFactory;
import org.gradle.internal.concurrent.ExecutorFactory;
import org.gradle.internal.reflect.Instantiator;
import org.gradle.internal.service.ServiceRegistration;
import org.gradle.internal.service.ServiceRegistry;
import org.gradle.internal.service.scopes.AbstractPluginServiceRegistry;
import org.gradle.internal.work.WorkerLeaseService;

public class CompositeBuildServices extends AbstractPluginServiceRegistry {
    @Override
    public void registerBuildTreeServices(ServiceRegistration registration) {
        registration.addProvider(new CompositeBuildTreeScopeServices());
    }

    @Override
    public void registerBuildServices(ServiceRegistration registration) {
        registration.addProvider(new CompositeBuildBuildScopeServices());
    }

    private static class CompositeBuildTreeScopeServices {
        public IncludedBuildRegistry createIncludedBuildRegistry(CompositeBuildContext context, DefaultProjectPathRegistry projectRegistry, Instantiator instantiator, StartParameter startParameter, WorkerLeaseService workerLeaseService, ImmutableModuleIdentifierFactory moduleIdentifierFactory, BuildLayoutFactory buildLayoutFactory) {
            IncludedBuildFactory includedBuildFactory = new DefaultIncludedBuildFactory(instantiator, startParameter, workerLeaseService, buildLayoutFactory);
            IncludedBuildDependencySubstitutionsBuilder dependencySubstitutionsBuilder = new IncludedBuildDependencySubstitutionsBuilder(context, moduleIdentifierFactory);
            return new DefaultIncludedBuildRegistry(includedBuildFactory, projectRegistry, dependencySubstitutionsBuilder, context);
        }

        public DefaultProjectPathRegistry createProjectPathRegistry() {
            return new DefaultProjectPathRegistry();
        }

        public CompositeBuildContext createCompositeBuildContext(ImmutableModuleIdentifierFactory moduleIdentifierFactory) {
            return new DefaultBuildableCompositeBuildContext(moduleIdentifierFactory, new IncludedBuildDependencyMetadataBuilder());
        }

        public IncludedBuildControllers createIncludedBuildControllers(ExecutorFactory executorFactory, IncludedBuildRegistry includedBuildRegistry) {
            return new DefaultIncludedBuildControllers(executorFactory, includedBuildRegistry);
        }

        public IncludedBuildTaskGraph createIncludedBuildTaskGraph(IncludedBuildControllers controllers) {
            return new DefaultIncludedBuildTaskGraph(controllers);
        }
    }

    private static class CompositeBuildBuildScopeServices {
        public TaskReferenceResolver createResolver(IncludedBuildTaskGraph includedBuilds, BuildIdentity buildIdentity) {
            return new IncludedBuildTaskReferenceResolver(includedBuilds, buildIdentity);
        }

        public ScriptClassPathInitializer createCompositeBuildClasspathResolver(IncludedBuildRegistry includedBuildRegistry, IncludedBuildTaskGraph includedBuildTaskGraph, ServiceRegistry serviceRegistry) {
            return new CompositeBuildClassPathInitializer(includedBuildRegistry, includedBuildTaskGraph, serviceRegistry);
        }
    }

}


text:
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#pragma once
#include "xsapi/contextual_search_service.h"

NAMESPACE_MICROSOFT_XBOX_SERVICES_CONTEXTUAL_SEARCH_BEGIN

/// <summary>Contains information about a contextual search game clip stat.</summary>
public ref class ContextualSearchGameClipStat sealed
{
public:
    /// <summary>
    /// Name of the stat
    /// </summary>
    DEFINE_PROP_GET_STR_OBJ(Name, stat_name);

    /// <summary>
    /// Value of the stat for string stats and integer stats representing a set value.
    /// If the stat changed during the clip, the field will have multiple values separated by a comma.
    /// If the "value" field is present, "min", "max" and "delta" fields will not be present.
    /// </summary>
    DEFINE_PROP_GET_STR_OBJ(Value, value);

    /// <summary>
    /// The minimum value the stat had during the recording of the game clip.
    /// If the "min" field is present, the "value" field will not be present.
    /// </summary>
    DEFINE_PROP_GET_STR_OBJ(MinValue, min_value);

    /// <summary>
    /// The maximum value the stat had during the recording of the game clip.
    /// If the "max" field is present, the "value" field will not be present.
    /// </summary>
    DEFINE_PROP_GET_STR_OBJ(MaxValue, max_value);

    /// <summary>
    /// "max"–"min". If the delta field is present, the "value" field will not be present.
    /// </summary>
    DEFINE_PROP_GET_STR_OBJ(DeltaValue, delta_value);

internal:
    ContextualSearchGameClipStat(
        _In_ xbox::services::contextual_search::contextual_search_game_clip_stat cppObj
        );

private:
    xbox::services::contextual_search::contextual_search_game_clip_stat m_cppObj;
};

NAMESPACE_MICROSOFT_XBOX_SERVICES_CONTEXTUAL_SEARCH_END


text:
Date: Tue, 10 Dec 1996 21:21:56 GMT
Server: NCSA/1.4.2
Content-type: text/html
Last-modified: Mon, 12 Aug 1996 23:59:01 GMT
Content-length: 3619

<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
<!Converted with LaTeX2HTML 95 (Thu Jan 19 1995) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >

<TITLE>A Powerful Clone Overlap Test for Restriction Fragment Mapping</TITLE>

<meta name="description" value="A Powerful Clone Overlap Test for Restriction Fragment Mapping">
<meta name="keywords" value="full_paper">
<meta name="resource-type" value="document">
<meta name="distribution" value="global">

 Next:  Introduction

A Powerful Clone Overlap Test for Restriction Fragment Mapping

Brendan Mumey

 Department of Computer Science

 University of Washington, Seattle, WA 98195, USA

 <tt> brendan@cs.washington.edu </tt>

 Key words: physical mapping, statistical inference,

 probabilistic reasoning, cluster analysis

Abstract:

This paper addresses a computational biology problem which
is to decide whether two clones (segments of a genome)
overlap based on their  multiple complete digest (MCD) fingerprint.
The problem arises in the context of building a physical map
of a genome, an important step in the human genome project.
The main result is an overlap test which is
argued to be powerful in a stochastic model of the process
in the sense of admitting the lowest false negative rate for a given rate
of false positives.  Initial experiments show that it yields about
20% fewer false negatives for a given rate of false positives than
a commonly used test.  This is likely to improve the success of
the subsequent mapping stages.

  Introduction

  A Stochastic Model of MCD Fingerprinting

  The  a posteriori Probability of Overlap

  Estimating

  Estimating

  The Proposed Overlap Test

  Comparison with a Currently Used Test

  Open problems and future work

 References

  Proof of Lemma 1

  An Initial Inequality

  Bounds on

  Discrepancy between  and

    About this document ...

<ADDRESS>
Brendan Mumey

Mon Aug 12 16:18:30 PDT 1996
</ADDRESS>


text:
/*
 * linux/arch/arm/mach-sa1100/leds-simpad.c
 *
 * Author: Juergen Messerer <juergen.messerer@siemens.ch>
 */
#include <linux/init.h>

#include <asm/hardware.h>
#include <asm/leds.h>
#include <asm/system.h>
#include <asm/arch/simpad.h>

#include "leds.h"

#define LED_STATE_ENABLED	1
#define LED_STATE_CLAIMED	2

static unsigned int led_state;
static unsigned int hw_led_state;

#define	LED_GREEN	(1)
#define	LED_MASK	(1)

extern void set_cs3_bit(int value);
extern void clear_cs3_bit(int value);

void simpad_leds_event(led_event_t evt)
{
	switch (evt)
	{
	case led_start:
	        hw_led_state = LED_GREEN;
		led_state = LED_STATE_ENABLED;
		break;

	case led_stop:
		led_state &= ~LED_STATE_ENABLED;
		break;

	case led_claim:
		led_state |= LED_STATE_CLAIMED;
		hw_led_state = LED_GREEN;
		break;

	case led_release:
		led_state &= ~LED_STATE_CLAIMED;
		hw_led_state = LED_GREEN;
		break;

#ifdef CONFIG_LEDS_TIMER
	case led_timer:
		if (!(led_state & LED_STATE_CLAIMED))
			hw_led_state ^= LED_GREEN;
		break;
#endif

#ifdef CONFIG_LEDS_CPU
	case led_idle_start:
		break;

	case led_idle_end:
		break;
#endif

	case led_halted:
		break;

	case led_green_on:
		if (led_state & LED_STATE_CLAIMED)
			hw_led_state |= LED_GREEN;
		break;

	case led_green_off:
		if (led_state & LED_STATE_CLAIMED)
			hw_led_state &= ~LED_GREEN;
		break;

	case led_amber_on:
		break;

	case led_amber_off:
		break;

	case led_red_on:
		break;

	case led_red_off:
		break;

	default:
		break;
	}

	if  (led_state & LED_STATE_ENABLED)
		set_cs3_bit(LED2_ON);
	else
	        clear_cs3_bit(LED2_ON);
}


text:
package org.glob3.mobile.demo;

import org.glob3.mobile.generated.Angle;
import org.glob3.mobile.generated.Color;
import org.glob3.mobile.generated.ElevationDataProvider;
import org.glob3.mobile.generated.GEORenderer;
import org.glob3.mobile.generated.Geodetic2D;
import org.glob3.mobile.generated.Geodetic3D;
import org.glob3.mobile.generated.LayerSet;
import org.glob3.mobile.generated.MapBoxLayer;
import org.glob3.mobile.generated.Planet;
import org.glob3.mobile.generated.Sector;
import org.glob3.mobile.generated.SingleBilElevationDataProvider;
import org.glob3.mobile.generated.TimeInterval;
import org.glob3.mobile.generated.URL;
import org.glob3.mobile.generated.Vector2I;
import org.glob3.mobile.specific.G3MBuilder_Android;
import org.glob3.mobile.specific.G3MWidget_Android;

import android.app.Activity;
import android.os.Bundle;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class ShapeSymbolizerActivity
         extends
            Activity {

   private G3MWidget_Android _g3mWidget;
   private RelativeLayout    _placeHolder;
   private GEORenderer       _vectorialRenderer;

   @Override
   protected void onCreate(final Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_shape_symbolizer);

      final Geodetic2D lower = new Geodetic2D( //
               Angle.fromDegrees(17.7504), //
               Angle.fromDegrees(-174.2));
      final Geodetic2D upper = new Geodetic2D( //
               Angle.fromDegrees(71.2906), //
               Angle.fromDegrees(-64.75));
      final Sector demSector = new Sector(lower, upper);

      final G3MBuilder_Android builder = new G3MBuilder_Android(this);

      builder.setPlanet(Planet.createFlatEarth());

      final LayerSet layerSet = new LayerSet();
      final MapBoxLayer mboxTerrainLayer = new MapBoxLayer("examples.map-qogxobv1", TimeInterval.fromDays(30), true, 3);
      layerSet.addLayer(mboxTerrainLayer);
      builder.getPlanetRendererBuilder().setLayerSet(layerSet);

      builder.setBackgroundColor(Color.fromRGBA255(185, 221, 209, 255).muchDarker());

      final ElevationDataProvider dem = new SingleBilElevationDataProvider(new URL("file:///full-earth-2048x1024.bil", false),
               demSector, new Vector2I(2048, 1024), 0);

      _vectorialRenderer = builder.createGEORenderer(Symbology.USCitiesSymbolizer);
      _vectorialRenderer.loadJSON(new URL("file:///uscitieslite.geojson"));
      builder.addRenderer(_vectorialRenderer);

      builder.getPlanetRendererBuilder().setElevationDataProvider(dem);
      builder.getPlanetRendererBuilder().setVerticalExaggeration(3f);
      builder.setShownSector(demSector);

      _g3mWidget = builder.createWidget();

      _g3mWidget.setAnimatedCameraPosition(Geodetic3D.fromDegrees(39.12787093899339d, -77.59965772558118d, 500000),
               TimeInterval.fromSeconds(8));

      _placeHolder = (RelativeLayout) findViewById(R.id.g3mWidgetHolder);

      final TextView labelUsPopulation = (TextView) findViewById(R.id.labelUSPopulation);
      labelUsPopulation.bringToFront();
      labelUsPopulation.setBackgroundColor(toAndroidColor(Color.fromRGBA255(0, 0, 0, 180)));

      _placeHolder.addView(_g3mWidget);

   }

   private int toAndroidColor(final Color c) {
      return android.graphics.Color.argb(Math.round(c._alpha * 255), Math.round(c._red * 255), Math.round(c._green * 255),
               Math.round(c._blue * 255));
   }

   @Override
   public void onBackPressed() {
      System.exit(0);
   }
}


text:
package org.firstinspires.ftc.quadx.Autonomous;

import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.Disabled;
import com.qualcomm.robotcore.util.ElapsedTime;

import org.firstinspires.ftc.quadx.Libraries.MyOpMode;

/**
 * This file contains an minimal example of a Linear "OpMode". An OpMode is a 'program' that runs in either
 * the autonomous or the teleop period of an FTC match. The names of OpModes appear on the menu
 * of the FTC Driver Station. When an selection is made from the menu, the corresponding OpMode
 * class is instantiated on the Robot Controller and executed.
 *
 * This particular OpMode just executes a basic Tank Drive Teleop for a PushBot
 * It includes all the skeletal structure that all linear OpModes contain.
 *
 * Use Android Studios to Copy this Class, and Paste it into your team's code folder with a new name.
 * Remove or comment out the @Disabled line to add this opmode to the Driver Station OpMode list
 */

@Autonomous(name="Trollbot", group="Testing")
@Disabled
public class Trollbot extends MyOpMode {

    private ElapsedTime runtime = new ElapsedTime();

    @Override
    public void runOpMode() throws InterruptedException {
        telemetry.addData("Status", "Initialized");
        telemetry.update();
        hardwareMapTroll();
        initSensors();

        waitForStart();
        runtime.reset();

        moveToRange(.2, 1000, 15);

        // run until the end of the match (driver presses STOP)
//        while (opModeIsActive()) {
//            telemetry.addData("Status", "Run Time: " + runtime.toString());
//            telemetry.addData("Gyro", getGyroYaw());
//            telemetry.addData("Ultra", getUltraDistance());
//            telemetry.addData("floorL", floorL.alpha());
//            telemetry.addData("floorR", floorR.alpha());
//            telemetry.addData("beaconL", beaconL.red());
//            telemetry.addData("beaconR", beaconR.red());
//            telemetry.update();
//
//
//            idle();
//        }
    }
}


text:
"""
Copyright [2009-2019] 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.
"""

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

import argparse
import os
import subprocess
import sys
from subprocess import Popen, PIPE

from utils import db_utils as db

# ------------------------------------- GLOBALS ------------------------------------
# this group only allows 10 rfsearch jobs to run concurrently
# this means 10*100 = 1000 jobs running concurrently which is the lsf limit

LSF_GROUP = "/family_srch"
MEMORY = 2000
CPU = 8
MAX_JOB_COUNT = 1000
family_exceptions = {'RF02924': '', 'RF03064': '', 'RF02913': '',
                     'RF02543': '', 'RF00017': '', 'RF02540': ''}

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

def checkout_family(rfam_acc):
    """
    Checks out a family from Rfam based on a valid Rfam accession.

    rfam_acc: A valid Rfam accession
    return: None
    """
    cmd = "rfco.pl %s" % rfam_acc
    subprocess.call(cmd, shell=True)

    # add some checks here

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

def submit_new_rfsearch_job(family_dir, rfmake=False):
    """
    Submits a new lsf job that runs rfsearch to update SCORES for a new release.
    If no threshold is set with rfsearch.pl, it uses existing thresholds by default.

    family_dir: The physical location of the family directory
    rfmake: If True, run rfmake after rfsearch completes. Default False

    return: None
    """

    # use the pre-process command to change directory to family_dir
    rfam_acc = os.path.basename(family_dir)
    lsf_err_file = os.path.join(family_dir, "auto_rfsearch.err")
    lsf_out_file = os.path.join(family_dir, "auto_rfsearch.out")
    cmd = ("bsub -M %s -R \"rusage[mem=%s]\" -o %s -e %s -n %s -g %s -q production-rh7 "
           "-J %s \"cd %s && rfsearch.pl -q production-rh7 -relax\"")

    # If rfmake is set to True, runs rfmake following rfsearch, otherwise run rfsearch
    # only by default

    if rfmake is True:
        cmd = ("bsub -M %s -R \"rusage[mem=%s]\" -o %s -e %s -n %s -g %s -q production-rh7 "
               "-J %s \"cd %s && rfsearch.pl -q production-rh7 -relax && rfmake.pl\"")

    subprocess.call(cmd % (MEMORY, MEMORY, lsf_out_file, lsf_err_file,
                           CPU, LSF_GROUP, rfam_acc, family_dir), shell=True)

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

def submit_new_rfmake_job(family_dir):
    """
    Submits a new lsf job that runs rfsearch to update SCORES for a new release.
    If no threshold is set with rfsearch.pl, it uses existing thresholds by default.

    family_dir: The physical location of the family directory
    rfmake: If True, run rfmake after rfsearch completes. Default False

    return: None
    """
    # use the pre-process command to change directory to family_dir

    rfam_acc = os.path.basename(family_dir)
    lsf_err_file = os.path.join(family_dir, "auto_rfmake.err")
    lsf_out_file = os.path.join(family_dir, "auto_rfmake.out")

    cmd = ("bsub -M %s -R \"rusage[mem=%s]\" -o %s -e %s -n %s -g %s -q production-rh7 "
           "-J %s \"cd %s && rfmake.pl\"")

    subprocess.call(cmd % (MEMORY, MEMORY, lsf_out_file, lsf_err_file,
                           CPU, LSF_GROUP, rfam_acc, family_dir), shell=True)

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

def load_rfam_accessions_from_file(accession_list):
    """
    This function parses a .txt file containing Rfam accessions and returns those
    accession_list: This is a .txt file containing a list of Rfam accessions

    return: list of Rfam family accessions
    """
    fp = open(accession_list, 'r')
    accessions = [x.strip() for x in fp]

    fp.close()

    return accessions

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

def checkout_and_search_family(rfam_acc, dest_dir, rfmake=False):
    """
    This function combines family checkout (rfco.pl) and re-scoring of hits
    using rfsearch.pl. If the family directory already exists, then the
    checkout step will be ignored

    rfam_acc: A valid Rfam family accession (RFXXXXX)
    dest_dir: A valid destination directory, where to checkout the family
    rfmake: If True, run rfmake after rfsearch completes. Default False

    return: void
    """

    # get family directory
    family_dir = os.path.join(dest_dir, rfam_acc)
    # checkout family if not done already
    if not os.path.exists(family_dir):
        os.chdir(dest_dir)
        checkout_family(rfam_acc)

    submit_new_rfsearch_job(family_dir, rfmake)

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

def parse_arguments():
    """
    Uses python's argparse to parse the command line arguments

    return: Argparse parser object
    """

    # create a new argument parser object
    parser = argparse.ArgumentParser(description='Update scores for new release')

    # group required arguments together
    req_args = parser.add_argument_group("required arguments")
    req_args.add_argument('--dest-dir', help='destination directory where to checkout families',
                          type=str, required=True)

    mutually_exclusive_args = parser.add_mutually_exclusive_group()
    mutually_exclusive_args.add_argument('-f', help='a file containing a list of Rfam family accessions', type=str)
    mutually_exclusive_args.add_argument('--all', help='runs rfsearch on all families', action="store_true")
    mutually_exclusive_args.add_argument('--acc', help="a valid rfam family accession RFXXXXX",
                                         type=str, default=None)
    parser.add_argument('--rfmake', help='run rfmake after rfsearch completion', action="store_true")
    parser.add_argument('-v', help='runs validation checks', action="store_true")

    parser.add_argument('--report', help='generates search reports', action="store_true")

    # this is mutually exclusive with --acc option
    parser.add_argument('--exclude-type', help='type(s) of ncRNAs to exclude', type=str, default=None)

    return parser

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

def is_valid_family(dest_dir, rfam_acc):
    """
    Checks if the job ran successfully by checking if .err file is empty and
    that Success keyword exists in .out file. As an additional sanity check, we
    look for the rfsearch.log file as an indication that rfsearch actually ran.

    return: True if the family is valid, False otherwise
    """

    family_dir = os.path.join(dest_dir, rfam_acc)

    # If log file does not exist rfsearch did not run for some reason
    if not os.path.exists(os.path.join(family_dir, "rfsearch.log")):
        return False

    # check if lsf .err file is empty
    if not os.path.getsize(os.path.join(family_dir, "auto_rfsearch.err")) == 0:
        return check_rfsearch_log_success(family_dir)

    # check if success in .out file
    lsf_out_file = os.path.join(family_dir, "auto_rfsearch.out")

    process = Popen(['grep', 'Success', lsf_out_file], stdin=PIPE, stdout=PIPE, stderr=PIPE)
    output, err = process.communicate()

    if output.find("Successfully completed.") == -1:
        return False

    return True

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

def get_missing_seeds_seedoutlist(num_seed_db, seedoutlist):
    """
    Parses the seedoutlist file and compares the number of seed sequences
    obtained from the database and the number of seed hits in the outlist file

    num_seed_db: The number of seed sequences found in the database
    seedoutlist: The SEED specific outlist file

    return (boolean): True if the number is consistent, False otherwise.
    """

    unique_seeds = extract_unique_seeds_from_seedoutlist(seedoutlist)
    seed_count = len(unique_seeds.keys())

    return num_seed_db - seed_count

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

def check_rfsearch_log_success(family_dir):
    """
    Checks if the rfsearch.log file contains the success string # [ok] in
    order to mark the family as successfully completed.
    """

    rfsearch_log_file = os.path.join(family_dir, "rfsearch.log")
    process = Popen(['tail', '-1', rfsearch_log_file], stdin=PIPE, stdout=PIPE, stderr=PIPE)
    output, err = process.communicate()

    if output.find("# [ok]") == -1:
        return False

    return True

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

def count_hits(scores_file):
    """
    Function to count SEED and FULL hits in outlist and species files at three
    different thresholds (above ga, below ga, below rev)

    scores_file: This is either the species or the outlist files from the family
    directories

    return: A dictionary with SEED and FULL counts at different thresholds
    """

    # check point flags
    flag_curr = 0
    flag_rev = 0

    # initialization of counts
    counts = {"seed_above_ga": 0,
              "full_above_ga": 0,
              "full_below_ga": 0,
              "seed_below_ga": 0,
              "seed_below_rev": 0,
              "full_below_rev": 0}

    # load file for easy parsing
    fp = open(scores_file, 'r')

    # generate stats
    for line in fp:
        # make flag_curr = 1 when we reach that line
        if line.find("CURRENT THRESHOLD") != -1:
            flag_curr = 1
            continue

        # when we reach the reversed sequence line set the flag to 1
        if line.find("BEST REVERSED") != -1:
            flag_rev = 1
            continue

        # we are above the
        if flag_curr == 0 and flag_rev == 0:
            if line.find("SEED") != -1:
                counts["seed_above_ga"] += 1

            elif line.find("FULL") != -1:
                counts["full_above_ga"] += 1
        # we are somewhere in between current threshold and reversed cutoff
        elif flag_curr == 1 and flag_rev == 0:
            if line.find("SEED") != -1:
                counts["seed_below_ga"] += 1

            elif line.find("FULL") != -1:
                counts["full_below_ga"] += 1

        elif flag_curr == 1 and flag_rev == 1:
            if line.find("SEED") != -1:
                counts["seed_below_rev"] += 1

            elif line.find("FULL") != -1:
                counts["full_below_rev"] += 1

    fp.close()

    return counts

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

def extract_unique_seeds_from_seedoutlist(seedoutlist):
    """
    Extracts all unique SEED accessions in the form of rfamseq_acc/start-end.
    Ignores duplicated hits.

    """

    seeds_found = {}

    fp = open(seedoutlist, 'r')

    for line in fp:
        if line[0] != '#':
            line = [x for x in line.strip().split(' ') if x != '']
            if line[3] not in seeds_found:
                seeds_found[line[3]] = float(line[0])

    fp.close()

    return seeds_found

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

def generate_search_stats(family_dir, scores_file='species', tag_miRNA=True):
    """
    Function to generate useful search stats per family

    family_dir: A valid Rfam family checkout directory where pre-computed searches
    were ran
    scores_file: A string specifying the scores file to parse (outlist, species)

    return: report string
    """

    rfam_acc = os.path.basename(family_dir)

    # check point flags
    flag_curr = 0
    flag_rev = 0
    elements = None
    prev_line = None

    seen_ga = False
    seen_rev_before_ga = False
    ga_bit_score = 0.0
    rev_bit_score = 0.0
    ga_rev_seq_gap = 0  # gap in sequences between GA/REV thresholds
    is_miRNA = 0

    seed_above_ga = None
    last_seed_seen = None
    seq_position = 0
    last_seed_pos = 0
    seed_above_ga_pos = 0
    ga_position = 0
    rev_position = 0
    position = 1  # keeps hold of the index position with respect to the entire outlist
    review_family = False
    full_check = False

    unique_seeds = {}

    # initialization of counts
    counts = {"seed_above_ga": 0,
              "full_above_ga": 0,
              "full_below_ga": 0,
              "seed_below_ga": 0,
              "seed_below_rev": 0,
              "full_below_rev": 0,
              "other_below_ga": 0}

    # fetch miRNA accessions from the database
    miRNAs = {}
    if tag_miRNA is True:
        miRNAs.update(db.fetch_type_specific_rfam_accessions("miRNA", return_type="dict"))

    if rfam_acc in miRNAs:
        is_miRNA = 1

    # get some useful numbers from the database
    num_seed_seqs_db = db.get_number_of_seed_sequences(rfam_acc)
    num_full_hits_db = db.get_number_of_full_hits(rfam_acc)
    unique_ncbi_ids_db = db.get_family_unique_ncbi_ids(rfam_acc)

    seedoutlist = os.path.join(family_dir, "seedoutlist")
    missing_seed_seqs_so = get_missing_seeds_seedoutlist(num_seed_seqs_db, seedoutlist)

    scores_fp = open(os.path.join(family_dir, scores_file), 'r')

    # this will basically read the first line which is a header so no harm
    line = scores_fp.readline()
    prev_line = line

    ncbi_ids_from_hits = set()

    # generate stats
    for line in scores_fp:
        position += 1  # starts from 1 because we read the 1st line out of the loop

        # make flag_curr = 1 when we reach that line
        if line.find("CURRENT GA THRESHOLD") != -1:
            flag_curr = 1
            # if we reached this point, it means we saw GA
            seen_ga = True
            ga_position = position

            # get all the elements of the last score line above the GA threshold
            seed_above_ga = last_seed_seen
            seed_above_ga_pos = last_seed_pos

            # get GA threshold
            elements = line.split(' ')
            ga_bit_score = float(elements[-3])
            continue

        # when we reach the reversed sequence line set the flag to 1
        if line.find("BEST REVERSED") != -1:
            flag_rev = 1
            rev_position = position
            # check if GA is false at this point. If yes, this means we saw REV first.
            # setting flag to True
            if seen_ga is False:
                seen_rev_before_ga = True
                continue

        if line[0] != '#':
            # increase sequence position
            # seq_position += 1
            elements = [x for x in line.strip().split(' ') if x != '']

            # first line after hitting REV line
            if flag_rev == 1 and rev_bit_score == 0.0:
                rev_bit_score = float(elements[0])

            # add id to ncbi_ids
            ncbi_ids_from_hits.add(elements[5])

            # we are above the GA
            if flag_curr == 0 and flag_rev == 0:
                if elements[2] == "SEED":
                    # make sure the sequences is not in the dictionary and that it starts from 1
                    if elements[3] not in unique_seeds:
                        counts["seed_above_ga"] += 1
                        unique_seeds[elements[3]] = (elements[8], elements[9])

                elif elements[2] == "FULL" or elements[2] == "FULL-SEED":
                    counts["full_above_ga"] += 1

            # we are somewhere in between current threshold and reversed cutoff
            elif flag_curr == 1 and flag_rev == 0:
                if elements[2] == "SEED":
                    if elements[3] not in unique_seeds:
                        counts["seed_below_ga"] += 1
                        unique_seeds[elements[3]] = (elements[8], elements[9])

            elif flag_curr == 1 and flag_rev == 1:
                if elements[2] == "SEED":
                    if elements[3] not in unique_seeds:
                        counts["seed_below_rev"] += 1
                        unique_seeds[elements[3]] = (elements[8], elements[9])

            # if between GA and REV count sequences
            if ((flag_curr == 1 and flag_rev == 0) or (flag_curr == 0 and flag_rev == 1)):
                ga_rev_seq_gap += 1

            # always stores the last seed up to the current iteration point
            # at the end of the file, last_seed_seen will be holding the last SEED sequence
            # seen in the outlist file
            if elements[2] == "SEED":
                last_seed_seen = elements
                # sets position
                last_seed_pos = position

        # current line becomes previous at the end of each iteration
        prev_line = line

    scores_fp.close()

    # computes the number of any missing SEED sequences. That is SEEDs that do not appear in the outlist
    missing_seed_seqs_o = abs(
        num_seed_seqs_db - (counts["seed_above_ga"] + counts["seed_below_ga"] + counts["seed_below_rev"]))

    # compute the total number of ncbi_ids including
    # total_ncbi_ids_found = len(list(set(unique_ncbi_ids_db).union(ncbi_ids_from_hits)))

    # calulates the number of new ncbi ids added to the full region after a new search
    # new_ncbi_ids_found = abs(total_ncbi_ids_found - len(unique_ncbi_ids_db))

    # ABS(NFULL_OLD-NFULL_NEW) > 0.1 * NFULL_OLD
    # full_diff = abs(num_full_hits_db - (counts["full_above_ga"] + counts["full_below_ga"]))

    # compute GA/REV bit score difference
    ga_rev_bitscore_diff = abs(ga_bit_score - rev_bit_score)

    # if full_diff > (0.1 * num_full_hits_db):
    # full_check = True

    # constraints to be met for reviewing families
    if (seen_rev_before_ga or (counts["seed_below_ga"] > 0) or (counts["seed_below_rev"] > 0)):
        review_family = True

    fields = [rfam_acc, str(num_seed_seqs_db), str(counts["seed_above_ga"]), str(counts["seed_below_ga"]),
              str(counts["seed_below_rev"]), str(missing_seed_seqs_o), str(missing_seed_seqs_so),
              str(ga_bit_score), str(rev_bit_score), str(ga_rev_bitscore_diff), str(ga_rev_seq_gap),
              str(int(seen_rev_before_ga)), seed_above_ga[0], str(seed_above_ga_pos),
              str(ga_position), str(rev_position), last_seed_seen[0], str(last_seed_pos),
              str(int(review_family))]

    """
    fields = [rfam_acc, str(num_seed_seqs_db), str(counts["seed_above_ga"]), str(counts["seed_below_ga"]),
    str(counts["seed_below_rev"]), str(missing_seed_seqs_o), str(missing_seed_seqs_so),
    str(num_full_hits_db), str(counts["full_above_ga"]), str(len(unique_ncbi_ids_db)),
    str(new_ncbi_ids_found), str(ga_bit_score), str(rev_bit_score), str(ga_rev_bitscore_diff),
    str(ga_rev_seq_gap), str(int(seen_rev_before_ga)), seed_above_ga[0], str(seed_above_ga_pos),
    str(ga_position), str(rev_position), last_seed_seen[0], str(last_seed_pos), str(int(review_family))]
    """

    if tag_miRNA is True:
        fields.append(str(is_miRNA))

    print ('\t'.join(fields))

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

def write_family_report_file(family_dir, scores_file="species"):
    """
    Function to generate a report about the outcome of a new search

    family_dir: A valid location of an Rfam family checkout
    scores_file: This is a string which specifies the file to parse (outlist | species)
    It parses species file by default.

    return (int): A number specifying the curation priority for a specific family, where
    3: critical, 2: critical but not erroneous, 1: check seed, 0: no attention needed
    """

    priority = 0
    # fetch number of seed sequences from the database
    rfam_acc = os.path.basename(family_dir)
    no_seed_seqs = db.get_number_of_seed_sequences(rfam_acc)

    scores_file_loc = os.path.join(family_dir, scores_file)
    counts = count_hits(scores_file_loc)

    report_fp = open(os.path.join(family_dir, "search_report.txt"), 'w')

    # sum all seed counts to get total number of seed sequences
    counted_seed_seqs = counts["seed_above_ga"] + counts["seed_below_ga"] + counts["seed_below_rev"]

    # Critical SEED issues
    if counts["seed_below_rev"] != 0:
        report_fp.write("CRITICAL: %s SEED sequences below reversed cutoff\n" % str(counts["seed_below_rev"]))
        priority = 3

    if counts["seed_below_ga"] > counts["seed_above_ga"]:
        percentage = float(counts["seed_below_ga"] * 100) / float(no_seed_seqs)
        report_fp.write("CRITICAL: More SEED sequences below GA than above. %s\n" % percentage)

        if priority < 2:
            priority = 2

    if counted_seed_seqs != no_seed_seqs:
        report_fp.write(
            "WARNING: The number of SEED sequences in the database does not match the number in the alignment\n\n")
        priority = 3

    # TODO - Develop code to check taxonomic distribution
    # TODO - Use information from FULL hits too

    # some useful information
    report_fp.write("Total number of SEED sequences in DB: %s\n" % no_seed_seqs)
    report_fp.write("Total number of SEED sequences counted: %s\n" % counted_seed_seqs)

    report_fp.write("%s SEED sequences are above GA\n" % counts["seed_above_ga"])
    report_fp.write("%s SEED sequences are below GA\n" % counts["seed_below_ga"])
    report_fp.write("%s SEED sequences are below the reversed cutoff\n" % counts["seed_below_rev"])

    report_fp.close()

    return priority

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

def extract_scores_from_outlist_file(outlist):
    """

    :param outlist:
    :return:
    """

    scores = {'SEED': [], 'FULL': [], 'OTHER': []}

    outlist_fp = open(outlist, 'r')

    for line in outlist_fp:
        if line[0] != '#':
            line = [x for x in line.strip().split(' ') if x!='']
            scores[line[2]].append(float(line[0]))

        else:
            # if we reached REVERSED line, we treat everything as TNs
            # break and return
            if line.find("BEST REVERSED") != -1:
                break

    outlist_fp.close()

    return scores

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

def print_report_header(extended=True):
    """
    Prints the report header

    extended (boolean): If true, prints all the columns, otherwise just the
    short version

    returns: void
    """

    if extended is True:
        print (
        "RFAM_ACC\tnum_seed_seqs\tseed_above_GA\tseed_below_ga\tseed_below_rev\tmissing_seeds_outlist\t".upper()),
        print ("missing_seeds_seedoutlist\tnum_full_DB\tfull_above_ga\tUNIQUE_NCBI_ID_DB\tNOVEL_NCBI_IDs\t".upper()),
        print (
        "ga_bit_SCORE\trev_bit_score\tGA_REV_SCORE_diff\tga_rev_seq_gap\tREV_before_GA\tseed_above_ga_score\t".upper()),
        print ("seed_above_ga_pos\tga_pos\trev_pos\tlast_seed_score\tlast_seed_pos\treview_family\tis_miRNA\n".upper()),

    else:
        print (
        "RFAM_ACC\tnum_seed_seqs\tseed_above_GA\tseed_below_ga\tseed_below_rev\tmissing_seeds_outlist\t".upper()),
        print ("missing_seeds_seedoutlist\tga_bit_SCORE\trev_bit_score\tGA_REV_SCORE_diff\tga_rev_seq_gap\t".upper()),
        print ("REV_before_GA\tseed_above_ga_score\tseed_above_ga_pos\tga_pos\trev_pos\tlast_seed_score\t".upper()),
        print ("last_seed_pos\treview_family\tis_miRNA\n".upper()),

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

if __name__ == '__main__':

    outlist = "../data/../outlist"
    print (extract_scores_from_outlist_file(outlist))

    """
    # create a new argument parser object
    parser = parse_arguments()
    args = parser.parse_args()

    if args.acc and not args.v and not args.report:
        # check accession provided is valid
        if args.acc[0:2] == 'RF' and len(args.acc) == 7:
            os.chdir(args.dest_dir)

            checkout_and_search_family(args.acc, args.dest_dir, rfmake=args.rfmake)

    elif args.f and not args.v:
        if not os.path.isfile(args.f):
            print ("The file location you provided does not exist!\n")
            sys.exit()

        # move to destination directory
        os.chdir(args.dest_dir)
        accessions = load_rfam_accessions_from_file(args.f)

        \"""
        # get number of job batches we need to submit
        # casting to int chops off decimals and ceil rounds up to nearest int
        if len(accessions) > MAX_JOB_COUNT:
            no_batches = int(math.ceil(len(accessions)/MAX_JOB_COUNT))

        i = 0
        while i < no_batches:
            lidx = i * MAX_JOB_COUNT     # left index
            ridx = (i+1) * MAX_JOB_COUNT # right index

            # get exactly MAX_JOB_COUNT items
            if i < no_batches - 1:
                new_batch = accessions[lidx:ridx]
            # get remaining accessions for last batch
            else:
                new_batch = accessions[lidx:]
            # call function to submit batch
            # while monitoring is True:
            # cluster monitoring function to be called here
            i+1 # this is done when the monitoring loop becomes false which is a signal to submit another batch
            \"""
        for rfam_acc in accessions:
            checkout_and_search_family(rfam_acc, args.dest_dir, rfmake=args.rfmake)

    # run rfsearch on all families in the database
    elif args.all and not args.v and not args.report and not args.rfmake:
        # fetch Rfam family accessions from the database
        # call checkout_and_search_family for every family in the list
        # fetches all rfam accessions from the database in DESC order based on the number of sequences in SEEDs
        rfam_acc_list = db.fetch_rfam_accs_sorted(order='DESC')
        for rfam_acc in rfam_acc_list:
            checkout_and_search_family(rfam_acc, args.dest_dir, rfmake=args.rfmake)

    # validate rfsearch runs
    elif args.v:
        # validate a single family
        if args.acc:
            if not is_valid_family(args.dest_dir, args.acc):
                print ("The family %s does not validate!" % args.acc)

        # validate runs for all accessions in the input file
        elif args.f:
            validation_file = os.path.join(args.dest_dir, "validation.log")
            fp = open(validation_file, 'w')

            accessions = load_rfam_accessions_from_file(args.f)

            for rfam_acc in accessions:
                if not is_valid_family(args.dest_dir, rfam_acc):
                    fp.write(rfam_acc + '\n')

            fp.close()

            if os.path.getsize(validation_file) == 0:
                print ("Validation process completed! All searches completed successfully!")

            else:
                print ("Validation process completed! Check validation.log for erroneous searches!")

        # validate all families in the directory, but don't generate any reports
        elif args.all and not args.report:

            validation_file = os.path.join(args.dest_dir, "validation.log")
            fp = open(validation_file, 'w')
            accessions = [x for x in os.listdir(args.dest_dir) if os.path.isdir(os.path.join(args.dest_dir, x))]

            for rfam_acc in accessions:
                if not is_valid_family(args.dest_dir, rfam_acc):
                    fp.write(rfam_acc + '\n')

            fp.close()

            if os.path.getsize(validation_file) == 0:
                print ("Validation process completed! All searches completed successfully!")

            else:
                print ("Validation process completed! Check validation.log for erroneous searches!")

    # generate reports
    elif args.report:

        # print report header
        print_report_header(extended=False)

        # generate report for a specific family
        if args.acc:
            # check if searches where validated
            if not os.path.exists(os.path.join(args.dest_dir, "validation.log")):
                sys.exit("WARNING: This search may be invalid. Run validation and try again!")

            family_dir = os.path.join(args.dest_dir, args.acc)
            generate_search_stats(family_dir, scores_file='species', tag_miRNA=True)

        # generate reports for all families in the destination directory
        elif args.all:

            families = [x for x in os.listdir(args.dest_dir) if os.path.isdir(os.path.join(args.dest_dir, x))]

            # fetch Rfam family accessions to exclude if defined
            exclude_accs = {}
            if args.exclude_type:
                exclude_accs = db.fetch_type_specific_rfam_accessions(args.exclude_type, return_type="dict")

            for family in families:
                # families of which searches did not complete
                # remove the database on
                if family not in exclude_accs and family not in family_exceptions:
                    family_dir = os.path.join(args.dest_dir, family)
                    generate_search_stats(family_dir, scores_file='species', tag_miRNA=True)

        # run rfmake
        elif args.rfmake:
            # run rfmake on all families
            if args.all:
                families = [x for x in os.listdir(args.dest_dir) if os.path.isdir(os.path.join(args.dest_dir, x))]

                for family in families:
                    family_dir = os.path.join(args.dest_dir, family)
                    submit_new_rfmake_job(family_dir)

            # run rfmake for a specific family
            elif args.acc:
                family_dir = os.path.join(args.dest_dir, args.acc)
                submit_new_rfmake_job(family_dir)

            # run rfmake for all accessions in the file
            elif args.f:
                fp = open(args.f, r)
                families = [x.strip() for x in fp]
                fp.close()

                for family in families:
                    family_dir = os.path.join(args.dest_dir, family)
                    submit_new_rfmake_job(family_dir)
    """


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Ascochyta corchoricola Khokhr.

### Remarks
null


text:
<?php

namespace UserBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Entity\User as FOSUser;

/**
 * @ORM\Entity
 * @ORM\Table(name="fos_user")
 */
class User  extends FOSUser{

    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    public function __construct()
    {
        parent::__construct();

    }

    public function getId() {
        return $this->id;
    }

    public function setId($id) {
        $this->id = $id;
    }
 }