text:
#region -- License Terms --
//
// MessagePack for CLI
//
// Copyright (C) 2010 FUJIWARA, Yusuke
//
//    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.
//
#endregion -- License Terms --

using System;
using System.Diagnostics;
using System.Net;
using System.Reflection;
using System.Threading;
using MsgPack.Rpc.Client.Protocols;
using MsgPack.Serialization;
using NUnit.Framework;
using MsgPack.Rpc.Protocols;
using System.Net.Sockets;

namespace MsgPack.Rpc.Client
{
	[TestFixture()]
	[Timeout( 3000 )]
	public class RpcClientTest
	{
		private static readonly IPEndPoint _loopbackEndPoint = new IPEndPoint( IPAddress.Loopback, MsgPack.Rpc.Server.CallbackServer.PortNumber );
		public const int TimeoutMilliseconds = 3000;

		[Test]
		public void TestConstructorRpcClient_Normal_SetPropertyAsIs()
		{
			using ( var environment = new InProcTestEnvironment() )
			{
				var configuration = RpcClientConfiguration.Default.Clone();
				configuration.TransportManagerProvider = conf => environment.ClientTransportManager;
				SerializationContext serializationContext = new SerializationContext();

				using ( RpcClient target = new RpcClient( environment.EndPoint, configuration, serializationContext ) )
				{
					Assert.That( target.SerializationContext, Is.SameAs( serializationContext ) );
				}
			}
		}

		[Test]
		[ExpectedException( typeof( ArgumentNullException ) )]
		public void TestConstructorRpcClient_TransportIsNull()
		{
			SerializationContext serializationContext = new SerializationContext();
			new RpcClient( null );
		}

		[Test]
		public void TestConstructorRpcClient_ConfigurationAndSerializationContextIsNull_DefaultsAreUsed()
		{
			using ( var environment = new InProcTestEnvironment() )
			{
				using ( RpcClient target = new RpcClient( environment.EndPoint, null, null ) )
				{
					Assert.That( target.SerializationContext, Is.Not.Null );
				}
			}
		}

		[Test]
		public void TestDispose_TransportDisposed()
		{
			using ( var environment = new InProcTestEnvironment() )
			{
				var target = new RpcClient( _loopbackEndPoint, environment.Configuration, null );
				target.EnsureConnected();
				target.Dispose();
				Assert.That( target.Transport.IsDisposed );
				Assert.That( target.TransportManager.IsDisposed );
			}
		}

		[Test]
		public void TestDispose_Twise_Harmless()
		{
			using ( var environment = new InProcTestEnvironment() )
			{
				var target = new RpcClient( _loopbackEndPoint, environment.Configuration, null );
				target.Dispose();
				target.Dispose();
			}
		}

		[Test]
		public void TestShutdown_TransportShutdownIsInitiated()
		{
			using ( var environment = new InProcTestEnvironment() )
			using ( var target = new RpcClient( _loopbackEndPoint, environment.Configuration, null ) )
			{
				int isShutdownCompleted = 0;
				target.EnsureConnected();
				target.Transport.ShutdownCompleted += ( sender, e ) => Interlocked.Exchange( ref isShutdownCompleted, 1 );
				target.Shutdown();
				Assert.That( target.Transport.IsClientShutdown );
				Assert.That( isShutdownCompleted, Is.EqualTo( 1 ) );
			}
		}

		[Test]
		public void TestShutdownAsync_TransportShutdownIsInitiated()
		{
			using ( var environment = new InProcTestEnvironment() )
			using ( var target = new RpcClient( _loopbackEndPoint, environment.Configuration, null ) )
			{
				int isShutdownCompleted = 0;
				target.EnsureConnected();
				target.Transport.ShutdownCompleted += ( sender, e ) => Interlocked.Exchange( ref isShutdownCompleted, 1 );
				using ( var task = target.ShutdownAsync() )
				{
					Assert.That( target.Transport.IsClientShutdown );
					Assert.That( task.Wait( TimeSpan.FromSeconds( 1 ) ) );
					Assert.That( isShutdownCompleted, Is.EqualTo( 1 ) );
				}
			}
		}

		[Test()]
		public void TestCall_Normal_Returned()
		{
			using ( var environment = new InProcTestEnvironment() )
			using ( var target = environment.CreateClient() )
			{
				var args = new object[] { 1, "3" };
				var result = target.Call( "Test", args );
				// CallbackServer just returns args.
				Assert.That( result.AsList()[ 0 ] == 1, result.AsList()[ 0 ].ToString() );
				Assert.That( result.AsList()[ 1 ] == "3", result.AsList()[ 1 ].ToString() );
			}
		}

		[Test()]
		public void TestCall_RemoteError_Thrown()
		{
			using ( var environment = new InProcTestEnvironment( new RpcMethodInvocationException( RpcError.CallError, "Test" ) ) )
			using ( var target = environment.CreateClient() )
			{
				var args = new object[] { 1, "3" };
				try
				{
					target.Call( "Test", args );
					Assert.Fail();
				}
				catch ( RpcException ex )
				{
					Assert.That( ex.RpcError.Identifier, Is.EqualTo( RpcError.CallError.Identifier ) );
				}
			}
		}

		[Test]
		public void TestCall_NetworkError_Exception()
		{
			using ( var environment = new InProcTestEnvironment() )
			using ( var target = environment.CreateClient() )
			{
				target.EnsureConnected();
				( target.Transport as InProcClientTransport ).DataSending += EmulateSocketError;
				var args = new object[] { 1, "3" };
				Assert.Catch<SocketException>( () => target.Call( "Test", args ) );
			}
		}

		[Test()]
		public void TestCallAsync_Normal_Returned()
		{
			using ( var environment = new InProcTestEnvironment() )
			using ( var target = environment.CreateClient() )
			{
				var args = new object[] { 1, "3" };
				var task = target.CallAsync( "Test", args, null );
				// CallbackServer just returns args.
				var result = task.Result;
				Assert.That( result.AsList()[ 0 ] == 1, result.AsList()[ 0 ].ToString() );
				Assert.That( result.AsList()[ 1 ] == "3", result.AsList()[ 1 ].ToString() );
			}
		}

		[Test()]
		public void TestCallAsync_RemoteError_Thrown()
		{
			using ( var environment = new InProcTestEnvironment( new RpcMethodInvocationException( RpcError.CallError, "Test" ) ) )
			using ( var target = environment.CreateClient() )
			{
				var args = new object[] { 1, "3" };
				try
				{
					var task = target.CallAsync( "Test", args, null );
					task.Wait();
					Assert.Fail();
				}
				catch ( AggregateException ex )
				{
					var rpcException = ex.InnerException as RpcException;
					Assert.That( rpcException, Is.Not.Null );
					Assert.That( rpcException.RpcError.Identifier, Is.EqualTo( RpcError.CallError.Identifier ) );
				}
			}
		}

		[Test]
		public void TestCallAsync_NetworkError_ExceptionOnAsyncItSelf()
		{
			using ( var environment = new InProcTestEnvironment() )
			using ( var target = environment.CreateClient() )
			{
				target.EnsureConnected();
				( target.Transport as InProcClientTransport ).DataSending += EmulateSocketError;
				var args = new object[] { 1, "3" };
				Assert.Catch<SocketException>( () => target.CallAsync( "Test", args, null ) );
			}
		}

		[Test()]
		public void TestBeginCallEndCall_Normal_Returned()
		{
			using ( var environment = new InProcTestEnvironment() )
			using ( var target = environment.CreateClient() )
			{
				var args = new object[] { 1, "3" };
				var ar = target.BeginCall( "Test", args, null, null );
				// CallbackServer just returns args.
				var result = target.EndCall( ar );
				Assert.That( result.AsList()[ 0 ] == 1, result.AsList()[ 0 ].ToString() );
				Assert.That( result.AsList()[ 1 ] == "3", result.AsList()[ 1 ].ToString() );
			}
		}

		[Test()]
		public void TestBeginCallEndCall_RemoteError_Thrown()
		{
			using ( var environment = new InProcTestEnvironment( new RpcMethodInvocationException( RpcError.CallError, "Test" ) ) )
			using ( var target = environment.CreateClient() )
			{
				var args = new object[] { 1, "3" };
				try
				{
					var ar = target.BeginCall( "Test", args, null, null );
					Assert.That( ar.AsyncWaitHandle.WaitOne( TimeSpan.FromSeconds( 1 ) ) );
					target.EndCall( ar );
					Assert.Fail();
				}
				catch ( RpcException ex )
				{
					Assert.That( ex.RpcError.Identifier, Is.EqualTo( RpcError.CallError.Identifier ) );
				}
			}
		}

		[Test]
		public void TestBeginCallEndCall_NetworkError_ExceptionOnBeginCall()
		{
			using ( var environment = new InProcTestEnvironment() )
			using ( var target = environment.CreateClient() )
			{
				target.EnsureConnected();
				( target.Transport as InProcClientTransport ).DataSending += EmulateSocketError;
				var args = new object[] { 1, "3" };
				Assert.Catch<SocketException>( () => target.BeginCall( "Test", args, null, null ) );
			}
		}

		private const int _notificationIsOk = 1;
		private const int _notificationInvalidArguments = 2;

		[Test()]
		public void TestNotify_Normal_ReachToServer()
		{
			var clientArgs = new object[] { 1, "3" };
			int result = 0;
			using ( var waitHandle = new ManualResetEventSlim() )
			using ( var environment = new InProcTestEnvironment(
				( id, args ) =>
				{
					try
					{
						if ( args[ 0 ] != 1 || args[ 1 ] != "3" )
						{
							Interlocked.Exchange( ref result, _notificationInvalidArguments );
						}
						else
						{
							Interlocked.Exchange( ref result, _notificationIsOk );
						}

						return MessagePackObject.Nil;
					}
					finally
					{
						waitHandle.Set();
					}
				}
			) )
			using ( var target = environment.CreateClient() )
			{
				target.Notify( "Test", clientArgs );
				Assert.That( waitHandle.Wait( TimeSpan.FromSeconds( 1 ) ) );
				Assert.That( Interlocked.CompareExchange( ref result, 0, 0 ), Is.EqualTo( _notificationIsOk ) );
			}
		}

		[Test()]
		public void TestNotify_RemoteError_NoEffect()
		{
			var clientArgs = new object[] { 1, "3" };
			using ( var environment = new InProcTestEnvironment(
				( id, args ) =>
				{
					throw new RpcMethodInvocationException( RpcError.CallError, "Test" );
				}
			) )
			using ( var target = environment.CreateClient() )
			{
				target.Notify( "Test", clientArgs );
			}
		}

