text:
package techreborn.compat.jei.assemblingMachine;

import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.*;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeCategory;
import net.minecraft.client.Minecraft;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.gui.GuiAssemblingMachine;
import techreborn.compat.jei.RecipeCategoryUids;
import techreborn.compat.jei.RecipeUtil;
import techreborn.lib.ModInfo;

import javax.annotation.Nonnull;

@SuppressWarnings("deprecation")
public class AssemblingMachineRecipeCategory implements IRecipeCategory<AssemblingMachineRecipeWrapper> {
	private static final int[] INPUT_SLOTS = { 0, 1 };
	private static final int[] OUTPUT_SLOTS = { 2 };

	private final IDrawable background;
	private final IDrawableAnimated electricity;
	private final String title;

	public AssemblingMachineRecipeCategory(IGuiHelper guiHelper) {
		background = guiHelper.createDrawable(GuiAssemblingMachine.texture, 46, 16, 91, 54);
		IDrawableStatic electricityDrawable = guiHelper.createDrawable(GuiAssemblingMachine.texture, 176, 0, 14, 14);
		electricity = guiHelper.createAnimatedDrawable(electricityDrawable, 300, IDrawableAnimated.StartDirection.TOP,
			true);
		title = I18n.translateToLocal("tile.techreborn.assemblingmachine.name");
	}

	@Override
	public String getModName() {
		return ModInfo.MOD_NAME;
	}

	@Nonnull
	@Override
	public String getUid() {
		return RecipeCategoryUids.ASSEMBLING_MACHINE;
	}

	@Nonnull
	@Override
	public String getTitle() {
		return title;
	}

	@Nonnull
	@Override
	public IDrawable getBackground() {
		return background;
	}

	@Override
	public void drawExtras(
		@Nonnull
			Minecraft minecraft) {
		electricity.draw(minecraft, 10, 20);
	}

	@Override
	public void setRecipe(
		@Nonnull
			IRecipeLayout recipeLayout,
		@Nonnull
			AssemblingMachineRecipeWrapper recipeWrapper,
		@Nonnull
			IIngredients ingredients) {
		IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
		guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0);
		guiItemStacks.init(INPUT_SLOTS[1], true, 18, 0);
		guiItemStacks.init(OUTPUT_SLOTS[0], false, 69, 18);

		RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
	}
}


text:
<?php
namespace Swoole\WebSocket;

/**
 * @since 2.1.1
 */
class Server extends \Swoole\Http\Server
{

    /**
     * @param $event_name[required]
     * @param $callback[required]
     * @return mixed
     */
    public function on($event_name, $callback){}

    /**
     * @param $fd[required]
     * @param $data[required]
     * @param $opcode[optional]
     * @param $finish[optional]
     * @return mixed
     */
    public function push($fd, $data, $opcode=null, $finish=null){}

    /**
     * @param $fd[required]
     * @return mixed
     */
    public function exist($fd){}

    /**
     * @param $fd[required]
     * @return mixed
     */
    public function isEstablished($fd){}

    /**
     * @param $data[required]
     * @param $opcode[optional]
     * @param $finish[optional]
     * @param $mask[optional]
     * @return mixed
     */
    public static function pack($data, $opcode=null, $finish=null, $mask=null){}

    /**
     * @param $data[required]
     * @return mixed
     */
    public static function unpack($data){}

    /**
     * @return mixed
     */
    public function start(){}

    /**
     * @return mixed
     */
    public function __sleep(){}

    /**
     * @return mixed
     */
    public function __wakeup(){}

    /**
     * @param $host[required]
     * @param $port[optional]
     * @param $mode[optional]
     * @param $sock_type[optional]
     * @return mixed
     */
    public function __construct($host, $port=null, $mode=null, $sock_type=null){}

    /**
     * @return mixed
     */
    public function __destruct(){}

    /**
     * @param $host[required]
     * @param $port[required]
     * @param $sock_type[required]
     * @return mixed
     */
    public function listen($host, $port, $sock_type){}

    /**
     * @param $host[required]
     * @param $port[required]
     * @param $sock_type[required]
     * @return mixed
     */
    public function addlistener($host, $port, $sock_type){}

    /**
     * @param $settings[required]
     * @return mixed
     */
    public function set($settings){}

    /**
     * @param $fd[required]
     * @param $send_data[required]
     * @param $reactor_id[optional]
     * @return mixed
     */
    public function send($fd, $send_data, $reactor_id=null){}

    /**
     * @param $ip[required]
     * @param $port[required]
     * @param $send_data[required]
     * @param $server_socket[optional]
     * @return mixed
     */
    public function sendto($ip, $port, $send_data, $server_socket=null){}

    /**
     * @param $conn_fd[required]
     * @param $send_data[required]
     * @return mixed
     */
    public function sendwait($conn_fd, $send_data){}

    /**
     * @param $fd[required]
     * @param $is_protected[optional]
     * @return mixed
     */
    public function protect($fd, $is_protected=null){}

    /**
     * @param $conn_fd[required]
     * @param $filename[required]
     * @param $offset[optional]
     * @param $length[optional]
     * @return mixed
     */
    public function sendfile($conn_fd, $filename, $offset=null, $length=null){}

    /**
     * @param $fd[required]
     * @param $reset[optional]
     * @return mixed
     */
    public function close($fd, $reset=null){}

    /**
     * @param $fd[required]
     * @return mixed
     */
    public function confirm($fd){}

    /**
     * @param $fd[required]
     * @return mixed
     */
    public function pause($fd){}

    /**
     * @param $fd[required]
     * @return mixed
     */
    public function resume($fd){}

    /**
     * @param $data[required]
     * @param $worker_id[optional]
     * @param $finish_callback[optional]
     * @return mixed
     */
    public function task($data, $worker_id=null, $finish_callback=null){}

    /**
     * @param $data[required]
     * @param $timeout[optional]
     * @param $worker_id[optional]
     * @return mixed
     */
    public function taskwait($data, $timeout=null, $worker_id=null){}

    /**
     * @param $tasks[required]
     * @param $timeout[optional]
     * @return mixed
     */
    public function taskWaitMulti($tasks, $timeout=null){}

    /**
     * @param $tasks[required]
     * @param $timeout[optional]
     * @return mixed
     */
    public function taskCo($tasks, $timeout=null){}

    /**
     * @param $data[required]
     * @return mixed
     */
    public function finish($data){}

    /**
     * @return mixed
     */
    public function reload(){}

    /**
     * @return mixed
     */
    public function shutdown(){}

    /**
     * @param $worker_id[optional]
     * @return mixed
     */
    public function stop($worker_id=null){}

    /**
     * @return mixed
     */
    public function getLastError(){}

    /**
     * @param $reactor_id[required]
     * @return mixed
     */
    public function heartbeat($reactor_id){}

    /**
     * @param $fd[required]
     * @param $reactor_id[optional]
     * @return mixed
     */
    public function connection_info($fd, $reactor_id=null){}

    /**
     * @param $start_fd[required]
     * @param $find_count[optional]
     * @return mixed
     */
    public function connection_list($start_fd, $find_count=null){}

    /**
     * @param $fd[required]
     * @param $reactor_id[optional]
     * @return mixed
     */
    public function getClientInfo($fd, $reactor_id=null){}

    /**
     * @param $start_fd[required]
     * @param $find_count[optional]
     * @return mixed
     */
    public function getClientList($start_fd, $find_count=null){}

    /**
     * @param $ms[required]
     * @param $callback[required]
     * @param $param[optional]
     * @return mixed
     */
    public function after($ms, $callback, $param=null){}

    /**
     * @param $ms[required]
     * @param $callback[required]
     * @return mixed
     */
    public function tick($ms, $callback){}

    /**
     * @param $timer_id[required]
     * @return mixed
     */
    public function clearTimer($timer_id){}

    /**
     * @param $callback[required]
     * @return mixed
     */
    public function defer($callback){}

    /**
     * @param $dst_worker_id[required]
     * @param $data[required]
     * @return mixed
     */
    public function sendMessage($dst_worker_id, $data){}

    /**
     * @param $process[required]
     * @return mixed
     */
    public function addProcess($process){}

    /**
     * @return mixed
     */
    public function stats(){}

    /**
     * @param $port[optional]
     * @return mixed
     */
    public function getSocket($port=null){}

    /**
     * @param $fd[required]
     * @param $uid[required]
     * @return mixed
     */
    public function bind($fd, $uid){}

}

redpajama_set_name: RedPajamaGithub


text:
from datetime import datetime
from tkinter import ttk, N, E, W
from Infrastructure import MobberManager
from Infrastructure.ImageUtility import ImageUtility
from Infrastructure.PathUtility import PathUtility
from Infrastructure.ScreenUtility import ScreenUtility

