text:
<?php

namespace LaravelDoctrine\Fluent\Builders;

use InvalidArgumentException;
use LaravelDoctrine\Fluent\Builders\Inheritance\Inheritance;
use LaravelDoctrine\Fluent\Builders\Inheritance\InheritanceFactory;
use LaravelDoctrine\Fluent\Builders\Overrides\Override;
use LaravelDoctrine\Fluent\Builders\Traits\Fields;
use LaravelDoctrine\Fluent\Builders\Traits\Macroable;
use LaravelDoctrine\Fluent\Builders\Traits\Queueable;
use LaravelDoctrine\Fluent\Builders\Traits\Relations;
use LaravelDoctrine\Fluent\Fluent;
use LogicException;

/**
 * @method $this array($name, callable $callback = null)
 */
class Builder extends AbstractBuilder implements Fluent
{
    use Fields, Relations, Macroable, Queueable;

    /**
     * @param string|callable $name
     * @param callable|null   $callback
     *
     * @return Table
     */
    public function table($name, callable $callback = null)
    {
        if ($this->isEmbeddedClass()) {
            throw new LogicException();
        }

        $table = new Table($this->builder);

        if (is_callable($name)) {
            $name($table);
        } else {
            $table->setName($name);
        }

        if (is_callable($callback)) {
            $callback($table);
        }

        return $table;
    }

    /**
     * @param callable|null $callback
     *
     * @return Entity
     */
    public function entity(callable $callback = null)
    {
        if ($this->isEmbeddedClass()) {
            throw new LogicException();
        }

        $entity = new Entity($this->builder, $this->namingStrategy);

        if (is_callable($callback)) {
            $callback($entity);
        }

        return $entity;
    }

    /**
     * @param string        $type
     * @param callable|null $callback
     *
     * @return Inheritance
     */
    public function inheritance($type, callable $callback = null)
    {
        $inheritance = InheritanceFactory::create($type, $this->builder);

        if (is_callable($callback)) {
            $callback($inheritance);
        }

        return $inheritance;
    }

    /**
     * @param callable|null $callback
     *
     * @return Inheritance
     */
    public function singleTableInheritance(callable $callback = null)
    {
        return $this->inheritance(Inheritance::SINGLE, $callback);
    }

    /**
     * @param callable|null $callback
     *
     * @return Inheritance
     */
    public function joinedTableInheritance(callable $callback = null)
    {
        return $this->inheritance(Inheritance::JOINED, $callback);
    }

    /**
     * @param array|string $columns
     *
     * @return Index
     */
    public function index($columns)
    {
        $columns = is_array($columns) ? $columns : func_get_args();

        $index = new Index(
            $this->builder,
            $columns
        );

        $this->queue($index);

        return $index;
    }

    /**
     * @param array|string $fields
     *
     * @return Primary
     */
    public function primary($fields)
    {
        $fields = is_array($fields) ? $fields : func_get_args();

        $primary = new Primary(
            $this->builder,
            $fields
        );

        $this->queue($primary);

        return $primary;
    }

    /**
     * @param array|string $columns
     *
     * @return UniqueConstraint
     */
    public function unique($columns)
    {
        $columns = is_array($columns) ? $columns : func_get_args();

        $unique = new UniqueConstraint(
            $this->builder,
            $columns
        );

        $this->queue($unique);

        return $unique;
    }

    /**
     * @param string        $embeddable
     * @param string|null   $field
     * @param callable|null $callback
     *
     * @return Embedded
     */
    public function embed($embeddable, $field = null, callable $callback = null)
    {
        $embedded = new Embedded(
            $this->builder,
            $this->namingStrategy,
            $this->guessSingularField($embeddable, $field),
            $embeddable
        );

        $this->callbackAndQueue($embedded, $callback);

        return $embedded;
    }

    /**
     * @param string   $name
     * @param callable $callback
     *
     * @return Override
     */
    public function override($name, callable $callback)
    {
        $override = new Override(
            $this->getBuilder(),
            $this->getNamingStrategy(),
            $name,
            $callback
        );

        $this->queue($override);

        return $override;
    }

    /**
     * @param callable|null $callback
     *
     * @return LifecycleEvents
     */
    public function events(callable $callback = null)
    {
        $events = new LifecycleEvents($this->builder);

        $this->callbackAndQueue($events, $callback);

        return $events;
    }

    /**
     * @return bool
     */
    public function isEmbeddedClass()
    {
        return $this->builder->getClassMetadata()->isEmbeddedClass;
    }

    /**
     * @param string $method
     * @param array  $params
     *
     * @return mixed
     */
    public function __call($method, $params)
    {
        // Workaround for reserved keywords
        if ($method === 'array') {
            return call_user_func_array([$this, 'setArray'], $params);
        }

        if ($this->hasMacro($method)) {
            return $this->callMacro($method, $params);
        }

        throw new InvalidArgumentException('Fluent builder method [' . $method . '] does not exist');
    }
}


text:
declare module 'vscode' {

	// https://github.com/microsoft/vscode/issues/107467

	export namespace tests {
		/**
		 * Requests that tests be run by their controller.
		 * @param run Run options to use.
		 * @param token Cancellation token for the test run
		 */
		export function runTests(run: TestRunRequest, token?: CancellationToken): Thenable<void>;

		/**
		 * Returns an observer that watches and can request tests.
		 */
		export function createTestObserver(): TestObserver;
		/**
		 * List of test results stored by the editor, sorted in descending
		 * order by their `completedAt` time.
		 */
		export const testResults: ReadonlyArray<TestRunResult>;

		/**
		 * Event that fires when the {@link testResults} array is updated.
		 */
		export const onDidChangeTestResults: Event<void>;
	}

	export interface TestObserver {
		/**
		 * List of tests returned by test provider for files in the workspace.
		 */
		readonly tests: ReadonlyArray<TestItem>;

		/**
		 * An event that fires when an existing test in the collection changes, or
		 * null if a top-level test was added or removed. When fired, the consumer
		 * should check the test item and all its children for changes.
		 */
		readonly onDidChangeTest: Event<TestsChangeEvent>;

		/**
		 * Dispose of the observer, allowing the editor to eventually tell test
		 * providers that they no longer need to update tests.
		 */
		dispose(): void;
	}

	export interface TestsChangeEvent {
		/**
		 * List of all tests that are newly added.
		 */
		readonly added: ReadonlyArray<TestItem>;

		/**
		 * List of existing tests that have updated.
		 */
		readonly updated: ReadonlyArray<TestItem>;

		/**
		 * List of existing tests that have been removed.
		 */
		readonly removed: ReadonlyArray<TestItem>;
	}

	/**
	 * TestResults can be provided to the editor in {@link tests.publishTestResult},
	 * or read from it in {@link tests.testResults}.
	 *
	 * The results contain a 'snapshot' of the tests at the point when the test
	 * run is complete. Therefore, information such as its {@link Range} may be
	 * out of date. If the test still exists in the workspace, consumers can use
	 * its `id` to correlate the result instance with the living test.
	 */
	export interface TestRunResult {
		/**
		 * Unix milliseconds timestamp at which the test run was completed.
		 */
		readonly completedAt: number;

		/**
		 * Optional raw output from the test run.
		 */
		readonly output?: string;

		/**
		 * List of test results. The items in this array are the items that
		 * were passed in the {@link tests.runTests} method.
		 */
		readonly results: ReadonlyArray<Readonly<TestResultSnapshot>>;
	}

	/**
	 * A {@link TestItem}-like interface with an associated result, which appear
	 * or can be provided in {@link TestResult} interfaces.
	 */
	export interface TestResultSnapshot {
		/**
		 * Unique identifier that matches that of the associated TestItem.
		 * This is used to correlate test results and tests in the document with
		 * those in the workspace (test explorer).
		 */
		readonly id: string;

		/**
		 * Parent of this item.
		 */
		readonly parent?: TestResultSnapshot;

		/**
		 * URI this TestItem is associated with. May be a file or file.
		 */
		readonly uri?: Uri;

		/**
		 * Display name describing the test case.
		 */
		readonly label: string;

		/**
		 * Optional description that appears next to the label.
		 */
		readonly description?: string;

		/**
		 * Location of the test item in its `uri`. This is only meaningful if the
		 * `uri` points to a file.
		 */
		readonly range?: Range;

		/**
		 * State of the test in each task. In the common case, a test will only
		 * be executed in a single task and the length of this array will be 1.
		 */
		readonly taskStates: ReadonlyArray<TestSnapshotTaskState>;

		/**
		 * Optional list of nested tests for this item.
		 */
		readonly children: Readonly<TestResultSnapshot>[];
	}

	export interface TestSnapshotTaskState {
		/**
		 * Current result of the test.
		 */
		readonly state: TestResultState;

		/**
		 * The number of milliseconds the test took to run. This is set once the
		 * `state` is `Passed`, `Failed`, or `Errored`.
		 */
		readonly duration?: number;

		/**
		 * Associated test run message. Can, for example, contain assertion
		 * failure information if the test fails.
		 */
		readonly messages: ReadonlyArray<TestMessage>;
	}

	/**
	 * Possible states of tests in a test run.
	 */
	export enum TestResultState {
		// Test will be run, but is not currently running.
		Queued = 1,
		// Test is currently running
		Running = 2,
		// Test run has passed
		Passed = 3,
		// Test run has failed (on an assertion)
		Failed = 4,
		// Test run has been skipped
		Skipped = 5,
		// Test run failed for some other reason (compilation error, timeout, etc)
		Errored = 6
	}
}

redpajama_set_name: RedPajamaGithub


text:
package ch.pantas.billsplitter.ui.event;

import android.os.Bundle;

import com.google.inject.Inject;

import org.mockito.Mock;

import java.util.UUID;

import ch.pantas.billsplitter.dataaccess.EventStore;
import ch.pantas.billsplitter.framework.BaseMockitoInstrumentationTest;
import ch.pantas.billsplitter.model.Event;
import ch.pantas.billsplitter.model.SupportedCurrency;
import ch.pantas.billsplitter.ui.EventDetails;
import ch.pantas.splitty.R;

import static org.mockito.Matchers.any;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

public class EditEventPresenterTest extends BaseMockitoInstrumentationTest {

    @Mock
    private EventStore eventStore;

    @Mock
    private EditEventView view;

    @Inject
    private EditEventPresenter presenter;

    private Bundle arguments;
    private Event event = new Event(UUID.randomUUID(), "Test Event", SupportedCurrency.CHF, UUID.randomUUID());
    private String editTemplate = "Event: %s";

    @Override
    public void setUp() throws Exception {
        super.setUp();
        presenter.setView(view);
        arguments = new Bundle();
        arguments.putSerializable(EventDetails.ARGUMENT_EVENT_ID, event.getId());

        when(eventStore.getById(event.getId())).thenReturn(event);
        when(view.getString(R.string.edit_template)).thenReturn(editTemplate);
    }

    public void testOnSetupSetsCorrectTitle() {
        presenter.onSetup(arguments);

        verify(view).setupTitle(String.format(editTemplate, event.getName()));
    }

