text:
import numpy as np

from ray.rllib.models.utils import get_activation_fn
from ray.rllib.utils.framework import try_import_torch, TensorType

torch, nn = try_import_torch()

class NoisyLayer(nn.Module):
    """A Layer that adds learnable Noise to some previous layer's outputs.

    Consists of:
    - a common dense layer: y = w^{T}x + b
    - a noisy layer: y = (w + \\epsilon_w*\\sigma_w)^{T}x +
        (b+\\epsilon_b*\\sigma_b)
    , where \epsilon are random variables sampled from factorized normal
    distributions and \\sigma are trainable variables which are expected to
    vanish along the training procedure.
    """

    def __init__(self,
                 in_size: int,
                 out_size: int,
                 sigma0: float,
                 activation: str = "relu"):
        """Initializes a NoisyLayer object.

        Args:
            in_size: Input size for Noisy Layer
            out_size: Output size for Noisy Layer
            sigma0: Initialization value for sigma_b (bias noise)
            activation: Non-linear activation for Noisy Layer
        """
        super().__init__()

        self.in_size = in_size
        self.out_size = out_size
        self.sigma0 = sigma0
        self.activation = get_activation_fn(activation, framework="torch")
        if self.activation is not None:
            self.activation = self.activation()

        sigma_w = nn.Parameter(
            torch.from_numpy(
                np.random.uniform(
                    low=-1.0 / np.sqrt(float(self.in_size)),
                    high=1.0 / np.sqrt(float(self.in_size)),
                    size=[self.in_size, out_size])).float())
        self.register_parameter("sigma_w", sigma_w)
        sigma_b = nn.Parameter(
            torch.from_numpy(
                np.full(
                    shape=[out_size],
                    fill_value=sigma0 / np.sqrt(float(self.in_size)))).float())
        self.register_parameter("sigma_b", sigma_b)

        w = nn.Parameter(
            torch.from_numpy(
                np.full(
                    shape=[self.in_size, self.out_size],
                    fill_value=6 /
                    np.sqrt(float(in_size) + float(out_size)))).float())
        self.register_parameter("w", w)
        b = nn.Parameter(torch.from_numpy(np.zeros([out_size])).float())
        self.register_parameter("b", b)

    def forward(self, inputs: TensorType) -> TensorType:
        epsilon_in = self._f_epsilon(
            torch.normal(
                mean=torch.zeros([self.in_size]),
                std=torch.ones([self.in_size])).to(inputs.device))
        epsilon_out = self._f_epsilon(
            torch.normal(
                mean=torch.zeros([self.out_size]),
                std=torch.ones([self.out_size])).to(inputs.device))
        epsilon_w = torch.matmul(
            torch.unsqueeze(epsilon_in, -1),
            other=torch.unsqueeze(epsilon_out, 0))
        epsilon_b = epsilon_out

        action_activation = torch.matmul(
            inputs, self.w +
            self.sigma_w * epsilon_w) + self.b + self.sigma_b * epsilon_b

        if self.activation is not None:
            action_activation = self.activation(action_activation)
        return action_activation

    def _f_epsilon(self, x: TensorType) -> TensorType:
        return torch.sign(x) * torch.pow(torch.abs(x), 0.5)


text:
A small growl-like notification plugin for jQuery
- http://boedesign.com/blog/2009/07/11/growl-for-jquery-gritter/

## Change Log

### Changes in 1.7.4 (February 24, 2012)

* Fixing bug where click event was being bound multiple times on hover. The result was the beforeClose callback being called multiple times. Thanks for commit aossowski!

### Changes in 1.7.3 (December 8, 2011)

* Added $.gritter.options.class_name option
* Added 'gritter-light' class_name option to use light messages instead of dark ones

### Changes in 1.7.2 (December 2, 2011)

* Added option to return false on "before_open" callback to determine whether or not to show the gritter message (good for setting a max)

### Changes in 1.7.1 (March 29, 2011)

* Dropped IE6 support
* Added position option to global options (bottom-left, top-left, top-right, bottom-right)

### Changes in 1.7 (March 25, 2011)

* Fixed 404 issue in the css when fetching '.' as an image
* Added callback parameter in before_close and after_close callbacks to determine whether it was closed manually by clicking the (X)

### Changes in 1.6 (December1, 2009)