		[Test]
		public void TestNotify_NetworkError_Exception()
		{
			using ( var environment = new InProcTestEnvironment() )
			using ( var target = environment.CreateClient() )
			{
				target.EnsureConnected();
				( target.Transport as InProcClientTransport ).DataSending += EmulateSocketError;
				var args = new object[] { 1, "3" };
				Assert.Catch<SocketException>( () => target.Notify( "Test", args ) );
			}
		}

		[Test()]
		public void TestNotifyAsync_Normal_ReachToServer()
		{
			var clientArgs = new object[] { 1, "3" };
			int result = 0;
			using ( var waitHandle = new ManualResetEventSlim() )
			using ( var environment = new InProcTestEnvironment(
				( id, args ) =>
				{
					if ( args[ 0 ] != 1 || args[ 1 ] != "3" )
					{
						Interlocked.Exchange( ref result, _notificationInvalidArguments );
					}
					else
					{
						Interlocked.Exchange( ref result, _notificationIsOk );
					}

					waitHandle.Set();
					return MessagePackObject.Nil;
				}
			) )
			using ( var target = environment.CreateClient() )
			{
				using ( var task = target.NotifyAsync( "Test", clientArgs, null ) )
				{
					Assert.That( task.Wait( TimeSpan.FromSeconds( 1 ) ) );
					Assert.That( waitHandle.Wait( TimeSpan.FromSeconds( 1 ) ) );
					Assert.That( Interlocked.CompareExchange( ref result, 0, 0 ), Is.EqualTo( _notificationIsOk ) );
				}
			}
		}

		[Test()]
		public void TestNotifyAsync_RemoteError_NoEffect()
		{
			var clientArgs = new object[] { 1, "3" };
			using ( var environment = new InProcTestEnvironment(
				( id, args ) =>
				{
					throw new RpcMethodInvocationException( RpcError.CallError, "Test" );
				}
			) )
			using ( var target = environment.CreateClient() )
			{
				using ( var task = target.NotifyAsync( "Test", clientArgs, null ) )
				{
					Assert.That( task.Wait( TimeSpan.FromSeconds( 1 ) ) );
				}
			}
		}

		[Test]
		public void TestNotifyAsync_NetworkError_ExceptionOnAsyncItSelf()
		{
			using ( var environment = new InProcTestEnvironment() )
			using ( var target = environment.CreateClient() )
			{
				target.EnsureConnected();
				( target.Transport as InProcClientTransport ).DataSending += EmulateSocketError;
				var args = new object[] { 1, "3" };
				Assert.Catch<SocketException>( () => target.NotifyAsync( "Test", args, null ) );
			}
		}

		[Test()]
		public void TestBeginNotifyEndNotify_Normal_ReachToServer()
		{
			var clientArgs = new object[] { 1, "3" };
			int result = 0;
			using ( var waitHandle = new ManualResetEventSlim() )
			using ( var environment = new InProcTestEnvironment(
				( id, args ) =>
				{
					if ( args[ 0 ] != 1 || args[ 1 ] != "3" )
					{
						Interlocked.Exchange( ref result, _notificationInvalidArguments );
					}
					else
					{
						Interlocked.Exchange( ref result, _notificationIsOk );
					}

					waitHandle.Set();
					return MessagePackObject.Nil;
				}
			) )
			using ( var target = environment.CreateClient() )
			{
				var ar = target.BeginNotify( "Test", clientArgs, null, null );
				Assert.That( ar.AsyncWaitHandle.WaitOne( TimeSpan.FromSeconds( 1 ) ) );
				target.EndNotify( ar );
				Assert.That( waitHandle.Wait( TimeSpan.FromSeconds( 1 ) ) );
				Assert.That( Interlocked.CompareExchange( ref result, 0, 0 ), Is.EqualTo( _notificationIsOk ) );
			}
		}

		[Test()]
		public void TestBeginNotifyEndNotify_RemoteError_NoEffect()
		{
			var clientArgs = new object[] { 1, "3" };
			using ( var environment = new InProcTestEnvironment(
				( id, args ) =>
				{
					throw new RpcMethodInvocationException( RpcError.CallError, "Test" );
				}
			) )
			using ( var target = environment.CreateClient() )
			{
				var ar = target.BeginNotify( "Test", clientArgs, null, null );
				Assert.That( ar.AsyncWaitHandle.WaitOne( TimeSpan.FromSeconds( 1 ) ) );
				target.EndNotify( ar );
			}
		}

		[Test]
		public void TestBeginNotifyEndNotify_NetworkError_ExceptionOnBeginCall()
		{
			using ( var environment = new InProcTestEnvironment() )
			using ( var target = environment.CreateClient() )
			{
				target.EnsureConnected();
				( target.Transport as InProcClientTransport ).DataSending += EmulateSocketError;
				var args = new object[] { 1, "3" };
				Assert.Catch<SocketException>( () => target.BeginNotify( "Test", args, null, null ) );
			}
		}

		private static void EmulateSocketError( object sender, InProcDataSendingEventArgs e )
		{
			throw new SocketException( ( int )SocketError.ConnectionReset );
		}

		private sealed class InProcTestEnvironment : IDisposable
		{
			private readonly EndPoint _endPoint;

			public EndPoint EndPoint
			{
				get { return this._endPoint; }
			}

			private readonly MsgPack.Rpc.Server.CallbackServer _server;
			private readonly MsgPack.Rpc.Server.Protocols.InProcServerTransportManager _serverTransportManager;

			private RpcClientConfiguration _configuration;

			public RpcClientConfiguration Configuration
			{
				get { return this._configuration; }
				set { this._configuration = value; }
			}

			private readonly InProcClientTransportManager _clientTransportManager;

			public ClientTransportManager ClientTransportManager
			{
				get { return this._clientTransportManager; }
			}

			public InProcTestEnvironment() : this( ( id, args ) => args ) { }

			public InProcTestEnvironment( RpcException errorToBeRaised )
				: this( ( id, args ) => { throw errorToBeRaised; } )
			{
			}

			public InProcTestEnvironment( Func<int?, MessagePackObject[], MessagePackObject> callback )
			{
				this._endPoint = new IPEndPoint( IPAddress.Loopback, MsgPack.Rpc.Server.CallbackServer.PortNumber );
				this._server = MsgPack.Rpc.Server.CallbackServer.Create( callback, true );
				this._configuration = RpcClientConfiguration.Default.Clone();
				this._configuration.TransportManagerProvider = conf => this._clientTransportManager;
				this._configuration.Freeze();
				this._serverTransportManager = new MsgPack.Rpc.Server.Protocols.InProcServerTransportManager( this._server.Server as Server.RpcServer, mgr => new SingletonObjectPool<Server.Protocols.InProcServerTransport>( new Server.Protocols.InProcServerTransport( mgr ) ) );
				this._clientTransportManager = new InProcClientTransportManager( new RpcClientConfiguration(), this._serverTransportManager );
			}

			public void Dispose()
			{
				this._clientTransportManager.Dispose();
				this._serverTransportManager.Dispose();
				this._server.Dispose();
			}

			public void ShutdownServer()
			{
				this._server.Dispose();
			}

			public RpcClient CreateClient()
			{
				return new RpcClient( this._endPoint, this._configuration, null );
			}
		}

		private sealed class TcpTestEnvironment : IDisposable
		{
			private readonly TcpListener _server;
			private readonly TcpClientTransportManager _clientTransportManager;

			public ClientTransportManager ClientTransportManager
			{
				get { return this._clientTransportManager; }
			}

			public TcpTestEnvironment()
			{
				this._server = new TcpListener( IPAddress.Loopback, MsgPack.Rpc.Server.CallbackServer.PortNumber );
				this._clientTransportManager = new TcpClientTransportManager( new RpcClientConfiguration() );
				this._server.Start();
			}

			public void Dispose()
			{
				this._clientTransportManager.Dispose();
				try
				{
					this._server.Stop();
				}
				catch { }
			}
		}
	}
}


text: Was not redirected

redpajama_set_name: RedPajamaGithub


text:
package modules.pages.mail;
import static com.xceptance.xlt.api.engine.scripting.StaticScriptCommands.*;

/**
 *
Validate nominal value with row table counter.

 */
public class VMail_Table_validateRowCounter
{

    /**
     *
Validate nominal value with row table counter.

     *
     * @param nominalValue
     */
    public static void execute(String nominalValue)
    {
        // resolve any placeholder in the parameters
        nominalValue = resolve(nominalValue);
        // counterRow
        assertXpathCount("/html/body/div[2]/div/div/table/tbody/tr", nominalValue);

    }
}


text:
<!doctype html>

        <title>Mobile Test</title>
        <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap.min.css" rel="stylesheet">

    			<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Where are we?

    			Set Location

            <form action="." method="get" class="form-inline">

                    Pane
                    <select name="pane" class="input-medium">
                        <option>people</option>
                        <option>housing</option>
                        <option>fun</option>
                        <option>environment</option>
                        <option>history</option>
                    </select>

                    Location
                    <input type="text" name="lat" class="input-small" value="38.906956">

                <input type="text" name="lon" class="input-small" value="-77.042883">

                    <input type="checkbox" name="retina" value="1" checked>
                    Retina

                <input type="submit" value="Load Pane" class="btn btn-primary">

                        <input type="checkbox" name="size" value="1" checked>
                        iPhone 5

            </form>


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

namespace Evol.TMovie.Domain.Models.Entities
{
    /// <summary>
    /// Role(1) ----《 Permission(n)
    /// </summary>
    public class RolePermissionShip : BaseEntity
    {
        public Guid RoleId { get; set; }

        public Guid PermissionId { get; set; }
    }
}


text:
/* jshint maxlen: false */

'use strict';

var createAPIRequest = require('../../lib/apirequest');

/**
 * Drive API
 *
 * Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.
 *
 * @example
 * var google = require('googleapis');
 * var drive = google.drive('v3');
 *
 * @namespace drive
 * @type {Function}
 * @version v3
 * @variation v3
 * @param {object=} options Options for Drive
 */