    public void testOnSetupSetsCorrectEventName() {
        presenter.onSetup(arguments);

        verify(view).setEventName(event.getName());
    }

    public void testOnSetupSetsCorrectCurrency() {
        presenter.onSetup(arguments);

        verify(view).setUpCurrencyAdapter(event.getCurrency());
    }

    public void testOnSaveEventUpdatesEventNameAndCurrency() {
        presenter.onSetup(arguments);
        String newName = "New Event Name";
        SupportedCurrency newCurrency = SupportedCurrency.USD;
        when(view.getEventName()).thenReturn(newName);
        when(view.getSelectedCurrency()).thenReturn(newCurrency);

        presenter.onSaveEvent();

        assertEquals(newName, event.getName());
        assertEquals(newCurrency, event.getCurrency());
    }

    public void testOnSaveEventPersistsEvent() {
        presenter.onSetup(arguments);
        String newName = "New Event Name";
        SupportedCurrency newCurrency = SupportedCurrency.USD;
        when(view.getEventName()).thenReturn(newName);
        when(view.getSelectedCurrency()).thenReturn(newCurrency);

        presenter.onSaveEvent();

        verify(eventStore).persist(event);
    }

    public void testOnSaveEventOpensEventDetails() {
        presenter.onSetup(arguments);
        String newName = "New Event Name";
        SupportedCurrency newCurrency = SupportedCurrency.USD;
        when(view.getEventName()).thenReturn(newName);
        when(view.getSelectedCurrency()).thenReturn(newCurrency);

        presenter.onSaveEvent();

        verify(view).openEventDetails(event);
    }

    public void testOnSaveShowsErrorIfEventNameIsEmpty() {
        presenter.onSetup(arguments);
        when(view.getEventName()).thenReturn("");

        presenter.onSaveEvent();

        verify(view).setEventNameError();
    }

    public void testOnSaveDoesNotPersistEventIfEventNameIsEmpty() {
        presenter.onSetup(arguments);
        when(view.getEventName()).thenReturn("");

        presenter.onSaveEvent();

        verify(eventStore, never()).persist(any(Event.class));
    }

}


text:
( function () {

	class ConvexGeometry extends THREE.BufferGeometry {

		constructor( points = [] ) {

			super(); // buffers

			const vertices = [];
			const normals = [];

			if ( THREE.ConvexHull === undefined ) {

				console.error( 'THREE.ConvexGeometry: ConvexGeometry relies on THREE.ConvexHull' );

			}

			const convexHull = new THREE.ConvexHull().setFromPoints( points ); // generate vertices and normals

			const faces = convexHull.faces;

			for ( let i = 0; i < faces.length; i ++ ) {

				const face = faces[ i ];
				let edge = face.edge; // we move along a doubly-connected edge list to access all face points (see HalfEdge docs)

				do {

					const point = edge.head().point;
					vertices.push( point.x, point.y, point.z );
					normals.push( face.normal.x, face.normal.y, face.normal.z );
					edge = edge.next;

				} while ( edge !== face.edge );

			} // build geometry

			this.setAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) );
			this.setAttribute( 'normal', new THREE.Float32BufferAttribute( normals, 3 ) );

		}

	}

	THREE.ConvexGeometry = ConvexGeometry;

} )();


text:
package org.apache.flink.runtime.checkpoint;

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

/**
 * Singleton {@link CheckpointStoreUtil} implementation for ZooKeeper.
 *
 */
public enum  ZooKeeperCheckpointStoreUtil implements CheckpointStoreUtil {
	INSTANCE;

	private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperCheckpointStoreUtil.class);

	/**
	 * Convert a checkpoint id into a ZooKeeper path.
	 *
	 * @param checkpointId to convert to the path
	 * @return Path created from the given checkpoint id
	 */
	@Override
	public String checkpointIDToName(long checkpointId) {
		return String.format("/%019d", checkpointId);
	}

	/**
	 * Converts a path to the checkpoint id.
	 *
	 * @param path in ZooKeeper
	 * @return Checkpoint id parsed from the path
	 */
	@Override
	public long nameToCheckpointID(String path) {
		try {
			String numberString;

			// check if we have a leading slash
			if ('/' == path.charAt(0)) {
				numberString = path.substring(1);
			} else {
				numberString = path;
			}
			return Long.parseLong(numberString);
		} catch (NumberFormatException e) {
			LOG.warn("Could not parse checkpoint id from {}. This indicates that the " +
				"checkpoint id to path conversion has changed.", path);

			return INVALID_CHECKPOINT_ID;
		}
	}
}


text:
var GB_ROOT_DIR = "/Common/JS/GreyBox/";