* Commented code using JSDOC
* Major code cleanup/re-write
* Made it so when you hit the (X) close button, the notification slides up and vanishes instead of just vanishing
* Added optional "class_name" option for $.gritter.add() to apply a class to a specific notification
* Fixed IE7 issue pointed out by stoffel (http://boedesign.com/blog/2009/07/11/growl-for-jquery-gritter/)

### Changes in 1.5 (October 21, 2009)

* Renamed the global option parameters to make more sense
* Made it so the global options are only being ran once instead of each $.gritter.add() call

### Changes in 1.4 (October 20, 2009)

* Added callbacks (before_open, before_close, after_open, after_close) to the gritter notifications
* Added callbacks (before_close, after_close) to the removeAll() function
* Using 1 image for the CSS instead of 5 (Thanks to Ozum Eldogan)
* Added option to over-ride gritter global options with $.extend

### Changes in 1.3 (August 1, 2009)

* Fixed IE6 positioning bug

### Changes in 1.2 (July 13, 2009)

* Fixed hover bug (pointed out by Beel & tXptr on the comments)

redpajama_set_name: RedPajamaGithub


text:
from django import forms
from .models import Chart

EMPTY_NAME_FIELD_ERROR = "You must provide a name."

class TextAreaForm(forms.Form):

    def __init__(self, *args, **kwargs):
        self.values = kwargs.pop('values', None)
        super(TextAreaForm, self).__init__(*args, **kwargs)
        if self.values:
            self.fields['data'].initial = self.values

    data = forms.CharField(max_length=100000,
                           widget=forms.Textarea(attrs={
                            'class': 'form-control',
                            'rows': '15',
                            'id': 'textInput'}))

class ChartForm(forms.ModelForm):

    def __init__(self, *args, **kwargs):
        self.user = kwargs.pop('user', None)
        super(ChartForm, self).__init__(*args, **kwargs)
        if self.user:
            if not self.user.is_authenticated():
                for key in self.fields:
                    self.fields[key].widget.attrs['readonly'] = True

    class Meta:
        model = Chart
        fields = ['name', 'xname', 'xunit', 'yname', 'yunit',
                  'legend', 'details', 'reference']
        widgets = {
            'name': forms.TextInput(attrs={'placeholder': 'Chart name', 'autocomplete': 'off', 'class': 'form-control input-lg'}),
            'xname': forms.TextInput(attrs={'placeholder': 'Name x-axis', 'class': 'form-control input-lg'}),
            'xunit': forms.TextInput(attrs={'placeholder': 'x-units', 'class': 'form-control input-lg'}),
            'yname': forms.TextInput(attrs={'placeholder': 'Name y-axis', 'class': 'form-control input-lg'}),
            'yunit': forms.TextInput(attrs={'placeholder': 'y-units', 'class': 'form-control input-lg'}),
            'legend': forms.TextInput(attrs={'placeholder': 'Legend', 'class': 'form-control input-lg'}),
            'details': forms.Textarea(attrs={'cols': 80, 'rows': 5, 'placeholder': 'Details',
                                             'class': 'form-control input-lg'}),
            'reference': forms.Textarea(attrs={'cols': 80, 'rows': 5, 'placeholder': 'Reference',
                                               'class': 'form-control input-lg'}),
        }
        error_messages = {
            'name': {'required': EMPTY_NAME_FIELD_ERROR}
        }


text:
import subprocess

class CaptchaPrompt(object):
    def newCaptchaTask(self, task):
        if not task.isTextual():
            return False
        return self.processCaptcha(task)

    def processCaptcha(self, task):
        imageviewer = 'xv' # 'xdg-open'
        subprocess.Popen([imageviewer, task.tmpfile.name])
        # print "gwenview %s" % task.tmpfile.name
        while True:
            solvedCaptcha = raw_input("Write the captcha code or '?': ")
            if solvedCaptcha == "?":
                print("typing nothing will use another service (if configured)")
            else:
                break
        task.setResult(solvedCaptcha)
        return solvedCaptcha


text:
package machine

import (
	"fmt"
	"net"
	"os"
	"testing"

	"k8s.io/minikube/pkg/minikube/command"
)

const initialEtcHostsContent string = `127.0.0.1	localhost
127.0.1.1	mymachinename

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
127.0.0.1	host.minikube.internal
192.168.42.139	control-plane.minikube.internal
10.8.0.22	control-plane.minikube.internal
`

const expectedEtcHostsContent string = `127.0.0.1	localhost
127.0.1.1	mymachinename

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
127.0.0.1	host.minikube.internal
10.1.2.3	control-plane.minikube.internal
`

func TestAddHostAliasInner(t *testing.T) {
	// Arrange
	tempFilePath, err := writeContentToTempFile(initialEtcHostsContent)
	if err != nil {
		t.Error(err)
	}
	defer os.Remove(tempFilePath)
	hostname := "control-plane.minikube.internal"
	ip := net.ParseIP("10.1.2.3")
	hostsFileLine := fmt.Sprintf("%s\t%s", ip, hostname)

	// Act
	cmd := addHostAliasCommand(hostname, hostsFileLine, false, tempFilePath)
	if err = cmd.Run(); err != nil {
		t.Error(err)
	}

	// Assert
	if err != nil {
		t.Error(err)
	}

	buff, err := os.ReadFile(tempFilePath)
	if err != nil {
		t.Error(err)
	}

	actualEtcHostsContent := string(buff)
	if expectedEtcHostsContent != actualEtcHostsContent {
		t.Errorf("\n=== EXPECTED ===\n%s\n=== ACTUAL ===\n%s\n",
			expectedEtcHostsContent,
			actualEtcHostsContent)
	}
}

func writeContentToTempFile(content string) (string, error) {
	etcHosts, err := os.CreateTemp("", "hosts")
	if err != nil {
		return "", err
	}

	path := etcHosts.Name()
	if _, err = etcHosts.WriteString(content); err != nil {
		return "", err
	}

	if err = etcHosts.Close(); err != nil {
		return "", err
	}

	return path, nil
}

func TestDiskUsed(t *testing.T) {
	ex := command.NewFakeCommandRunner()
	ex.SetCommandToOutput(map[string]string{
		"sh -c \"df -h /var | awk 'NR==2{print $5}'\"": "20%",
	})
	nonex := command.NewFakeCommandRunner()
	nonex.SetCommandToOutput(map[string]string{
		"sh -c \"df -h /nonexistent | awk 'NR==2{print $5}'\"": "df: /nonexistent: No such file or directory",
	})

	type args struct {
		cr  command.Runner
		dir string
	}
	tests := []struct {
		name    string
		args    args
		want    int
		wantErr bool
	}{
		{
			name:    "existent",
			args:    args{ex, "/var"},
			want:    20,
			wantErr: false,
		},
		{
			name:    "existent",
			args:    args{nonex, "/nonexistent"},
			want:    0,
			wantErr: true,
		},
	}
	for _, tt := range tests {
		t.Logf("starting %v", tt.name)
		t.Run(tt.name, func(t *testing.T) {
			got, err := DiskUsed(tt.args.cr, tt.args.dir)
			t.Logf("err: %v\n", err)
			t.Logf("got: %v\n", got)
			if (err != nil) != tt.wantErr {
				t.Fatalf("DiskUsed() error = %v, wantErr %v", err, tt.wantErr)
			}
			if got != tt.want {
				t.Errorf("DiskUsed() = %v, want %v", got, tt.want)
			}
		})
	}
}

func TestDiskAvailable(t *testing.T) {
	ex := command.NewFakeCommandRunner()
	ex.SetCommandToOutput(map[string]string{
		"sh -c \"df -BG /var | awk 'NR==2{print $4}'\"": "20",
	})
	nonex := command.NewFakeCommandRunner()
	nonex.SetCommandToOutput(map[string]string{
		"sh -c \"df -BG /nonexistent | awk 'NR==2{print $4}'\"": "df: /nonexistent: No such file or directory",
	})

	type args struct {
		cr  command.Runner
		dir string
	}
	tests := []struct {
		name    string
		args    args
		want    int
		wantErr bool
	}{
		{
			name:    "existent",
			args:    args{ex, "/var"},
			want:    20,
			wantErr: false,
		},
		{
			name:    "existent",
			args:    args{nonex, "/nonexistent"},
			want:    0,
			wantErr: true,
		},
	}
	for _, tt := range tests {
		t.Logf("starting %v", tt.name)
		t.Run(tt.name, func(t *testing.T) {
			got, err := DiskAvailable(tt.args.cr, tt.args.dir)
			t.Logf("err: %v\n", err)
			if (err != nil) != tt.wantErr {
				t.Fatalf("DiskAvailable() error = %v, wantErr %v", err, tt.wantErr)
			}
			if got != tt.want {
				t.Errorf("DiskAvailable() = %v, want %v", got, tt.want)
			}
		})
	}
}


text:
import {defaults as reqDefaults} from './request'

const defaultRequest = reqDefaults()
export const get = create(defaultRequest, 'get')
export const post = create(defaultRequest, 'post')

export function defaults(options) {
  const request = reqDefaults(options)
  return {
    get: create(request, 'get'),
    post: create(request, 'post')
  }
}

function create(request, method) {
  const req = function (...args) {
    return request[method](...args)
      .then(response => {

        // Parse body if json
        try {
          response.json = JSON.parse(response.body)
        } catch (error) {
            // its not json
        }
        return response
      })
      .catch(error => {
        error.json = JSON.parse(error.response.body)
        return Promise.reject(error)
      })
  }

  const ownPropertyDescriptor = Object.getOwnPropertyDescriptor(req, 'name')
  if (ownPropertyDescriptor && ownPropertyDescriptor.configurable) {
    Object.defineProperty(req, 'name', {value: method})
  }
  return req
}


text:
<?php

namespace SpomkyLabs\JoseBundle\DependencyInjection\Source\JWKSetSource;

use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;

interface JWKSetSourceInterface
{
    /**
     * Creates the JWKSet, registers it and returns its id.
     *
     * @param ContainerBuilder $container A ContainerBuilder instance
     * @param string           $type      The type of the service
     * @param string           $id        The id of the service
     * @param array            $config    An array of configuration
     */
    public function create(ContainerBuilder $container, $type, $id, array $config);

    /**
     * Returns the key set for the Key Set Source configuration.
     *
     * @return string
     */
    public function getKeySet();

    /**
     * Adds configuration nodes for this service.
     *
     * @param NodeDefinition $builder
     */
    public function addConfiguration(NodeDefinition $builder);
}


text:
{#-
       Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you 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.
       This is used when user is trying to imput a new review

-#}
{% import 'allura:templates/jinja_master/lib.html' as lib with context %}

{% import 'forgefeedback:templates/feedback/common_feedback.html' as common_feed %}

{% extends g.theme.master %}
{% set hide_left_bar = True %}
{% do g.register_app_css('css/feedback.css') %}
{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / New feedback{% endblock %}

{% block header %}{{c.app.config.options.mount_label}}{% endblock %}

{% block content %}

    <form action="{{ c.app.url }}create_feedback" method="post" id="feedback_form">

Provide your feedback for  {{c.project.name}}

    {{ common_feed.alert_message() }}

          <fieldset class="rating" id="sar">
              <input type="radio" id="star5" name="rating" value="5" onclick="manage()" />5 stars
              <input type="radio" id="star4" name="rating" value="4" onclick="manage()" />4 stars
              <input type="radio" id="star3" name="rating" value="3" onclick="manage()" />3 stars
              <input type="radio" id="star2" name="rating" value="2" onclick="manage()" />2 stars
              <input type="radio" id="star1" name="rating" value="1" onclick="manage()" />1 star
          </fieldset>

    {{ common_feed.feed_textarea(placeholder='Enter your feedback here',description=description ) }}

       <input type="submit" value="Submit" id="button" disabled />
       {{ common_feed.feed_cancel(url=c.app.url) }}

    {{ lib.csrf_token() }}
    </form>

{% endblock %}

{% block extra_js %}

    {{ common_feed.profanity_scripts(url=c.app.url) }}
{% endblock %}


text:
using System;

namespace MatterHackers.MatterControl.DesignTools
{

	[AttributeUsage(AttributeTargets.Property)]
	public class MultiLineEditAttribute : Attribute
	{
	}

	[AttributeUsage(AttributeTargets.Property)]
	public class UpdateOnEveryKeystrokeAttribute : Attribute
	{
	}
}


text:
@interface NAICSItem : NSObject

@property (nonatomic,strong)NSString *NAICSCode;
@property (nonatomic,strong)NSString *NAICSTitle;
@property (nonatomic,strong)NSString *Country;
@property (nonatomic,strong)NSString *IndustryDescription;

@end


text:
'use strict';

// MODULES //

var partial = require( './partial.js' );

// PDF //

/**
* FUNCTION: pdf( out, matrix, a, b, c )
*	Evaluates the probability density function (PDF) for a Triangular distribution with lower limit `a` and upper limit `b` and mode `c` for each matrix element.
*
* @param {Matrix} out - output matrix
* @param {Matrix} arr - input matrix
* @param {Number} a - lower limit
* @param {Number} b - upper limit
* @param {Number} c - mode
* @returns {Matrix} output matrix
*/
function pdf( y, x, a, b, c ) {
	var len = x.length,
		fcn,
		i;
	if ( y.length !== len ) {
		throw new Error( 'pdf()::invalid input arguments. Input and output matrices must be the same length.' );
	}
	fcn = partial( a, b, c );
	for ( i = 0; i < len; i++ ) {
		y.data[ i ] = fcn( x.data[ i ] );
	}
	return y;
} // end FUNCTION pdf()

// EXPORTS //

module.exports = pdf;


text:
<topology asn="100">
  <node internal="true" name="A"></node>
  <node internal="true" name="B"></node>
  <node internal="true" name="C"></node>
  <node internal="true" name="D"></node>
  <edge source="A" target="B"></edge>
  <edge source="A" target="C"></edge>
  <edge source="B" target="C"></edge>
  <edge source="B" target="D"></edge>
  <edge source="C" target="D"></edge>
</topology>


text:
<?php

namespace App\Dotlan;

use Goutte\Client as WebScraper;

class Dotlan
{
    const URL = 'http://evemaps.dotlan.net/';

    function getRoute($type, array $waypoints)
    {
        $url = self::URL . "route/$type:" . implode(':', $waypoints);
        $route = [];

        $httpclient = new WebScraper;
        $crawler = $httpclient->request('GET', $url);
        $crawler->filter('div#navtools>table>tr>td:nth-of-type(3)>b>a')->each(function($node) use (&$route) {
            $route[] = $node->text();
        });

        return $route;
    }
}


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

{% load i18n %}
{% load threadedcommentstags %}
{% load tagging_tags %}

{% block head_title %}{% blocktrans %}Offer{% endblocktrans %} : {{ offer.short_description }}{% endblock %}

{% block body %}

{{ offer.short_description }}

{% trans "Offered by:" %} {{ offer.offerer.username }}{% trans " on " %} {{ offer.offered_time|date }}

			{% trans "Offering" %}: {{ offer.offering|urlize }}

			{% trans "Want" %}: {{ offer.want|urlize }}

			{% trans "State" %}: {{ offer.get_state_display }}

            {% tags_for_object offer as tags %}
            {% for tag in tags %}
                {{ tag }}
            {% endfor %}

			{% if offer.is_changeable %}
				{% ifequal offer.offerer request.user %}
					<form style="display: inline;" action="{% url offer_edit offer.id %}" method="GET">
						<input type="hidden" name="returnto" value="offer_list_yours" />
						<input type="submit" value="{% trans "Edit Offer" %}" />
					</form>
					{% if offer.is_deletable %}
						<form style="display: inline;" action="{% url offer_delete offer.id %}" method="POST">
							<input type="submit" value="{% trans "Delete Offer" %}" />
						</form>
					{% else %}
						{% if offer.is_cancelable %}
							<form style="display: inline;" action="{% url offer_cancel offer.id %}" method="POST">
								<input type="submit" value="{% trans "Cancel Offer" %}" />
							</form>
						{% endif %}
					{% endif %}
				{% endifequal %}
			{% endif %}

{% endblock %}


text:
import { Component, ComponentFactoryResolver, ElementRef, HostListener, Renderer, ViewChild, ViewContainerRef } from '@angular/core';
import { Config } from '../../config/config';
import { Key } from '../../util/key';
import { NavParams } from '../../navigation/nav-params';
import { ViewController } from '../../navigation/view-controller';
import { GestureController, BLOCK_ALL } from '../../gestures/gesture-controller';
export var PopoverCmp = (function () {
    function PopoverCmp(_cfr, _elementRef, _renderer, _config, _navParams, _viewCtrl, gestureCtrl) {
        this._cfr = _cfr;
        this._elementRef = _elementRef;
        this._renderer = _renderer;
        this._config = _config;
        this._navParams = _navParams;
        this._viewCtrl = _viewCtrl;
        this._gestureBlocker = gestureCtrl.createBlocker(BLOCK_ALL);
        this.d = _navParams.data.opts;
        _renderer.setElementClass(_elementRef.nativeElement, "popover-" + _config.get('mode'), true);
        if (this.d.cssClass) {
            this.d.cssClass.split(' ').forEach(function (cssClass) {
                if (cssClass.trim() !== '')
                    _renderer.setElementClass(_elementRef.nativeElement, cssClass, true);
            });
        }
        this.id = (++popoverIds);
    }
    PopoverCmp.prototype.ionViewPreLoad = function () {
        var activeElement = document.activeElement;
        activeElement && activeElement.blur();
        this._load(this._navParams.data.component);
    };
    PopoverCmp.prototype._load = function (component) {
        if (component) {
            var componentFactory = this._cfr.resolveComponentFactory(component);
            var componentRef = this._viewport.createComponent(componentFactory, this._viewport.length, this._viewport.parentInjector, []);
            this._viewCtrl._setInstance(componentRef.instance);
            this._enabled = true;
            this._viewCtrl.willEnter.subscribe(this._viewWillEnter.bind(this));
            this._viewCtrl.didLeave.subscribe(this._viewDidLeave.bind(this));
        }
    };
    PopoverCmp.prototype._viewWillEnter = function () {
        this._gestureBlocker.block();
    };
    PopoverCmp.prototype._viewDidLeave = function () {
        this._gestureBlocker.unblock();
    };
    PopoverCmp.prototype._setCssClass = function (componentRef, className) {
        this._renderer.setElementClass(componentRef.location.nativeElement, className, true);
    };
    PopoverCmp.prototype._bdClick = function () {
        if (this._enabled && this.d.enableBackdropDismiss) {
            return this._viewCtrl.dismiss(null, 'backdrop');
        }
    };
    PopoverCmp.prototype._keyUp = function (ev) {
        if (this._enabled && ev.keyCode === Key.ESCAPE && this._viewCtrl.isLast()) {
            this._bdClick();
        }
    };
    PopoverCmp.prototype.ngOnDestroy = function () {
        (void 0);
        this._gestureBlocker.destroy();
    };
    PopoverCmp.decorators = [
        { type: Component, args: [{
                    selector: 'ion-popover',
                    template: '<ion-backdrop (click)="_bdClick()" [hidden]="!d.showBackdrop"></ion-backdrop>' +
                        '
' +
                        '

' +
                        '
' +
                        '
' +
                        '

' +
                        '
' +
                        '
' +
                        '
'
                },] },
    ];
    PopoverCmp.ctorParameters = [
        { type: ComponentFactoryResolver, },
        { type: ElementRef, },
        { type: Renderer, },
        { type: Config, },
        { type: NavParams, },
        { type: ViewController, },
        { type: GestureController, },
    ];
    PopoverCmp.propDecorators = {
        '_viewport': [{ type: ViewChild, args: ['viewport', { read: ViewContainerRef },] },],
        '_keyUp': [{ type: HostListener, args: ['body:keyup', ['$event'],] },],
    };
    return PopoverCmp;
}());
var popoverIds = -1;
//# sourceMappingURL=popover-component.js.map


text:
package config

import (
	"io"
	"io/ioutil"
	"log"
	"os"

	"gopkg.in/yaml.v2"
)

type Config struct {
	CsCluster struct {
		Host string
		Port int
	}
	Rabbit struct {
		Host string
	}
}

var File string

// Read and retrun config
func ReadReturn(path string) (*Config, error) {
	f := OpenConfig(&path)
	c, err := ReadConfig(f)
	if err != nil {
		return nil, err
	}
	return c, nil
}

// Open the config file for reading
func OpenConfig(configFile *string) *os.File {
	f, err := os.Open(*configFile)
	if err != nil {
		log.Fatal(err)
	}
	return f
}

// ReadConfig config from io.Reader
func ReadConfig(r io.Reader) (*Config, error) {
	data, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, err
	}
	var c Config
	yaml.Unmarshal(data, &c)
	return &c, nil
}


text:
/**
 * Common types.
 *
 *
Starting points

 *

 *
{@link com.linecorp.armeria.common.ServiceInvocationContext}

 *
{@link com.linecorp.armeria.common.TimeoutPolicy}

 *

 */
package com.linecorp.armeria.common;


text:
#include <aws/cloudformation/model/UpdateStackInstancesRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

using namespace Aws::CloudFormation::Model;
using namespace Aws::Utils;

UpdateStackInstancesRequest::UpdateStackInstancesRequest() :
    m_stackSetNameHasBeenSet(false),
    m_accountsHasBeenSet(false),
    m_deploymentTargetsHasBeenSet(false),
    m_regionsHasBeenSet(false),
    m_parameterOverridesHasBeenSet(false),
    m_operationPreferencesHasBeenSet(false),
    m_operationId(Aws::Utils::UUID::RandomUUID()),
    m_operationIdHasBeenSet(true)
{
}

Aws::String UpdateStackInstancesRequest::SerializePayload() const
{
  Aws::StringStream ss;
  ss << "Action=UpdateStackInstances&";
  if(m_stackSetNameHasBeenSet)
  {
    ss << "StackSetName=" << StringUtils::URLEncode(m_stackSetName.c_str()) << "&";
  }

  if(m_accountsHasBeenSet)
  {
    unsigned accountsCount = 1;
    for(auto& item : m_accounts)
    {
      ss << "Accounts.member." << accountsCount << "="
          << StringUtils::URLEncode(item.c_str()) << "&";
      accountsCount++;
    }
  }

  if(m_deploymentTargetsHasBeenSet)
  {
    m_deploymentTargets.OutputToStream(ss, "DeploymentTargets");
  }

  if(m_regionsHasBeenSet)
  {
    unsigned regionsCount = 1;
    for(auto& item : m_regions)
    {
      ss << "Regions.member." << regionsCount << "="
          << StringUtils::URLEncode(item.c_str()) << "&";
      regionsCount++;
    }
  }

  if(m_parameterOverridesHasBeenSet)
  {
    unsigned parameterOverridesCount = 1;
    for(auto& item : m_parameterOverrides)
    {
      item.OutputToStream(ss, "ParameterOverrides.member.", parameterOverridesCount, "");
      parameterOverridesCount++;
    }
  }

  if(m_operationPreferencesHasBeenSet)
  {
    m_operationPreferences.OutputToStream(ss, "OperationPreferences");
  }

  if(m_operationIdHasBeenSet)
  {
    ss << "OperationId=" << StringUtils::URLEncode(m_operationId.c_str()) << "&";
  }

  ss << "Version=2010-05-15";
  return ss.str();
}

void  UpdateStackInstancesRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
  uri.SetQueryString(SerializePayload());
}


text:
import type { IPerfDatasets } from "core/Misc/interfaces/iPerfViewer";
import type { Observable } from "core/Misc/observable";

/**
 * Defines a structure to hold max, min and a optional current.
 */
export interface IPerfMinMax {
    min: number;
    max: number;
    current?: number;
}

/**
 * Defines structure of the object which contains information related to panning.
 */
export interface IPerfMousePanningPosition {
    xPos: number;
    delta: number;
}

/**
 * Defines structure of the object which contains information regarding the bounds of each dataset we want to consider.
 */
export interface IPerfIndexBounds {
    start: number;
    end: number;
}

export interface IPerfLayoutSize {
    width: number;
    height: number;
}

/**
 * Defines the structure of the meta object for the tooltip that appears when hovering over a performance graph!
 */
export interface IPerfTooltip {
    text: string;
    color: string;
}

/**
 * Defines the structure of a cache object used to store the result of measureText().
 */
export interface IPerfTextMeasureCache {
    text: string;
    width: number;
}

/**
 * Defines a structure defining the available space in a drawable area.
 */
export interface IGraphDrawableArea {
    top: number;
    left: number;
    bottom: number;
    right: number;
}

/**
 * Defines the structure representing necessary ticker information.
 */
export interface IPerfTicker extends IPerfMinMax {
    id: string;
    text: string;
}

export interface IVisibleRangeChangedObservableProps {
    valueMap: Map<string, IPerfMinMax>;
}

/**
 * Defines what settings our canvas graphing service accepts
 */
export interface ICanvasGraphServiceSettings {
    datasets: IPerfDatasets;
    onVisibleRangeChangedObservable?: Observable<IVisibleRangeChangedObservableProps>;
}

/**
 * Defines the structure representing the preprocessable tooltip information.
 */
export interface ITooltipPreprocessedInformation {
    xForActualTimestamp: number;
    numberOfTooltipItems: number;
    longestText: string;
    focusedId: string;
}

export interface IPerfTooltipHoverPosition {
    xPos: number;
    yPos: number;
}

/**
 * Defines the supported timestamp units.
 */
export enum TimestampUnit {
    Milliseconds = 0,
    Seconds = 1,
    Minutes = 2,
    Hours = 3,
}


text:
void hello() {
    printf("Hello World, test addIncludePath!\n");
}


text:
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;

namespace PocoEx.CodeAnalysis.Rethrow
{
    [DiagnosticAnalyzer(LanguageNames.CSharp)]
    public class RethrowAnalyzer : DiagnosticAnalyzer
    {
        public const string DiagnosticId = "PocoEx.Rethrow";

        private static readonly ImmutableArray<SyntaxKind> CatchClauseTargets
            = ImmutableArray.Create(SyntaxKind.CatchClause);

        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; }
            = ImmutableArray.Create(Rules.PocoEx00001, Rules.PocoEx00002);

        public override void Initialize(AnalysisContext context)
        {
            context.RegisterSyntaxNodeAction(AnalyzeCatchClause, CatchClauseTargets);
        }

        private static void AnalyzeCatchClause(SyntaxNodeAnalysisContext context)
        {
            var @catch = (CatchClauseSyntax)context.Node;
            if (@catch.Declaration.Identifier == null) return;

            var cause = context.SemanticModel.GetDeclaredSymbol(@catch.Declaration);
            var analyzer = new CatchClauseAnalyzer()
            {
                Context = context,
                Cause = cause,
            };
            analyzer.VisitCatchClause(@catch);
        }

        class CatchClauseAnalyzer
            : CSharpSyntaxWalker
        {
            public SyntaxNodeAnalysisContext Context { get; set; }
            /// <summary><see cref="ILocalSymbol"/> of the catching exception.</summary>
            public ILocalSymbol Cause { get; set; }
            public override void VisitThrowStatement(ThrowStatementSyntax node)
            {
                if (node.Expression == null)
                {
                    return;
                }
                else if (node.Expression.IsKind(SyntaxKind.IdentifierName))
                {
                    var symbol = Context.SemanticModel.GetSymbolInfo(node.Expression);
                    if (symbol.CandidateReason == CandidateReason.None && Cause.Equals(symbol.Symbol))
                    {
                        Context.ReportDiagnostic(Rules.PocoEx00001.ToDiagnostic(node.GetLocation(), Cause.Name));
                    }
                }
                else if (node.Expression.IsKind(SyntaxKind.ObjectCreationExpression))
                {
                    var @new = (ObjectCreationExpressionSyntax)node.Expression;
                    var foundCause = false;
                    foreach (var arg in @new.ArgumentList?.Arguments ?? Enumerable.Empty<ArgumentSyntax>())
                    {
                        if (!arg.Expression.IsKind(SyntaxKind.IdentifierName)) continue;
                        var symbol = Context.SemanticModel.GetSymbolInfo(arg.Expression);
                        if (symbol.CandidateReason != CandidateReason.None) continue;
                        if (Cause.Equals(symbol.Symbol))
                        {
                            foundCause = true;
                            break;
                        }
                    }
                    if (!foundCause)
                    {
                        Context.ReportDiagnostic(Rules.PocoEx00002.ToDiagnostic(@new.GetLocation(), @new.Type, Cause.Name));
                    }
                }
            }

        }
    }
}