class MinimalScreenBlockerFrame(ttk.Frame):
    def __init__(self, master, controller, time_options_manager, mobber_manager, countdown_manager, settings_manager,
                 tips_manager, theme_manager,
                 **kwargs):
        super().__init__(master, **kwargs)
        self.showing_extend_time_button = False
        self.master = master
        self.controller = controller
        self.countdown_manager = countdown_manager
        self.time_options_manager = time_options_manager
        self.mobber_manager = mobber_manager  # type: MobberManager
        self.settings_manager = settings_manager

        self.theme_manager = theme_manager
        self.tips_manager = tips_manager
        self.build_window_content()
        self.mobber_manager.subscribe_to_mobber_list_change(self.mobber_list_change_callback)
        if self.settings_manager.get_continue_screen_blocker_show_current_time():
            self.countdown_manager.subscribe_to_time_changes(self.update_current_time)

    def update_current_time(self, days, minutes, seconds):
        self.current_time_label["text"] = datetime.now().strftime('%Y-%m-%d     %I:%M %p')

    def build_window_content(self):

        scale = self.master.monitor.height / ScreenUtility.get_expected_height()
        unique_theme = self.theme_manager.get_unique_theme_for_scale(scale)

        center_frame = ttk.Frame(self)
        center_frame.grid()

        row_index = 0

        image_utility = ImageUtility(self.theme_manager)
        icon_size = int(75*scale)
        invisible_path = PathUtility.normalize_path('images\\invisible.png')
        self.invisible_icon = image_utility.load(invisible_path, icon_size, icon_size)
        self.fade_label = ttk.Label(center_frame, image=self.invisible_icon)
        self.fade_label.grid(row=0, column=0, sticky=(N, W))
        self.fade_label.bind("<Enter>", lambda event: self.controller.fade_app())
        self.fade_label.bind("<Leave>", lambda event: self.controller.unfade_app())

        if self.settings_manager.get_general_use_logo_image():
            self.image_utility = ImageUtility(self.theme_manager)
            image_width =int(800*scale)
            image_height = int(200*scale)
            self.background_image = self.image_utility.load(self.settings_manager.get_general_logo_image_name(), image_width,
                                                            image_height, self.settings_manager.get_general_auto_theme_logo())
            title = ttk.Label(center_frame, image=self.background_image)
        else:
            title = ttk.Label(center_frame, text="Mobbing Timer", style=unique_theme.title_style_id)
        title_padx = int(150*scale)
        pad_y = int(10*scale)
        title.grid(row=row_index, column=0, columnspan=6, padx=title_padx, pady=pad_y)
        row_index += 1

        self.keyboard_icon = image_utility.load(PathUtility.normalize_path('images\\keyboard.png'), icon_size, icon_size)
        self.keyboard_label = ttk.Label(center_frame, image=self.keyboard_icon)
        self.keyboard_label.grid(row=row_index, column=1, sticky=(N, E))

        self.current_mobber_label = ttk.Label(center_frame, text="", style=unique_theme.current_mobber_label_style_id)
        self.current_mobber_label.grid(row=row_index, column=2, columnspan=1, sticky=(N, W))
        self.current_mobber_label.bind("<Button-1>", lambda event: self.mobber_manager.switch_next_driver())

        self.minions_icon = image_utility.load(PathUtility.normalize_path('images\\minions.png'), icon_size, icon_size)
        self.minions_label = ttk.Label(center_frame, image=self.minions_icon)
        self.minions_label.grid(row=row_index, column=3, sticky=(N, E))

        self.next_mobber_label = ttk.Label(center_frame, text="", style=unique_theme.next_mobber_label_style_id)
        self.next_mobber_label.grid(row=row_index, column=4, columnspan=1, sticky=(N, W))
        row_index += 1

        start_button = ttk.Button(center_frame, text="Continue Mobbing!", style=unique_theme.start_button_style_id)
        start_button.grid(row=row_index, column=1, columnspan=4, sticky=N + E + W, padx=pad_y, pady=pad_y)
        start_button.bind("<Button-1>", lambda event: self.controller.show_transparent_countdown_frame())
        row_index += 1

        if self.settings_manager.get_general_enable_tips():
            self.tip_text = ttk.Label(center_frame, text="", style=unique_theme.label_style_id, wraplength=500)
            self.tip_text.grid(row=row_index, column=1, columnspan=4, padx=int(30*scale), pady=pad_y, sticky=(N))
            row_index += 1

        if self.settings_manager.get_continue_screen_blocker_show_current_time():
            self.current_time_label = ttk.Label(center_frame, text="current time", style=unique_theme.label_style_id)
            self.current_time_label.grid(row=row_index, column=1, columnspan=4, padx=int(30*scale), pady=pad_y, sticky=(N))
            row_index += 1

        if self.settings_manager.get_timer_extension_enabled() and not self.settings_manager.get_randomize_randomize_next_driver():
            minutes = self.settings_manager.get_timer_extension_minutes()
            seconds = self.settings_manager.get_timer_extension_seconds()
            self.extend_time_button = ttk.Button(center_frame, text=self.get_extend_time_button_text(), style=unique_theme.button_style_id)
            self.extend_time_button.grid(row=row_index, column=1, columnspan=4, sticky=N + E + W, padx=int(90*scale), pady=pad_y)
            self.showing_extend_time_button = True
            self.extend_time_button.bind("<Button-1>",
                                         lambda event: self.controller.rewind_and_extend(minutes, seconds))
            row_index += 1

        setup_button = ttk.Button(center_frame, text="Mob Setup & Time",style=unique_theme.button_style_id)
        setup_button.grid(row=row_index, column=1, columnspan=4, sticky=N + E + W, padx=int(90*scale), pady=pad_y)
        setup_button.bind("<Button-1>", lambda event: self.controller.show_screen_blocker_frame())
        row_index += 1

        quit_button = ttk.Button(center_frame, text="Quit Mobbing",style=unique_theme.button_style_id)
        quit_button.grid(row=row_index, column=1, columnspan=4, sticky=N + E + W, padx=int(90*scale), pady=pad_y)
        quit_button.bind("<Button-1>", lambda event: self.controller.quit_and_destroy_session())
        row_index += 1

    def get_extend_time_button_text(self):
        minutes = self.settings_manager.get_timer_extension_minutes()
        seconds = self.settings_manager.get_timer_extension_seconds()
        return "Extend Time By {:0>2}:{:0>2} ({})".format(minutes, seconds,
                                                       self.controller.timer_extension_count - self.controller.extensions_used)

    def mobber_list_change_callback(self, mobber_list, driver_index, navigator_index):
        self.current_mobber_label['text'] = ""
        self.next_mobber_label['text'] = ""
        for index in range(0, mobber_list.__len__()):
            name = mobber_list[index]
            if index == driver_index:
                self.current_mobber_label['text'] = "{} ".format(name)
            if index == navigator_index:
                self.next_mobber_label['text'] = "{}".format(name)
        if self.settings_manager.get_general_enable_tips():
            self.tip_text['text'] = self.tips_manager.get_random_tip()

    def show_extend_time_button(self):
        if self.settings_manager.get_timer_extension_enabled() and not self.settings_manager.get_randomize_randomize_next_driver():
            if self.controller.extensions_used < self.controller.timer_extension_count:
                self.extend_time_button["text"] = self.get_extend_time_button_text()
                self.extend_time_button.grid()
            else:
                self.extend_time_button.grid_remove()


text:
import scrapy

class FlhhkkItem(scrapy.Item):
    # define the fields for your item here like:
    # name = scrapy.Field()
    _id = scrapy.Field()
    title = scrapy.Field()
    content = scrapy.Field()
    url = scrapy.Field()
    download_content = scrapy.Field()


text:
category: tutorial
title: maybe
layout: post
---

The `maybe` type, also known as `option` type is a container for a value that may not be there.

The purpose of this monad is to eliminate the need for writing `null` checks.
Furthermore it also eliminates the possibility of making errors by missing null-checks.

<!--more-->

To use the `maybe` monad constructor, you can require it using node:

		var maybe = require("../library/maybe")

Where the `../` is the location of the module.

Then you will be able to wrap a value in `maybe` with:

		var maybe_val = maybe(val)

If the 'val' is equal to *undefined* it threats the container as empty.

`map(funk)`
----
Executes `funk` with the `maybe`'s value as an argument, but only if the value is different from *undefined*, and wraps the result in a new maybe.

***

Traditionally, if we have a value that may be undefined we do a null check before doing something with it:

	var val = get_property(obj)

	if(val !== undefined){
		val = val.toString()
	}
	assert.equal(val, undefined)

With `map` this can be written like this

 	var maybe_get_property = get_property.map(maybe)

	maybe_get_property(obj).map((val) => {

		val.toString()//this is not executed
	})

The biggest benefit we get is that in the first case we can easily forget the null check:

	assert.throws(function(){
		get_property(obj).toString()  //this blows up
	})

While in the second case we cannot access the underlying value directly, and therefore cannot execute an action on it, if it is not there.

`phatMap(funk)`
----

Same as `map`, but if `funk` returns a `maybe` it flattens the two `maybes` into one.

***

`map` works fine for eliminating errors, but it does not solve one of the most annoying problems with null-checks - nesting:

	var obj = { first: {second:"val" } }

	maybe(obj)
		.map( root => maybe(root.first))
		.map( maybeFirst => maybeFirst.map (first => maybe (maybeFirst.second ) ) )
		.map( maybeMaybeValue => maybeMaybeValue.map (maybeValue => maybeValue.map( (value)=>( assert.equal( val, "val") ) ) ) )

`phatMap` does the flattening for us, and allows us to write code like this

	maybe(obj)
		.flatMap(root => maybe(root.first))
		.flatMap(first => maybe(first.second))
		.flatMap(val => {
			assert.equal(val, "val")
		})