function Drive(options) { // eslint-disable-line
  var self = this;
  self._options = options || {};

  self.about = {

    /**
     * drive.about.get
     *
     * @desc Gets information about the user, the user's Drive, and system capabilities.
     *
     * @alias drive.about.get
     * @memberOf! drive(v3)
     *
     * @param {object=} params Parameters for request
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    get: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/about',
          method: 'GET'
        },
        params: params,
        requiredParams: [],
        pathParams: [],
        context: self
      };

      return createAPIRequest(parameters, callback);
    }

  };

  self.changes = {

    /**
     * drive.changes.getStartPageToken
     *
     * @desc Gets the starting pageToken for listing future changes.
     *
     * @alias drive.changes.getStartPageToken
     * @memberOf! drive(v3)
     *
     * @param {object=} params Parameters for request
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    getStartPageToken: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/changes/startPageToken',
          method: 'GET'
        },
        params: params,
        requiredParams: [],
        pathParams: [],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.changes.list
     *
     * @desc Lists changes for a user.
     *
     * @alias drive.changes.list
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {boolean=} params.includeRemoved Whether to include changes indicating that items have left the view of the changes list, for example by deletion or lost access.
     * @param {integer=} params.pageSize The maximum number of changes to return per page.
     * @param {string} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method.
     * @param {boolean=} params.restrictToMyDrive Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive.
     * @param {string=} params.spaces A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    list: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/changes',
          method: 'GET'
        },
        params: params,
        requiredParams: ['pageToken'],
        pathParams: [],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.changes.watch
     *
     * @desc Subscribes to changes for a user.
     *
     * @alias drive.changes.watch
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {boolean=} params.includeRemoved Whether to include changes indicating that items have left the view of the changes list, for example by deletion or lost access.
     * @param {integer=} params.pageSize The maximum number of changes to return per page.
     * @param {string} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method.
     * @param {boolean=} params.restrictToMyDrive Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive.
     * @param {string=} params.spaces A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.
     * @param {object} params.resource Request body data
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    watch: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/changes/watch',
          method: 'POST'
        },
        params: params,
        requiredParams: ['pageToken'],
        pathParams: [],
        context: self
      };

      return createAPIRequest(parameters, callback);
    }

  };

  self.channels = {

    /**
     * drive.channels.stop
     *
     * @desc Stop watching resources through this channel
     *
     * @alias drive.channels.stop
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {object} params.resource Request body data
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    stop: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/channels/stop',
          method: 'POST'
        },
        params: params,
        requiredParams: [],
        pathParams: [],
        context: self
      };

      return createAPIRequest(parameters, callback);
    }

  };

  self.comments = {

    /**
     * drive.comments.create
     *
     * @desc Creates a new comment on a file.
     *
     * @alias drive.comments.create
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.fileId The ID of the file.
     * @param {object} params.resource Request body data
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    create: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/comments',
          method: 'POST'
        },
        params: params,
        requiredParams: ['fileId'],
        pathParams: ['fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.comments.delete
     *
     * @desc Deletes a comment.
     *
     * @alias drive.comments.delete
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.commentId The ID of the comment.
     * @param {string} params.fileId The ID of the file.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    delete: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}',
          method: 'DELETE'
        },
        params: params,
        requiredParams: ['fileId', 'commentId'],
        pathParams: ['commentId', 'fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.comments.get
     *
     * @desc Gets a comment by ID.
     *
     * @alias drive.comments.get
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.commentId The ID of the comment.
     * @param {string} params.fileId The ID of the file.
     * @param {boolean=} params.includeDeleted Whether to return deleted comments. Deleted comments will not include their original content.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    get: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}',
          method: 'GET'
        },
        params: params,
        requiredParams: ['fileId', 'commentId'],
        pathParams: ['commentId', 'fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.comments.list
     *
     * @desc Lists a file's comments.
     *
     * @alias drive.comments.list
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.fileId The ID of the file.
     * @param {boolean=} params.includeDeleted Whether to include deleted comments. Deleted comments will not include their original content.
     * @param {integer=} params.pageSize The maximum number of comments to return per page.
     * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.
     * @param {string=} params.startModifiedTime The minimum value of 'modifiedTime' for the result comments (RFC 3339 date-time).
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    list: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/comments',
          method: 'GET'
        },
        params: params,
        requiredParams: ['fileId'],
        pathParams: ['fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.comments.update
     *
     * @desc Updates a comment with patch semantics.
     *
     * @alias drive.comments.update
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.commentId The ID of the comment.
     * @param {string} params.fileId The ID of the file.
     * @param {object} params.resource Request body data
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    update: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}',
          method: 'PATCH'
        },
        params: params,
        requiredParams: ['fileId', 'commentId'],
        pathParams: ['commentId', 'fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    }

  };

  self.files = {

    /**
     * drive.files.copy
     *
     * @desc Creates a copy of a file and applies any requested updates with patch semantics.
     *
     * @alias drive.files.copy
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.fileId The ID of the file.
     * @param {boolean=} params.ignoreDefaultVisibility Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders.
     * @param {boolean=} params.keepRevisionForever Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive.
     * @param {string=} params.ocrLanguage A language hint for OCR processing during image import (ISO 639-1 code).
     * @param {object} params.resource Request body data
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    copy: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/copy',
          method: 'POST'
        },
        params: params,
        requiredParams: ['fileId'],
        pathParams: ['fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.files.create
     *
     * @desc Creates a new file.
     *
     * @alias drive.files.create
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {boolean=} params.ignoreDefaultVisibility Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders.
     * @param {boolean=} params.keepRevisionForever Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive.
     * @param {string=} params.ocrLanguage A language hint for OCR processing during image import (ISO 639-1 code).
     * @param {boolean=} params.useContentAsIndexableText Whether to use the uploaded content as indexable text.
     * @param  {object} params.resource Media resource metadata
     * @param {object} params.media Media object
     * @param {string} params.media.mimeType Media mime-type
     * @param {string|object} params.media.body Media body contents
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    create: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files',
          method: 'POST'
        },
        params: params,
        mediaUrl: 'https://www.googleapis.com/upload/drive/v3/files',
        requiredParams: [],
        pathParams: [],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.files.delete
     *
     * @desc Permanently deletes a file owned by the user without moving it to the trash. If the target is a folder, all descendants owned by the user are also deleted.
     *
     * @alias drive.files.delete
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.fileId The ID of the file.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    delete: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}',
          method: 'DELETE'
        },
        params: params,
        requiredParams: ['fileId'],
        pathParams: ['fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.files.emptyTrash
     *
     * @desc Permanently deletes all of the user's trashed files.
     *
     * @alias drive.files.emptyTrash
     * @memberOf! drive(v3)
     *
     * @param {object=} params Parameters for request
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    emptyTrash: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/trash',
          method: 'DELETE'
        },
        params: params,
        requiredParams: [],
        pathParams: [],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.files.export
     *
     * @desc Exports a Google Doc to the requested MIME type and returns the exported content.
     *
     * @alias drive.files.export
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.fileId The ID of the file.
     * @param {string} params.mimeType The MIME type of the format requested for this export.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    export: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/export',
          method: 'GET'
        },
        params: params,
        requiredParams: ['fileId', 'mimeType'],
        pathParams: ['fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.files.generateIds
     *
     * @desc Generates a set of file IDs which can be provided in create requests.
     *
     * @alias drive.files.generateIds
     * @memberOf! drive(v3)
     *
     * @param {object=} params Parameters for request
     * @param {integer=} params.count The number of IDs to return.
     * @param {string=} params.space The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    generateIds: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/generateIds',
          method: 'GET'
        },
        params: params,
        requiredParams: [],
        pathParams: [],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.files.get
     *
     * @desc Gets a file's metadata or content by ID.
     *
     * @alias drive.files.get
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {boolean=} params.acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
     * @param {string} params.fileId The ID of the file.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    get: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}',
          method: 'GET'
        },
        params: params,
        requiredParams: ['fileId'],
        pathParams: ['fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.files.list
     *
     * @desc Lists or searches files.
     *
     * @alias drive.files.list
     * @memberOf! drive(v3)
     *
     * @param {object=} params Parameters for request
     * @param {string=} params.corpus The source of files to list.
     * @param {string=} params.orderBy A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.
     * @param {integer=} params.pageSize The maximum number of files to return per page.
     * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.
     * @param {string=} params.q A query for filtering the file results. See the "Search for Files" guide for supported syntax.
     * @param {string=} params.spaces A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    list: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files',
          method: 'GET'
        },
        params: params,
        requiredParams: [],
        pathParams: [],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.files.update
     *
     * @desc Updates a file's metadata and/or content with patch semantics.
     *
     * @alias drive.files.update
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string=} params.addParents A comma-separated list of parent IDs to add.
     * @param {string} params.fileId The ID of the file.
     * @param {boolean=} params.keepRevisionForever Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive.
     * @param {string=} params.ocrLanguage A language hint for OCR processing during image import (ISO 639-1 code).
     * @param {string=} params.removeParents A comma-separated list of parent IDs to remove.
     * @param {boolean=} params.useContentAsIndexableText Whether to use the uploaded content as indexable text.
     * @param  {object} params.resource Media resource metadata
     * @param {object} params.media Media object
     * @param {string} params.media.mimeType Media mime-type
     * @param {string|object} params.media.body Media body contents
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    update: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}',
          method: 'PATCH'
        },
        params: params,
        mediaUrl: 'https://www.googleapis.com/upload/drive/v3/files/{fileId}',
        requiredParams: ['fileId'],
        pathParams: ['fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.files.watch
     *
     * @desc Subscribes to changes to a file
     *
     * @alias drive.files.watch
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {boolean=} params.acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
     * @param {string} params.fileId The ID of the file.
     * @param {object} params.resource Request body data
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    watch: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/watch',
          method: 'POST'
        },
        params: params,
        requiredParams: ['fileId'],
        pathParams: ['fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    }

  };

  self.permissions = {

    /**
     * drive.permissions.create
     *
     * @desc Creates a permission for a file.
     *
     * @alias drive.permissions.create
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string=} params.emailMessage A custom message to include in the notification email.
     * @param {string} params.fileId The ID of the file.
     * @param {boolean=} params.sendNotificationEmail Whether to send a notification email when sharing to users or groups. This defaults to true for users and groups, and is not allowed for other requests. It must not be disabled for ownership transfers.
     * @param {boolean=} params.transferOwnership Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect.
     * @param {object} params.resource Request body data
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    create: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/permissions',
          method: 'POST'
        },
        params: params,
        requiredParams: ['fileId'],
        pathParams: ['fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.permissions.delete
     *
     * @desc Deletes a permission.
     *
     * @alias drive.permissions.delete
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.fileId The ID of the file.
     * @param {string} params.permissionId The ID of the permission.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    delete: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/permissions/{permissionId}',
          method: 'DELETE'
        },
        params: params,
        requiredParams: ['fileId', 'permissionId'],
        pathParams: ['fileId', 'permissionId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.permissions.get
     *
     * @desc Gets a permission by ID.
     *
     * @alias drive.permissions.get
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.fileId The ID of the file.
     * @param {string} params.permissionId The ID of the permission.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    get: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/permissions/{permissionId}',
          method: 'GET'
        },
        params: params,
        requiredParams: ['fileId', 'permissionId'],
        pathParams: ['fileId', 'permissionId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.permissions.list
     *
     * @desc Lists a file's permissions.
     *
     * @alias drive.permissions.list
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.fileId The ID of the file.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    list: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/permissions',
          method: 'GET'
        },
        params: params,
        requiredParams: ['fileId'],
        pathParams: ['fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.permissions.update
     *
     * @desc Updates a permission with patch semantics.
     *
     * @alias drive.permissions.update
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.fileId The ID of the file.
     * @param {string} params.permissionId The ID of the permission.
     * @param {boolean=} params.removeExpiration Whether to remove the expiration date.
     * @param {boolean=} params.transferOwnership Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect.
     * @param {object} params.resource Request body data
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    update: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/permissions/{permissionId}',
          method: 'PATCH'
        },
        params: params,
        requiredParams: ['fileId', 'permissionId'],
        pathParams: ['fileId', 'permissionId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    }

  };

  self.replies = {

    /**
     * drive.replies.create
     *
     * @desc Creates a new reply to a comment.
     *
     * @alias drive.replies.create
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.commentId The ID of the comment.
     * @param {string} params.fileId The ID of the file.
     * @param {object} params.resource Request body data
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    create: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}/replies',
          method: 'POST'
        },
        params: params,
        requiredParams: ['fileId', 'commentId'],
        pathParams: ['commentId', 'fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.replies.delete
     *
     * @desc Deletes a reply.
     *
     * @alias drive.replies.delete
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.commentId The ID of the comment.
     * @param {string} params.fileId The ID of the file.
     * @param {string} params.replyId The ID of the reply.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    delete: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}',
          method: 'DELETE'
        },
        params: params,
        requiredParams: ['fileId', 'commentId', 'replyId'],
        pathParams: ['commentId', 'fileId', 'replyId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.replies.get
     *
     * @desc Gets a reply by ID.
     *
     * @alias drive.replies.get
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.commentId The ID of the comment.
     * @param {string} params.fileId The ID of the file.
     * @param {boolean=} params.includeDeleted Whether to return deleted replies. Deleted replies will not include their original content.
     * @param {string} params.replyId The ID of the reply.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    get: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}',
          method: 'GET'
        },
        params: params,
        requiredParams: ['fileId', 'commentId', 'replyId'],
        pathParams: ['commentId', 'fileId', 'replyId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.replies.list
     *
     * @desc Lists a comment's replies.
     *
     * @alias drive.replies.list
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.commentId The ID of the comment.
     * @param {string} params.fileId The ID of the file.
     * @param {boolean=} params.includeDeleted Whether to include deleted replies. Deleted replies will not include their original content.
     * @param {integer=} params.pageSize The maximum number of replies to return per page.
     * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    list: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}/replies',
          method: 'GET'
        },
        params: params,
        requiredParams: ['fileId', 'commentId'],
        pathParams: ['commentId', 'fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.replies.update
     *
     * @desc Updates a reply with patch semantics.
     *
     * @alias drive.replies.update
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.commentId The ID of the comment.
     * @param {string} params.fileId The ID of the file.
     * @param {string} params.replyId The ID of the reply.
     * @param {object} params.resource Request body data
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    update: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}',
          method: 'PATCH'
        },
        params: params,
        requiredParams: ['fileId', 'commentId', 'replyId'],
        pathParams: ['commentId', 'fileId', 'replyId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    }

  };

  self.revisions = {

    /**
     * drive.revisions.delete
     *
     * @desc Permanently deletes a revision. This method is only applicable to files with binary content in Drive.
     *
     * @alias drive.revisions.delete
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.fileId The ID of the file.
     * @param {string} params.revisionId The ID of the revision.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    delete: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/revisions/{revisionId}',
          method: 'DELETE'
        },
        params: params,
        requiredParams: ['fileId', 'revisionId'],
        pathParams: ['fileId', 'revisionId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.revisions.get
     *
     * @desc Gets a revision's metadata or content by ID.
     *
     * @alias drive.revisions.get
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {boolean=} params.acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
     * @param {string} params.fileId The ID of the file.
     * @param {string} params.revisionId The ID of the revision.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    get: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/revisions/{revisionId}',
          method: 'GET'
        },
        params: params,
        requiredParams: ['fileId', 'revisionId'],
        pathParams: ['fileId', 'revisionId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.revisions.list
     *
     * @desc Lists a file's revisions.
     *
     * @alias drive.revisions.list
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.fileId The ID of the file.
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    list: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/revisions',
          method: 'GET'
        },
        params: params,
        requiredParams: ['fileId'],
        pathParams: ['fileId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    },

    /**
     * drive.revisions.update
     *
     * @desc Updates a revision with patch semantics.
     *
     * @alias drive.revisions.update
     * @memberOf! drive(v3)
     *
     * @param {object} params Parameters for request
     * @param {string} params.fileId The ID of the file.
     * @param {string} params.revisionId The ID of the revision.
     * @param {object} params.resource Request body data
     * @param {callback} callback The callback that handles the response.
     * @return {object} Request object
     */
    update: function (params, callback) {
      var parameters = {
        options: {
          url: 'https://www.googleapis.com/drive/v3/files/{fileId}/revisions/{revisionId}',
          method: 'PATCH'
        },
        params: params,
        requiredParams: ['fileId', 'revisionId'],
        pathParams: ['fileId', 'revisionId'],
        context: self
      };

      return createAPIRequest(parameters, callback);
    }

  };
}