text:
"""This module, problem_035.py, solves the thirty-fifth euler problem."""

from project_euler_problems.problem import Problem
from project_euler_problems.math_utilities import math_utilities as mu

'''
The prime 41, can be written as the sum of six consecutive primes:

41 = 2 + 3 + 5 + 7 + 11 + 13
This is the longest sum of consecutive primes that adds to a prime below one-hundred.

The longest sum of consecutive primes below one-thousand that adds to a prime, contains 21 terms, and is equal to 953.

Which prime, below one-million, can be written as the sum of the most consecutive primes?
'''

# [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]

class ImplementedProblem(Problem):
	"""This specific problem's implementation."""

	def get_solution(self):
		"""Solves the solution for problem 050.
		:return: The solution for problem 050."""

		#primes         = mu.get_primes_below_n(1000000)
		primes         = mu.get_primes_below_n_as_set(1000)

		dynamic_solutions = {}

		starting_index = 0
		best_prime     = -1
		longest_chain  = -1
		length_tried = 0
		#while length_tried < len(primes):
		#	if sum(primes[starting_index:starting_index + length_tried + 1]) in primes:

		'''
		while starting_index != len(primes):

			print('Starting index : ' + str(starting_index))

			number_of_remaining_elements = len(primes) - 1 - starting_index
			length_tried = 0
			while length_tried < number_of_remaining_elements + 1:

				if sum(primes[starting_index:starting_index + length_tried + 1]) in primes:

					chain_length = (starting_index + length_tried + 1) - starting_index
					if chain_length > longest_chain:

						longest_chain = chain_length
						best_prime    = sum(primes[starting_index:starting_index + length_tried + 1])

				length_tried += 1
			starting_index += 1

		print(best_prime)
		print(longest_chain)
		'''

		return 1