var GB_CURRENT=null;
GB_hide=function(){
GB_CURRENT.hide();
};
GreyBox=new AJS.Class({init:function(_1){
this.use_fx=AJS.fx;
this.type="page";
this.overlay_click_close=false;
this.salt=0;
this.root_dir=GB_ROOT_DIR;
this.callback_fns=[];
this.reload_on_close=false;
this.src_loader=this.root_dir+"loader_frame.html";
var _2=window.location.hostname.indexOf("www");
var _3=this.src_loader.indexOf("www");
if(_2!=-1&&_3==-1){
this.src_loader=this.src_loader.replace("://","://www.");
}
if(_2==-1&&_3!=-1){
this.src_loader=this.src_loader.replace("://www.","://");
}
this.show_loading=true;
AJS.update(this,_1);
},addCallback:function(fn){
if(fn){
this.callback_fns.push(fn);
}
},show:function(_5){
GB_CURRENT=this;
this.url=_5;
var _6=[AJS.$bytc("object"),AJS.$bytc("select")];
AJS.map(AJS.flattenList(_6),function(_7){
_7.style.visibility="hidden";
});
this.createElements();
return false;
},hide:function(){
var _8=this.callback_fns;
if(_8!=[]){
AJS.map(_8,function(fn){
fn();
});
}
this.onHide();
if(this.use_fx){
var _a=this.overlay;
AJS.fx.fadeOut(this.overlay,{onComplete:function(){
AJS.removeElement(_a);
_a=null;
},duration:300});
AJS.removeElement(this.g_window);
}else{
AJS.removeElement(this.g_window,this.overlay);
}
this.removeFrame();
AJS.REV(window,"scroll",_GB_setOverlayDimension);
AJS.REV(window,"resize",_GB_update);
var _b=[AJS.$bytc("object"),AJS.$bytc("select")];
AJS.map(AJS.flattenList(_b),function(_c){
_c.style.visibility="visible";
});
GB_CURRENT=null;
if(this.reload_on_close){
window.location.reload();
}
},update:function(){
this.setOverlayDimension();
this.setFrameSize();
this.setWindowPosition();
},createElements:function(){
this.initOverlay();
this.g_window=AJS.DIV({"id":"GB_window"});
AJS.hideElement(this.g_window);
AJS.getBody().insertBefore(this.g_window,this.overlay.nextSibling);
this.initFrame();
this.initHook();
this.update();
var me=this;
if(this.use_fx){
AJS.fx.fadeIn(this.overlay,{duration:300,to:0.7,onComplete:function(){
me.onShow();
AJS.showElement(me.g_window);
me.startLoading();
}});
}else{
AJS.setOpacity(this.overlay,0.7);
AJS.showElement(this.g_window);
this.onShow();
this.startLoading();
}
AJS.AEV(window,"scroll",_GB_setOverlayDimension);
AJS.AEV(window,"resize",_GB_update);
},removeFrame:function(){
try{
AJS.removeElement(this.iframe);
}
catch(e){
}
this.iframe=null;
},startLoading:function(){
this.iframe.src=this.src_loader+"?s="+this.salt++;
AJS.showElement(this.iframe);
},setOverlayDimension:function(){
var _e=AJS.getWindowSize();
if(AJS.isMozilla()||AJS.isOpera()){
AJS.setWidth(this.overlay,"100%");
}else{
AJS.setWidth(this.overlay,_e.w);
}
var _f=Math.max(AJS.getScrollTop()+_e.h,AJS.getScrollTop()+this.height);
if(_f<AJS.getScrollTop()){
AJS.setHeight(this.overlay,_f);
}else{
AJS.setHeight(this.overlay,AJS.getScrollTop()+_e.h);
}
},initOverlay:function(){
this.overlay=AJS.DIV({"id":"GB_overlay"});
if(this.overlay_click_close){
AJS.AEV(this.overlay,"click",GB_hide);
}
AJS.setOpacity(this.overlay,0);
AJS.getBody().insertBefore(this.overlay,AJS.getBody().firstChild);
},initFrame:function(){
if(!this.iframe){
var d={"name":"GB_frame","class":"GB_frame","frameBorder":0};
this.iframe=AJS.IFRAME(d);
this.middle_cnt=AJS.DIV({"class":"content"},this.iframe);
this.top_cnt=AJS.DIV();
this.bottom_cnt=AJS.DIV();
AJS.ACN(this.g_window,this.top_cnt,this.middle_cnt,this.bottom_cnt);
}
},onHide:function(){
},onShow:function(){
},setFrameSize:function(){
},setWindowPosition:function(){
},initHook:function(){
}});
_GB_update=function(){
if(GB_CURRENT){
GB_CURRENT.update();
}
};
_GB_setOverlayDimension=function(){
if(GB_CURRENT){
GB_CURRENT.setOverlayDimension();
}
};
AJS.preloadImages(GB_ROOT_DIR+"indicator.gif");
script_loaded=true;
var GB_SETS={};
function decoGreyboxLinks(){
var as=AJS.$bytc("a");
AJS.map(as,function(a){
if(a.getAttribute("href")&&a.getAttribute("rel")){
var rel=a.getAttribute("rel");
if(rel.indexOf("gb_")==0){
var _14=rel.match(/\w+/)[0];
var _15=rel.match(/\[(.*)\]/)[1];
var _16=0;
var _17={"caption":a.title||"","url":a.href};
if(_14=="gb_pageset"||_14=="gb_imageset"){
if(!GB_SETS[_15]){
GB_SETS[_15]=[];
}
GB_SETS[_15].push(_17);
_16=GB_SETS[_15].length;
}
if(_14=="gb_pageset"){
a.onclick=function(){
GB_showFullScreenSet(GB_SETS[_15],_16);
return false;
};
}
if(_14=="gb_imageset"){
a.onclick=function(){
GB_showImageSet(GB_SETS[_15],_16);
return false;
};
}
if(_14=="gb_image"){
a.onclick=function(){
GB_showImage(_17.caption,_17.url);
return false;
};
}
if(_14=="gb_page"){
a.onclick=function(){
var sp=_15.split(/, ?/);
GB_show(_17.caption,_17.url,parseInt(sp[1]),parseInt(sp[0]));
return false;
};
}
if(_14=="gb_page_fs"){
a.onclick=function(){
GB_showFullScreen(_17.caption,_17.url);
return false;
};
}
if(_14=="gb_page_center"){
a.onclick=function(){
var sp=_15.split(/, ?/);
GB_showCenter(_17.caption,_17.url,parseInt(sp[1]),parseInt(sp[0]));
return false;
};
}
}
}
});
}
AJS.AEV(window,"load",decoGreyboxLinks);
GB_showImage=function(_1a,url,_1c){
var _1d={width:300,height:300,type:"image",fullscreen:false,center_win:true,caption:_1a,callback_fn:_1c};
var win=new GB_Gallery(_1d);
return win.show(url);
};
GB_showPage=function(_1f,url,_21){
var _22={type:"page",caption:_1f,callback_fn:_21,fullscreen:true,center_win:false};
var win=new GB_Gallery(_22);
return win.show(url);
};
GB_Gallery=GreyBox.extend({init:function(_24){
this.parent({});
this.img_close=this.root_dir+"g_close.gif";
AJS.update(this,_24);
this.addCallback(this.callback_fn);
},initHook:function(){
AJS.addClass(this.g_window,"GB_Gallery");
var _25=AJS.DIV({"class":"inner"});
this.header=AJS.DIV({"class":"GB_header"},_25);
AJS.setOpacity(this.header,0);
AJS.getBody().insertBefore(this.header,this.overlay.nextSibling);
var _26=AJS.TD({"id":"GB_caption","class":"caption","width":"40%"},this.caption);
var _27=AJS.TD({"id":"GB_middle","class":"middle","width":"20%"});
var _28=AJS.IMG({"src":this.img_close});
AJS.AEV(_28,"click",GB_hide);
var _29=AJS.TD({"class":"close","width":"40%"},_28);
var _2a=AJS.TBODY(AJS.TR(_26,_27,_29));
var _2b=AJS.TABLE({"cellspacing":"0","cellpadding":0,"border":0},_2a);
AJS.ACN(_25,_2b);
if(this.fullscreen){
AJS.AEV(window,"scroll",AJS.$b(this.setWindowPosition,this));
}else{
AJS.AEV(window,"scroll",AJS.$b(this._setHeaderPos,this));
}
},setFrameSize:function(){
var _2c=this.overlay.offsetWidth;
var _2d=AJS.getWindowSize();
if(this.fullscreen){
this.width=_2c-40;
this.height=_2d.h-80;
}
AJS.setWidth(this.iframe,this.width);
AJS.setHeight(this.iframe,this.height);
AJS.setWidth(this.header,_2c);
},_setHeaderPos:function(){
AJS.setTop(this.header,AJS.getScrollTop()+10);
},setWindowPosition:function(){
var _2e=this.overlay.offsetWidth;
var _2f=AJS.getWindowSize();
AJS.setLeft(this.g_window,((_2e-50-this.width)/2));
var _30=AJS.getScrollTop()+55;
if(!this.center_win){
AJS.setTop(this.g_window,_30);
}else{
var fl=((_2f.h-this.height)/2)+20+AJS.getScrollTop();
if(fl<0){
fl=0;
}
if(_30>fl){
fl=_30;
}
AJS.setTop(this.g_window,fl);
}
this._setHeaderPos();
},onHide:function(){
AJS.removeElement(this.header);
AJS.removeClass(this.g_window,"GB_Gallery");
},onShow:function(){
if(this.use_fx){
AJS.fx.fadeIn(this.header,{to:1});
}else{
AJS.setOpacity(this.header,1);
}
}});
AJS.preloadImages(GB_ROOT_DIR+"g_close.gif");
GB_showFullScreenSet=function(set,_33,_34){
var _35={type:"page",fullscreen:true,center_win:false};
var _36=new GB_Sets(_35,set);
_36.addCallback(_34);
_36.showSet(_33-1);
return false;
};
GB_showImageSet=function(set,_38,_39){
var _3a={type:"image",fullscreen:false,center_win:true,width:300,height:300};
var _3b=new GB_Sets(_3a,set);
_3b.addCallback(_39);
_3b.showSet(_38-1);
return false;
};
GB_Sets=GB_Gallery.extend({init:function(_3c,set){
this.parent(_3c);
if(!this.img_next){
this.img_next=this.root_dir+"next.gif";
}
if(!this.img_prev){
this.img_prev=this.root_dir+"prev.gif";
}
this.current_set=set;
},showSet:function(_3e){
this.current_index=_3e;
var _3f=this.current_set[this.current_index];
this.show(_3f.url);
this._setCaption(_3f.caption);
this.btn_prev=AJS.IMG({"class":"left",src:this.img_prev});
this.btn_next=AJS.IMG({"class":"right",src:this.img_next});
AJS.AEV(this.btn_prev,"click",AJS.$b(this.switchPrev,this));
AJS.AEV(this.btn_next,"click",AJS.$b(this.switchNext,this));
GB_STATUS=AJS.SPAN({"class":"GB_navStatus"});
AJS.ACN(AJS.$("GB_middle"),this.btn_prev,GB_STATUS,this.btn_next);
this.updateStatus();
},updateStatus:function(){
AJS.setHTML(GB_STATUS,(this.current_index+1)+" / "+this.current_set.length);
if(this.current_index==0){
AJS.addClass(this.btn_prev,"disabled");
}else{
AJS.removeClass(this.btn_prev,"disabled");
}
if(this.current_index==this.current_set.length-1){
AJS.addClass(this.btn_next,"disabled");
}else{
AJS.removeClass(this.btn_next,"disabled");
}
},_setCaption:function(_40){
AJS.setHTML(AJS.$("GB_caption"),_40);
},updateFrame:function(){
var _41=this.current_set[this.current_index];
this._setCaption(_41.caption);
this.url=_41.url;
this.startLoading();
},switchPrev:function(){
if(this.current_index!=0){
this.current_index--;
this.updateFrame();
this.updateStatus();
}
},switchNext:function(){
if(this.current_index!=this.current_set.length-1){
this.current_index++;
this.updateFrame();
this.updateStatus();
}
}});
AJS.AEV(window,"load",function(){
AJS.preloadImages(GB_ROOT_DIR+"next.gif",GB_ROOT_DIR+"prev.gif");
});
GB_show=function(_42,url,_44,_45,_46){
var _47={caption:_42,height:_44||500,width:_45||500,fullscreen:false,callback_fn:_46};
var win=new GB_Window(_47);
return win.show(url);
};
GB_showCenter=function(_49,url,_4b,_4c,_4d){
var _4e={caption:_49,center_win:true,height:_4b||500,width:_4c||500,fullscreen:false,callback_fn:_4d};
var win=new GB_Window(_4e);
return win.show(url);
};
GB_showFullScreen=function(_50,url,_52){
var _53={caption:_50,fullscreen:true,callback_fn:_52};
var win=new GB_Window(_53);
return win.show(url);
};
GB_Window=GreyBox.extend({init:function(_55){
this.parent({});
this.img_header=this.root_dir+"header_bg.gif";
this.img_close=this.root_dir+"w_close.gif";
this.show_close_img=true;
AJS.update(this,_55);
this.addCallback(this.callback_fn);
},initHook:function(){
AJS.addClass(this.g_window,"GB_Window");
this.header=AJS.TABLE({"class":"header"});
this.header.style.backgroundImage="url("+this.img_header+")";
var _56=AJS.TD({"class":"caption"},this.caption);
var _57=AJS.TD({"class":"close"});
if(this.show_close_img){
var _58=AJS.IMG({"src":this.img_close});
var _59=AJS.SPAN("Close");
var btn=AJS.DIV(_58,_59);
AJS.AEV([_58,_59],"mouseover",function(){
AJS.addClass(_59,"on");
});
AJS.AEV([_58,_59],"mouseout",function(){
AJS.removeClass(_59,"on");
});
AJS.AEV([_58,_59],"mousedown",function(){
AJS.addClass(_59,"click");
});
AJS.AEV([_58,_59],"mouseup",function(){
AJS.removeClass(_59,"click");
});
AJS.AEV([_58,_59],"click",GB_hide);
AJS.ACN(_57,btn);
}
tbody_header=AJS.TBODY();
AJS.ACN(tbody_header,AJS.TR(_56,_57));
AJS.ACN(this.header,tbody_header);
AJS.ACN(this.top_cnt,this.header);
if(this.fullscreen){
AJS.AEV(window,"scroll",AJS.$b(this.setWindowPosition,this));
}
},setFrameSize:function(){
if(this.fullscreen){
var _5b=AJS.getWindowSize();
overlay_h=_5b.h;
this.width=Math.round(this.overlay.offsetWidth-(this.overlay.offsetWidth/100)*10);
this.height=Math.round(overlay_h-(overlay_h/100)*10);
}
AJS.setWidth(this.header,this.width+6);
AJS.setWidth(this.iframe,this.width);
AJS.setHeight(this.iframe,this.height);
},setWindowPosition:function(){
var _5c=AJS.getWindowSize();
AJS.setLeft(this.g_window,((_5c.w-this.width)/2)-13);
if(!this.center_win){
AJS.setTop(this.g_window,AJS.getScrollTop());
}else{
var fl=((_5c.h-this.height)/2)-20+AJS.getScrollTop();
if(fl<0){
fl=0;
}
AJS.setTop(this.g_window,fl);
}
}});
AJS.preloadImages(GB_ROOT_DIR+"w_close.gif",GB_ROOT_DIR+"header_bg.gif");


text:
package com.example.bootweb.security.about;

import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

/**
 * 提供与ResourceBundle有关的工具。
 */
public class ResourceBundleUtil {

  /**
   * 取得指定语言环境下的ResourceBundle对象。
   *
   * @param baseClass
   *          类,提供对baseName的定位,以及ClassLoader。允许传入null。意味着从classpath根路径下搜索资源,
   *          并且使用默认的ClassLoader。
   * @param baseName
   *          资源包的基本名称,如果以字符
   *          "\"开始,则被认为是相对classpath根路径,否则被认为是baseClass指定的相对路径。禁止传入null。
   * @throws MissingResourceException
   *           如果未找到指定名称的资源包
   */
  public static ResourceBundle getBundle(Class<?> baseClass, String baseName)
      throws MissingResourceException {
    return getBundle(baseClass, baseName, null);
  }

  /**
   * 取得指定语言环境下的ResourceBundle对象。
   *
   * @param baseClass
   *          类,提供对baseName的定位,以及ClassLoader。允许传入null。意味着从classpath根路径下搜索资源,
   *          并且使用默认的ClassLoader。
   * @param baseName
   *          资源包的基本名称,如果以字符
   *          "\"开始,则被认为是相对classpath根路径,否则被认为是baseClass指定的相对路径。禁止传入null。
   * @param locale
   *          语言环境对象,传入null表示取得默认语言环境。
   * @throws MissingResourceException
   *           如果未找到指定名称的资源包
   */
  public static ResourceBundle getBundle(Class<?> baseClass, String baseName, Locale locale)
      throws MissingResourceException {
    if (baseName == null) {
      throw new MissingResourceException("baseName", ResourceBundleUtil.class.getName(), baseName);
    }
    String fullName = baseName;
    if (fullName.charAt(0) != '/') {
      if (baseClass == null) {
        fullName = '/' + fullName;
      } else {
        fullName = baseClass.getPackage().getName().replace('.', '/') + '/' + fullName;
      }
    }
    ClassLoader classLoader = ResourceBundleUtil.class.getClassLoader();
    if (baseClass != null) {
      classLoader = baseClass.getClassLoader();
    }
    Locale aLocale = locale == null ? Locale.getDefault() : locale;
    return ResourceBundle.getBundle(fullName, aLocale, classLoader);
  }
}