module.exports = Drive;


text:
require_relative './adequate_json/version'
require_relative './adequate_json/adequate_json.rb'


text:
@extends('layouts.app')

@section('content')

Edit Boy CSS

            <?php
            echo file_get_contents('./css/boy.css', true);
            ?>

        <button id="css-save" class="btn btn-primary">Update</button>

@endsection


text:
/**
 * Helper functions
 */
function p2rho(p)
{
	return 1.2230948554874 * p;
}

function terminal_v(params, m)
{
	return Math.sqrt(2.0*m*params.bodyGravity/(p2rho(params.bodyPressure) * 0.008*m * params.craftDrag));
}

function newChart(axis)
{
	var chart = nv.models.lineChart();
	chart.useInteractiveGuideline(true).transitionDuration(350);
	chart.showLegend(true).showXAxis(true).showYAxis(true);
	chart.xAxis.axisLabel(axis.x.label).tickFormat(d3.format(axis.x.fmt));
	chart.yAxis.axisLabel(axis.y.label).tickFormat(d3.format(axis.y.fmt));

	return chart;
}

/**
 * Simulation functions
 */
function calculateForces(params)
{
	var NUM_POINTS = 100;
	var fuel_mass = params.craftTotalMass - params.craftDryMass;
	var rho = p2rho(params.bodyPressure);
	var v_surface = 0.0;

	var thrust_data = [], weight_data = [], drag_data = [], total_data = [];
	for (var i = 0; i <= NUM_POINTS; ++i)
	{
		var m = params.craftDryMass + fuel_mass*(i/NUM_POINTS);

		var f_t = params.engineThrust;
		var f_w = m * params.bodyGravity;
		var f_d = 0.5 * rho * Math.pow(v_surface, 2) * params.craftDrag * 0.008*m;

		thrust_data.push({ x: m, y: f_t });
		weight_data.push({ x: m, y: f_w });
		drag_data.push({   x: m, y: f_d });
		total_data.push({  x: m, y: f_t - f_w - f_d });
	}

	return {
		thrust: { values: thrust_data, key: "Thrust",    color: "#43459d" },
		weight: { values: weight_data, key: "Weight",    color: "#572a1a" },
		drag:   { values: drag_data,   key: "Drag",      color: "#e49307" },
		total:  { values: total_data,  key: "Net force", color: "#d3362d" }
	};
}

function getNetForce(T, g, m, v, rho, c_d)
{
	return T - m*g - 0.5*rho*Math.pow(v, 2)*c_d*(0.008*m);
}

function calculateSpeedAndHeight(params)
{
	// this is completely wrong; hacked together to test NVD3.js

	var MAX_NUM_POINTS = 2000;
	var DT = 0.2;
	var stats = { dry: params.craftDryMass, fuel: params.craftTotalMass - params.craftDryMass, h: 0.0, v: 0.0 };
	var speed_data = [ { x: 0.0, y: 0.0 }], height_data = [ { x: 0.0, y: 0.0 } ];

	var i;
	for (i = 1; i < MAX_NUM_POINTS && (stats.h > 0 || i <= 2); ++i)
	{
		var t = i*DT;
		var a = getNetForce(stats.fuel > 0 ? params.engineThrust : 0, params.bodyGravity, stats.dry + stats.fuel, stats.v, p2rho(params.bodyPressure), params.craftDrag)/(stats.dry + stats.fuel);

		stats.h = Math.max(0, stats.h + stats.v*DT);
		stats.v = Math.max(-terminal_v(params, stats.dry + stats.fuel), stats.v + a*DT);
		if (stats.h == 0 && stats.v < 0) stats.v = 0;
		stats.fuel = Math.max(0, stats.fuel - params.engineFuelDot*1e-3*DT);

		height_data.push({ x: t, y: stats.h });
		speed_data.push({ x: t, y: stats.v });
	}

	for (var j = 0; j < Math.max(3, i*0.05); ++j)
	{
		height_data.push({ x: (i+j)*DT, y: 0 });
		speed_data.push({ x: (i+j)*DT, y: 0 });
	}

	return {
		height: { values: height_data, key: "Height", color: "#e49307" },
		speed: { values: speed_data, key: "Speed", color: "#43459d" }
	};
}

function getSimulationData(params)
{
	var foo = calculateSpeedAndHeight(params);
	return { forces: calculateForces(params), speed: foo.speed, height: foo.height };
}

/**
 * Ready callback
 */