text:
package org.moparscape.elysium.net.codec;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import org.moparscape.elysium.net.codec.decoder.MessageDecoder;

import java.io.IOException;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 *
 * @author lothy
 */
public final class ElysiumDecoder extends ByteToMessageDecoder {

    @Override
    public void decode(ChannelHandlerContext ctx, ByteBuf buffer, List<Object> out)
            throws Exception {
        buffer.markReaderIndex();

        // If there are not enough bytes to read a length, return
        if (buffer.readableBytes() < 2) {
            return;
        }

        boolean shortLen = false;
        int length = buffer.readByte();
        if (length >= 160) {
            length = (length - 160) * 256 + buffer.readByte();
            shortLen = true;
        }

        // If the remaining payload has less than length bytes then
        // the packet hasn't fully arrived. Rewind the buffer and return.
        if (length > buffer.readableBytes()) {
            buffer.resetReaderIndex();
            return;
        }

        // If the length is a short, or the packet has no payload, then we can just
        // read the contents of buffer.
        // However, if the length is a byte then the next byte is actually the last
        // value of the payload, so we need to put it back in its correct position.
        int opcode;
        ByteBuf payload;
        if (shortLen || length <= 1) {
            opcode = buffer.readUnsignedByte();
            payload = buffer;
        } else {
            // A length greater than one indicates that there is a payload after
            // the opcode. Fix the order of the payload.
            byte[] data = new byte[length - 1];
            data[length - 2] = buffer.readByte();
            opcode = buffer.readUnsignedByte();
            buffer.readBytes(data, 0, length - 2);
            payload = Unpooled.wrappedBuffer(data);
        }

        //System.out.println("OPCODE: " + opcode);
        MessageDecoder<?> decoder = CodecLookupService.getDecoder(opcode);
        if (decoder == null) {
            System.out.println("No decoder for " + opcode);
            throw new IOException("Unknown opcode: " + opcode);
        }

        // Reduce length by 1 so that it is only referring to the payload's length, without the opcode
        --length;

        out.add(decoder.decode(payload, length));
    }