text:
package filter

import (
	"gvisor.dev/gvisor/pkg/log"
	"gvisor.dev/gvisor/pkg/seccomp"
	"gvisor.dev/gvisor/pkg/sentry/platform"
)

// Options are seccomp filter related options.
type Options struct {
	Platform      platform.Platform
	HostNetwork   bool
	ProfileEnable bool
	ControllerFD  int
}

// Install installs seccomp filters for based on the given platform.
func Install(opt Options) error {
	s := allowedSyscalls
	s.Merge(controlServerFilters(opt.ControllerFD))

	// Set of additional filters used by -race and -msan. Returns empty
	// when not enabled.
	s.Merge(instrumentationFilters())

	if opt.HostNetwork {
		Report("host networking enabled: syscall filters less restrictive!")
		s.Merge(hostInetFilters())
	}
	if opt.ProfileEnable {
		Report("profile enabled: syscall filters less restrictive!")
		s.Merge(profileFilters())
	}

	s.Merge(opt.Platform.SyscallFilters())

	return seccomp.Install(s, seccomp.DenyNewExecMappings)
}

// Report writes a warning message to the log.
func Report(msg string) {
	log.Warningf("*** SECCOMP WARNING: %s", msg)
}


text:
package org.colorcoding.ibas.bobas.common;

import javax.xml.bind.annotation.XmlType;

import org.colorcoding.ibas.bobas.MyConfiguration;
import org.colorcoding.ibas.bobas.mapping.Value;

/**
 * 排序
 */
@XmlType(name = "SortType", namespace = MyConfiguration.NAMESPACE_BOBAS_COMMON)
public enum SortType {

	/** 降序 */
	@Value("D")
	DESCENDING,
	/** 升序 */
	@Value("A")
	ASCENDING;

	public static SortType valueOf(int value) {
		return values()[value];
	}

	public static SortType valueOf(String value, boolean ignoreCase) {
		if (ignoreCase) {
			for (Object item : SortType.class.getEnumConstants()) {
				if (item.toString().equalsIgnoreCase(value)) {
					return (SortType) item;
				}
			}
		}
		return SortType.valueOf(value);
	}
}


text:
package etcd

import (
	kapi "k8s.io/kubernetes/pkg/api"
	"k8s.io/kubernetes/pkg/fields"
	"k8s.io/kubernetes/pkg/labels"
	"k8s.io/kubernetes/pkg/registry/generic"
	etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd"
	"k8s.io/kubernetes/pkg/runtime"
	"k8s.io/kubernetes/pkg/storage"

	"github.com/openshift/origin/pkg/build/api"
	"github.com/openshift/origin/pkg/build/registry/build"
)

type REST struct {
	*etcdgeneric.Etcd
}

// NewStorage returns a RESTStorage object that will work against Build objects.
func NewREST(s storage.Interface) (*REST, *DetailsREST) {
	prefix := "/builds"

	store := &etcdgeneric.Etcd{
		NewFunc:           func() runtime.Object { return &api.Build{} },
		NewListFunc:       func() runtime.Object { return &api.BuildList{} },
		QualifiedResource: api.Resource("builds"),
		KeyRootFunc: func(ctx kapi.Context) string {
			return etcdgeneric.NamespaceKeyRootFunc(ctx, prefix)
		},
		KeyFunc: func(ctx kapi.Context, id string) (string, error) {
			return etcdgeneric.NamespaceKeyFunc(ctx, prefix, id)
		},
		ObjectNameFunc: func(obj runtime.Object) (string, error) {
			return obj.(*api.Build).Name, nil
		},
		PredicateFunc: func(label labels.Selector, field fields.Selector) generic.Matcher {
			return build.Matcher(label, field)
		},
		CreateStrategy:      build.Strategy,
		UpdateStrategy:      build.Strategy,
		DeleteStrategy:      build.Strategy,
		Decorator:           build.Decorator,
		ReturnDeletedObject: false,
		Storage:             s,
	}

	detailsStore := *store
	detailsStore.UpdateStrategy = build.DetailsStrategy

	return &REST{store}, &DetailsREST{&detailsStore}
}

type DetailsREST struct {
	store *etcdgeneric.Etcd
}

// New returns an empty object that can be used with Update after request data has been put into it.
func (r *DetailsREST) New() runtime.Object {
	return r.store.New()
}