Advanced Usage
----

 `maybe` can be used with the function monad to effectively produce 'safe' versions of functions

	var get = f((prop, obj) => obj[prop])
	var maybeGet = get.map(maybe)

This combined with the use of currying makes for a very fluent style of coding:

	var getFirstSecond = (root) => maybe(root).phatMap(maybeGet('first')).phatMap(maybeGet('second'))

	getFirstSecond({ first: {second:"value" } }).map((val) => assert.equal(val,"value"))
	getFirstSecond({ first: {second:"other_value" } }).map((val) => assert.equal(val,"other_value"))
	getFirstSecond({ first: "" }).map((val) => assert.equal(val,"whatever") )//won't be executed

under the hood
--------------
Let's see how the type is implemented

The `of` method, takes a value and wraps it in a `maybe`.
In this case we do this by just calling the constructor.

	//a -> m a
	of:function(input){
		return maybe(input)
	},

`map` takes the function and applies it to the value in the maybe, if there is one.

	//m a -> ( a -> b ) -> m b
	map:function(funk){
		if(this !== nothing){
			return maybe(funk(this._value))
		}else{
			return this
		}
	},

`flat` takes a maybe that contains another maybe and flattens it.
In this case this means just returning the inner value.

	//m (m x) -> m x
	flat:function(){
		if(this !== nothing){
			return this._value
		}else{
			return this
		}
	},

finally we have `tryFlat` which does the same thing, but checks the types first. The shortcut to `map().tryFlat()` is called `phatMap`

	tryFlat:function(){
		if(this !== nothing && this._value.funktionType === "maybe"){
			return this._value
		}else{
			return this
		}
	},

Finally, the type has some helper functions:

	filter:function filter (funk){
		return funk(this._value) ? this : nothing
	},

	reduce:function reduce (funk){
		return funk(this._value)
	},

        getProp:function getProp (prop){
		return this.phatMap( (val) => this.of(val[prop]) )
	},

methods.extras = [methods.getProp]

Add aliases to map . flat as flatMap and map . tryFlat as phatMap
        methods.flatMap = helpers.flatMap
        methods.phatMap = helpers.phatMap

Add a print function, used for debugging.
        methods.print = helpers.print

In case you are interested, here is how the maybe constructor is implemented

	var maybe = function(value){
		if (value === undefined){
			return nothing
		}else{
			var obj = Object.create(methods)
			obj._value = value
			obj.constructor = maybe
			Object.freeze(obj)
			return obj
		}
	}

maybe.prototype = methods


text:
class SendGridMailer < ActionMailer::Base

  #
  #
  #
  #
  #
  def email
    mail(:to => to, :from => 'info@railsaccounting.herokuapp.com', :subject => subject) do |format|
      format.text { render :text => body }
      format.html { render :text => body }
    end
  end

end


text:
            {{name}}

                <input type="text" ng-model="model" class="form-control"
                       placeholder="{{name}}"/>


text:
using System;
using System.Collections.Generic;
using System.Text;

namespace Tester
{
    class Prueba_DAO
    {
        private int? propId;
        private string propNombre;
        private string propDireccion;

        public int? Id
        {
            get { return propId; }
            set { propId = value; }
        }

        public string Nombre
        {
            get { return propNombre; }
            set { propNombre = value; }
        }

        public string Direccion
        {
            get { return propDireccion; }
            set { propDireccion = value; }
        }
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>JHotDraw 7: PERT Sample Applet</title>

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

JHotDraw 7: PERT Sample Applet

  <applet code="org.jhotdraw.samples.pert.PertApplet"
	  name="pertApplet" width="620" height="520"
      codebase=".." archive="Samples/PERT/signed/jhotdraw_pert.jar" id="pertApplet"
      mayscript="mayscript">
    <param name="datafile" value="images/pert.xml" />

    <param name="codebase_lookup" value="false" />
    <param name="classloader_cache" value="false" />
    <param name="java_arguments" value="-Djnlp.packEnabled=true -Dswing.aatext=true" />

    <param name="boxborder" value="false" />
    <param name="centerimage" value="true" />
  </applet>

JHotDraw © 1996-2011 by the original authors and all contributors.


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto

package com.google.cloud.bigquery.datatransfer.v1;

public final class DataTransferProto {
  private DataTransferProto() {}

  public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}