    private void dump(ByteBuf buffer, int opcode, int length) {
        buffer.markReaderIndex();

        // Dump the contents as a string of unsigned bytes
        StringBuilder sb = new StringBuilder(2000);
        sb.append("Opcode = ").append(opcode).append(" Len = ").append(length).append("\n");
        sb.append(buffer.readUnsignedByte());
        for (int i = 0; i < length - 1; i++) {
            sb.append(", ").append(buffer.readUnsignedByte());
        }
        System.out.println(sb.toString());

        buffer.resetReaderIndex();
    }
}


text:
package com.github.eduardovalentim.easymath.processor.mathematical.operation;

import java.util.Deque;

import com.github.eduardovalentim.easymath.processor.mathematical.operation.operand.Operand;

/**
 * A abstract operation definition to be specialized
 *
 * @author eduardo.valentim
 */
public abstract class AbstractOperation implements Operation {

    private String id;
    private String operator;
    private String type;
    private String text;

    /**
     * Public constructor
     *
     * @param id The id
     * @param operator The operator
     * @param type The type
     * @param text The text
     */
    protected AbstractOperation(String id, String operator, String type, String text) {
        super();
        this.id = id;
        this.operator = operator;
        this.type = type;
        this.text = text;
    }

    /**
     * The list of operands for this operation
     * @return
     */
    public abstract Deque<Operand> getOperands();