$(function() {
	// Initialize charts
	var forceChart = newChart({ x: { label: "Mass (t)", fmt: ",.2f" }, y: { label: "Force (kN)", fmt: ",.1f" } });
	var speedChart = newChart({ x: { label: "Time (s)", fmt: ",.1f" }, y: { label: "Speed (m/s)", fmt: ",.2f" } });
	var heightChart = newChart({ x: { label: "Time (s)", fmt: ",.2f" }, y: { label: "Height (m)", fmt: ",.2f" } });

	nv.addGraph(function() { d3.select("#forceChart").append("svg").datum([]).call(forceChart); return forceChart; });
	nv.addGraph(function() { d3.select("#speedChart").append("svg").datum([]).call(speedChart); return speedChart; });
	nv.addGraph(function() { d3.select("#heightChart").append("svg").datum([]).call(heightChart); return heightChart; });

	nv.utils.windowResize(function() {
		forceChart.update();
		speedChart.update();
		heightChart.update();
	});

	// Register callbacks
	$("#updateCharts").click(function() {
		var params = {};
		$("#simParams input").each(function() { params[this.id] = parseFloat(this.value); });

		forceChart.forceX([params.craftDryMass, params.craftTotalMass]);

		var d = getSimulationData(params);
		d3.select("#forceChart svg").datum([d.forces.thrust, d.forces.weight, d.forces.drag, d.forces.total]).call(forceChart);
		d3.select("#speedChart svg").datum([d.speed]).call(speedChart);
		d3.select("#heightChart svg").datum([d.height]).call(heightChart);
	});
});


text:
body {
  display: flex;
  flex-direction: column;
  background: #000;
}
#heading {
  flex: 0 0 auto;
  padding: 10px 0;
  height: calc( 20pt + ( 2 * 13px ) );
}

#titlewrapper {
  position: relative;
  height: calc( 20pt + ( 2 * 13px ) );
  width: 350px;
  display: inline-block;
}

#heading input.title {
  color: #ddd;
  font-family: sans-serif;
  font-weight: lighter;
  margin: 0;
  font-size: 20pt;
  background: transparent;
  border: 1px solid #333;
  padding: 10px;
  position: absolute;
  box-sizing: border-box;
  height: inherit;
  width: 350px;
  transition: .2s background;
}

#titlewrapper:hover #title-disabled {
  background: #333;
}

#heading input#title-disabled {
  color: #999;
}

#buttons {
  display: inline-block;
  position: relative;;
  top: -10px;
}

.menubutton {
  display: inline-block;
  position: relative;
}
.menuwrapper {
  display: inline-block;
  width: 0;
  height: 0;
  position: absolute;
  z-index: 4;
  bottom: 0;
  left: 0;
}
.menu {
  background: #999;
  border-radius: 5px;
  min-width: 200px;
  padding: 0;
  font-family: sans-serif;
  color: #333;
  display: inline-block;
  position: relative;
  margin-top: 10px;
  visibility: hidden;
  opacity: 0;
  transition: .2s opacity, 0s .2s visibility;
}
.menubutton.open .menu {
  visibility: visible;
  opacity: 1;
  transition: .2s opacity;
}
.menu::before {
  content: '';
  background: inherit;
  width: 8px;
  height: 8px;
  position: absolute;
  transform: rotate(45deg);
  left: 23px;
  top: calc( ( -8px * .707 ) + 1px );
}
.menu li {
  padding: 7px;
  list-style-type: none;
  position: relative;
  cursor: default;
  white-space: nowrap;
}
.menu li:first-child {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}
.menu li:last-child {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}
.menu li:hover {
  background: #ddd;
}
.menu li img {
  width: 15px;
  margin-right: 5px;
  vertical-align: middle;
}
.menu li span {
  color: #666;
}

.menu li.openFile {
  background: rgba(134, 134, 204, 0.8);
  color: #666;
}

.button {
  background: #999;
  padding: 7px;
  display: inline-block;
  border-radius: 100%;
  margin-left: 10px;
  transition: .2s background;
}
.button:hover {
  background: #ddd;
}

.button > img {
  width: 25px;
}

#savestatus {
  display: inline-block;
  color: #999;
  font-family: sans-serif;
  font-size: 10pt;
  position: relative;
  top: -18px;
  margin-left: 10px;
}

#editor {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  background: #333;
  color: #ddd;
  font-family: monospace;
  border: 1px solid #ddd;
  padding: 10px;
  counter-reset: lines;
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none; /* Chrome/Safari/Opera */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
  user-select: none;
  position: relative;
}
.line {
  outline: none;
  flex: 0 0 auto;
  display: flex;
}
.line::before {
  flex: 0 0 auto;
  text-align: right;
  padding-right: 10px;
  border-right: 1px solid gray;
  margin-right: 10px;
  color: gray;
  counter-increment: lines;
  content: counters(lines, "");
  transition: width .6s;
  overflow: hidden;
  white-space: nowrap;
}
.linecontent {
  flex: 1 1 auto;
  margin-bottom: auto;
  min-height: 1em;
  word-break: break-all;
  white-space: pre;
}
.line:hover .linecontent {
  background: rgba(100,100,100,.3);
}
.line:last-child {
  flex: 1 0 auto;
}
.char.select {
  background: rgba(134, 134, 204, 0.6);
}
.caret {
  display: inline-block;
  width: 0;
  height: 0;
  vertical-align: text-top;
}
.caret-blinker {
  animation: 1s caret infinite step-end;
  background: #ddd;
  height: 1em;
  width: 1px;
}

#editor.command .caret-blinker {
  background: #999;
  animation: none;
}

@keyframes caret {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

#commandcontainer {
  visibility: hidden;
  opacity: 0;
  transition: .2s opacity, 0s .2s visibility;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: rgba(40,40,40,.5);
  text-align: center;
}

#editor.command #commandcontainer {
  visibility: visible;
  opacity: 1;
  transition: .2s opacity;
}

#commandinput {
  display: inline-block;
  margin-top: 150px;
  border: 1px solid rgba(134, 134, 204, 0.6);
  padding: 10px;
  border-radius: 5px;
  font-size: 20pt;
  background: rgba(100,100,100,.5);
  box-shadow: 0 0 5px 0px rgba(134, 134, 204, 0.6) inset;
  color: rgba(134, 134, 204, 0.8);
  height: 1em;
  white-space: pre;
}


text:
haxby::core::modes::register reload
haxby::modes::help::register "reload: re-initialize database and attempt to save existing data"

function haxby::modes::reload {
    haxby::modes::init-cluster reload
    haxby::modes::schema load reload
}


text:
using ::tensorflow::strings::Scanner;
using ::tensorflow::strings::StrCat;