  public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
  }

  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_DataSourceParameter_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_DataSourceParameter_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_DataSource_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_DataSource_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_GetDataSourceRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_GetDataSourceRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_ListDataSourcesRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_ListDataSourcesRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_ListDataSourcesResponse_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_ListDataSourcesResponse_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_CreateTransferConfigRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_CreateTransferConfigRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_UpdateTransferConfigRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_UpdateTransferConfigRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_GetTransferConfigRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_GetTransferConfigRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_DeleteTransferConfigRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_DeleteTransferConfigRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_GetTransferRunRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_GetTransferRunRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_DeleteTransferRunRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_DeleteTransferRunRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferConfigsRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferConfigsRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferConfigsResponse_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferConfigsResponse_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferRunsRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferRunsRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferRunsResponse_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferRunsResponse_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferLogsRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferLogsRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferLogsResponse_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferLogsResponse_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_CheckValidCredsRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_CheckValidCredsRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_CheckValidCredsResponse_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_CheckValidCredsResponse_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_ScheduleTransferRunsRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_ScheduleTransferRunsRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_datatransfer_v1_ScheduleTransferRunsResponse_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_datatransfer_v1_ScheduleTransferRunsResponse_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
    return descriptor;
  }

  private static com.google.protobuf.Descriptors.FileDescriptor descriptor;

  static {
    java.lang.String[] descriptorData = {
      "\n8google/cloud/bigquery/datatransfer/v1/"
          + "datatransfer.proto\022%google.cloud.bigquer"
          + "y.datatransfer.v1\032\034google/api/annotation"
          + "s.proto\0324google/cloud/bigquery/datatrans"
          + "fer/v1/transfer.proto\032\036google/protobuf/d"
          + "uration.proto\032\033google/protobuf/empty.pro"
          + "to\032 google/protobuf/field_mask.proto\032\037go"
          + "ogle/protobuf/timestamp.proto\032\036google/pr"
          + "otobuf/wrappers.proto\"\361\004\n\023DataSourcePara"
          + "meter\022\020\n\010param_id\030\001 \001(\t\022\024\n\014display_name\030"
          + "\002 \001(\t\022\023\n\013description\030\003 \001(\t\022M\n\004type\030\004 \001(\016"
          + "2?.google.cloud.bigquery.datatransfer.v1"
          + ".DataSourceParameter.Type\022\020\n\010required\030\005 "
          + "\001(\010\022\020\n\010repeated\030\006 \001(\010\022\030\n\020validation_rege"
          + "x\030\007 \001(\t\022\026\n\016allowed_values\030\010 \003(\t\022/\n\tmin_v"
          + "alue\030\t \001(\0132\034.google.protobuf.DoubleValue"
          + "\022/\n\tmax_value\030\n \001(\0132\034.google.protobuf.Do"
          + "ubleValue\022J\n\006fields\030\013 \003(\0132:.google.cloud"
          + ".bigquery.datatransfer.v1.DataSourcePara"
          + "meter\022\036\n\026validation_description\030\014 \001(\t\022\033\n"
          + "\023validation_help_url\030\r \001(\t\022\021\n\timmutable\030"
          + "\016 \001(\010\022\017\n\007recurse\030\017 \001(\010\"i\n\004Type\022\024\n\020TYPE_U"
          + "NSPECIFIED\020\000\022\n\n\006STRING\020\001\022\013\n\007INTEGER\020\002\022\n\n"
          + "\006DOUBLE\020\003\022\013\n\007BOOLEAN\020\004\022\n\n\006RECORD\020\005\022\r\n\tPL"
          + "US_PAGE\020\006\"\317\007\n\nDataSource\022\014\n\004name\030\001 \001(\t\022\026"
          + "\n\016data_source_id\030\002 \001(\t\022\024\n\014display_name\030\003"
          + " \001(\t\022\023\n\013description\030\004 \001(\t\022\021\n\tclient_id\030\005"
          + " \001(\t\022\016\n\006scopes\030\006 \003(\t\022J\n\rtransfer_type\030\007 "
          + "\001(\01623.google.cloud.bigquery.datatransfer"
          + ".v1.TransferType\022#\n\033supports_multiple_tr"
          + "ansfers\030\010 \001(\010\022\037\n\027update_deadline_seconds"
          + "\030\t \001(\005\022\030\n\020default_schedule\030\n \001(\t\022 \n\030supp"
          + "orts_custom_schedule\030\013 \001(\010\022N\n\nparameters"
          + "\030\014 \003(\0132:.google.cloud.bigquery.datatrans"
          + "fer.v1.DataSourceParameter\022\020\n\010help_url\030\r"
          + " \001(\t\022_\n\022authorization_type\030\016 \001(\0162C.googl"
          + "e.cloud.bigquery.datatransfer.v1.DataSou"
          + "rce.AuthorizationType\022\\\n\021data_refresh_ty"
          + "pe\030\017 \001(\0162A.google.cloud.bigquery.datatra"
          + "nsfer.v1.DataSource.DataRefreshType\022(\n d"
          + "efault_data_refresh_window_days\030\020 \001(\005\022\034\n"
          + "\024manual_runs_disabled\030\021 \001(\010\022<\n\031minimum_s"
          + "chedule_interval\030\022 \001(\0132\031.google.protobuf"
          + ".Duration\"s\n\021AuthorizationType\022\"\n\036AUTHOR"
          + "IZATION_TYPE_UNSPECIFIED\020\000\022\026\n\022AUTHORIZAT"
          + "ION_CODE\020\001\022\"\n\036GOOGLE_PLUS_AUTHORIZATION_"
          + "CODE\020\002\"c\n\017DataRefreshType\022!\n\035DATA_REFRES"
          + "H_TYPE_UNSPECIFIED\020\000\022\022\n\016SLIDING_WINDOW\020\001"
          + "\022\031\n\025CUSTOM_SLIDING_WINDOW\020\002\"$\n\024GetDataSo"
          + "urceRequest\022\014\n\004name\030\001 \001(\t\"O\n\026ListDataSou"
          + "rcesRequest\022\016\n\006parent\030\001 \001(\t\022\022\n\npage_toke"
          + "n\030\003 \001(\t\022\021\n\tpage_size\030\004 \001(\005\"{\n\027ListDataSo"
          + "urcesResponse\022G\n\014data_sources\030\001 \003(\01321.go"
          + "ogle.cloud.bigquery.datatransfer.v1.Data"
          + "Source\022\027\n\017next_page_token\030\002 \001(\t\"\231\001\n\033Crea"
          + "teTransferConfigRequest\022\016\n\006parent\030\001 \001(\t\022"
          + "N\n\017transfer_config\030\002 \001(\01325.google.cloud."
          + "bigquery.datatransfer.v1.TransferConfig\022"
          + "\032\n\022authorization_code\030\003 \001(\t\"\272\001\n\033UpdateTr"
          + "ansferConfigRequest\022N\n\017transfer_config\030\001"
          + " \001(\01325.google.cloud.bigquery.datatransfe"
          + "r.v1.TransferConfig\022\032\n\022authorization_cod"
          + "e\030\003 \001(\t\022/\n\013update_mask\030\004 \001(\0132\032.google.pr"
          + "otobuf.FieldMask\"(\n\030GetTransferConfigReq"
          + "uest\022\014\n\004name\030\001 \001(\t\"+\n\033DeleteTransferConf"
          + "igRequest\022\014\n\004name\030\001 \001(\t\"%\n\025GetTransferRu"
          + "nRequest\022\014\n\004name\030\001 \001(\t\"(\n\030DeleteTransfer"
          + "RunRequest\022\014\n\004name\030\001 \001(\t\"l\n\032ListTransfer"
          + "ConfigsRequest\022\016\n\006parent\030\001 \001(\t\022\027\n\017data_s"
          + "ource_ids\030\002 \003(\t\022\022\n\npage_token\030\003 \001(\t\022\021\n\tp"
          + "age_size\030\004 \001(\005\"\207\001\n\033ListTransferConfigsRe"
          + "sponse\022O\n\020transfer_configs\030\001 \003(\01325.googl"
          + "e.cloud.bigquery.datatransfer.v1.Transfe"
          + "rConfig\022\027\n\017next_page_token\030\002 \001(\t\"\255\002\n\027Lis"
          + "tTransferRunsRequest\022\016\n\006parent\030\001 \001(\t\022D\n\006"
          + "states\030\002 \003(\01624.google.cloud.bigquery.dat"
          + "atransfer.v1.TransferState\022\022\n\npage_token"
          + "\030\003 \001(\t\022\021\n\tpage_size\030\004 \001(\005\022^\n\013run_attempt"
          + "\030\005 \001(\0162I.google.cloud.bigquery.datatrans"
          + "fer.v1.ListTransferRunsRequest.RunAttemp"
          + "t\"5\n\nRunAttempt\022\033\n\027RUN_ATTEMPT_UNSPECIFI"
          + "ED\020\000\022\n\n\006LATEST\020\001\"~\n\030ListTransferRunsResp"
          + "onse\022I\n\rtransfer_runs\030\001 \003(\01322.google.clo"
          + "ud.bigquery.datatransfer.v1.TransferRun\022"
          + "\027\n\017next_page_token\030\002 \001(\t\"\257\001\n\027ListTransfe"
          + "rLogsRequest\022\016\n\006parent\030\001 \001(\t\022\022\n\npage_tok"
          + "en\030\004 \001(\t\022\021\n\tpage_size\030\005 \001(\005\022]\n\rmessage_t"
          + "ypes\030\006 \003(\0162F.google.cloud.bigquery.datat"
          + "ransfer.v1.TransferMessage.MessageSeveri"
          + "ty\"\206\001\n\030ListTransferLogsResponse\022Q\n\021trans"
          + "fer_messages\030\001 \003(\01326.google.cloud.bigque"
          + "ry.datatransfer.v1.TransferMessage\022\027\n\017ne"
          + "xt_page_token\030\002 \001(\t\"&\n\026CheckValidCredsRe"
          + "quest\022\014\n\004name\030\001 \001(\t\"2\n\027CheckValidCredsRe"
          + "sponse\022\027\n\017has_valid_creds\030\001 \001(\010\"\213\001\n\033Sche"
          + "duleTransferRunsRequest\022\016\n\006parent\030\001 \001(\t\022"
          + ".\n\nstart_time\030\002 \001(\0132\032.google.protobuf.Ti"
          + "mestamp\022,\n\010end_time\030\003 \001(\0132\032.google.proto"
          + "buf.Timestamp\"`\n\034ScheduleTransferRunsRes"
          + "ponse\022@\n\004runs\030\001 \003(\01322.google.cloud.bigqu"
          + "ery.datatransfer.v1.TransferRun2\206\033\n\023Data"
          + "TransferService\022\337\001\n\rGetDataSource\022;.goog"
          + "le.cloud.bigquery.datatransfer.v1.GetDat"
          + "aSourceRequest\0321.google.cloud.bigquery.d"
          + "atatransfer.v1.DataSource\"^\202\323\344\223\002X\022//v1/{"
          + "name=projects/*/locations/*/dataSources/"
          + "*}Z%\022#/v1/{name=projects/*/dataSources/*"
          + "}\022\360\001\n\017ListDataSources\022=.google.cloud.big"
          + "query.datatransfer.v1.ListDataSourcesReq"
          + "uest\032>.google.cloud.bigquery.datatransfe"
          + "r.v1.ListDataSourcesResponse\"^\202\323\344\223\002X\022//v"
          + "1/{parent=projects/*/locations/*}/dataSo"
          + "urcesZ%\022#/v1/{parent=projects/*}/dataSou"
          + "rces\022\235\002\n\024CreateTransferConfig\022B.google.c"
          + "loud.bigquery.datatransfer.v1.CreateTran"
          + "sferConfigRequest\0325.google.cloud.bigquer"
          + "y.datatransfer.v1.TransferConfig\"\211\001\202\323\344\223\002"
          + "\202\001\"3/v1/{parent=projects/*/locations/*}/"
          + "transferConfigs:\017transfer_configZ:\"\'/v1/"
          + "{parent=projects/*}/transferConfigs:\017tra"
          + "nsfer_config\022\275\002\n\024UpdateTransferConfig\022B."
          + "google.cloud.bigquery.datatransfer.v1.Up"
          + "dateTransferConfigRequest\0325.google.cloud"
          + ".bigquery.datatransfer.v1.TransferConfig"
          + "\"\251\001\202\323\344\223\002\242\0012C/v1/{transfer_config.name=pr"
          + "ojects/*/locations/*/transferConfigs/*}:"
          + "\017transfer_configZJ27/v1/{transfer_config"
          + ".name=projects/*/transferConfigs/*}:\017tra"
          + "nsfer_config\022\332\001\n\024DeleteTransferConfig\022B."
          + "google.cloud.bigquery.datatransfer.v1.De"
          + "leteTransferConfigRequest\032\026.google.proto"
          + "buf.Empty\"f\202\323\344\223\002`*3/v1/{name=projects/*/"
          + "locations/*/transferConfigs/*}Z)*\'/v1/{n"
          + "ame=projects/*/transferConfigs/*}\022\363\001\n\021Ge"
          + "tTransferConfig\022?.google.cloud.bigquery."
          + "datatransfer.v1.GetTransferConfigRequest"
          + "\0325.google.cloud.bigquery.datatransfer.v1"
          + ".TransferConfig\"f\202\323\344\223\002`\0223/v1/{name=proje"
          + "cts/*/locations/*/transferConfigs/*}Z)\022\'"
          + "/v1/{name=projects/*/transferConfigs/*}\022"
          + "\204\002\n\023ListTransferConfigs\022A.google.cloud.b"
          + "igquery.datatransfer.v1.ListTransferConf"
          + "igsRequest\032B.google.cloud.bigquery.datat"
          + "ransfer.v1.ListTransferConfigsResponse\"f"
          + "\202\323\344\223\002`\0223/v1/{parent=projects/*/locations"
          + "/*}/transferConfigsZ)\022\'/v1/{parent=proje"
          + "cts/*}/transferConfigs\022\255\002\n\024ScheduleTrans"
          + "ferRuns\022B.google.cloud.bigquery.datatran"
          + "sfer.v1.ScheduleTransferRunsRequest\032C.go"
          + "ogle.cloud.bigquery.datatransfer.v1.Sche"
          + "duleTransferRunsResponse\"\213\001\202\323\344\223\002\204\001\"B/v1/"
          + "{parent=projects/*/locations/*/transferC"
          + "onfigs/*}:scheduleRuns:\001*Z;\"6/v1/{parent"
          + "=projects/*/transferConfigs/*}:scheduleR"
          + "uns:\001*\022\370\001\n\016GetTransferRun\022<.google.cloud"
          + ".bigquery.datatransfer.v1.GetTransferRun"
          + "Request\0322.google.cloud.bigquery.datatran"
          + "sfer.v1.TransferRun\"t\202\323\344\223\002n\022:/v1/{name=p"
          + "rojects/*/locations/*/transferConfigs/*/"
          + "runs/*}Z0\022./v1/{name=projects/*/transfer"
          + "Configs/*/runs/*}\022\342\001\n\021DeleteTransferRun\022"
          + "?.google.cloud.bigquery.datatransfer.v1."
          + "DeleteTransferRunRequest\032\026.google.protob"
          + "uf.Empty\"t\202\323\344\223\002n*:/v1/{name=projects/*/l"
          + "ocations/*/transferConfigs/*/runs/*}Z0*."
          + "/v1/{name=projects/*/transferConfigs/*/r"
          + "uns/*}\022\211\002\n\020ListTransferRuns\022>.google.clo"
          + "ud.bigquery.datatransfer.v1.ListTransfer"
          + "RunsRequest\032?.google.cloud.bigquery.data"
          + "transfer.v1.ListTransferRunsResponse\"t\202\323"
          + "\344\223\002n\022:/v1/{parent=projects/*/locations/*"
          + "/transferConfigs/*}/runsZ0\022./v1/{parent="
          + "projects/*/transferConfigs/*}/runs\022\251\002\n\020L"
          + "istTransferLogs\022>.google.cloud.bigquery."
          + "datatransfer.v1.ListTransferLogsRequest\032"
          + "?.google.cloud.bigquery.datatransfer.v1."
          + "ListTransferLogsResponse\"\223\001\202\323\344\223\002\214\001\022I/v1/"
          + "{parent=projects/*/locations/*/transferC"
          + "onfigs/*/runs/*}/transferLogsZ?\022=/v1/{pa"
          + "rent=projects/*/transferConfigs/*/runs/*"
          + "}/transferLogs\022\227\002\n\017CheckValidCreds\022=.goo"
          + "gle.cloud.bigquery.datatransfer.v1.Check"
          + "ValidCredsRequest\032>.google.cloud.bigquer"
          + "y.datatransfer.v1.CheckValidCredsRespons"
          + "e\"\204\001\202\323\344\223\002~\"?/v1/{name=projects/*/locatio"
          + "ns/*/dataSources/*}:checkValidCreds:\001*Z8"
          + "\"3/v1/{name=projects/*/dataSources/*}:ch"
          + "eckValidCreds:\001*B\343\001\n)com.google.cloud.bi"
          + "gquery.datatransfer.v1B\021DataTransferProt"
          + "oP\001ZQgoogle.golang.org/genproto/googleap"
          + "is/cloud/bigquery/datatransfer/v1;datatr"
          + "ansfer\252\002%Google.Cloud.BigQuery.DataTrans"
          + "fer.V1\312\002%Google\\Cloud\\BigQuery\\DataTrans"
          + "fer\\V1b\006proto3"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
        new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
          public com.google.protobuf.ExtensionRegistry assignDescriptors(
              com.google.protobuf.Descriptors.FileDescriptor root) {
            descriptor = root;
            return null;
          }
        };
    com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
        descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
          com.google.api.AnnotationsProto.getDescriptor(),
          com.google.cloud.bigquery.datatransfer.v1.TransferProto.getDescriptor(),
          com.google.protobuf.DurationProto.getDescriptor(),
          com.google.protobuf.EmptyProto.getDescriptor(),
          com.google.protobuf.FieldMaskProto.getDescriptor(),
          com.google.protobuf.TimestampProto.getDescriptor(),
          com.google.protobuf.WrappersProto.getDescriptor(),
        },
        assigner);
    internal_static_google_cloud_bigquery_datatransfer_v1_DataSourceParameter_descriptor =
        getDescriptor().getMessageTypes().get(0);
    internal_static_google_cloud_bigquery_datatransfer_v1_DataSourceParameter_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_DataSourceParameter_descriptor,
            new java.lang.String[] {
              "ParamId",
              "DisplayName",
              "Description",
              "Type",
              "Required",
              "Repeated",
              "ValidationRegex",
              "AllowedValues",
              "MinValue",
              "MaxValue",
              "Fields",
              "ValidationDescription",
              "ValidationHelpUrl",
              "Immutable",
              "Recurse",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_DataSource_descriptor =
        getDescriptor().getMessageTypes().get(1);
    internal_static_google_cloud_bigquery_datatransfer_v1_DataSource_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_DataSource_descriptor,
            new java.lang.String[] {
              "Name",
              "DataSourceId",
              "DisplayName",
              "Description",
              "ClientId",
              "Scopes",
              "TransferType",
              "SupportsMultipleTransfers",
              "UpdateDeadlineSeconds",
              "DefaultSchedule",
              "SupportsCustomSchedule",
              "Parameters",
              "HelpUrl",
              "AuthorizationType",
              "DataRefreshType",
              "DefaultDataRefreshWindowDays",
              "ManualRunsDisabled",
              "MinimumScheduleInterval",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_GetDataSourceRequest_descriptor =
        getDescriptor().getMessageTypes().get(2);
    internal_static_google_cloud_bigquery_datatransfer_v1_GetDataSourceRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_GetDataSourceRequest_descriptor,
            new java.lang.String[] {
              "Name",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_ListDataSourcesRequest_descriptor =
        getDescriptor().getMessageTypes().get(3);
    internal_static_google_cloud_bigquery_datatransfer_v1_ListDataSourcesRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_ListDataSourcesRequest_descriptor,
            new java.lang.String[] {
              "Parent", "PageToken", "PageSize",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_ListDataSourcesResponse_descriptor =
        getDescriptor().getMessageTypes().get(4);
    internal_static_google_cloud_bigquery_datatransfer_v1_ListDataSourcesResponse_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_ListDataSourcesResponse_descriptor,
            new java.lang.String[] {
              "DataSources", "NextPageToken",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_CreateTransferConfigRequest_descriptor =
        getDescriptor().getMessageTypes().get(5);
    internal_static_google_cloud_bigquery_datatransfer_v1_CreateTransferConfigRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_CreateTransferConfigRequest_descriptor,
            new java.lang.String[] {
              "Parent", "TransferConfig", "AuthorizationCode",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_UpdateTransferConfigRequest_descriptor =
        getDescriptor().getMessageTypes().get(6);
    internal_static_google_cloud_bigquery_datatransfer_v1_UpdateTransferConfigRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_UpdateTransferConfigRequest_descriptor,
            new java.lang.String[] {
              "TransferConfig", "AuthorizationCode", "UpdateMask",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_GetTransferConfigRequest_descriptor =
        getDescriptor().getMessageTypes().get(7);
    internal_static_google_cloud_bigquery_datatransfer_v1_GetTransferConfigRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_GetTransferConfigRequest_descriptor,
            new java.lang.String[] {
              "Name",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_DeleteTransferConfigRequest_descriptor =
        getDescriptor().getMessageTypes().get(8);
    internal_static_google_cloud_bigquery_datatransfer_v1_DeleteTransferConfigRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_DeleteTransferConfigRequest_descriptor,
            new java.lang.String[] {
              "Name",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_GetTransferRunRequest_descriptor =
        getDescriptor().getMessageTypes().get(9);
    internal_static_google_cloud_bigquery_datatransfer_v1_GetTransferRunRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_GetTransferRunRequest_descriptor,
            new java.lang.String[] {
              "Name",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_DeleteTransferRunRequest_descriptor =
        getDescriptor().getMessageTypes().get(10);
    internal_static_google_cloud_bigquery_datatransfer_v1_DeleteTransferRunRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_DeleteTransferRunRequest_descriptor,
            new java.lang.String[] {
              "Name",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferConfigsRequest_descriptor =
        getDescriptor().getMessageTypes().get(11);
    internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferConfigsRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferConfigsRequest_descriptor,
            new java.lang.String[] {
              "Parent", "DataSourceIds", "PageToken", "PageSize",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferConfigsResponse_descriptor =
        getDescriptor().getMessageTypes().get(12);
    internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferConfigsResponse_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferConfigsResponse_descriptor,
            new java.lang.String[] {
              "TransferConfigs", "NextPageToken",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferRunsRequest_descriptor =
        getDescriptor().getMessageTypes().get(13);
    internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferRunsRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferRunsRequest_descriptor,
            new java.lang.String[] {
              "Parent", "States", "PageToken", "PageSize", "RunAttempt",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferRunsResponse_descriptor =
        getDescriptor().getMessageTypes().get(14);
    internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferRunsResponse_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferRunsResponse_descriptor,
            new java.lang.String[] {
              "TransferRuns", "NextPageToken",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferLogsRequest_descriptor =
        getDescriptor().getMessageTypes().get(15);
    internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferLogsRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferLogsRequest_descriptor,
            new java.lang.String[] {
              "Parent", "PageToken", "PageSize", "MessageTypes",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferLogsResponse_descriptor =
        getDescriptor().getMessageTypes().get(16);
    internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferLogsResponse_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_ListTransferLogsResponse_descriptor,
            new java.lang.String[] {
              "TransferMessages", "NextPageToken",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_CheckValidCredsRequest_descriptor =
        getDescriptor().getMessageTypes().get(17);
    internal_static_google_cloud_bigquery_datatransfer_v1_CheckValidCredsRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_CheckValidCredsRequest_descriptor,
            new java.lang.String[] {
              "Name",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_CheckValidCredsResponse_descriptor =
        getDescriptor().getMessageTypes().get(18);
    internal_static_google_cloud_bigquery_datatransfer_v1_CheckValidCredsResponse_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_CheckValidCredsResponse_descriptor,
            new java.lang.String[] {
              "HasValidCreds",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_ScheduleTransferRunsRequest_descriptor =
        getDescriptor().getMessageTypes().get(19);
    internal_static_google_cloud_bigquery_datatransfer_v1_ScheduleTransferRunsRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_ScheduleTransferRunsRequest_descriptor,
            new java.lang.String[] {
              "Parent", "StartTime", "EndTime",
            });
    internal_static_google_cloud_bigquery_datatransfer_v1_ScheduleTransferRunsResponse_descriptor =
        getDescriptor().getMessageTypes().get(20);
    internal_static_google_cloud_bigquery_datatransfer_v1_ScheduleTransferRunsResponse_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_datatransfer_v1_ScheduleTransferRunsResponse_descriptor,
            new java.lang.String[] {
              "Runs",
            });
    com.google.protobuf.ExtensionRegistry registry =
        com.google.protobuf.ExtensionRegistry.newInstance();
    registry.add(com.google.api.AnnotationsProto.http);
    com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor(
        descriptor, registry);
    com.google.api.AnnotationsProto.getDescriptor();
    com.google.cloud.bigquery.datatransfer.v1.TransferProto.getDescriptor();
    com.google.protobuf.DurationProto.getDescriptor();
    com.google.protobuf.EmptyProto.getDescriptor();
    com.google.protobuf.FieldMaskProto.getDescriptor();
    com.google.protobuf.TimestampProto.getDescriptor();
    com.google.protobuf.WrappersProto.getDescriptor();
  }

  // @@protoc_insertion_point(outer_class_scope)
}


text:
/* jshint node: true, bitwise: true, curly: true, eqeqeq: true, forin: true, freeze: true, immed: true, indent: 4, latedef: true, newcap: true, noarg: true, noempty: true, nonbsp: true, nonew: true, quotmark: double, undef: true, unused: true, strict: true, trailing: true */

"use strict";

// Default port to listen on
var port = process.env.PORT || 80;
// Set to host static content (HTML/CSS/JS) for the client component
var STATIC_SERVER = false;

// Initialize Express
var path = require("path");
var express = require("express");
var bodyParser = require("body-parser");
var remotestorage = require("./remotestorage");
var app = express();

// Configure Express
app.set("x-powered-by", false);
if (STATIC_SERVER) {
  // Configure a custom router to block non-public content
  var rejectRouter = express.Router();
  rejectRouter.use(function(req, res) {
    res.sendStatus(500);
  });
  app.use("/App_Code", rejectRouter);
  app.use("/App_Data", rejectRouter);
  app.use("/NodeJs", rejectRouter);
  app.use("/Test", rejectRouter);
  // Serve static content
  app.use(express.static(path.join(__dirname, "/.."), { index: "default.htm" }));
}

// Configure remotestorage middleware
app.use(bodyParser.urlencoded({ extended: false }));
app.use(remotestorage(express.Router(), path.resolve(__dirname, "App_Data")));

// Fail all other requests
app.use(function(req, res) {
  res.sendStatus(500);
});

// Start Express server (HTTP)
app.listen(port);
console.log(__filename + " listening on port " + port + "...");
// Listen on HTTPS as well
/* require("https").createServer({
  key: fs.readFileSync(...),
  cert: fs.readFileSync(...)
}, app).listen(443); */


text:
require 'dfp_api'
require 'dfp_api_statement'

API_VERSION = :v201505
NUMBER_OF_REQUESTS = 50

def get_suggested_ad_units_by_statement()
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
  dfp = DfpApi::Api.new

  # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
  # the configuration file or provide your own logger:
  # dfp.logger = Logger.new('dfp_xml.log')

  # Get the SuggestedAdUnitService.
  suggested_ad_unit_service = dfp.service(:SuggestedAdUnitService, API_VERSION)

  # Create a statement to only select suggested ad units with more than 50
  # requests.
  statement = DfpApiStatement::FilterStatement.new(
      'WHERE numRequests > :num_requests ORDER BY id ASC',
      [
          {:key => 'num_requests',
           :value => {:value => NUMBER_OF_REQUESTS,
                      :xsi_type => 'NumberValue'}}
      ]
  )

  begin
    # Get ad units by statement.
    page = suggested_ad_unit_service.get_suggested_ad_units_by_statement(
        statement.toStatement())

    if page[:results]
      # Print details about each suggested ad unit in results.
      page[:results].each_with_index do |ad_unit, index|
        puts "%d) Suggested ad unit ID: '%s', number of requests: %d" %
            [index + statement.offset, ad_unit[:id], ad_unit[:num_requests]]
      end
    end
    statement.offset += DfpApiStatement::SUGGESTED_PAGE_LIMIT
  end statement.offset < page[:total_result_set_size]

  # Print a footer.
  if page.include?(:total_result_set_size)
    puts "Total number of suggested ad units: %d" % page[:total_result_set_size]
  end
end

if __FILE__ == $0
  begin
    get_suggested_ad_units_by_statement()

  # HTTP errors.
  rescue AdsCommon::Errors::HttpError => e
    puts "HTTP Error: %s" % e

  # API errors.
  rescue DfpApi::Errors::ApiException => e
    puts "Message: %s" % e.message
    puts 'Errors:'
    e.errors.each_with_index do |error, index|
      puts "\tError [%d]:" % (index + 1)
      error.each do |field, value|
        puts "\t\t%s: %s" % [field, value]
      end
    end
  end
end


text:
const _ = require('underscore');

const PlayAreaLocations = ['play area', 'active plot'];

/**
 * Represents a card based effect applied to one or more targets.
 *
 * Properties:
 * match            - function that takes a card and context object and returns
 *                    a boolean about whether the passed card should have the
 *                    effect applied. Alternatively, a card can be passed as the
 *                    match property to match that single card.
 * duration         - string representing how long the effect lasts.
 * until            - optional object to specify events that will cancel the
 *                    effect when duration is 'custom'. The keys of the object
 *                    represent event names that will be listened to and the
 *                    corresponding values should be handler functions for those
 *                    events that return true when the effect should be
 *                    cancelled.
 * condition        - function that returns a boolean determining whether the
 *                    effect can be applied. Use with cards that have a
 *                    condition that must be met before applying a persistent
 *                    effect (e.g. "when there are more Summer plots revealed
 *                    than Winter plots").
 * targetController - string that determines which player's cards are targeted.
 *                    Can be 'current' (default), 'opponent' or 'any'.
 * targetLocation   - string that determines the location of cards that can be
 *                    applied by the effect. Can be 'play area' (default) or
 *                    'hand'.
 * effect           - object representing the effect to be applied.
 * effect.apply     - function that takes a card and a context object and modifies
 *                    the card to apply the effect.
 * effect.unapply   - function that takes a card and a context object and modifies
 *                    the card to remove the previously applied effect.
 */
class Effect {
    constructor(game, source, properties) {
        this.game = game;
        this.source = source;
        this.match = properties.match || (() => true);
        this.duration = properties.duration;
        this.until = properties.until || {};
        this.condition = properties.condition || (() => true);
        this.location = properties.location || 'play area';
        this.targetController = properties.targetController || 'current';
        this.targetType = properties.effect.targetType || 'card';
        this.targetLocation = properties.targetLocation || 'play area';
        this.effect = this.buildEffect(properties.effect);
        this.gameAction = this.effect.gameAction || 'genericEffect';
        this.targets = [];
        this.context = { game: game, source: source };
        this.active = !source.facedown;
        this.isConditional = !!properties.condition || this.targetType === 'player' && _.isFunction(properties.match);
        this.isStateDependent = this.isConditional || this.effect.isStateDependent;
    }

    static flattenProperties(properties) {
        if(Array.isArray(properties.effect)) {
            let effects = _.flatten(properties.effect);
            return effects.map(effect => Object.assign({}, properties, { effect: effect }));
        }

        return [properties];
    }

    buildEffect(effect) {
        if(_.isArray(effect)) {
            throw new '`effect` cannot be an array';
        }

        return effect;
    }

    isInActiveLocation() {
        return ['any', this.source.location].includes(this.location);
    }

    hasEnded() {
        return this.duration === 'custom' && Object.keys(this.until).length === 0 && !this.condition();
    }

    addTargets(targets) {
        if(!this.active || !this.condition()) {
            return;
        }

        let newTargets = _.difference(targets, this.targets);

        _.each(newTargets, target => {
            if(this.isValidTarget(target)) {
                this.targets.push(target);
                this.effect.apply(target, this.context);
            }
        });
    }

    isValidTarget(target) {
        if(this.targetType === 'card' && target.getGameElementType() === 'card') {
            if(this.targetLocation === 'play area' && !PlayAreaLocations.includes(target.location)) {
                return false;
            }

            if(!['any', 'play area'].includes(this.targetLocation) && target.location !== this.targetLocation) {
                return false;
            }

            let gameAction = typeof this.gameAction === 'function' ? this.gameAction(target, this.context) : this.gameAction;

            if(!target.allowGameAction(gameAction, { source: this.source, resolutionStage: 'effect' })) {
                return false;
            }
        }

        if(!_.isFunction(this.match)) {
            return target === this.match;
        }

        if(this.targetType !== target.getGameElementType()) {
            return false;
        }

        if(!this.match(target, this.context)) {
            return false;
        }

        if(this.targetType === 'card') {
            if(this.targetController === 'current') {
                return target.controller === this.source.controller;
            }

            if(this.targetController === 'opponent') {
                return target.controller !== this.source.controller;
            }
        } else if(this.targetType === 'player') {
            if(this.targetController === 'current') {
                return target === this.source.controller;
            }

            if(this.targetController === 'opponent') {
                return target !== this.source.controller;
            }

            if(this.targetController !== 'any') {
                return target === this.targetController;
            }
        }

        return true;
    }

    removeTarget(card) {
        if(!_.contains(this.targets, card)) {
            return;
        }

        this.effect.unapply(card, this.context);

        this.targets = _.reject(this.targets, target => target === card);
    }

    hasTarget(card) {
        return this.targets.includes(card);
    }

    setActive(newActive, newTargets) {
        let oldActive = this.active;

        this.active = newActive;

        if(oldActive && !newActive) {
            this.cancel();
        }

        if(!oldActive && newActive) {
            this.addTargets(newTargets);
        }
    }

    cancel() {
        _.each(this.targets, target => this.effect.unapply(target, this.context));
        this.targets = [];
    }

    reapply(newTargets) {
        if(!this.active) {
            return;
        }

        if(this.isConditional) {
            let newCondition = this.condition();

            if(!newCondition) {
                this.cancel();
                return;
            }

            if(newCondition) {
                let invalidTargets = _.filter(this.targets, target => !this.isValidTarget(target));
                _.each(invalidTargets, target => {
                    this.removeTarget(target);
                });
                this.addTargets(newTargets);
            }
        }

        if(this.effect.isStateDependent) {
            let reapplyFunc = this.createReapplyFunc();
            _.each(this.targets, target => reapplyFunc(target));
        }
    }

    createReapplyFunc() {
        if(this.effect.reapply) {
            return target => this.effect.reapply(target, this.context);
        }

        return target => {
            this.effect.unapply(target, this.context);
            this.effect.apply(target, this.context);
        };
    }

    get order() {
        return this.effect.order || 0;
    }
}

module.exports = Effect;


text:
// @COPYRIGHT@
// Licensed under MIT license (LICENSE.txt)

// clxx/app/options/exceptions/with_no_option_name.hpp

/** // doc: clxx/app/options/exceptions/with_no_option_name.hpp {{{
 * \file clxx/app/options/exceptions/with_no_option_name.hpp
 * \todo Write documentation
 */ // }}}
#ifndef CLXX_APP_OPTIONS_EXCEPTIONS_WITH_NO_OPTION_NAME_HPP_INCLUDED
#define CLXX_APP_OPTIONS_EXCEPTIONS_WITH_NO_OPTION_NAME_HPP_INCLUDED

#include <boost/program_options/errors.hpp>

namespace clxx { namespace app { namespace options {
} } } // end namespace clxx::app::options

#endif /* CLXX_APP_OPTIONS_EXCEPTIONS_WITH_NO_OPTION_NAME_HPP_INCLUDED */
// vim: set expandtab tabstop=2 shiftwidth=2:
// vim: set foldmethod=marker foldcolumn=4:


text:
package beloid.compiler.ast;

import lombok.EqualsAndHashCode;
import lombok.ToString;

@EqualsAndHashCode(callSuper = false)
@ToString
public class IgnoreMatchNode extends PatternMatchNode {

    @Override
    public <T> T accept(PatternMatchVisitor<T> visitor) {
        return visitor.visit(this);
    }
}


text:
require 'logger'
require 'fileutils'
require 'tilt'

require 'awestruct/util/exception_helper'
require 'awestruct/handlers/template/asciidoc'

module Awestruct
  module TestData
    def test_data_dir(test)
      File.join File.dirname(__FILE__), 'test-data', test
    end
  end
end

RSpec.configure do |config|
  config.include Awestruct::TestData
  config.before :suite do
    FileUtils.mkdir_p( File.join(File.dirname(__FILE__), 'test-config/.awestruct'))
    $LOG = Logger.new(File.join(File.dirname(__FILE__), 'test-config/.awestruct/test.log'))
    ::Tilt.register ::Awestruct::Tilt::AsciidoctorTemplate, 'adoc', 'asciidoc', 'ad'
  end
  config.after :suite do
    FileUtils.rm_rf File.join(File.dirname(__FILE__), 'test-config/.awestruct')
  end
  config.before :each do
    Awestruct::ExceptionHelper.class_variable_set :@@failed, false
  end
end


text:
package com.ztiany.adapter_list;

/**
 * @author Ztiany
 * Date : 2018-08-14 16:38
 */
public class Person {

    private int id;
    private String name;
    private String address;

    public Person() {
    }

    public Person(int id, String name, String address) {
        this.id = id;
        this.name = name;
        this.address = address;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}


text:
package de.pfabulist.lindwurm.niotest.tests.topics;

public interface FileOwnerView extends Topic {
}


text:
package org.jetbrains.jps.incremental.scala
package remote

import java.io._
import java.util.{Timer, TimerTask}

import com.intellij.util.Base64Converter
import com.martiansoftware.nailgun.NGContext
import org.jetbrains.jps.incremental.messages.BuildMessage.Kind
import org.jetbrains.jps.incremental.scala.local.LocalServer
import org.jetbrains.jps.incremental.scala.local.worksheet.WorksheetServer

/**
 * @author Pavel Fatin
 * @author Dmitry Naydanov
 */
object Main {
  private val Server = new LocalServer()
  private val worksheetServer = new WorksheetServer

  private var shutdownTimer: Timer = null

  def nailMain(context: NGContext) {
    cancelShutdown()
    make(context.getArgs.toSeq, context.out, standalone = false)
    resetShutdownTimer(context)
  }

  def main(args: Array[String]) {
    make(args, System.out, standalone = true)
  }

  private def make(arguments: Seq[String], out: PrintStream, standalone: Boolean) {
    var hasErrors = false

    val client = {
      val eventHandler = (event: Event) => {
        val encode = Base64Converter.encode(event.toBytes)
        out.write((if (standalone && !encode.endsWith("=")) encode + "=" else encode).getBytes)
      }
      new EventGeneratingClient(eventHandler, out.checkError) {
        override def error(text: String, source: Option[File], line: Option[Long], column: Option[Long]) {
          hasErrors = true
          super.error(text, source, line, column)
        }

        override def message(kind: Kind, text: String, source: Option[File], line: Option[Long], column: Option[Long]) {
          if (kind == Kind.ERROR) hasErrors = true
          super.message(kind, text, source, line, column)
        }
      }
    }

    val oldOut = System.out
    // Suppress any stdout data, interpret such data as error
    System.setOut(System.err)

    try {
      val args = {
        val strings = arguments.map {
          arg =>
            val s = new String(Base64Converter.decode(arg.getBytes), "UTF-8")
            if (s == "#STUB#") "" else s
        }
        Arguments.from(strings)
      }

      if (!worksheetServer.isRepl(args)) Server.compile(args.sbtData, args.compilerData, args.compilationData, client)

      if (!hasErrors) worksheetServer.loadAndRun(args, out, client, standalone)
    } catch {
      case e: Throwable =>
        client.trace(e)
    } finally {
      System.setOut(oldOut)
    }
  }

  private def cancelShutdown() = {
    if (shutdownTimer != null) shutdownTimer.cancel()
  }

  private def resetShutdownTimer(context: NGContext) {
    val delay = Option(System.getProperty("shutdown.delay")).map(_.toInt)
    delay.foreach { t =>
      val delayMs = t * 60 * 1000
      val shutdownTask = new TimerTask {
        override def run(): Unit = context.getNGServer.shutdown(true)
      }
      shutdownTimer = new Timer()
      shutdownTimer.schedule(shutdownTask, delayMs)
    }
  }
}


text:
<?php

namespace Antares\Html\Form;

use Closure;
use Illuminate\Support\Arr;
use Illuminate\Http\Request;
use InvalidArgumentException;
use Illuminate\Support\Fluent;
use Antares\Html\HtmlBuilder;
use Antares\Contracts\Html\Form\Template;
use Illuminate\Contracts\Container\Container;
use Antares\Contracts\Html\Form\Control as ControlContract;

class Control implements ControlContract
{

    /**
     * Container instance.
     *
     * @var \Illuminate\Contracts\Container\Container
     */
    protected $app;

    /**
     * Html builder instance.
     *
     * @var \Antares\Html\HtmlBuilder
     */
    protected $html;

    /**
     * Presenter instance.
     *
     * @var \Antares\Contracts\Html\Form\Template
     */
    protected $presenter;

    /**
     * Request instance.
     *
     * @var \Illuminate\Http\Request
     */
    protected $request;

    /**
     * Fieldset templates configuration.
     *
     * @var  array
     */
    protected $templates = [];

    /**
     * Create a new Field instance.
     *
     * @param  \Illuminate\Contracts\Container\Container  $app
     * @param  \Antares\Html\HtmlBuilder  $html
     * @param  \Illuminate\Http\Request  $request
     */
    public function __construct(Container $app, HtmlBuilder $html, Request $request)
    {
        $this->app     = $app;
        $this->html    = $html;
        $this->request = $request;
    }

    /**
     * Set presenter instance.
     *
     * @param  \Antares\Contracts\Html\Form\Template  $presenter
     *
     * @return $this
     */
    public function setPresenter(Template $presenter)
    {
        $this->presenter = $presenter;

        return $this;
    }

    /**
     * Get presenter instance.
     *
     * @return \Antares\Contracts\Html\Form\Template
     */
    public function getPresenter()
    {
        return $this->presenter;
    }

    /**
     * Set template.
     *
     * @param  array  $templates
     *
     * @return $this
     */
    public function setTemplates(array $templates = [])
    {
        $this->templates = $templates;

        return $this;
    }

    /**
     * Get template.
     *
     * @return array
     */
    public function getTemplates()
    {
        return $this->templates;
    }

    /**
     * Generate Field.
     *
     * @param  string  $type
     *
     * @return \Closure
     */
    public function generate($type)
    {
        return function ($row, $control, $templates = []) use ($type) {
            $data = $this->buildFieldByType($type, $row, $control);
            return $this->render($templates, $data);
        };
    }

    /**
     * Build field by type.
     *
     * @param  string  $type
     * @param  mixed  $row
     * @param  \Illuminate\Support\Fluent  $control
     *
     * @return \Illuminate\Support\Fluent
     */
    public function buildFieldByType($type, $row, Fluent $control)
    {

        $attributes = (array) $control->attributes;

        $html              = $this->html;
        $templates         = $this->templates;
        $data              = $this->buildFluentData($type, $row, $control);
        $method            = $data->get('method');
        $data->options($this->getOptionList($row, $control));
        $data->checked($control->get('checked'));
        $data->optionsData = $control->get('optionsData') ?: [];

        $data->attributes($html->decorate($attributes, Arr::get($templates, $method)));
        if ($type === 'dropzone') {
            $data->label = $control->get('label');
        }
        return $data;
    }

    /**
     * Build data.
     *
     * @param  string  $type
     * @param  mixed  $row
     * @param  \Illuminate\Support\Fluent  $control
     *
     * @return \Illuminate\Support\Fluent
     */
    public function buildFluentData($type, $row, Fluent $control)
    {
        $name  = $control->get('name');
        $value = $this->resolveFieldValue($name, $row, $control);

        $data = new Field([
            'method'     => '',
            'type'       => $type,
            'options'    => [],
            'checked'    => false,
            'attributes' => [],
            'name'       => $name,
            'value'      => $value,
        ]);

        return $this->resolveFieldType($type, $data);
    }

    /**
     * Get options from control.
     *
     * @param  mixed  $row
     * @param  \Illuminate\Support\Fluent  $control
     *
     * @return array
     */
    protected function getOptionList($row, Fluent $control)
    {
        $options = $control->get('options');

        if ($options instanceof Closure) {
            $options = call_user_func($options, $row, $control);
        }

        return $options;
    }

    /**
     * Render the field.
     *
     * @param  array  $templates
     * @param  \Illuminate\Support\Fluent  $field
     *
     * @return string
     *
     * @throws \InvalidArgumentException
     */
    public function render($templates, Fluent $field)
    {
        $method   = $field->get('method');
        $template = Arr::get($templates, $method, [$this->presenter, $method]);
        if (!is_callable($template)) {
            throw new InvalidArgumentException("Form template for [{$method}] is not available.");
        }

        return call_user_func($template, $field);
    }

    /**
     * Resolve method name and type.
     *
     * @param  string  $value
     * @param  \Illuminate\Support\Fluent  $data
     *
     * @return \Illuminate\Support\Fluent
     */
    protected function resolveFieldType($value, Fluent $data)
    {

        $filterable = array_keys($this->templates);
        $value      = ($value == 'switch') ? 'switch_field' : $value;

        if (preg_match('/^(input):([a-zA-Z]+)$/', $value, $matches)) {
            $value = $matches[2];
        } elseif (preg_match('/^(button):([a-zA-Z]+)$/', $value, $matches)) {
            $value        = $matches[1];
            $data['type'] = $matches[2];
        } elseif (!in_array($value, $filterable)) {
            $value = 'text';
        }
        if (in_array($value, $filterable)) {
            $data->method($value);
        } else {
            $data->method('input')->type($value);
        }

        return $data;
    }

    /**
     * Resolve field value.
     *
     * @param  string  $name
     * @param  mixed  $row
     * @param  \Illuminate\Support\Fluent  $control
     *
     * @return mixed
     */
    protected function resolveFieldValue($name, $row, Fluent $control)
    {
        if (ends_with($name, '[]')) {
            $fieldnameInRequest = str_replace('[]', '', $name);
            $oldRequest         = $this->request->old($fieldnameInRequest);
            if (!is_null($oldRequest)) {

                if (($keyField = array_search($control->get('value'), $oldRequest)) !== false) {
                    $name = $fieldnameInRequest . '.' . $oldRequest[$keyField];
                    if ($control->offsetExists('checked')) {
                        $control->attributes = ['checked' => 'checked'];
                    }
                }
            }
        }

        $value = $this->request->old($name);
        if (!is_null($value) && $control->offsetExists('checked')) {
            $control->attributes = ['checked' => 'checked'];
        }

        $model = data_get($row, $name);

        if (!is_null($model) && is_null($value)) {
            $value = $model;
        }

        if (is_null($control->get('value'))) {
            return $value;
        }

        $value = $control->get('value');

        if ($value instanceof Closure) {
            $value = $value($row, $control);
        }

        return $value;
    }

}


text:
using Raven.Assure.BackUp;
using Raven.Assure.Restore;

namespace Raven.Assure.Fluent
{
   public static class Restore
   {
      public static IRestoreDatabase<RestoreDatabase> Database()
      {
         return new RestoreDatabase();
      }

      public static IRestoreFileSystem<RestoreFileSystem> FileSystem()
      {
         return new RestoreFileSystem();
      }
   }
}


text:
package com.navercorp.pinpoint.profiler.plugin;

import org.junit.Assert;
import org.junit.Test;

import java.util.Arrays;

/**
 * @author Woonduk Kang(emeroad)
 */
public class PluginPackageFilterTest {

    @Test
    public void testAccept() throws Exception {
        PluginPackageFilter filter = new PluginPackageFilter(Arrays.asList("com.plugin"));

        Assert.assertTrue(filter.accept("com.plugin.test.module"));

        Assert.assertFalse(filter.accept("test"));
    }
}


text:
package ipfix

import "fmt"

// SubTemplateList represents a list of zero or more instances of a structured data type, where the data type of each list element is the same and corresponds with a single Template Record.
// Examples include a structured data type composed of multiple pairs of ("MPLS label stack entry position", "MPLS label stack value"), a structured data type composed of performance metrics, and a structured data type composed of multiple pairs of IP address, etc.
type SubTemplateList struct {
	Semantic            uint8            //one of: SemanticsNoneOf, ExactlyOneOf, OneOrMoreOf, AllOf, Ordered or Undefined
	TemplateID          uint16           //Each of the newly generated Template Records is given a unique Template ID.  This uniqueness is local to the Transport Session and Observation Domain that generated the Template ID. Template IDs 0-255 are reserved for Template Sets, Options Template Sets, and other reserved Sets yet to be created.  Template IDs of Data Sets are numbered from 256 to 65535.  There are no constraints regarding the order of the Template ID allocation.
	AssociatedTemplates *ActiveTemplates //We can only begin to marshal/unmarshal the records when we have the whole template belonging to the TemplateID
	Records             []Record         //The list of Records
}

// NewSubTemplateList returns a new SubTemplateList.
func NewSubTemplateList(semantic uint8, templateid uint16) (*SubTemplateList, error) {
	if templateid < 256 {
		return nil, NewError(fmt.Sprintf("Can not have a template id <256, but got %d", templateid), ErrCritical)
	}
	if semantic >= 0x05 && semantic <= 0xFE {
		return nil, NewError(fmt.Sprintf("Semantic undefined: %d", semantic), ErrCritical)
	}
	return &SubTemplateList{
		Semantic:   semantic,
		TemplateID: templateid,
		Records:    make([]Record, 0, 0),
	}, nil
}

// Len returns the length of the field specifier, in octets.
func (stl *SubTemplateList) Len() uint16 {
	stllen := uint16(3)
	for _, listitem := range stl.Records {
		stllen += listitem.Len()
	}
	return stllen
}

// AssociateTemplates sets the template to be used marshalling/unmarshalling this SubTemplateList
func (stl *SubTemplateList) AssociateTemplates(at *ActiveTemplates) error {
	if at == nil {
		return NewError(fmt.Sprintf("Can not use nil as Template List"), ErrCritical)
	}
	stl.AssociatedTemplates = at
	return nil
}