    /**
     * {@inheritDoc}
     */
    @Override
    public String getId() {
        return id;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getOperator() {
        return operator;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getType() {
        return type;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getText() {
        return text;
    }
}


text:
require 'data_mapper'
require 'dotenv/load'

require 'incoming/dallas/models'

require 'omniauth/strategies/dallas'
require 'omniauth-dropbox2'

DataMapper::Logger.new($stdout, (ENV['DATAMAPPER_LOG_LEVEL'] || :info).to_sym)
DataMapper.setup(:default, ENV['POSTGRES_URL'])
DataMapper.finalize
DataMapper.auto_upgrade!


text:
Token based text embedding trained on Korean Google News
15B corpus.

<!-- dataset: google-news -->
<!-- asset-path: legacy -->
<!-- language: ko -->
<!-- task: text-embedding -->
<!-- network-architecture: nnlm -->
<!-- fine-tunable: true -->
<!-- format: saved_model_2 -->
<!-- colab: https://colab.research.google.com/github/tensorflow/hub/blob/master/examples/colab/tf2_text_classification.ipynb -->

## TF2 SavedModel

This is a [SavedModel in TensorFlow 2
format](https://www.tensorflow.org/hub/tf2_saved_model).
Using it requires TensorFlow 2 (or 1.15) and TensorFlow Hub 0.5.0 or newer.

## Overview
This module is in the **SavedModel 2.0** format and was created to help preview
TF2.0 functionalities. It is based on [https://tfhub.dev/google/nnlm-ko-dim128/1](https://tfhub.dev/google/nnlm-ko-dim128/1).

Text embedding based on feed-forward Neural-Net Language Models[1] with
pre-built OOV. Maps from text to 128-dimensional embedding vectors.

#### Example use
The saved model can be loaded directly:

```
import tensorflow_hub as hub

embed = hub.load("https://tfhub.dev/google/tf2-preview/nnlm-ko-dim128/1")
embeddings = embed(["고양이", "고양이 과 개"])
```

It can also be used within Keras:

```
hub_layer = hub.KerasLayer("https://tfhub.dev/google/tf2-preview/nnlm-ko-dim128/1", output_shape=[128],
                           input_shape=[], dtype=tf.string)

model = keras.Sequential()
model.add(hub_layer)
model.add(keras.layers.Dense(16, activation='relu'))
model.add(keras.layers.Dense(1, activation='sigmoid'))

model.summary()
```

## Details
Based on NNLM with three hidden layers.

#### Input
The module takes **a batch of sentences in a 1-D tensor of strings** as input.

#### Preprocessing
The module preprocesses its input by **splitting on spaces**.

#### Out of vocabulary tokens
Small fraction of the least frequent tokens and embeddings (~2.5%) are
**replaced by hash buckets**. Each hash bucket is initialized using the remaining
embedding vectors that hash to the same bucket.

#### Sentence embeddings
Word embeddings are combined into sentence embedding using the `sqrtn` combiner
(see [tf.nn.embedding_lookup_sparse](https://www.tensorflow.org/api_docs/python/tf/nn/embedding_lookup_sparse)).

#### References

[1] Yoshua Bengio, Réjean Ducharme, Pascal Vincent, Christian Jauvin.
[A Neural Probabilistic Language Model](https://www.jmlr.org/papers/volume3/bengio03a/bengio03a.pdf).
Journal of Machine Learning Research, 3:1137-1155, 2003.


text:
USING_NS_CC;

// The images for the Firebase buttons.
static const std::string kNormalButtonImage = "NormalButtonImage.png";
static const std::string kSelectedButtonImage = "SelectedButtonImage.png";
static const std::string kDisabledButtonImage = "SelectedButtonImage.png";

/// Padding for the UI elements.
static const float kUIElementPadding = 10.0;

/// The title text size for the Firebase buttons.
static const float kButtonTitleFontSize = 12.0;

/// The content size for the Firebase buttons.
static const cocos2d::Size kButtonContentSize = cocos2d::Size(150, 20);

/// The factor used to determine when to resize the ScrollView's inner container
/// height.
static const float kScrollViewContainerHeightFactor = 0.85;

/// The logging ScrollView.
cocos2d::ui::ScrollView* scrollView;

/// The log text for the Text Widget.
cocos2d::ui::Text* logTextWidget;

/// The log text.
std::string logTextString;

cocos2d::ui::Button* FirebaseScene::createButton(
    bool buttonEnabled, const std::string& buttonTitleText,
    const cocos2d::Color3B& buttonColor) {
  auto visibleSize = Director::getInstance()->getVisibleSize();
  cocos2d::Vec2 origin = Director::getInstance()->getVisibleOrigin();
  cocos2d::ui::Button* button = cocos2d::ui::Button::create(
      kNormalButtonImage, kSelectedButtonImage, kDisabledButtonImage);
  button->setEnabled(buttonEnabled);
  button->setColor(buttonColor);
  button->setTitleText(buttonTitleText);
  button->setTitleFontSize(kButtonTitleFontSize);
  button->ignoreContentAdaptWithSize(false);
  button->setContentSize(kButtonContentSize);
  nextYPosition -= button->getContentSize().height + kUIElementPadding;
  button->setPosition(
      cocos2d::Vec2(origin.x + visibleSize.width / 4, nextYPosition));

  return button;
}

cocos2d::ui::Button* FirebaseScene::createButton(
    bool buttonEnabled, const std::string& buttonTitleText) {
  return createButton(buttonEnabled, buttonTitleText, cocos2d::Color3B::WHITE);
}

cocos2d::ui::TextField* FirebaseScene::createTextField(
    const char* placeholder) {
  auto visibleSize = Director::getInstance()->getVisibleSize();
  cocos2d::Vec2 origin = Director::getInstance()->getVisibleOrigin();
  cocos2d::ui::TextField* text_field =
      ui::TextField::create(placeholder, "fonts/arial.ttf", 12);
  text_field->setPlaceHolderColor(Color3B::WHITE);
  nextYPosition -= text_field->getContentSize().height + kUIElementPadding;
  text_field->setPosition(
      cocos2d::Vec2(origin.x + visibleSize.width / 4, nextYPosition));
  return text_field;
}

void FirebaseScene::createScrollView(float yPosition, float widthFraction) {
  cocos2d::Size visibleSize = Director::getInstance()->getVisibleSize();
  cocos2d::Vec2 origin = Director::getInstance()->getVisibleOrigin();

  scrollView = cocos2d::ui::ScrollView::create();
  auto scrollViewFrameSize =
    Size(visibleSize.width * (1 - widthFraction), yPosition);
  scrollView->setContentSize(scrollViewFrameSize);
  scrollView->setPosition(
      cocos2d::Point(origin.x + visibleSize.width * widthFraction, origin.y));
  cocos2d::Size scrollViewContainerSize =
      cocos2d::Size(scrollViewFrameSize.width, scrollViewFrameSize.height);
  scrollView->setInnerContainerSize(scrollViewContainerSize);

  logTextWidget = cocos2d::ui::Text::create("", "fonts/arial.ttf", 12);
  logTextWidget->setTextAreaSize(
      cocos2d::Size(scrollViewContainerSize.width, 0));
  scrollView->addChild(logTextWidget);

  this->addChild(scrollView);
}

void FirebaseScene::createScrollView(float yPosition) {
  createScrollView(yPosition, 0.5f);
}

/// Adds text to the log TextWidget.
void FirebaseScene::logMessage(std::string format, ...) {
  static const int kLineBufferSize = 100;
  char buffer[kLineBufferSize + 2];

  va_list list;
  va_start(list, format);
  vsnprintf(buffer, kLineBufferSize, format.c_str(), list);
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
  __android_log_vprint(ANDROID_LOG_INFO, "FIREBASE-COCOS", format.c_str(),
                       list);
#endif
  va_end(list);
  logTextString.append("\n");
  logTextString.append(buffer);

  // Update the log TextWidget and the ScrollView's inner container size on the
  // Cocos2d thread.
  cocos2d::Director::getInstance()
      ->getScheduler()
      ->performFunctionInCocosThread([=]() {
        logTextWidget->setString(logTextString);
        cocos2d::Size scrollViewContainerSize =
            scrollView->getInnerContainerSize();
        // Check to see if the ScrollView's inner container needs to be resized.
        if (logTextWidget->getContentSize().height /
                scrollViewContainerSize.height >=
            kScrollViewContainerHeightFactor) {
          cocos2d::Size newScrollViewContainerSize =
              cocos2d::Size(scrollViewContainerSize.width,
                            scrollViewContainerSize.height * 2);
          scrollView->setInnerContainerSize(newScrollViewContainerSize);
          scrollViewContainerSize = scrollView->getInnerContainerSize();
        }
        logTextWidget->setPosition(cocos2d::Point(
            scrollViewContainerSize.width -
                logTextWidget->getContentSize().width / 2,
            scrollViewContainerSize.height +
                kUIElementPadding -
                logTextWidget->getContentSize().height / 2));
        float scrollPercent = logTextWidget->getContentSize().height /
                              scrollViewContainerSize.height;
        scrollView->scrollToPercentVertical(scrollPercent * 100, 1.0, false);
      });
}

#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
// Returns the iOS RootViewController's main view (i.e. the EAGLView).
WindowContext getWindowContext() {
  return (id)Director::getInstance()->getOpenGLView()->getEAGLView();
}
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
// Returns the Android Activity.
WindowContext getWindowContext() { return JniHelper::getActivity(); }
#else
WindowContext getWindowContext() { return nullptr; }
#endif