namespace tensorflow {

string ProtoDebugString(
    const ::tensorflow::CostGraphDef_Node_InputInfo& msg) {
  string s;
  ::tensorflow::strings::ProtoTextOutput o(&s, false);
  internal::AppendProtoDebugString(&o, msg);
  o.CloseTopMessage();
  return s;
}

string ProtoShortDebugString(
    const ::tensorflow::CostGraphDef_Node_InputInfo& msg) {
  string s;
  ::tensorflow::strings::ProtoTextOutput o(&s, true);
  internal::AppendProtoDebugString(&o, msg);
  o.CloseTopMessage();
  return s;
}

namespace internal {

void AppendProtoDebugString(
    ::tensorflow::strings::ProtoTextOutput* o,
    const ::tensorflow::CostGraphDef_Node_InputInfo& msg) {
  o->AppendNumericIfNotZero("preceding_node", msg.preceding_node());
  o->AppendNumericIfNotZero("preceding_port", msg.preceding_port());
}

}  // namespace internal

bool ProtoParseFromString(
    const string& s,
    ::tensorflow::CostGraphDef_Node_InputInfo* msg) {
  msg->Clear();
  Scanner scanner(s);
  if (!internal::ProtoParseFromScanner(&scanner, false, false, msg)) return false;
  scanner.Eos();
  return scanner.GetResult();
}

namespace internal {

bool ProtoParseFromScanner(
    ::tensorflow::strings::Scanner* scanner, bool nested, bool close_curly,
    ::tensorflow::CostGraphDef_Node_InputInfo* msg) {
  std::vector<bool> has_seen(2, false);
  while(true) {
    ProtoSpaceAndComments(scanner);
    if (nested && (scanner->Peek() == (close_curly ? '}' : '>'))) {
      scanner->One(Scanner::ALL);
      ProtoSpaceAndComments(scanner);
      return true;
    }
    if (!nested && scanner->empty()) { return true; }
    scanner->RestartCapture()
        .Many(Scanner::LETTER_DIGIT_UNDERSCORE)
        .StopCapture();
    StringPiece identifier;
    if (!scanner->GetResult(nullptr, &identifier)) return false;
    bool parsed_colon = false;
    ProtoSpaceAndComments(scanner);
    if (scanner->Peek() == ':') {
      parsed_colon = true;
      scanner->One(Scanner::ALL);
      ProtoSpaceAndComments(scanner);
    }
    if (identifier == "preceding_node") {
      if (has_seen[0]) return false;
      has_seen[0] = true;
      int32 value;
      if (!parsed_colon || !::tensorflow::strings::ProtoParseNumericFromScanner(scanner, &value)) return false;
      msg->set_preceding_node(value);
    }
    else if (identifier == "preceding_port") {
      if (has_seen[1]) return false;
      has_seen[1] = true;
      int32 value;
      if (!parsed_colon || !::tensorflow::strings::ProtoParseNumericFromScanner(scanner, &value)) return false;
      msg->set_preceding_port(value);
    }
  }
}

}  // namespace internal

string ProtoDebugString(
    const ::tensorflow::CostGraphDef_Node_OutputInfo& msg) {
  string s;
  ::tensorflow::strings::ProtoTextOutput o(&s, false);
  internal::AppendProtoDebugString(&o, msg);
  o.CloseTopMessage();
  return s;
}

string ProtoShortDebugString(
    const ::tensorflow::CostGraphDef_Node_OutputInfo& msg) {
  string s;
  ::tensorflow::strings::ProtoTextOutput o(&s, true);
  internal::AppendProtoDebugString(&o, msg);
  o.CloseTopMessage();
  return s;
}

namespace internal {

void AppendProtoDebugString(
    ::tensorflow::strings::ProtoTextOutput* o,
    const ::tensorflow::CostGraphDef_Node_OutputInfo& msg) {
  o->AppendNumericIfNotZero("size", msg.size());
  o->AppendNumericIfNotZero("alias_input_port", msg.alias_input_port());
}

}  // namespace internal

bool ProtoParseFromString(
    const string& s,
    ::tensorflow::CostGraphDef_Node_OutputInfo* msg) {
  msg->Clear();
  Scanner scanner(s);
  if (!internal::ProtoParseFromScanner(&scanner, false, false, msg)) return false;
  scanner.Eos();
  return scanner.GetResult();
}

namespace internal {

bool ProtoParseFromScanner(
    ::tensorflow::strings::Scanner* scanner, bool nested, bool close_curly,
    ::tensorflow::CostGraphDef_Node_OutputInfo* msg) {
  std::vector<bool> has_seen(2, false);
  while(true) {
    ProtoSpaceAndComments(scanner);
    if (nested && (scanner->Peek() == (close_curly ? '}' : '>'))) {
      scanner->One(Scanner::ALL);
      ProtoSpaceAndComments(scanner);
      return true;
    }
    if (!nested && scanner->empty()) { return true; }
    scanner->RestartCapture()
        .Many(Scanner::LETTER_DIGIT_UNDERSCORE)
        .StopCapture();
    StringPiece identifier;
    if (!scanner->GetResult(nullptr, &identifier)) return false;
    bool parsed_colon = false;
    ProtoSpaceAndComments(scanner);
    if (scanner->Peek() == ':') {
      parsed_colon = true;
      scanner->One(Scanner::ALL);
      ProtoSpaceAndComments(scanner);
    }
    if (identifier == "size") {
      if (has_seen[0]) return false;
      has_seen[0] = true;
      int64 value;
      if (!parsed_colon || !::tensorflow::strings::ProtoParseNumericFromScanner(scanner, &value)) return false;
      msg->set_size(value);
    }
    else if (identifier == "alias_input_port") {
      if (has_seen[1]) return false;
      has_seen[1] = true;
      int64 value;
      if (!parsed_colon || !::tensorflow::strings::ProtoParseNumericFromScanner(scanner, &value)) return false;
      msg->set_alias_input_port(value);
    }
  }
}

}  // namespace internal

string ProtoDebugString(
    const ::tensorflow::CostGraphDef_Node& msg) {
  string s;
  ::tensorflow::strings::ProtoTextOutput o(&s, false);
  internal::AppendProtoDebugString(&o, msg);
  o.CloseTopMessage();
  return s;
}

string ProtoShortDebugString(
    const ::tensorflow::CostGraphDef_Node& msg) {
  string s;
  ::tensorflow::strings::ProtoTextOutput o(&s, true);
  internal::AppendProtoDebugString(&o, msg);
  o.CloseTopMessage();
  return s;
}

namespace internal {

void AppendProtoDebugString(
    ::tensorflow::strings::ProtoTextOutput* o,
    const ::tensorflow::CostGraphDef_Node& msg) {
  o->AppendStringIfNotEmpty("name", ProtobufStringToString(msg.name()));
  o->AppendStringIfNotEmpty("device", ProtobufStringToString(msg.device()));
  o->AppendNumericIfNotZero("id", msg.id());
  for (int i = 0; i < msg.input_info_size(); ++i) {
    o->OpenNestedMessage("input_info");
    ::tensorflow::internal::AppendProtoDebugString(o, msg.input_info(i));
    o->CloseNestedMessage();
  }
  for (int i = 0; i < msg.output_info_size(); ++i) {
    o->OpenNestedMessage("output_info");
    ::tensorflow::internal::AppendProtoDebugString(o, msg.output_info(i));
    o->CloseNestedMessage();
  }
  o->AppendNumericIfNotZero("temporary_memory_size", msg.temporary_memory_size());
  o->AppendBoolIfTrue("is_final", msg.is_final());
  for (int i = 0; i < msg.control_input_size(); ++i) {
    o->AppendNumeric("control_input", msg.control_input(i));
  }
}

}  // namespace internal

bool ProtoParseFromString(
    const string& s,
    ::tensorflow::CostGraphDef_Node* msg) {
  msg->Clear();
  Scanner scanner(s);
  if (!internal::ProtoParseFromScanner(&scanner, false, false, msg)) return false;
  scanner.Eos();
  return scanner.GetResult();
}

namespace internal {

bool ProtoParseFromScanner(
    ::tensorflow::strings::Scanner* scanner, bool nested, bool close_curly,
    ::tensorflow::CostGraphDef_Node* msg) {
  std::vector<bool> has_seen(8, false);
  while(true) {
    ProtoSpaceAndComments(scanner);
    if (nested && (scanner->Peek() == (close_curly ? '}' : '>'))) {
      scanner->One(Scanner::ALL);
      ProtoSpaceAndComments(scanner);
      return true;
    }
    if (!nested && scanner->empty()) { return true; }
    scanner->RestartCapture()
        .Many(Scanner::LETTER_DIGIT_UNDERSCORE)
        .StopCapture();
    StringPiece identifier;
    if (!scanner->GetResult(nullptr, &identifier)) return false;
    bool parsed_colon = false;
    ProtoSpaceAndComments(scanner);
    if (scanner->Peek() == ':') {
      parsed_colon = true;
      scanner->One(Scanner::ALL);
      ProtoSpaceAndComments(scanner);
    }
    if (identifier == "name") {
      if (has_seen[0]) return false;
      has_seen[0] = true;
      string str_value;
      if (!parsed_colon || !::tensorflow::strings::ProtoParseStringLiteralFromScanner(
          scanner, &str_value)) return false;
      SetProtobufStringSwapAllowed(&str_value, msg->mutable_name());
    }
    else if (identifier == "device") {
      if (has_seen[1]) return false;
      has_seen[1] = true;
      string str_value;
      if (!parsed_colon || !::tensorflow::strings::ProtoParseStringLiteralFromScanner(
          scanner, &str_value)) return false;
      SetProtobufStringSwapAllowed(&str_value, msg->mutable_device());
    }
    else if (identifier == "id") {
      if (has_seen[2]) return false;
      has_seen[2] = true;
      int32 value;
      if (!parsed_colon || !::tensorflow::strings::ProtoParseNumericFromScanner(scanner, &value)) return false;
      msg->set_id(value);
    }
    else if (identifier == "input_info") {
      const bool is_list = (scanner->Peek() == '[');
      do {
        if (is_list) {
          scanner->One(Scanner::ALL);
          ProtoSpaceAndComments(scanner);
        }
        const char open_char = scanner->Peek();
        if (open_char != '{' && open_char != '<') return false;
        scanner->One(Scanner::ALL);
        ProtoSpaceAndComments(scanner);
        if (!::tensorflow::internal::ProtoParseFromScanner(
            scanner, true, open_char == '{', msg->add_input_info())) return false;
      } while (is_list && scanner->Peek() == ',');
      if (is_list && !scanner->OneLiteral("]").GetResult()) return false;
    }
    else if (identifier == "output_info") {
      const bool is_list = (scanner->Peek() == '[');
      do {
        if (is_list) {
          scanner->One(Scanner::ALL);
          ProtoSpaceAndComments(scanner);
        }
        const char open_char = scanner->Peek();
        if (open_char != '{' && open_char != '<') return false;
        scanner->One(Scanner::ALL);
        ProtoSpaceAndComments(scanner);
        if (!::tensorflow::internal::ProtoParseFromScanner(
            scanner, true, open_char == '{', msg->add_output_info())) return false;
      } while (is_list && scanner->Peek() == ',');
      if (is_list && !scanner->OneLiteral("]").GetResult()) return false;
    }
    else if (identifier == "temporary_memory_size") {
      if (has_seen[5]) return false;
      has_seen[5] = true;
      int64 value;
      if (!parsed_colon || !::tensorflow::strings::ProtoParseNumericFromScanner(scanner, &value)) return false;
      msg->set_temporary_memory_size(value);
    }
    else if (identifier == "is_final") {
      if (has_seen[6]) return false;
      has_seen[6] = true;
      bool value;
      if (!parsed_colon || !::tensorflow::strings::ProtoParseBoolFromScanner(scanner, &value)) return false;
      msg->set_is_final(value);
    }
    else if (identifier == "control_input") {
      const bool is_list = (scanner->Peek() == '[');
      do {
        if (is_list) {
          scanner->One(Scanner::ALL);
          ProtoSpaceAndComments(scanner);
        }
        int32 value;
        if (!parsed_colon || !::tensorflow::strings::ProtoParseNumericFromScanner(scanner, &value)) return false;
        msg->add_control_input(value);
      } while (is_list && scanner->Peek() == ',');
      if (is_list && !scanner->OneLiteral("]").GetResult()) return false;
    }
  }
}

}  // namespace internal

string ProtoDebugString(
    const ::tensorflow::CostGraphDef& msg) {
  string s;
  ::tensorflow::strings::ProtoTextOutput o(&s, false);
  internal::AppendProtoDebugString(&o, msg);
  o.CloseTopMessage();
  return s;
}

string ProtoShortDebugString(
    const ::tensorflow::CostGraphDef& msg) {
  string s;
  ::tensorflow::strings::ProtoTextOutput o(&s, true);
  internal::AppendProtoDebugString(&o, msg);
  o.CloseTopMessage();
  return s;
}

namespace internal {

void AppendProtoDebugString(
    ::tensorflow::strings::ProtoTextOutput* o,
    const ::tensorflow::CostGraphDef& msg) {
  for (int i = 0; i < msg.node_size(); ++i) {
    o->OpenNestedMessage("node");
    ::tensorflow::internal::AppendProtoDebugString(o, msg.node(i));
    o->CloseNestedMessage();
  }
}

}  // namespace internal

bool ProtoParseFromString(
    const string& s,
    ::tensorflow::CostGraphDef* msg) {
  msg->Clear();
  Scanner scanner(s);
  if (!internal::ProtoParseFromScanner(&scanner, false, false, msg)) return false;
  scanner.Eos();
  return scanner.GetResult();
}

namespace internal {

bool ProtoParseFromScanner(
    ::tensorflow::strings::Scanner* scanner, bool nested, bool close_curly,
    ::tensorflow::CostGraphDef* msg) {
  std::vector<bool> has_seen(1, false);
  while(true) {
    ProtoSpaceAndComments(scanner);
    if (nested && (scanner->Peek() == (close_curly ? '}' : '>'))) {
      scanner->One(Scanner::ALL);
      ProtoSpaceAndComments(scanner);
      return true;
    }
    if (!nested && scanner->empty()) { return true; }
    scanner->RestartCapture()
        .Many(Scanner::LETTER_DIGIT_UNDERSCORE)
        .StopCapture();
    StringPiece identifier;
    if (!scanner->GetResult(nullptr, &identifier)) return false;
    bool parsed_colon = false;
    ProtoSpaceAndComments(scanner);
    if (scanner->Peek() == ':') {
      parsed_colon = true;
      scanner->One(Scanner::ALL);
      ProtoSpaceAndComments(scanner);
    }
    if (identifier == "node") {
      const bool is_list = (scanner->Peek() == '[');
      do {
        if (is_list) {
          scanner->One(Scanner::ALL);
          ProtoSpaceAndComments(scanner);
        }
        const char open_char = scanner->Peek();
        if (open_char != '{' && open_char != '<') return false;
        scanner->One(Scanner::ALL);
        ProtoSpaceAndComments(scanner);
        if (!::tensorflow::internal::ProtoParseFromScanner(
            scanner, true, open_char == '{', msg->add_node())) return false;
      } while (is_list && scanner->Peek() == ',');
      if (is_list && !scanner->OneLiteral("]").GetResult()) return false;
    }
  }
}

}  // namespace internal

}  // namespace tensorflow