// Update finds a resource in the storage and updates it.
func (r *DetailsREST) Update(ctx kapi.Context, obj runtime.Object) (runtime.Object, bool, error) {
	return r.store.Update(ctx, obj)
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (django-datatable-view)" project-jdk-type="Python SDK" />
</project>


text:
package org.jetbrains.plugins.scala.testingSupport.scalatest.staticStringTest

import org.jetbrains.plugins.scala.testingSupport.scalatest.ScalaTestTestCase

/**
  * @author Roman.Shein
  * @since 26.06.2015.
  */
trait PropSpecStaticStringTest extends ScalaTestTestCase {
  val propSpecClassName = "PropSpecStringTest"
  val propSpecFileName = propSpecClassName + ".scala"

  def addPropSpec() = {
    addFileToProject(propSpecFileName,
      """
        |import org.scalatest._
        |
        |class PropSpecStringTest extends PropSpec {
        |  val constName = "const"
        |  property(constName) {
        |  }
        |
        |  property(constName + " test name") {
        |  }
        |
        |  property("string" + " sum") {
        |  }
        |
        |  property("time: " + System.currentTimeMillis()) {
        |  }
        |}
      """.stripMargin.trim()
    )
  }

  def testPropSpecSum() = {
    addPropSpec()

    assert(checkConfigAndSettings(createTestFromLocation(10, 10, propSpecFileName), propSpecClassName, "string sum"))
  }

  def testPropSpecVal() = {
    addPropSpec()

    assert(checkConfigAndSettings(createTestFromLocation(4, 10, propSpecFileName), propSpecClassName, "const"))
  }

  def testPropSpecValSum() = {
    addPropSpec()

    assert(checkConfigAndSettings(createTestFromLocation(7, 10, propSpecFileName), propSpecClassName, "const test name"))
  }

  def testPropSpecNonConst() = {
    addPropSpec()

    assert(checkConfigAndSettings(createTestFromLocation(13, 10, propSpecFileName), propSpecClassName))
  }
}


text:
// Title:  Assembly information
// Author: Emily Heiner
//
// MIT License
// Copyright(c) 2017 Emily Heiner (emilysamantha80@gmail.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace ESH.Utility
{
    public class AssemblyInfo
    {
        //Gets the entry assembly for web apps
        //http://stackoverflow.com/questions/4277692/getentryassembly-for-web-applications
        //Note: On App_Start System.Web.HttpContext.Current.ApplicationInstance is NULL
        private static Assembly GetWebEntryAssembly()
        {
            if (System.Web.HttpContext.Current == null || System.Web.HttpContext.Current.ApplicationInstance == null)
            {
                return null;
            }
            var type = System.Web.HttpContext.Current.ApplicationInstance.GetType();
            while (type != null && type.Namespace == "ASP")
            {
                type = type.BaseType;
            }
            return type == null ? null : type.Assembly;
        }

        public static string GetCallingAssemblyPath()
        {
            var path = Path.GetDirectoryName(new Uri(GetCallingAssembly().CodeBase).LocalPath);
            return path;
        }

        //Try as hard as possible to get the proper entry assembly
        public static Assembly GetCallingAssembly()
        {
            Assembly assembly = null;
            assembly = GetWebEntryAssembly();
            if (assembly == null)
                assembly = Assembly.GetEntryAssembly();
            if (assembly == null)
                assembly = Assembly.GetCallingAssembly();
            if (assembly == null)
                assembly = Assembly.GetExecutingAssembly();

            return assembly;
        }

        public static string AssemblyFileName
        {
            get
            {
                string location = GetCallingAssembly().Location;
                return location.Substring(location.LastIndexOf(@"\") + 1);
            }
        }

        public static string AssemblyLocation
        {
            get
            {
                //Assembly.Location is not always accurate, especially when used in Web Applications and NUnit. Assembly.CodeBase is, but must be manipulated.
                //http://stackoverflow.com/questions/52797/how-do-i-get-the-path-of-the-assembly-the-code-is-in
                //The Assembly.Location property sometimes gives you some funny results when using NUnit (where assemblies run from a temporary folder), so I prefer to use CodeBase
                //which gives you the path in URI format, then UriBuild.UnescapeDataString removes the File:// at the beginning, and GetDirectoryName changes it to the normal windows format.
                string codeBase = GetCallingAssembly().CodeBase;
                UriBuilder uri = new UriBuilder(codeBase);
                string path = Uri.UnescapeDataString(uri.Path);
                return Path.GetDirectoryName(path);
            }
        }

        public static string AssemblyTitle
        {
            get
            {
                object[] attributes = GetCallingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
                if (attributes.Length > 0)
                {
                    AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
                    if (titleAttribute.Title != "")
                    {
                        return titleAttribute.Title;
                    }
                }
                return String.Empty;
            }
        }

        public static string AssemblyVersion
        {
            get
            {
                return GetCallingAssembly().GetName().Version.ToString();
            }
        }

        public static string AssemblyDescription
        {
            get
            {
                object[] attributes = GetCallingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
                if (attributes.Length == 0)
                {
                    return "";
                }
                return ((AssemblyDescriptionAttribute)attributes[0]).Description;
            }
        }

        public static string AssemblyProduct
        {
            get
            {
                object[] attributes = GetCallingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
                if (attributes.Length == 0)
                {
                    return "";
                }
                return ((AssemblyProductAttribute)attributes[0]).Product;
            }
        }

        public static string AssemblyCopyright
        {
            get
            {
                object[] attributes = GetCallingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
                if (attributes.Length == 0)
                {
                    return "";
                }
                return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
            }
        }

        public static string AssemblyCompany
        {
            get
            {
                object[] attributes = GetCallingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
                if (attributes.Length == 0)
                {
                    return "";
                }
                return ((AssemblyCompanyAttribute)attributes[0]).Company;
            }
        }
    }
}


text:
module Docs
  class DocsSyncService

    include Agents::GitHubAgentInstance
    include Agents::GitLabAgentInstance

    def initialize help_search_service:
      @help_search_service = help_search_service
    end

    def sync_all
      return false unless allow_sync?

      DocsSource.all.each(&method(:sync))
    end

    def sync docs_source
      return false unless allow_sync?

      case
      when docs_source.github_repo?
        git_hub_repo_docs_sync_service.sync docs_source
      when docs_source.hosted_gitlab_repo?
        hosted_git_lab_repo_docs_sync_service.sync docs_source
      else
        raise "Kind '#{docs_source.kind}' (for DocsSource ID '#{docs_source.id}') not currently supported for docs syncing"
      end
    end

    private

    def allow_sync?
      FeatureFlagService.is_enabled?(:docs_sync)
    end

    def git_hub_repo_docs_sync_service
      @git_hub_repo_docs_sync_service ||= GitHubRepoDocsSyncService.new(
        git_hub_agent: git_hub_agent_service,
        help_search_service: @help_search_service
      )
    end

    def hosted_git_lab_repo_docs_sync_service
      @hosted_git_lab_repo_docs_sync_service ||= HostedGitLabRepoDocsSyncService.new(
        git_lab_agent: git_lab_agent_service,
        help_search_service: @help_search_service
      )
    end

  end
end


text:
FROM r-base
RUN apt-get update && apt-get install -y curl jq libcurl4-gnutls-dev
RUN R -e 'install.packages("Rbitcoin", repos=c("https://jangorecki.gitlab.io/Rbitcoin","https://cran.rstudio.com"))'
ADD rbitcoin.R /


text:
package jsettlers.graphics.map.controls.original.panel.button.stock;

import jsettlers.common.material.EMaterialType;
import jsettlers.graphics.map.controls.original.panel.button.SelectionManagedMaterialButton;
import jsettlers.graphics.map.controls.original.panel.selection.BuildingSelectionContent;
import jsettlers.graphics.map.controls.original.panel.selection.BuildingState;

/**
 * This is a material that is displayed on the stock screen.
 *
 * @author Michael Zangl
 * @author Andreas Eberle
 */
public class StockControlButton extends SelectionManagedMaterialButton implements BuildingSelectionContent.StateDependingElement {
	/**
	 * Creates a new stock control button.
	 *
	 * @param material
	 *            The material.
	 */
	public StockControlButton(EMaterialType material) {
		super(material);
	}

	@Override
	public void setState(BuildingState state) {
		setDotColor(computeColor(state));
	}

	private DotColor computeColor(BuildingState state) {
		if (state.stockAcceptsMaterial(getMaterial())) {
			return DotColor.GREEN;
		} else {
			return DotColor.RED;
		}
	}
}


text:
from django.views.generic import DetailView
from django.core.urlresolvers import reverse

class DetailViewBase(DetailView):
	url_name = "" # line 2

class DetailViewCustom(DetailViewBase):
	template_name = 'base/cbv/cbv/DetailViewCustom.html' # line 1
	def get_success_url(self): # line 3
		return reverse(self.success_url)
	def get_context_data(self, **kwargs): # line 4
		context = super(DetailViewCustom, self).get_context_data(**kwargs) # line 5
		model_name = self.model._meta.verbose_name.title() # line 6
		context['model_name'] = model_name # line 7
		context['url_name'] = self.url_name # line 8
		return context


text:
// (C) Copyright 2015 Moodle Pty Ltd.
//
// 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 { Component, OnInit } from '@angular/core';
import { CoreSitePlugins } from '@features/siteplugins/services/siteplugins';
import { CoreUserTours } from '@features/usertours/services/user-tours';
import { CoreSites } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreUtils } from '@services/utils/utils';
import { Platform } from '@singletons';

/**
 * Page that displays the developer options.
 */
@Component({
    selector: 'page-core-app-settings-dev',
    templateUrl: 'dev.html',
})
export class CoreSettingsDevPage implements OnInit {

    rtl = false;
    forceSafeAreaMargins = false;
    direction = 'ltr';

    remoteStyles = true;
    remoteStylesCount = 0;
    pluginStyles = true;
    pluginStylesCount = 0;
    sitePlugins: CoreSitePluginsBasicInfo[] = [];
    userToursEnabled = true;

    disabledFeatures: string[] = [];

    siteId: string | undefined;

    async ngOnInit(): Promise<void> {
        this.rtl = Platform.isRTL;
        this.RTLChanged();

        this.forceSafeAreaMargins = document.documentElement.classList.contains('force-safe-area-margins');
        this.safeAreaChanged();

        this.siteId = CoreSites.getCurrentSite()?.getId();

        if (!this.siteId) {
            return;
        }

        this.remoteStyles = false;
        this.remoteStylesCount = 0;

        this.pluginStyles = false;
        this.pluginStylesCount = 0;

        this.userToursEnabled = !CoreUserTours.isDisabled();

        document.head.querySelectorAll('style').forEach((style) => {
            if (this.siteId && style.id.endsWith(this.siteId)) {
                if (style.innerHTML.length > 0) {
                    this.remoteStylesCount++;
                }
                this.remoteStyles = this.remoteStyles || style.getAttribute('media') != 'disabled';
            }

            if (style.id.startsWith('siteplugin-')) {
                if (style.innerHTML.length > 0) {
                    this.pluginStylesCount++;
                }
                this.pluginStyles = this.pluginStyles || style.getAttribute('media') != 'disabled';
            }
        });

        this.sitePlugins = CoreSitePlugins.getCurrentSitePluginList().map((plugin) => ({
            addon: plugin.addon,
            component: plugin.component,
            version: plugin.version,
        }));

        const disabledFeatures = (await CoreSites.getCurrentSite()?.getPublicConfig())?.tool_mobile_disabledfeatures;

        this.disabledFeatures = disabledFeatures?.split(',') || [];
    }

    /**
     * Called when the rtl is enabled or disabled.
     */
    RTLChanged(): void {
        this.direction = this.rtl ? 'rtl' : 'ltr';
        document.dir = this.direction;
    }

    /**
     * Called when safe area margins is enabled or disabled.
     */
    safeAreaChanged(): void {
        document.documentElement.classList.toggle('force-safe-area-margins', this.forceSafeAreaMargins);
    }

    /**
     * Called when remote styles is enabled or disabled.
     */
    remoteStylesChanged(): void {
        document.head.querySelectorAll('style').forEach((style) => {
            if (this.siteId && style.id.endsWith(this.siteId)) {
                if (this.remoteStyles) {
                    style.removeAttribute('media');
                } else {
                    style.setAttribute('media', 'disabled');
                }
            }
        });
    }

    /**
     * Called when remote styles is enabled or disabled.
     */
    pluginStylesChanged(): void {
        document.head.querySelectorAll('style').forEach((style) => {
            if (style.id.startsWith('siteplugin-')) {
                if (this.pluginStyles) {
                    style.removeAttribute('media');
                } else {
                    style.setAttribute('media', 'disabled');
                }
            }
        });
    }

    /**
     * Copies site info.
     */
    copyInfo(): void {
        CoreUtils.copyToClipboard(JSON.stringify({ disabledFeatures: this.disabledFeatures, sitePlugins: this.sitePlugins }));
    }

    /**
     * Reset all user tours.
     */
    async resetUserTours(): Promise<void> {
        await CoreUserTours.resetTours();
        CoreDomUtils.showToast('User tours have been reseted');
    }

}

// Basic site plugin info.
type CoreSitePluginsBasicInfo = {
    component: string;
    addon: string;
    version: string;
};


text:
package com.tectonica.jonix.onix3;

import java.io.Serializable;

import com.tectonica.jonix.JPU;
import com.tectonica.jonix.OnixElement;
import com.tectonica.jonix.codelist.RecordSourceTypes;
import com.tectonica.jonix.codelist.ReligiousTextFeatureTypes;

/*
 * NOTE: THIS IS AN AUTO-GENERATED FILE, DON'T EDIT MANUALLY
 */

@SuppressWarnings("serial")
public class ReligiousTextFeatureType implements OnixElement, Serializable
{
	public static final String refname = "ReligiousTextFeatureType";
	public static final String shortname = "b358";

	/**
	 * (type: dt.DateOrDateTime)
	 */
	public String datestamp;

	public RecordSourceTypes sourcetype;

	public String sourcename;

	public ReligiousTextFeatureTypes value;

	public ReligiousTextFeatureType()
	{}

	public ReligiousTextFeatureType(org.w3c.dom.Element element)
	{
		datestamp = JPU.getAttribute(element, "datestamp");
		sourcetype = RecordSourceTypes.byValue(JPU.getAttribute(element, "sourcetype"));
		sourcename = JPU.getAttribute(element, "sourcename");

		value = ReligiousTextFeatureTypes.byValue(JPU.getContentAsString(element));
	}
}


text:
<?php

/**
 * @category   Zend
 * @package    Zend_Auth
 * @subpackage UnitTests
 * @group      Zend_Auth
 * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Auth_Adapter_DbTable_BasicSqliteTest_SkipTests extends PHPUnit_Framework_TestCase
{

    public $message = 'Skipped for unspecified reason';

    public function setUp()
    {
        $this->markTestSkipped($this->message);
    }

    public function testBasicSqlite()
    {
        // this is here only so we have at least one test
    }

}


text:
from anchore_engine.analyzers.syft.handlers.common import save_entry_to_findings

def save_entry(findings, engine_entry, pkg_key=None):
    if not pkg_key:
        pkg_name = engine_entry.get("name", "")
        pkg_version = engine_entry.get("version", engine_entry.get("latest", ""))
        location = engine_entry.get("location", "/virtual/gopkg/")
        pkg_key = f"{location}:{pkg_name}@{pkg_version}"

    save_entry_to_findings(findings, engine_entry, "pkgs.go", pkg_key)

def translate_and_save_entry(findings, artifact):
    """
    Handler function to map syft results for the go-module type into the engine "raw" document format.
    """

    if len(artifact["locations"]) > 0:
        location = artifact["locations"][0]["path"]
    else:
        location = None

    # craft the artifact document
    pkg_value = {
        "name": artifact["name"],
        "version": artifact["version"],
        "location": location,
        "type": "go",
        "files": [],
        "license": "N/A",
        "origin": "N/A",
        "cpes": artifact.get("cpes", []),
        "metadata": artifact.get("metadata", {}),
    }

    # inject the artifact document into the "raw" analyzer document
    save_entry(findings, pkg_value)


text:
#ifndef DFGPredictionPropagationPhase_h
#define DFGPredictionPropagationPhase_h

#include <wtf/Platform.h>

#if ENABLE(DFG_JIT)

namespace JSC { namespace DFG {

class Graph;

// Propagate predictions gathered at heap load sites by the value profiler, and
// from slow path executions, to generate a prediction for each node in the graph.
// This is a crucial phase of compilation, since before running this phase, we
// have no idea what types any node (or most variables) could possibly have, unless
// that node is either a heap load, a call, a GetLocal for an argument, or an
// arithmetic op that had definitely taken slow path. Most nodes (even most
// arithmetic nodes) do not qualify for any of these categories. But after running
// this phase, we'll have full information for the expected type of each node.

bool performPredictionPropagation(Graph&);

} } // namespace JSC::DFG::Phase

#endif // ENABLE(DFG_JIT)

#endif // DFGPredictionPropagationPhase_h


text:
package com.azure.resourcemanager.scvmm.implementation;

import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.scvmm.fluent.models.InventoryItemInner;
import com.azure.resourcemanager.scvmm.models.InventoryItem;

public final class InventoryItemImpl implements InventoryItem, InventoryItem.Definition {
    private InventoryItemInner innerObject;

    private final com.azure.resourcemanager.scvmm.ScvmmManager serviceManager;

    InventoryItemImpl(InventoryItemInner innerObject, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) {
        this.innerObject = innerObject;
        this.serviceManager = serviceManager;
    }

    public String id() {
        return this.innerModel().id();
    }

    public String name() {
        return this.innerModel().name();
    }

    public String type() {
        return this.innerModel().type();
    }

    public SystemData systemData() {
        return this.innerModel().systemData();
    }

    public String kind() {
        return this.innerModel().kind();
    }

    public String managedResourceId() {
        return this.innerModel().managedResourceId();
    }

    public String uuid() {
        return this.innerModel().uuid();
    }

    public String inventoryItemName() {
        return this.innerModel().inventoryItemName();
    }

    public String provisioningState() {
        return this.innerModel().provisioningState();
    }

    public InventoryItemInner innerModel() {
        return this.innerObject;
    }

    private com.azure.resourcemanager.scvmm.ScvmmManager manager() {
        return this.serviceManager;
    }

    private String resourceGroupName;

    private String vmmServerName;

    private String inventoryItemName;

    public InventoryItemImpl withExistingVmmServer(String resourceGroupName, String vmmServerName) {
        this.resourceGroupName = resourceGroupName;
        this.vmmServerName = vmmServerName;
        return this;
    }

    public InventoryItem create() {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getInventoryItems()
                .createWithResponse(
                    resourceGroupName, vmmServerName, inventoryItemName, this.innerModel(), Context.NONE)
                .getValue();
        return this;
    }

    public InventoryItem create(Context context) {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getInventoryItems()
                .createWithResponse(resourceGroupName, vmmServerName, inventoryItemName, this.innerModel(), context)
                .getValue();
        return this;
    }

    InventoryItemImpl(String name, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) {
        this.innerObject = new InventoryItemInner();
        this.serviceManager = serviceManager;
        this.inventoryItemName = name;
    }

    public InventoryItem refresh() {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getInventoryItems()
                .getWithResponse(resourceGroupName, vmmServerName, inventoryItemName, Context.NONE)
                .getValue();
        return this;
    }

    public InventoryItem refresh(Context context) {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getInventoryItems()
                .getWithResponse(resourceGroupName, vmmServerName, inventoryItemName, context)
                .getValue();
        return this;
    }

    public InventoryItemImpl withKind(String kind) {
        this.innerModel().withKind(kind);
        return this;
    }
}


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Package org.apache.hadoop.mapred (Apache Hadoop Main 2.7.3 API)</title>
<meta name="date" content="2016-08-18">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Package
org.apache.hadoop.mapred

Packages that use org.apache.hadoop.mapred

Package
Description

org.apache.hadoop.mapred

org.apache.hadoop.mapred.jobcontrol

org.apache.hadoop.mapred.join

org.apache.hadoop.mapred.lib

org.apache.hadoop.mapred.lib.aggregate

org.apache.hadoop.mapred.lib.db

org.apache.hadoop.mapred.pipes

org.apache.hadoop.mapreduce

Classes in org.apache.hadoop.mapred used by org.apache.hadoop.mapred

Class and Description

ClusterStatus

Status information on the current state of the Map-Reduce cluster.

Counters

A set of named counters.

Counters.Counter

A counter record, comprising its name and value.

Counters.Group

Group of counters, comprising of counters from a particular
  counter Enum class.

FileAlreadyExistsException

Used when target file already exists for any operation and
 is not configured to be overwritten.

FileInputFormat

A base class for file-based InputFormat.

FileOutputFormat

A base class for OutputFormat.

FileSplit

A section of an input file.

InputFormat

InputFormat describes the input-specification for a
 Map-Reduce job.

InputSplit

InputSplit represents the data to be processed by an
 individual Mapper.

InputSplitWithLocationInfo

InvalidJobConfException

This exception is thrown when jobconf misses some mendatory attributes
 or value of some attributes is invalid.

JobConf

A map/reduce job configuration.

JobConfigurable

That what may be configured.

JobContext

JobID

JobID represents the immutable and unique identifier for
 the job.

JobPriority

Used to describe the priority of the running job.

JobQueueInfo

Class that contains the information regarding the Job Queues which are
 maintained by the Hadoop Map/Reduce framework.

JobStatus

Describes the current status of a job.

Mapper

Maps input key/value pairs to a set of intermediate key/value pairs.

MapRunnable

Expert: Generic interface for Mappers.

OutputCollector

Collects the <key, value> pairs output by Mappers
 and Reducers.

OutputCommitter

OutputCommitter describes the commit of task output for a
 Map-Reduce job.

OutputFormat

OutputFormat describes the output-specification for a
 Map-Reduce job.

Partitioner

Partitions the key space.

RecordReader

RecordReader reads <key, value> pairs from an
 InputSplit.

RecordWriter

RecordWriter writes the output <key, value> pairs
 to an output file.

Reducer

Reduces a set of intermediate values which share a key to a smaller set of
 values.

Reporter

A facility for Map-Reduce applications to report progress and update
 counters, status information etc.

RunningJob

RunningJob is the user-interface to query for details on a
 running Map-Reduce job.

SequenceFileInputFormat

An InputFormat for SequenceFiles.

SequenceFileOutputFormat

An OutputFormat that writes SequenceFiles.

SplitLocationInfo

TaskAttemptContext

TaskAttemptID

TaskAttemptID represents the immutable and unique identifier for
 a task attempt.

TaskCompletionEvent

This is used to track task completion events on
 job tracker.

TaskCompletionEvent.Status

TaskID

TaskID represents the immutable and unique identifier for
 a Map or Reduce Task.

TaskReport

A report on the state of a task.

Classes in org.apache.hadoop.mapred used by org.apache.hadoop.mapred.jobcontrol

Class and Description

JobClient

JobClient is the primary interface for the user-job to interact
 with the cluster.

JobConf

A map/reduce job configuration.

JobID

JobID represents the immutable and unique identifier for
 the job.

Classes in org.apache.hadoop.mapred used by org.apache.hadoop.mapred.join

Class and Description

InputFormat

InputFormat describes the input-specification for a
 Map-Reduce job.

InputSplit

InputSplit represents the data to be processed by an
 individual Mapper.

JobConf

A map/reduce job configuration.

RecordReader

RecordReader reads <key, value> pairs from an
 InputSplit.

Reporter

A facility for Map-Reduce applications to report progress and update
 counters, status information etc.

Classes in org.apache.hadoop.mapred used by org.apache.hadoop.mapred.lib

Class and Description

FileInputFormat

A base class for file-based InputFormat.

FileOutputFormat

A base class for OutputFormat.

FileSplit

A section of an input file.

InputFormat

InputFormat describes the input-specification for a
 Map-Reduce job.

InputSplit

InputSplit represents the data to be processed by an
 individual Mapper.

JobConf

A map/reduce job configuration.

JobConfigurable

That what may be configured.

Mapper

Maps input key/value pairs to a set of intermediate key/value pairs.

MapReduceBase

Base class for Mapper and Reducer implementations.

MapRunnable

Expert: Generic interface for Mappers.

OutputCollector

Collects the <key, value> pairs output by Mappers
 and Reducers.

OutputFormat

OutputFormat describes the output-specification for a
 Map-Reduce job.

Partitioner

Partitions the key space.

RecordReader

RecordReader reads <key, value> pairs from an
 InputSplit.

RecordWriter

RecordWriter writes the output <key, value> pairs
 to an output file.

Reducer

Reduces a set of intermediate values which share a key to a smaller set of
 values.

Reporter

A facility for Map-Reduce applications to report progress and update
 counters, status information etc.

Classes in org.apache.hadoop.mapred used by org.apache.hadoop.mapred.lib.aggregate

Class and Description

JobConf

A map/reduce job configuration.

JobConfigurable

That what may be configured.

Mapper

Maps input key/value pairs to a set of intermediate key/value pairs.

OutputCollector

Collects the <key, value> pairs output by Mappers
 and Reducers.

Reducer

Reduces a set of intermediate values which share a key to a smaller set of
 values.

Reporter

A facility for Map-Reduce applications to report progress and update
 counters, status information etc.

Classes in org.apache.hadoop.mapred used by org.apache.hadoop.mapred.lib.db

Class and Description

InputFormat

InputFormat describes the input-specification for a
 Map-Reduce job.

InputSplit

InputSplit represents the data to be processed by an
 individual Mapper.

JobConf

A map/reduce job configuration.

JobConfigurable

That what may be configured.

OutputFormat

OutputFormat describes the output-specification for a
 Map-Reduce job.

RecordReader

RecordReader reads <key, value> pairs from an
 InputSplit.

RecordWriter

RecordWriter writes the output <key, value> pairs
 to an output file.

Reporter

A facility for Map-Reduce applications to report progress and update
 counters, status information etc.

Classes in org.apache.hadoop.mapred used by org.apache.hadoop.mapred.pipes

Class and Description

JobConf

A map/reduce job configuration.

RunningJob

RunningJob is the user-interface to query for details on a
 running Map-Reduce job.

Classes in org.apache.hadoop.mapred used by org.apache.hadoop.mapreduce

Class and Description

ID

A general identifier, which internally stores the id
 as an integer.

SplitLocationInfo

TaskCompletionEvent

This is used to track task completion events on
 job tracker.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2016 Apache Software Foundation. All rights reserved.


text:
package com.aht.bonappettit.service.relationship;

import java.util.List;

import com.aht.bonappettit.domain.relationship.Affinity;

public interface AffinityService {
	public void create(Affinity affinity);
	public Affinity retrieve(long id);
	public void update(Affinity affinity);
	public void delete(Affinity affinity);
	public List<Affinity> retrieveAll();
}


text:
//
//  UIViewController+GDSheetController.h
//  GDSheetViewControllerDemo
//
//  Created by David Bonnet on 27/08/13.
//  Copyright (c) 2013 David Bonnet. All rights reserved.
//

#import <UIKit/UIKit.h>

@class GDSheetController;

/*
 * This category extends every UIViewController with a sheetController property.
 * It can be used in the same way as the navigationController property, thus
 * allowing simple access from all the relevant controllers, to enable quick and
 * easy message forwarding.
 */
@interface UIViewController (GDSheetController)

@property (nonatomic, strong, readwrite) GDSheetController *sheetController;

@end


text:
<mat-form-field class="full-width">
    <mat-select placeholder="{{placeholder}}" [compareWith]="compareFn" [formControl]="formValue" multiple>
        <mat-option *ngFor="let p of csDefinition.options | toKeyValuePairs" [value]="p.key">{{p.value}}</mat-option>
    </mat-select>
    <mat-hint *ngIf="csHasInfo">{{csDefinition.propertyDescription}}</mat-hint>
</mat-form-field>


text:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VTK_REQUIRED_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VTK_REQUIRED_CXX_FLAGS}")

# Add include directories needed to use VTK.
include_directories(${VTK_INCLUDE_DIRS})

# Add link directories needed to use VTK.
link_directories(${VTK_LIBRARY_DIRS})


text:
[Amazon Relational Database Service](http://aws.amazon.com/rds/) (Amazon RDS) is a web service that makes it easy to set up, operate, and scale a relational database in the cloud.

## How

This example creates a security group to allow Postgres RDS instance, then creates an RDS instance with that security group assigned.

  puppet apply rds_security.pp

Unfortunatly, it's not possible to assign the EC2 group and the allowed IP's to the `db_securitygroup` through the API, so you have to do this manually though the console for now:

## Add the Security Group We Made with Puppet**
![Add EC2 Security Group](./images/add-rds-securitygroup.png?raw=true)

## Add an IP to allow access to the RDS instance
**Note: Enter `0.0.0.0/32` to allow all IPs**
![Add IP to allow](./images/add-ip-to-allow.png?raw=true)

## It should look something like this
![Final Look](./images/final-screen.png?raw=true)

You can now check your security group is correct by using Puppet resource commands:

    puppet resource rds_db_securitygroup rds-postgres-db_securitygroup

It should return something like this:

```puppet
rds_db_securitygroup { 'rds-postgres-db_securitygroup':
  ensure              => 'present',
  ec2_security_groups => [{'ec2_security_group_id' => 'sg-83fb3z5', 'ec2_security_group_name' => 'rds-postgres-group', 'ec2_security_group_owner_id' => '4822239859', 'status' => 'authorized'}],
  ip_ranges           => [{'ip_range' => '0.0.0.0/32', 'status' => 'authorized'}],
  owner_id            => '239838031',
  region              => 'us-west-2',
}
```
When this is complete, create the RDS Postgres instance:

    puppet apply rds_postgres.pp

This can take a while to setup, but when it's complete, you should be able to access it:

```bash
psql -d postgresql -h puppetlabs-aws-postgres.cwgutxb9fmx.us-west-2.rds.amazonaws.com -U root

Password for user root: pullZstringz345
psql (9.4.0, server 9.3.5)
SSL connection (protocol: TLSv1.2, cipher: DHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.

postgresql=> exit
```


text:
import re
import os
import sys

from .. import http

try:
    # Python 3
    from http.client import HTTPException, BadStatusLine
    from urllib.request import ProxyHandler, HTTPPasswordMgrWithDefaultRealm, ProxyBasicAuthHandler, ProxyDigestAuthHandler, build_opener, Request
    from urllib.error import HTTPError, URLError
    import urllib.request as urllib_compat
except (ImportError):
    # Python 2
    from httplib import HTTPException, BadStatusLine
    from urllib2 import ProxyHandler, HTTPPasswordMgrWithDefaultRealm, ProxyBasicAuthHandler, ProxyDigestAuthHandler, build_opener, Request
    from urllib2 import HTTPError, URLError
    import urllib2 as urllib_compat

try:
    # Python 3.3
    import ConnectionError
except (ImportError):
    # Python 2.6-3.2
    from socket import error as ConnectionError

from ..console_write import console_write
from ..unicode import unicode_from_os
from ..http.validating_https_handler import ValidatingHTTPSHandler
from ..http.debuggable_http_handler import DebuggableHTTPHandler
from .rate_limit_exception import RateLimitException
from .downloader_exception import DownloaderException
from .cert_provider import CertProvider
from .decoding_downloader import DecodingDownloader
from .limiting_downloader import LimitingDownloader
from .caching_downloader import CachingDownloader

class UrlLibDownloader(CertProvider, DecodingDownloader, LimitingDownloader, CachingDownloader):
    """
    A downloader that uses the Python urllib module

    :param settings:
        A dict of the various Package Control settings. The Sublime Text
        Settings API is not used because this code is run in a thread.
    """

    def __init__(self, settings):
        self.opener = None
        self.settings = settings

    def close(self):
        """
        Closes any persistent/open connections
        """

        if not self.opener:
            return
        handler = self.get_handler()
        if handler:
            handler.close()
        self.opener = None

    def download(self, url, error_message, timeout, tries, prefer_cached=False):
        """
        Downloads a URL and returns the contents

        Uses the proxy settings from the Package Control.sublime-settings file,
        however there seem to be a decent number of proxies that this code
        does not work with. Patches welcome!

        :param url:
            The URL to download

        :param error_message:
            A string to include in the console error that is printed
            when an error occurs

        :param timeout:
            The int number of seconds to set the timeout to

        :param tries:
            The int number of times to try and download the URL in the case of
            a timeout or HTTP 503 error

        :param prefer_cached:
            If a cached version should be returned instead of trying a new request

        :raises:
            NoCaCertException: when no CA certs can be found for the url
            RateLimitException: when a rate limit is hit
            DownloaderException: when any other download error occurs

        :return:
            The string contents of the URL
        """

        if prefer_cached:
            cached = self.retrieve_cached(url)
            if cached:
                return cached

        self.setup_opener(url, timeout)

        debug = self.settings.get('debug')
        error_string = None
        while tries > 0:
            tries -= 1
            try:
                request_headers = {
                    "User-Agent": self.settings.get('user_agent'),
                    # Don't be alarmed if the response from the server does not
                    # select one of these since the server runs a relatively new
                    # version of OpenSSL which supports compression on the SSL
                    # layer, and Apache will use that instead of HTTP-level
                    # encoding.
                    "Accept-Encoding": "gzip,deflate"
                }
                request_headers = self.add_conditional_headers(url, request_headers)
                request = Request(url, headers=request_headers)
                http_file = self.opener.open(request, timeout=timeout)
                self.handle_rate_limit(http_file.headers, url)

                result = http_file.read()
                # Make sure the response is closed so we can re-use the connection
                http_file.close()

                encoding = http_file.headers.get('content-encoding')
                result = self.decode_response(encoding, result)

                return self.cache_result('get', url, http_file.getcode(),
                    http_file.headers, result)

            except (HTTPException) as e:
                # Since we use keep-alives, it is possible the other end closed
                # the connection, and we may just need to re-open
                if isinstance(e, BadStatusLine):
                    handler = self.get_handler()
                    if handler and handler.use_count > 1:
                        self.close()
                        self.setup_opener(url, timeout)
                        tries += 1
                        continue

                error_string = u'%s HTTP exception %s (%s) downloading %s.' % (
                    error_message, e.__class__.__name__, unicode_from_os(e), url)

            except (HTTPError) as e:
                # Make sure the response is closed so we can re-use the connection
                e.read()
                e.close()

                # Make sure we obey Github's rate limiting headers
                self.handle_rate_limit(e.headers, url)

                # Handle cached responses
                if unicode_from_os(e.code) == '304':
                    return self.cache_result('get', url, int(e.code), e.headers, b'')

                # Bitbucket and Github return 503 a decent amount
                if unicode_from_os(e.code) == '503' and tries != 0:
                    error_string = u'Downloading %s was rate limited' % url
                    if tries:
                        error_string += ', trying again'
                        if debug:
                            console_write(error_string, True)
                    continue

                error_string = u'%s HTTP error %s downloading %s.' % (
                    error_message, unicode_from_os(e.code), url)

            except (URLError) as e:

                # Bitbucket and Github timeout a decent amount
                if unicode_from_os(e.reason) == 'The read operation timed out' \
                        or unicode_from_os(e.reason) == 'timed out':
                    error_string = u'Downloading %s timed out' % url
                    if tries:
                        error_string += ', trying again'
                        if debug:
                            console_write(error_string, True)
                    continue

                error_string = u'%s URL error %s downloading %s.' % (
                    error_message, unicode_from_os(e.reason), url)

            except (ConnectionError):
                # Handle broken pipes/reset connections by creating a new opener, and
                # thus getting new handlers and a new connection
                error_string = u'Connection went away while trying to download %s, trying again' % url
                if debug:
                    console_write(error_string, True)

                self.opener = None
                self.setup_opener(url, timeout)
                tries += 1

                continue

            break

        raise DownloaderException(error_string)

    def get_handler(self):
        """
        Get the HTTPHandler object for the current connection
        """

        if not self.opener:
            return None

        for handler in self.opener.handlers:
            if isinstance(handler, ValidatingHTTPSHandler) or isinstance(handler, DebuggableHTTPHandler):
                return handler

    def setup_opener(self, url, timeout):
        """
        Sets up a urllib OpenerDirector to be used for requests. There is a
        fair amount of custom urllib code in Package Control, and part of it
        is to handle proxies and keep-alives. Creating an opener the way
        below is because the handlers have been customized to send the
        "Connection: Keep-Alive" header and hold onto connections so they
        can be re-used.

        :param url:
            The URL to download

        :param timeout:
            The int number of seconds to set the timeout to
        """

        if not self.opener:
            http_proxy = self.settings.get('http_proxy')
            https_proxy = self.settings.get('https_proxy')
            if http_proxy or https_proxy:
                proxies = {}
                if http_proxy:
                    proxies['http'] = http_proxy
                if https_proxy:
                    proxies['https'] = https_proxy
                proxy_handler = ProxyHandler(proxies)
            else:
                proxy_handler = ProxyHandler()

            password_manager = HTTPPasswordMgrWithDefaultRealm()
            proxy_username = self.settings.get('proxy_username')
            proxy_password = self.settings.get('proxy_password')
            if proxy_username and proxy_password:
                if http_proxy:
                    password_manager.add_password(None, http_proxy, proxy_username,
                        proxy_password)
                if https_proxy:
                    password_manager.add_password(None, https_proxy, proxy_username,
                        proxy_password)

            handlers = [proxy_handler]

            basic_auth_handler = ProxyBasicAuthHandler(password_manager)
            digest_auth_handler = ProxyDigestAuthHandler(password_manager)
            handlers.extend([digest_auth_handler, basic_auth_handler])

            debug = self.settings.get('debug')

            if debug:
                console_write(u"Urllib Debug Proxy", True)
                console_write(u"  http_proxy: %s" % http_proxy)
                console_write(u"  https_proxy: %s" % https_proxy)
                console_write(u"  proxy_username: %s" % proxy_username)
                console_write(u"  proxy_password: %s" % proxy_password)

            secure_url_match = re.match('^https://([^/]+)', url)
            if secure_url_match != None:
                secure_domain = secure_url_match.group(1)
                bundle_path = self.check_certs(secure_domain, timeout)
                bundle_path = bundle_path.encode(sys.getfilesystemencoding())
                handlers.append(ValidatingHTTPSHandler(ca_certs=bundle_path,
                    debug=debug, passwd=password_manager,
                    user_agent=self.settings.get('user_agent')))
            else:
                handlers.append(DebuggableHTTPHandler(debug=debug,
                    passwd=password_manager))
            self.opener = build_opener(*handlers)

    def supports_ssl(self):
        """
        Indicates if the object can handle HTTPS requests

        :return:
            If the object supports HTTPS requests
        """
        return 'ssl' in sys.modules and hasattr(urllib_compat, 'HTTPSHandler')


text:
package de.lessvoid.nifty.renderer.lwjgl.render.io;

import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;

import org.lwjgl.BufferUtils;

/**
 * A utility to load TGAs. Note: NOT THREAD SAFE
 *
 * Fresh cut of code but largely influeneced by the TGA loading class
 * provided as part of the Java Monkey Engine (JME). Why not check out
 * what they're doing over at http://www.jmonkeyengine.com. kudos to
 * Mark Powell.
 *
 * @author Kevin Glass
 */
public class TGAImageData implements ImageData {
	/** The width of the texture that needs to be generated */
	private int texWidth;
	/** The height of the texture that needs to be generated */
	private int texHeight;
	/** The width of the TGA image */
	private int width;
	/** The height of the TGA image */
	private int height;
	/** The bit depth of the image */
	private short pixelDepth;

	/**
	 * Create a new TGA Loader
	 */
	public TGAImageData() {
	}

	/**
	 * Flip the endian-ness of the short
	 *
	 * @param signedShort The short to flip
	 * @return The flipped short
	 */
	private short flipEndian(short signedShort) {
		int input = signedShort & 0xFFFF;
		return (short) (input << 8 | (input & 0xFF00) >>> 8);
	}

	/**
	 * @see org.newdawn.slick.opengl.ImageData#getDepth()
	 */
	public int getDepth() {
		return pixelDepth;
	}

	/**
	 * @see org.newdawn.slick.opengl.ImageData#getWidth()
	 */
	public int getWidth() {
		return width;
	}

	/**
	 * @see org.newdawn.slick.opengl.ImageData#getHeight()
	 */
	public int getHeight() {
		return height;
	}

	/**
	 * @see org.newdawn.slick.opengl.ImageData#getTexWidth()
	 */
	public int getTexWidth() {
		return texWidth;
	}

	/**
	 * @see org.newdawn.slick.opengl.ImageData#getTexHeight()
	 */
	public int getTexHeight() {
		return texHeight;
	}

	public ByteBuffer loadImage(InputStream fis) throws IOException {
		return loadImage(fis, false, null);
	}

	public ByteBuffer loadImage(InputStream fis, boolean flipped, int[] transparent) throws IOException {
		return loadImage(fis, flipped, true, transparent);
	}

	public ByteBuffer loadImage(InputStream fis, boolean flipped, boolean forceAlpha, int[] transparent) throws IOException {
	  return loadImageInternal(fis, flipped, forceAlpha, transparent, true, false);
	}

	public ByteBuffer loadMouseCursorImage(InputStream fis) throws IOException {
    return loadImageInternal(fis, true, false, null, false, true);
  }

  public ByteBuffer loadImageDirect(InputStream fis) throws IOException {
    return loadImageInternal(fis, false, true, null, false, false);
  }

	private ByteBuffer loadImageInternal(InputStream fis, boolean flipped, boolean forceAlpha, int[] transparent, boolean forceNonePowerOfTwo, boolean modeARGB) throws IOException {
		if (transparent != null) {
			forceAlpha = true;
		}
		byte red = 0;
		byte green = 0;
		byte blue = 0;
		byte alpha = 0;

		BufferedInputStream bis = new BufferedInputStream(fis, 100000);
		DataInputStream dis = new DataInputStream(bis);

		// Read in the Header
		short idLength = (short) dis.read();
		short colorMapType = (short) dis.read();
		short imageType = (short) dis.read();
		short cMapStart = flipEndian(dis.readShort());
		short cMapLength = flipEndian(dis.readShort());
		short cMapDepth = (short) dis.read();
		short xOffset = flipEndian(dis.readShort());
		short yOffset = flipEndian(dis.readShort());

		width = flipEndian(dis.readShort());
		height = flipEndian(dis.readShort());
		pixelDepth = (short) dis.read();
		if (pixelDepth == 32) {
			forceAlpha = false;
		}

    texWidth = width;
    texHeight = height;
    if (forceNonePowerOfTwo) {
      texWidth = get2Fold(width);
      texHeight = get2Fold(height);
    }

		short imageDescriptor = (short) dis.read();
		if ((imageDescriptor & 0x0020) == 0) {
		   flipped = !flipped;
		}

		// Skip image ID
		if (idLength > 0) {
			bis.skip(idLength);
		}

		byte[] rawData = null;
		if ((pixelDepth == 32) || (forceAlpha)) {
			pixelDepth = 32;
			rawData = new byte[texWidth * texHeight * 4];
		} else if (pixelDepth == 24) {
			rawData = new byte[texWidth * texHeight * 3];
		} else {
			throw new RuntimeException("Only 24 and 32 bit TGAs are supported");
		}

		if (pixelDepth == 24) {
			if (flipped) {
				for (int i = height-1; i >= 0; i--) {
					for (int j = 0; j < width; j++) {
						blue = dis.readByte();
						green = dis.readByte();
						red = dis.readByte();

						int ofs = ((j + (i * texWidth)) * 3);
						rawData[ofs] = red;
						rawData[ofs + 1] = green;
						rawData[ofs + 2] = blue;
					}
				}
			} else {
				for (int i = 0; i < height; i++) {
					for (int j = 0; j < width; j++) {
						blue = dis.readByte();
						green = dis.readByte();
						red = dis.readByte();

						int ofs = ((j + (i * texWidth)) * 3);
						rawData[ofs] = red;
						rawData[ofs + 1] = green;
						rawData[ofs + 2] = blue;
					}
				}
			}
		} else if (pixelDepth == 32) {
			if (flipped) {
				for (int i = height-1; i >= 0; i--) {
					for (int j = 0; j < width; j++) {
						blue = dis.readByte();
						green = dis.readByte();
						red = dis.readByte();
						if (forceAlpha) {
							alpha = (byte) 255;
						} else {
							alpha = dis.readByte();
						}

						int ofs = ((j + (i * texWidth)) * 4);

						rawData[ofs] = red;
						rawData[ofs + 1] = green;
						rawData[ofs + 2] = blue;
						rawData[ofs + 3] = alpha;

						if (alpha == 0) {
							rawData[ofs + 2] = (byte) 0;
							rawData[ofs + 1] = (byte) 0;
							rawData[ofs] = (byte) 0;
						}
					}
				}
			} else {
				for (int i = 0; i < height; i++) {
					for (int j = 0; j < width; j++) {
						blue = dis.readByte();
						green = dis.readByte();
						red = dis.readByte();
						if (forceAlpha) {
							alpha = (byte) 255;
						} else {
							alpha = dis.readByte();
						}

						int ofs = ((j + (i * texWidth)) * 4);

						if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN) {
							rawData[ofs] = red;
							rawData[ofs + 1] = green;
							rawData[ofs + 2] = blue;
							rawData[ofs + 3] = alpha;
						} else {
							rawData[ofs] = red;
							rawData[ofs + 1] = green;
							rawData[ofs + 2] = blue;
							rawData[ofs + 3] = alpha;
						}

						if (alpha == 0) {
							rawData[ofs + 2] = 0;
							rawData[ofs + 1] = 0;
							rawData[ofs] = 0;
						}
					}
				}
			}
		}
		fis.close();

		if (transparent != null) {
	        for (int i=0;i<rawData.length;i+=4) {
	        	boolean match = true;
	        	for (int c=0;c<3;c++) {
	        		if (rawData[i+c] != transparent[c]) {
	        			match = false;
	        		}
	        	}

	        	if (match) {
	        		rawData[i+3] = 0;
	           	}
	        }
        }

		// Get a pointer to the image memory
		ByteBuffer scratch = BufferUtils.createByteBuffer(rawData.length);
		scratch.put(rawData);

		int perPixel = pixelDepth / 8;
		if (height < texHeight-1) {
			int topOffset = (texHeight-1) * (texWidth*perPixel);
			int bottomOffset = (height-1) * (texWidth*perPixel);
			for (int x=0;x<texWidth*perPixel;x++) {
				scratch.put(topOffset+x, scratch.get(x));
				scratch.put(bottomOffset+(texWidth*perPixel)+x, scratch.get((texWidth*perPixel)+x));
			}
		}
		if (width < texWidth-1) {
			for (int y=0;y<texHeight;y++) {
				for (int i=0;i<perPixel;i++) {
					scratch.put(((y+1)*(texWidth*perPixel))-perPixel+i, scratch.get(y*(texWidth*perPixel)+i));
					scratch.put((y*(texWidth*perPixel))+(width*perPixel)+i, scratch.get((y*(texWidth*perPixel))+((width-1)*perPixel)+i));
				}
			}
		}

		scratch.flip();

		return scratch;
	}

    /**
     * Get the closest greater power of 2 to the fold number
     *
     * @param fold The target number
     * @return The power of 2
     */
    private int get2Fold(int fold) {
        int ret = 2;
        while (ret < fold) {
            ret *= 2;
        }
        return ret;
    }

	/**
	 * @see org.newdawn.slick.opengl.ImageData#getImageBufferData()
	 */
	public ByteBuffer getImageBufferData() {
		throw new RuntimeException("TGAImageData doesn't store it's image.");
	}

	/**
	 * @see org.newdawn.slick.opengl.LoadableImageData#configureEdging(boolean)
	 */
	public void configureEdging(boolean edging) {
	}
}


text:
package com.jaxio.celerio.configuration.database.mysql;

import com.jaxio.celerio.configuration.database.support.EnumExtractor;

import java.util.List;

public class MysqlEnumValuesExtractor {
    private static final String MYSQL_ENUM_VALUES = "[e|E][n|N][u|U][m|M]\\((.*)\\)$";
    private EnumExtractor enumExtractor = new EnumExtractor(MYSQL_ENUM_VALUES);

    public List<String> extract(String content) {
        return enumExtractor.extract(content);
    }
}


text:
var config = {

    hosts: {
        domain: 'desktop-545pc5b',
        muc: 'conference.desktop-545pc5b'
    },

    bosh: 'wss://desktop-545pc5b:7443/ws/',
    clientNode: 'http://jitsi.org/jitsimeet',

    disableSuspendVideo: true,
    desktopSharingChromeExtId: null,
    desktopSharingChromeDisabled: true,
    desktopSharingChromeSources: [ 'screen', 'window', 'tab' ],
    desktopSharingChromeMinExtVersion: '0.1',
    desktopSharingFirefoxDisabled: false,

    channelLastN: -1,
    enableWelcomePage: true,
    minHDHeight: 540,
    enableUserRolesBasedOnToken: false,

    p2p: {
        enabled: true,
        stunServers: [
            { urls: 'stun:stun.l.google.com:19302' },
            { urls: 'stun:stun1.l.google.com:19302' },
            { urls: 'stun:stun2.l.google.com:19302' }
        ],
        preferH264: true
    },

    deploymentInfo: {

    }
};