text:
\hypertarget{dir_afac61274991793aa7e9133a8f4f291e}{}\section{commands Directory Reference}
\label{dir_afac61274991793aa7e9133a8f4f291e}\index{commands Directory Reference@{commands Directory Reference}}
\subsection*{Files}
\begin{DoxyCompactItemize}
\item
file {\bfseries Daily\+Points.\+php}
\item
file {\bfseries Generate\+A\+P\+I\+Docs.\+php}
\item
file {\bfseries Import\+Census.\+php}
\item
file {\bfseries Normalize\+User\+Data.\+php}
\item
file {\bfseries Read\+Channels.\+php}
\item
file {\bfseries Reset\+Groups.\+php}
\item
file {\bfseries Sync\+Friends\+Data\+Command.\+php}
\item
file {\bfseries Sync\+Friends\+Images\+Command.\+php}
\item
file {\bfseries Sync\+Friends\+Relations\+Command.\+php}
\item
file {\bfseries Sync\+Friends\+To\+Mail\+Chimp.\+php}
\item
file {\bfseries Weekly\+Points.\+php}
\end{DoxyCompactItemize}


text:
"use strict"; // catch errors easier

const github = require("../github.js"); // GitHub wrapper initialization
const newComment = require("./newComment.js"); // create comment

module.exports = exports = function(body, issueNumber, repoName, repoOwner, issueLabelArray) {
  if (!body.match(/"(.*?)"/g)) return; // return if no parameters were specified
  let rejectedLabels = []; // initialize array for rejected labels that don't exist
  let issueLabels = []; // initialize array for labels that won't be removed
  let removedLabels = []; // initialize array for labels that are removed
  issueLabelArray.forEach(issueLabel => issueLabels.push(issueLabel.name)); // add all issue label names to issueLabels
  body.match(/"(.*?)"/g).forEach((label) => { // global regex search for content between double quotes ("")
    if (issueLabels.includes(label.replace(/"/g, ""))) { // check if content between quotes is a label on issue
      issueLabels.splice(issueLabels.indexOf(label.replace(/"/g, "")), 1); // label was specified to be deleted, make sure it doesn't get added back
      removedLabels.push(label);
    } else if (!removedLabels.includes(label)) {
      rejectedLabels.push(label); // specified label doesn't exist and wasn't removed, reject it
    }
  });
  github.issues.replaceAllLabels({ // replace labels without removed labels
    owner: repoOwner,
    repo: repoName,
    number: issueNumber,
    labels: issueLabels
  })
  .catch(console.error)
  .then(() => {
    const rejectedLabelsString = rejectedLabels.join(", "); // joins all elements in rejectedLabels array
    let labelGrammar, doGrammar, wasGrammar; // initialize grammar variables
    if (rejectedLabels.length > 1) { // more than one label (plural)
      labelGrammar = "Labels";
      doGrammar = "do";
      wasGrammar = "were";
    } else if (rejectedLabels.length === 1) { // one label (singular)
      labelGrammar = "Label";
      doGrammar = "does";
      wasGrammar = "was";
    } else return; // no rejected labels
    const rejectedLabelError = `**Error:** ${labelGrammar} ${rejectedLabelsString} ${doGrammar} not exist and ${wasGrammar} thus not removed from this issue.`; // template literal comment
    newComment(repoOwner, repoName, issueNumber, rejectedLabelError); // post error comment
  });
};


text:
/* Input Controller class
*
* Handle the inputs and generates the internal events
*/

#pragma once

#include <map>
#include <boost/filesystem.hpp>

#include "../../globals.h"

#include "../Model/Observer.h"

#include "BaseController.h"
#include "LogController.h"
#include "RenderController.h"

#include "../Model/InputConfig.h"

using namespace std;
using namespace RetroEnd;

namespace RetroEnd
{
	namespace Controller
	{
		struct InputDevice
		{
			string name;
			unsigned long vendor;
			unsigned long product;

			InputDevice(const string & deviceName, unsigned long vendorId, unsigned long productId);
			bool operator==(const InputDevice & b) const;
		};

		class InputController : public BaseController
		{
		public:

			static InputController& getInstance()
			{
				static InputController instance;
				return instance;
			}

			//activation of the controller
			void start();
			void stop();
			void update();

			//starts getting joystick events
			void enableJoystickHandling();
			void disableJoystickHandling();

			//handle inputConfig creation
			void addJoystick(int deviceID);		//deviceID is the Nth joystick in the system
			void delJoystick(int joystickID);	//joystickID is the SDL ID of the opened SDL_Joystick

			//EVENTS
			Model::Observer<int> onControllerAdded;
			Model::Observer<int> onControllerRemoved;
			Model::Observer<Model::InputConfig* > onControllerNeedConfiguration;
			Model::Observer<string> onTextInputReceived;
		protected:

		private:
			//analog to digital value limit
			static const int DEADZONE = 23000;

			bool parseEvent(const SDL_Event& ev);

			void loadDefaultKeyboardConfig();

			std::map<SDL_JoystickID, Model::InputConfig*> mPlayersConfig;

			Model::InputConfig* mKeyboardInputConfig;

			//---Singleton---
			InputController mInstance();

			//private instance costructor for Singleton Controller
			InputController() : mKeyboardInputConfig(NULL) { };
			InputController(InputController const&);// Don't Implement
			void operator=(InputController const&); // Don't implement
			//---Singleton---
		};
	}
}


text:
<?php
__autoloadDB('Db');
class Location extends Db
{
	public function SaveCountry($dataForm)
	{
		global $mySession;
		$db=new Db();
		$chkQry=$db->runQuery("select * from ".COUNTRIES." where country_name='".$dataForm['country_name']."'");
		if($chkQry!="" and count($chkQry)>0)
		{
		return 0;
		}
		else
		{
		$dataInsert['country_name']=$dataForm['country_name'];
		$db->save(COUNTRIES,$dataInsert);
		return 1;
		}
	}
	public function UpdateCountry($dataForm,$countryId)
	{
		global $mySession;
		$db=new Db();
		$chkQry=$db->runQuery("select * from ".COUNTRIES." where country_name='".$dataForm['country_name']."' and country_id!='".$countryId."'");
		if($chkQry!="" and count($chkQry)>0)
		{
		return 0;
		}
		else
		{
		$dataUpdate['country_name']=$dataForm['country_name'];
		$conditionUpdate="country_id='".$countryId."'";
		$db->modify(COUNTRIES,$dataUpdate,$conditionUpdate);
		return 1;
		}
	}
	public function SaveState($dataForm)
	{
		global $mySession;
		$db=new Db();
		$chkQry=$db->runQuery("select * from ".STATE." where state_name='".$dataForm['state_name']."' and country_id = '".$dataForm['country_id']."' ");
		if($chkQry!="" and count($chkQry)>0)
		{
		return 0;
		}
		else
		{
		$dataInsert['country_id']=$dataForm['country_id'];
		$dataInsert['state_name']=$dataForm['state_name'];
		$db->save(STATE,$dataInsert);
		return 1;
		}
	}
	public function UpdateState($dataForm,$stateId)
	{
		global $mySession;
		$db=new Db();
		$chkQry=$db->runQuery("select * from ".STATE." where state_name='".$dataForm['state_name']."' and state_id!='".$stateId."' and country_id = '".$dataForm['country_id']."' ");
		if($chkQry!="" and count($chkQry)>0)
		{
		return 0;
		}
		else
		{
		$dataUpdate['country_id']=$dataForm['country_id'];
		$dataUpdate['state_name']=$dataForm['state_name'];
		$conditionUpdate="state_id='".$stateId."'";
		$db->modify(STATE,$dataUpdate,$conditionUpdate);
		return 1;
		}
	}
	public function SaveCity($dataForm)
	{
		global $mySession;
		$db=new Db();
		$chkQry=$db->runQuery("select * from ".CITIES." where city_name='".$dataForm['city_name']."' and state_id='".$dataForm['state_id']."' ");
		if($chkQry!="" and count($chkQry)>0)
		{
		return 0;
		}
		else
		{
		$dataInsert['country_id']=$dataForm['country_id'];
		$dataInsert['state_id']=$dataForm['state_id'];
		$dataInsert['city_name']=$dataForm['city_name'];
		$db->save(CITIES,$dataInsert);
		return 1;
		}
	}
	public function UpdateCity($dataForm,$cityId)
	{
		global $mySession;
		$db=new Db();
		$chkQry=$db->runQuery("select * from ".CITIES." where city_name='".$dataForm['city_name']."' and city_id!='".$cityId."' and state_id='".$dataForm['state_id']."' ");
		if($chkQry!="" and count($chkQry)>0)
		{
		return 0;
		}
		else
		{
		$dataUpdate['country_id']=$dataForm['country_id'];
		$dataUpdate['state_id']=$dataForm['state_id'];
		$dataUpdate['city_name']=$dataForm['city_name'];
		$conditionUpdate="city_id='".$cityId."'";
		$db->modify(CITIES,$dataUpdate,$conditionUpdate);
		return 1;
		}
	}

	public function SaveSubarea($dataForm)
	{
		global $mySession;
		$db=new Db();
		$chkQry = $db->runQuery("select * from ".SUB_AREA." where sub_area_name = '".trim($dataForm['sub_area_name'])."' and city_id = '".$dataForm['city_name']."' ");
		if($chkQry!="" and count($chkQry)>0)
		{
			return 0;
		}
		else
		{

			//$dataInsert['country_id']=$dataForm['country_id'];
			//$dataInsert['state_id']=$dataForm['state_id'];
			$dataInsert['city_id'] = $dataForm['city_name'];
			$dataInsert['sub_area_name'] = $dataForm['sub_area_name'];
			$db->save(SUB_AREA,$dataInsert);
			return 1;
		}
	}
	public function UpdateSubarea($dataForm,$sId)
	{
		global $mySession;
		$db=new Db();
		$chkQry = $db->runQuery("select * from ".SUB_AREA." where sub_area_name='".trim($dataForm['sub_area_name'])."' and sub_area_id != '".$sId."' and city_id = '".$dataForm['city_name']."' ");
		if($chkQry!="" and count($chkQry)>0)
		{
			return 0;
		}
		else
		{
			//$dataUpdate['country_id']=$dataForm['country_id'];
			//$dataUpdate['state_id']=$dataForm['state_id'];
			$dataUpdate['city_id'] = $dataForm['city_name'];
			$dataUpdate['sub_area_name'] = $dataForm['sub_area_name'];
			$conditionUpdate="sub_area_id='".$sId."'";
			$db->modify(SUB_AREA,$dataUpdate,$conditionUpdate);
			return 1;
		}
	}
	public function SaveLocalarea($dataForm)
	{
		global $mySession;
		$db=new Db();
		$chkQry = $db->runQuery("select * from ".LOCAL_AREA." where local_area_name = '".trim($dataForm['local_area_name'])."' and sub_area_id = '".$dataForm['sub_area_name']."' ");
		if($chkQry!="" and count($chkQry)>0)
		{
			return 0;
		}
		else
		{
			$dataInsert['local_area_name'] = $dataForm['local_area_name'];
			$dataInsert['sub_area_id'] = $dataForm['sub_area_name'];
			$db->save(LOCAL_AREA,$dataInsert);
			return 1;
		}
	}
	public function UpdateLocalarea($dataForm,$lId)
	{
		global $mySession;
		$db=new Db();
		$chkQry = $db->runQuery("select * from ".LOCAL_AREA." where local_area_name='".trim($dataForm['local_area_name'])."' and local_area_id != '".$lId."' and sub_area_id = '".$dataForm['sub_area_name']."' ");
		if($chkQry!="" and count($chkQry)>0)
		{
			return 0;
		}
		else
		{
			$dataUpdate['sub_area_id'] = $dataForm['sub_area_name'];
			$dataUpdate['local_area_name'] = $dataForm['local_area_name'];
			$conditionUpdate="local_area_id='".$lId."'";
			$db->modify(LOCAL_AREA,$dataUpdate,$conditionUpdate);
			return 1;
		}
	}
}
?>


text:
from twisted.internet import reactor
from twisted.internet.protocol import Protocol, ClientFactory

class SimpleClient(Protocol):
	def connectionMade(self):
		self.transport.write('Conexion Establecida!!')

	def dataReceived(self, data):
		print 'Server Said: ', data
		self.transport.loseConnection()

	def connectionLost(self, reason):
		print 'Connection Lost %s ' %(reason)

class SimpleClientFactory(ClientFactory):
	protocol = SimpleClient

	def clientConnectionFailed(self, connector, reason):
		print 'Connection Failed!!'
		reactor.stop()

	def clientConnectionLost(self, connector, reason):
		print 'Connection Lost'
		reactor.stop()

reactor.connectTCP('localhost', 8000, SimpleClientFactory())
reactor.run()


text:
define([
    'ol',
    'd3'
], function (ol, d3) {

    var voronoilayerbuilder = {};

    voronoilayerbuilder.VoronoiLayerBuilder = function () {
        this.extent = undefined;
        this.seedCoords = undefined;
    };

    voronoilayerbuilder.VoronoiLayerBuilder.prototype.setExtent = function (extent) {
        this.extent = this.formatExtent(extent);
        return this;
    };

    voronoilayerbuilder.VoronoiLayerBuilder.prototype.setSeedCoords = function (seedCoords) {
        this.seedCoords = seedCoords;
        return this;
    };

    voronoilayerbuilder.VoronoiLayerBuilder.prototype.getExtent = function () {
        var extent = {
            x: {min: this.seedCoords[0][0], max: this.seedCoords[0][0]},
            y: {min: this.seedCoords[0][1], max: this.seedCoords[0][1]}
        };
        this.seedCoords.forEach(function (s) {
            extent.x.min = Math.min(extent.x.min, s[0]);
            extent.x.min = Math.max(extent.x.max, s[0]);
            extent.y.min = Math.min(extent.y.min, s[1]);
            extent.y.min = Math.max(extent.y.max, s[1]);
        });
        return extent;
    };

    voronoilayerbuilder.VoronoiLayerBuilder.prototype.formatExtent = function (olExtentObj) {
        // olExtentObj = [minx, miny, maxx, maxy]
        return {
            x: {max: olExtentObj[2], min: olExtentObj[0], dif: (olExtentObj[2] - olExtentObj[0])},
            y: {max: olExtentObj[3], min: olExtentObj[1], dif: (olExtentObj[3] - olExtentObj[1])}
        };
    };

    voronoilayerbuilder.VoronoiLayerBuilder.prototype.createVoronoi = function () {
        return d3.geom.voronoi()
                .clipExtent([
                    [this.extent.x.min - 1, this.extent.y.min - 1],
                    [this.extent.x.max + 1, this.extent.y.max + 1]
                ])
                .x(function (d) {return d.coord[0]; })
                .y(function (d) {return d.coord[1]; })
        (this.seedCoords);
    };

    voronoilayerbuilder.VoronoiLayerBuilder.prototype.buildPointVectorLayer = function () {
        var features = [],
            vectorSource,
            fill,
            stroke,
            styles;
        this.seedCoords.forEach(function (obj) {
            var feature = new ol.Feature({
                geometry: new ol.geom.Point(obj.coord),
                data: obj
            });
            features.push(feature);
        });

        fill = new ol.style.Fill({
            color: 'rgba(0,0,0,0.2)'//'rgba(230,230,230,0.6)'
        });
        stroke = new ol.style.Stroke({
            color: 'rgba(255,255,255, 0.6)',
            width: 8
        });
        styles = [
            new ol.style.Style({
                image: new ol.style.Circle({
                    fill: fill,
                    stroke: stroke,
                    radius: 4
                })
            })
        ];

        vectorSource = new ol.source.Vector({features: features});

        return new ol.layer.Vector({source: vectorSource, style: styles});

    };

    voronoilayerbuilder.VoronoiLayerBuilder.prototype.createPolygonStyleFunction = function () {
        var styles = {'max': undefined, 'med': undefined, 'min': undefined},
            styleAttrs = {
                'max': {opacity: 0.7, 'width': 5},
                'med': {opacity: 0.5, 'width': 4},
                'min': {opacity: 0.3, 'width': 3}
            };

        Object.keys(styleAttrs).forEach(function (key) {
            styles[key] = new ol.style.Style({
                fill: new ol.style.Fill({
                    color: 'rgba(255,255,255,0.0)'
                }),
                stroke: new ol.style.Stroke({
                    color: 'rgba(255,255,255,' + styleAttrs[key].opacity  + ')',
                    width: styleAttrs[key].width
                })
            });
        });

        return function (feature) {
            return [styles[feature.get('highlightLevel')]];
        };
    };

    voronoilayerbuilder.VoronoiLayerBuilder.prototype.buildPolygonVectorLayer = function () {
        var voronoi = this.createVoronoi(),
            features = [],
            vectorSource;
        voronoi.forEach(function (polyPoints, i) {
            var feature = new ol.Feature({
                    geometry: new ol.geom.Polygon([polyPoints]),
                    data: polyPoints.point,
                    highlightLevel: 'med'
                });
            features.push(feature);
        });
        vectorSource = new ol.source.Vector({features: features});

        return new ol.layer.Vector({source: vectorSource, style: this.createPolygonStyleFunction()});

    };

    return voronoilayerbuilder;
});


text:
import { Component } from '@angular/core';
import { TexBlobService } from '../../tex-blob/services/tex-blob.service';

@Component({
	selector: 'text-editor-home',
	templateUrl: './text-editor-home.component.html',
	styleUrls: ['./text-editor-home.component.css']
})

export class TextEditorHomeComponent {
	userTex: string;

	constructor(private texBlobService: TexBlobService) {}

	setUserTex(userTex: string): void {
		this.texBlobService.setUserTex(userTex);
	}

	placeholderTex = `Soient $n$ dans $\\mathbb{N}^*$,
$a_1,\\ldots,a_n,b_1,\\ldots,b_n$ des réels. Montrer que :
$$\\left\\lvert\\sum_{i=1}^{n}a_{i}b_{i}\\right\\rvert
\\leq\\sqrt{\\sum_{i=1}^{n}a_i^2}\\sqrt{\\sum_{i=1}^{n}b_i^2}$$`;
}


text:
package org.spoofax.interpreter.library.ssl;

import org.spoofax.interpreter.core.IContext;
import org.spoofax.interpreter.core.InterpreterException;
import org.spoofax.interpreter.library.AbstractPrimitive;
import org.spoofax.interpreter.stratego.Strategy;
import org.spoofax.interpreter.terms.IStrategoReal;
import org.spoofax.interpreter.terms.IStrategoTerm;
import org.spoofax.terms.util.TermUtils;

public class SSL_subtr extends AbstractPrimitive {

    protected SSL_subtr() {
        super("SSL_subtr", 0, 2);
    }

    @Override
    public boolean call(IContext env, Strategy[] svars, IStrategoTerm[] tvars) throws InterpreterException {

        if(!TermUtils.isReal(tvars[0]))
            return false;
        if(!TermUtils.isReal(tvars[1]))
            return false;

        IStrategoReal a = (IStrategoReal) tvars[0];
        IStrategoReal b = (IStrategoReal) tvars[1];
        env.setCurrent(env.getFactory().makeReal(a.realValue() - b.realValue()));
        return true;
    }
}


text:
    <search-bar></search-bar>

      <img ng-src="<[noExplorationsImgUrl]>" alt="No explorations found">

  <activity-tiles-infinity-grid></activity-tiles-infinity-grid>