text:
[CmdletBinding()]
param()

. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1
. $PSScriptRoot\MockVariable.ps1

#path to Utility.ps1 for SqlAzureDacpacDeployment task
. "$PSScriptRoot\..\Utility.ps1"

Register-Mock Add-AzureSqlDatabaseServerFirewallRule { throw "IPAddress mentioned is not a valid IPv4 address." } -ParametersEvaluator { $startIPAddress -eq $outOfRangeIPAddress }
Register-Mock Add-AzureSqlDatabaseServerFirewallRule { throw "Sql Database Server: '$invalidAzureSqlServerName' not found."} -ParametersEvaluator { $serverName -eq $invalidAzureSqlServerName }

Assert-Throws {
    Create-AzureSqlDatabaseServerFirewallRule -startIp $outOfRangeIPAddress -endIP $endIP -serverName $azureSqlServerName -endpoint $spnEndpoint
} -MessagePattern "IPAddress mentioned is not a valid IPv4 address."

Assert-Throws {
    Create-AzureSqlDatabaseServerFirewallRule -startIp $startIP -endIP $endIP -serverName $invalidAzureSqlServerName -endpoint $spnEndpoint
} -MessagePattern "Sql Database Server: '$invalidAzureSqlServerName' not found."

Register-Mock Add-AzureSqlDatabaseServerFirewallRule {
    $azureSqlDatabaseServerFirewallRule = @{ };
    $azureSqlDatabaseServerFirewallRule.RuleName = "RuleName";
    $azureSqlDatabaseServerFirewallRule.IsConfigured = $true;
    return $azureSqlDatabaseServerFirewallRule;
}  -ParametersEvaluator { $endpoint.Auth.Scheme -eq  $spnAuth.Scheme }

$azureSqlDatabaseServerFirewallRule = Create-AzureSqlDatabaseServerFirewallRule -startIp $startIP -endIP $endIP -serverName $azureSqlServerName -endpoint $spnEndpoint

Assert-IsNotNullOrEmpty $azureSqlDatabaseServerFirewallRule "Firewall Rule - certificate end point cannot be null"
Assert-IsNotNullOrEmpty $azureSqlDatabaseServerFirewallRule.RuleName "Firewall Rule - username end point 'Rule Name' cannot be null"
Assert-AreEqual $true $azureSqlDatabaseServerFirewallRule.IsConfigured


text:
<?php

namespace DatabaseLog;

use Cake\Core\BasePlugin;
use Cake\Routing\RouteBuilder;

/**
 * Plugin for DatabaseLog
 */
class Plugin extends BasePlugin {

	/**
	 * @var bool
	 */
	protected $middlewareEnabled = false;

	/**
	 * @param \Cake\Routing\RouteBuilder $routes The route builder to update.
	 * @return void
	 */
	public function routes(RouteBuilder $routes): void {
		$routes->prefix('Admin', function (RouteBuilder $routes) {
			$routes->plugin('DatabaseLog', ['path' => '/database-log'], function (RouteBuilder $routes) {
				$routes->connect('/', ['controller' => 'DatabaseLog', 'action' => 'index']);

				$routes->fallbacks();
			});
		});
	}

}

redpajama_set_name: RedPajamaGithub


text:
package com.microsoft.azure.management.mediaservices.v2018_07_01;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Class to specify which protocols are enabled.
 */
public class EnabledProtocols {
    /**
     * Enable Download protocol or not.
     */
    @JsonProperty(value = "download", required = true)
    private boolean download;

    /**
     * Enable DASH protocol or not.
     */
    @JsonProperty(value = "dash", required = true)
    private boolean dash;

    /**
     * Enable HLS protocol or not.
     */
    @JsonProperty(value = "hls", required = true)
    private boolean hls;

    /**
     * Enable SmoothStreaming protocol or not.
     */
    @JsonProperty(value = "smoothStreaming", required = true)
    private boolean smoothStreaming;

    /**
     * Get enable Download protocol or not.
     *
     * @return the download value
     */
    public boolean download() {
        return this.download;
    }

    /**
     * Set enable Download protocol or not.
     *
     * @param download the download value to set
     * @return the EnabledProtocols object itself.
     */
    public EnabledProtocols withDownload(boolean download) {
        this.download = download;
        return this;
    }

    /**
     * Get enable DASH protocol or not.
     *
     * @return the dash value
     */
    public boolean dash() {
        return this.dash;
    }

    /**
     * Set enable DASH protocol or not.
     *
     * @param dash the dash value to set
     * @return the EnabledProtocols object itself.
     */
    public EnabledProtocols withDash(boolean dash) {
        this.dash = dash;
        return this;
    }

    /**
     * Get enable HLS protocol or not.
     *
     * @return the hls value
     */
    public boolean hls() {
        return this.hls;
    }

    /**
     * Set enable HLS protocol or not.
     *
     * @param hls the hls value to set
     * @return the EnabledProtocols object itself.
     */
    public EnabledProtocols withHls(boolean hls) {
        this.hls = hls;
        return this;
    }

    /**
     * Get enable SmoothStreaming protocol or not.
     *
     * @return the smoothStreaming value
     */
    public boolean smoothStreaming() {
        return this.smoothStreaming;
    }

    /**
     * Set enable SmoothStreaming protocol or not.
     *
     * @param smoothStreaming the smoothStreaming value to set
     * @return the EnabledProtocols object itself.
     */
    public EnabledProtocols withSmoothStreaming(boolean smoothStreaming) {
        this.smoothStreaming = smoothStreaming;
        return this;
    }

}


text:
<project name="Path" default="help">

	<property file="../../build.properties"/>

	<target name="jflextask" unless="jflex.available" description="creates JFlex Ant task">
		<taskdef name="jflex" classname="JFlex.anttask.JFlexTask" classpath="${jflex_jar}"/>
		<property name="jflex.available" value="yes"/>
	</target>

	<target name="beavertask" unless="beaver.available" description="creates Beaver Ant task">
		<taskdef name="beaver" classname="beaver.comp.run.AntTask" classpath="../../lib/beaver.jar"/>
		<property name="beaver.available" value="yes"/>
	</target>

	<target name="help" description="show help message">
		<echo message="Ant build file for Multiple goals example. Useful targets:"/>
		<echo message=""/>
		<echo message="clean:  remove compiled files"/>
		<echo message="make:   compiles the example"/>
	</target>

	<target name="scanner" depends="jflextask" description="generate scanner">
		<jflex file="path.l" nobak="yes"/>
	</target>

	<target name="parser" depends="beavertask" description="generate parser">
		<beaver file="path.g" terminalNames="no" useSwitch="yes"/>
	</target>

	<target name="compile" description="compile all classes">
		<javac srcdir="." destdir=".." includes="*.java" source="1.3" debug="${debug.info}">
			<classpath>
				<pathelement location=".."/>
				<pathelement location="../../lib/beaver-rt.jar"/>
			</classpath>
        </javac>
	</target>

	<target name="make" depends="scanner,parser,compile" description="makes the example"/>

	<target name="clean" description="remove compiled files">
		<delete>
			<fileset dir="." includes="*.class,*.java,*.spec,*.*~" excludes="Run.java"/>
		</delete>
	</target>

</project>


text:
package com.MibacTechnologies.Minecraft.DestroyTheMonument.Utils;

import java.io.Serializable;

import org.bukkit.Location;

/**
 * @author Michał "mibac138" Bączkowski
 * @since Creation date: 31 Jan 2015 (17:12:00)
 */
public class Bounds implements Serializable {
	private static final long serialVersionUID = 1L;
	private final Location location1;
	private final Location location2;
	private final Location[] bounds;

	public Bounds( final Location location1, final Location location2 ) {
		this.location1 = location1;
		this.location2 = location2;
		Location[] bounds = { location1, location2 };
		this.bounds = bounds;
	}

	/**
	 * @return 1st corner
	 */
	public Location getSt ( ) {
		return location1;
	}

	/**
	 * @return 2nd corner
	 */
	public Location getNd ( ) {
		return location2;
	}

	/**
	 * @return bounds (2)
	 */
	public Location[] getBounds ( ) {
		return bounds;
	}
}


text:
function error {
    echo "ERROR: $1"
    echo "Aborting"
    exit $?
}

#Display success messages
function success {
    echo "Success: $1"
}
function createDatabase {
    echo "Creating DATABSE, need some info!"
    echo "Hostname:"
    read DBHOST
    echo "Username:"
    read DBUSER
    echo "Password:"
    read DBPWD
    echo "Database name:"
    read DBNAME
    echo "Creating DB"
    if `mysql -h $DBHOST -u $DBUSER -p$DBPWD -e "CREATE DATABASE $DBNAME"`; then
         success "Database $DBNAME created"
         createConfig $DBNAME $DBUSER $DBPWD $DBHOST
     else
        error "Database creation failed."
     fi
}
function getDatabase {
    echo "I gotta know what your db details are!"
    echo "Creating DATABSE, need some info!"
    echo "NBNBNBNB!!!"
    echo "You NEED to have your MAMP MySQL in path for this to work"
    echo "NBNBNBNB!!!"
    echo "Hostname:"
    read DBHOST
    echo "Username:"
    read DBUSER
    echo "Password:"
    read DBPWD
    echo "Database name:"
    read DBNAME
    createConfig $DBNAME $DBUSER $DBPWD $DBHOST
}

function createConfig {
echo ">>>>>Creating wp-config"
echo `wp core config --dbname=$1 --dbuser=$2 --dbpass=$3 --dbhost=$4 --locale=nb_NO`
}

#Show a spinner after long running processes
#Usage: "(long-running-command) & spinner $!""
spinner()
{
    local pid=$1
    local delay=0.75
    local spinstr='|/-\'
    while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
        local temp=${spinstr#?}
        printf " [%c]  " "$spinstr"
        local spinstr=$temp${spinstr%"$temp"}
        sleep $delay
        printf "\b\b\b\b\b\b"
    done
    printf "    \b\b\b\b"
}

#####################
#   wp-cli config   #
#####################

#Test if WP CLI is installed
if `wp > /dev/null`; then
    echo "Ready to go!"
else
    error "WP CLI needs to be installed and configured from http://wp-cli.org/"
fi
echo "path: `pwd`" > "wp-cli.local.yml"

#Create wp cli config from user input
echo "Give me the title of the website!"
read TITLE
echo "Title is set to: $TITLE!"
#write to and create config
echo "title: $TITLE" >> "wp-cli.local.yml"

echo "Present to me the url that shall be used! (http://localhost:8000)"
read URL
echo "Url set to $URL!"
#write to config
echo "url: $URL" >> "wp-cli.local.yml"

echo "Your (user)name mortal?!"
read USER
echo "Username set to $USER!"
#write to config
echo "user: $USER" >> "wp-cli.local.yml"

echo "Your Password?!"
read PWD

echo "Electronic mail address if you please:"
read ADMMAIl

#####################
#   Wordpress core  #
#####################

#download latest wordpress in norwegian
echo "Downloading and installing wordpress - norwegian"
echo ">>>>Downloading"
echo `wp core download --locale=nb_NO`

echo ">>>>Removing extra themes and plugins"
# Remove themes that are unwanted, keeping one for fallback
`rm -rf wp-content/themes/twentyfourteen`
`rm -rf wp-content/themes/twentythirteen`
# Remove unused plugins
`rm -rf wp-content/plugins/hello.php`
`rm -rf wp-content/plugins/akismet`

echo "#####################"
echo "#   Database setup  #"
echo "#####################"

read -p "Want to set up a new database? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
    then
    createDatabase
else
    getDatabase
fi

echo `wp core install --title=$TITLE --admin_user=$USER --admin_password=$PWD --admin_email=$ADMMAIl`

echo "#####################"
echo "#      Themes       #"
echo "#####################"

#Get riiskit
echo ">>>>Riiskitting the wp install"
echo `wp theme install https://github.com/Chrisriis/riiskit/archive/master.zip`
echo ">>>>Childing the riiskit install"
echo `wp theme install https://github.com/Chrisriis/riiskit-child/archive/master.zip --activate`

#####################
#      Plugins      #
#####################
echo "##################"
echo "# Choose Plugins #"
echo "##################"

read -p "WP Importer? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
    then
    echo "Installing and activating"
    echo `wp plugin install https://downloads.wordpress.org/plugin/wordpress-importer.zip --activate`
fi

read -p ">>>>>Automattic developer?(y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
    then
    echo "Installing and activating"
echo `wp plugin install https://github.com/Automattic/developer/archive/master.zip --activate`
fi

read -p ">>>>>WP-debugbar?(y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
    then
    echo "Installing and activating"
echo `wp plugin install https://github.com/wpplex/wp-debugbar/archive/master.zip --activate`
fi

read -p ">>>>>Log viewer? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
    then
    echo "Installing and activating"
echo `wp plugin install https://downloads.wordpress.org/plugin/log-viewer.zip --activate`
fi

read -p ">>>>>Force regen thumbnails?(y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
    then
    echo "Installing and activating"
echo `wp plugin install https://github.com/wp-plugins/force-regenerate-thumbnails/archive/master.zip --activate`
fi

read -p ">>>>>User switching? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
    then
    echo "Installing and activating"
echo `wp plugin install https://github.com/crowdfavorite-mirrors/wp-user-switching/archive/master.zip --activate`
fi

read -p ">>>>>Yoast? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
    then
    echo "Installing and activating"
echo `wp plugin install https://github.com/Yoast/wordpress-seo/archive/trunk.zip --activate`
fi

echo ">>>>>WP Retina"
read -p "WP Importer? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
    then
    echo "Installing and activating"
echo `wp plugin install https://github.com/wp-plugins/wp-retina-2x/archive/master.zip --activate`
fi

read -p ">>>>>EWWW image optimizer? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
    then
    echo "Installing and activating"
    echo `wp plugin install https://github.com/wp-plugins/ewww-image-optimizer/archive/master.zip --activate`
fi

read -p ">>>>>Duplicate post? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
    then
    echo "Installing and activating"
    echo `wp plugin install https://downloads.wordpress.org/plugin/duplicate-post.zip --activate`
fi

#ACF is a bit harder, but we can do it
read -p ">>>>>ACF PRO? (y/n)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
    then
    echo "Installing and activating"
    # get acf zip file
    echo `wget -O wp-content/plugins/acf-pro.zip "http://connect.advancedcustomfields.com/index.php?p=pro&a=download&k=[your_key]"`
    # install & activate acf
    echo `wp plugin install wp-content/plugins/acf-pro.zip -–activate`
    # remove zip file
    `rm -rf wp-content/plugins/acf-pro.zip`
fi


text:
using System;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.ResourceManager.Sql.Models;

namespace Azure.ResourceManager.Sql
{
    internal partial class MetricDefinitionsRestOperations
    {
        private readonly TelemetryDetails _userAgent;
        private readonly HttpPipeline _pipeline;
        private readonly Uri _endpoint;
        private readonly string _apiVersion;

        /// <summary> Initializes a new instance of MetricDefinitionsRestOperations. </summary>
        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
        /// <param name="applicationId"> The application id to use for user agent. </param>
        /// <param name="endpoint"> server parameter. </param>
        /// <param name="apiVersion"> Api Version. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="pipeline"/> or <paramref name="apiVersion"/> is null. </exception>
        public MetricDefinitionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default)
        {
            _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline));
            _endpoint = endpoint ?? new Uri("https://management.azure.com");
            _apiVersion = apiVersion ?? "2014-04-01";
            _userAgent = new TelemetryDetails(GetType().Assembly, applicationId);
        }

        internal HttpMessage CreateListDatabaseRequest(string subscriptionId, string resourceGroupName, string serverName, string databaseName)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;
            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();
            uri.Reset(_endpoint);
            uri.AppendPath("/subscriptions/", false);
            uri.AppendPath(subscriptionId, true);
            uri.AppendPath("/resourceGroups/", false);
            uri.AppendPath(resourceGroupName, true);
            uri.AppendPath("/providers/Microsoft.Sql/servers/", false);
            uri.AppendPath(serverName, true);
            uri.AppendPath("/databases/", false);
            uri.AppendPath(databaseName, true);
            uri.AppendPath("/metricDefinitions", false);
            uri.AppendQuery("api-version", _apiVersion, true);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            _userAgent.Apply(message);
            return message;
        }

        /// <summary> Returns database metric definitions. </summary>
        /// <param name="subscriptionId"> The subscription ID that identifies an Azure subscription. </param>
        /// <param name="resourceGroupName"> The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. </param>
        /// <param name="serverName"> The name of the server. </param>
        /// <param name="databaseName"> The name of the database. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="subscriptionId"/>, <paramref name="resourceGroupName"/>, <paramref name="serverName"/> or <paramref name="databaseName"/> is null. </exception>
        /// <exception cref="ArgumentException"> <paramref name="subscriptionId"/>, <paramref name="resourceGroupName"/>, <paramref name="serverName"/> or <paramref name="databaseName"/> is an empty string, and was expected to be non-empty. </exception>
        public async Task<Response<MetricDefinitionListResult>> ListDatabaseAsync(string subscriptionId, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
            Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName));
            Argument.AssertNotNullOrEmpty(serverName, nameof(serverName));
            Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName));

            using var message = CreateListDatabaseRequest(subscriptionId, resourceGroupName, serverName, databaseName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        MetricDefinitionListResult value = default;
                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
                        value = MetricDefinitionListResult.DeserializeMetricDefinitionListResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw new RequestFailedException(message.Response);
            }
        }

        /// <summary> Returns database metric definitions. </summary>
        /// <param name="subscriptionId"> The subscription ID that identifies an Azure subscription. </param>
        /// <param name="resourceGroupName"> The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. </param>
        /// <param name="serverName"> The name of the server. </param>
        /// <param name="databaseName"> The name of the database. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="subscriptionId"/>, <paramref name="resourceGroupName"/>, <paramref name="serverName"/> or <paramref name="databaseName"/> is null. </exception>
        /// <exception cref="ArgumentException"> <paramref name="subscriptionId"/>, <paramref name="resourceGroupName"/>, <paramref name="serverName"/> or <paramref name="databaseName"/> is an empty string, and was expected to be non-empty. </exception>
        public Response<MetricDefinitionListResult> ListDatabase(string subscriptionId, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
            Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName));
            Argument.AssertNotNullOrEmpty(serverName, nameof(serverName));
            Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName));

            using var message = CreateListDatabaseRequest(subscriptionId, resourceGroupName, serverName, databaseName);
            _pipeline.Send(message, cancellationToken);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        MetricDefinitionListResult value = default;
                        using var document = JsonDocument.Parse(message.Response.ContentStream);
                        value = MetricDefinitionListResult.DeserializeMetricDefinitionListResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw new RequestFailedException(message.Response);
            }
        }

        internal HttpMessage CreateListElasticPoolRequest(string subscriptionId, string resourceGroupName, string serverName, string elasticPoolName)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;
            request.Method = RequestMethod.Get;
            var uri = new RawRequestUriBuilder();
            uri.Reset(_endpoint);
            uri.AppendPath("/subscriptions/", false);
            uri.AppendPath(subscriptionId, true);
            uri.AppendPath("/resourceGroups/", false);
            uri.AppendPath(resourceGroupName, true);
            uri.AppendPath("/providers/Microsoft.Sql/servers/", false);
            uri.AppendPath(serverName, true);
            uri.AppendPath("/elasticPools/", false);
            uri.AppendPath(elasticPoolName, true);
            uri.AppendPath("/metricDefinitions", false);
            uri.AppendQuery("api-version", _apiVersion, true);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            _userAgent.Apply(message);
            return message;
        }

        /// <summary> Returns elastic pool metric definitions. </summary>
        /// <param name="subscriptionId"> The subscription ID that identifies an Azure subscription. </param>
        /// <param name="resourceGroupName"> The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. </param>
        /// <param name="serverName"> The name of the server. </param>
        /// <param name="elasticPoolName"> The name of the elastic pool. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="subscriptionId"/>, <paramref name="resourceGroupName"/>, <paramref name="serverName"/> or <paramref name="elasticPoolName"/> is null. </exception>
        /// <exception cref="ArgumentException"> <paramref name="subscriptionId"/>, <paramref name="resourceGroupName"/>, <paramref name="serverName"/> or <paramref name="elasticPoolName"/> is an empty string, and was expected to be non-empty. </exception>
        public async Task<Response<MetricDefinitionListResult>> ListElasticPoolAsync(string subscriptionId, string resourceGroupName, string serverName, string elasticPoolName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
            Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName));
            Argument.AssertNotNullOrEmpty(serverName, nameof(serverName));
            Argument.AssertNotNullOrEmpty(elasticPoolName, nameof(elasticPoolName));

            using var message = CreateListElasticPoolRequest(subscriptionId, resourceGroupName, serverName, elasticPoolName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        MetricDefinitionListResult value = default;
                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
                        value = MetricDefinitionListResult.DeserializeMetricDefinitionListResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw new RequestFailedException(message.Response);
            }
        }

        /// <summary> Returns elastic pool metric definitions. </summary>
        /// <param name="subscriptionId"> The subscription ID that identifies an Azure subscription. </param>
        /// <param name="resourceGroupName"> The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. </param>
        /// <param name="serverName"> The name of the server. </param>
        /// <param name="elasticPoolName"> The name of the elastic pool. </param>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="subscriptionId"/>, <paramref name="resourceGroupName"/>, <paramref name="serverName"/> or <paramref name="elasticPoolName"/> is null. </exception>
        /// <exception cref="ArgumentException"> <paramref name="subscriptionId"/>, <paramref name="resourceGroupName"/>, <paramref name="serverName"/> or <paramref name="elasticPoolName"/> is an empty string, and was expected to be non-empty. </exception>
        public Response<MetricDefinitionListResult> ListElasticPool(string subscriptionId, string resourceGroupName, string serverName, string elasticPoolName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
            Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName));
            Argument.AssertNotNullOrEmpty(serverName, nameof(serverName));
            Argument.AssertNotNullOrEmpty(elasticPoolName, nameof(elasticPoolName));

            using var message = CreateListElasticPoolRequest(subscriptionId, resourceGroupName, serverName, elasticPoolName);
            _pipeline.Send(message, cancellationToken);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        MetricDefinitionListResult value = default;
                        using var document = JsonDocument.Parse(message.Response.ContentStream);
                        value = MetricDefinitionListResult.DeserializeMetricDefinitionListResult(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                default:
                    throw new RequestFailedException(message.Response);
            }
        }
    }
}


text:
from nose.tools import eq_

from kitsune.sumo.tests import TestCase
from kitsune.wiki.admin import DocumentAdmin
from kitsune.wiki.models import Document
from kitsune.wiki.tests import document, translated_revision

class ArchiveTests(TestCase):
    """Tests for the archival bit flipping in the admin UI"""

    def test_inheritance(self):
        """Make sure parent/child equality of is_archived is maintained."""
        # Set up a child and a parent and an orphan (all false) and something
        # true.
        translated_revision(save=True)
        translated_revision(save=True)
        document(save=True)
        document(is_archived=True, save=True)

        # Batch-clear the archival bits:
        DocumentAdmin._set_archival(Document.objects.all(), True)

        # Assert the child of the parent and the parent of the child (along
        # with everything else) became (or stayed) true:
        eq_(Document.objects.filter(is_archived=True).count(), 6)
        # We didn't lose any, and they're all true.


text:
using System;

namespace EnterSentials.Framework
{
    public class ActivatorBasedLoggingSinkFactory : ILoggingSinkFactory
    {
        public ILoggingSink Get(LoggingSinkConfiguration configuration)
        {
            return (ILoggingSink) (configuration.Parameters == null
                ?  Activator.CreateInstance(configuration.Type)
                :  Activator.CreateInstance(configuration.Type, configuration.Parameters));
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Verh. K. ned. Akad. Wet. , 2 Sectie 13(4): 224 (1907)

#### Original name
Pestalotia canangae Koord.

### Remarks
null


text:
from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('addresses', '0006_auto_20160105_1619'),
    ]

    operations = [
        migrations.AlterField(
            model_name='addressforwarding',
            name='coin_symbol',
            field=models.CharField(choices=[('btc', 'Bitcoin'), ('btc-testnet', 'Bitcoin Testnet'), ('ltc', 'Litecoin'), ('doge', 'Dogecoin'), ('dash', 'Dash'), ('bcy', 'BlockCypher Testnet')], db_index=True, max_length=16),
        ),
        migrations.AlterField(
            model_name='addresssubscription',
            name='coin_symbol',
            field=models.CharField(choices=[('btc', 'Bitcoin'), ('btc-testnet', 'Bitcoin Testnet'), ('ltc', 'Litecoin'), ('doge', 'Dogecoin'), ('dash', 'Dash'), ('bcy', 'BlockCypher Testnet')], db_index=True, max_length=16),
        ),
    ]


text:
CD ../frontend
START atom .
START lineman run
START chrome "http://localhost:8001"


text:
@font-face {
  font-family: 'iconfont';
  src: url('../fonts/icons/turn-arrow.eot') format("embedded-opentype"), /* IE9*/
  url('../fonts/icons/turn-arrow.woff') format('woff'), /* chrome、firefox */
  url('../fonts/icons/turn-arrow.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
  url('../fonts/icons/turn-arrow.svg') format('svg'); /* iOS 4.1- */
}

html,body{
  width:100%;
  height:100%;
  background: #222;
}

.content{
  width: 100%;
  height:100%;
}

/*stage--start*/
.stage{
  position: relative;

  width:100%;
  height: 100%;
}
/*stage--end*/

/*img-start*/
.img-sec{
  position: relative;

  width: 100%;
  height: 100%;
  overflow: hidden;

  background-color: #ddd;

  perspective: 1800px;
  -webkit-perspective: 1800px;
  -moz-perspective: 1800px;
}

.img-figure{
  width:480px;
  height:360px;
  padding:40px;
  position: absolute;
  margin:0;
  background-color:#fff;
  box-sizing: border-box;
  cursor: pointer;
  transform-origin: 0 50% 0;
  transform-style: preserve-3d;
  transition: transform .6s ease-in-out, left .6s ease-in-out, top .6s ease-in-out;
}

.is-inverse {
  transform: translate(480px) rotateY(180deg);

}
.is-inverse img {
  visibility: hidden;
}

.img-figure img{
  width: 100%;
}

figcaption{
  text-align: center;
}

.img-back{
  position: absolute;
  top: 0;
  left: 0;

  width: 100%;
  height: 100%;
  padding: 150px 40px;
  overflow: auto;

  color: #a7a0a2;
  font-size: 22px;
  line-height: 1.25;
  text-align: left;

  background-color: #fff;

  box-sizing: border-box;
  transform: rotateY(180deg) translateZ(1px);
  backface-visibility: hidden;
}

figcaption .img-title{
  margin:20px 0 0 0;
  color: #a7a0a2;
  font-size: 16px;
}

/*img-end*/

/*controler--start*/
.controller-nav{
  width:100%;
  position: absolute;
  left:0;
  bottom: 30px;
  z-index: 101;
  text-align: center;

}

.controller-nav .controller-unit{
  display: inline-block;
  width:30px;
  height:30px;
  margin: 5px;
  text-align: center;
  vertical-align: middle;
  background: #aaa;
  border-radius: 50%;
  transform: scale(0.5);

  transition: transform .6s ease-in-out,background-color .6s;

}

.controller-nav .is-center{
  background: #888;
  transform: scale(1);
}

.controller-nav .is-center::after{
  color:#fff;
  font-family: "iconfont";
  font-size: 80%;
  line-height: 30px;

  content: "\e600";

  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.controller-nav .is-inverse{
  background: #555;

  transform: rotateY(180deg);
}
/*controler--end*/


text:
package org.apache.geode.cache.lucene.internal.filesystem;

import java.io.EOFException;
import java.io.IOException;

/**
 * An input stream that reads chunks from a File saved in the region. This input stream will keep
 * going back to the region to look for chunks until nothing is found.
 */
class FileInputStream extends SeekableInputStream {

  private final File file;
  private byte[] chunk = null;
  private int chunkPosition = 0;
  private int chunkId = 0;
  private boolean open = true;

  public FileInputStream(File file) {
    this.file = file;
    nextChunk();
  }

  public FileInputStream(FileInputStream other) {
    file = other.file;
    chunk = other.chunk;
    chunkId = other.chunkId;
    chunkPosition = other.chunkPosition;
    open = other.open;
  }

  @Override
  public int read() throws IOException {
    assertOpen();

    checkAndFetchNextChunk();

    if (null == chunk) {
      return -1;
    }

    return chunk[chunkPosition++] & 0xff;
  }

  @Override
  public void seek(long position) throws IOException {
    if (position > file.length) {
      throw new EOFException();
    }
    int targetChunk = (int) (position / file.getChunkSize());
    int targetPosition = (int) (position % file.getChunkSize());

    if (targetChunk != (chunkId - 1)) {
      chunk = file.getFileSystem().getChunk(file, targetChunk);
      chunkId = targetChunk + 1;
      chunkPosition = targetPosition;
    } else {
      chunkPosition = targetPosition;
    }
  }

  @Override
  public long skip(long n) throws IOException {
    int currentPosition = (chunkId - 1) * file.getChunkSize() + chunkPosition;
    seek(currentPosition + n);
    return n;
  }

  @Override
  public synchronized void reset() throws IOException {
    seek(0);
  }

  @Override
  public int read(byte[] b, int off, int len) throws IOException {
    assertOpen();

    checkAndFetchNextChunk();

    if (null == chunk) {
      return -1;
    }

    int read = 0;
    while (len > 0) {
      final int min = Math.min(remaining(), len);
      System.arraycopy(chunk, chunkPosition, b, off, min);
      off += min;
      len -= min;
      chunkPosition += min;
      read += min;

      if (len > 0) {
        // we read to the end of the chunk, fetch another.
        nextChunk();
        if (null == chunk) {
          break;
        }
      }
    }

    return read;
  }

  @Override
  public int available() throws IOException {
    assertOpen();

    return remaining();
  }

  @Override
  public void close() throws IOException {
    if (open) {
      open = false;
    }
  }

  private int remaining() {
    return chunk.length - chunkPosition;
  }

  private void checkAndFetchNextChunk() {
    if (null != chunk && remaining() <= 0) {
      nextChunk();
    }
  }

  private void nextChunk() {
    chunk = file.getFileSystem().getChunk(file, chunkId++);
    chunkPosition = 0;
  }

  private void assertOpen() throws IOException {
    if (!open) {
      throw new IOException("Closed");
    }
  }

  @Override
  public FileInputStream clone() {
    return new FileInputStream(this);
  }
}


text:
require 'spec_helper'
require 'pong/rectangular_paddle'

describe Pong::Ball do
	before :each do
		@ball = Pong::Ball.new 0, 0, 20, 10, 10
	end

  it "should move according to its velocity" do
  	5.times { @ball.move }
  	@ball.position.x.should be_within(0.0000001).of 50
  	@ball.position.y.should be_within(0.0000001).of 50
  end
end


text:
package kr.ac.ajou.dsd.kda;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.test.context.web.WebAppConfiguration;

import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = KoreanDiningAdvisorApplication.class)
@WebAppConfiguration
public class KoreanDiningAdvisorApplicationTests {

	protected Logger logger = LoggerFactory.getLogger(this.getClass());

	@Test
	public void contextLoads() {
	}

}


text:
"""
Barbican worker server.
"""

import eventlet
import os
import sys

# Oslo messaging RPC server uses eventlet.
eventlet.monkey_patch()

# 'Borrowed' from the Glance project:
# If ../barbican/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
                                   os.pardir,
                                   os.pardir))
if os.path.exists(os.path.join(possible_topdir, 'barbican', '__init__.py')):
    sys.path.insert(0, possible_topdir)

from barbican.common import config
from barbican.openstack.common import log
from barbican.openstack.common import service
from barbican import queue
from barbican.queue import server
from oslo_config import cfg

def fail(returncode, e):
    sys.stderr.write("ERROR: {0}\n".format(e))
    sys.exit(returncode)

if __name__ == '__main__':
    try:
        config.parse_args()

        # Import and configure logging.
        log.setup('barbican')
        LOG = log.getLogger(__name__)
        LOG.debug("Booting up Barbican worker node...")

        # Queuing initialization
        CONF = cfg.CONF
        queue.init(CONF)

        service.launch(
            server.TaskServer()
        ).wait()
    except RuntimeError as e:
        fail(1, e)


text:
<?php
namespace Neos\Flow\Tests\Persistence\Fixture\Model;

use Neos\Flow\Annotations as Flow;
use Neos\Flow\Aop\JoinPointInterface;
use Neos\Flow\Aop\ProxyInterface;

/**
 * A model fixture used for testing the persistence manager
 *
 * @Flow\Entity
 */
class Entity2 implements ProxyInterface
{
    /**
     * Just a normal string
     *
     * @var string
     */
    public $someString;

    /**
     * @var integer
     */
    public $someInteger;

    /**
     * @var Entity3
     */
    public $someReference;

    /**
     * @var array
     */
    public $someReferenceArray = [];

    /**
     * Invokes the joinpoint - calls the target methods.
     *
     * @param JoinPointInterface $joinPoint The join point
     * @return mixed Result of the target (ie. original) method
     */
    public function Flow_Aop_Proxy_invokeJoinPoint(JoinPointInterface $joinPoint)
    {
    }

    /**
     * A stub to satisfy the Flow Proxy Interface
     */
    public function __wakeup()
    {
    }
}


text:
describe("BloqueSpec", function() {
  var bloque;
  var dimensionX=Casilla.maximo+1;
  var dimensionY=Casilla.maximo+1;
  beforeEach(function() {
    bloque = new Bloque(dimensionX,dimensionY);
  });
  it("debeInicializarUnBloque", function() {
    bloque.inicializar();
	expect(dimensionX).toEqual(bloque.getCasillas().length);
  });
  it("debeInicializarArregloAIzquierdaArriba", function() {
    bloque.inicializar();
	var esperado;
	var casilla;
	var veces=0;
	for (var i = 0; i<bloque.getDimensionX(); i++)
	{
		for (var j = 0; j<bloque.getDimensionY(); j++)
		{
			if(bloque.getCasillas()[i][j].esExtremoAIzquierdaArriba())
			{
				esperado=bloque.getArregloIzquierdaArriba(bloque.getCasillas()[i][j]);
				veces++;
			}
		}
	}
	expect(3).toEqual(esperado.length);
	expect(1).toEqual(veces);
	expect(Casilla.minimo).toEqual(esperado[0].getX());
	expect(Casilla.minimo+1).toEqual(esperado[0].getY());
	expect(Casilla.minimo+1).toEqual(esperado[1].getX());
	expect(Casilla.minimo+1).toEqual(esperado[1].getY());
	expect(Casilla.minimo+1).toEqual(esperado[2].getX());
	expect(Casilla.minimo).toEqual(esperado[2].getY());
  });
  it("debeInicializarArregloADerechaArriba", function() {
    bloque.inicializar();
	var esperado;
	var casilla;
	var veces=0;
	for (var i = 0; i<bloque.getDimensionX(); i++)
	{
		for (var j = 0; j<bloque.getDimensionY(); j++)
		{
			if(bloque.getCasillas()[i][j].esExtremoADerechaArriba())
			{
				casilla=bloque.getCasillas()[i][j];
				esperado=bloque.getArregloDerechaArriba(casilla);
				veces++;
			}
		}
	}
	expect(3).toEqual(esperado.length);
	expect(1).toEqual(veces);
	expect(Casilla.minimo).toEqual(esperado[0].getX());
	expect(Casilla.maximo-1).toEqual(esperado[0].getY());
	expect(Casilla.minimo+1).toEqual(esperado[1].getX());
	expect(Casilla.maximo-1).toEqual(esperado[1].getY());
	expect(Casilla.minimo+1).toEqual(esperado[2].getX());
	expect(Casilla.maximo).toEqual(esperado[2].getY());
  });
  it("debeInicializarArregloAIzquierdaAbajo", function() {
    bloque.inicializar();
	var esperado;
	var casilla;
	var veces=0;
	for (var i = 0; i<bloque.getDimensionX(); i++)
	{
		for (var j = 0; j<bloque.getDimensionY(); j++)
		{
			if(bloque.getCasillas()[i][j].esExtremoAIzquierdaAbajo())
			{
				casilla=bloque.getCasillas()[i][j];
				esperado=bloque.getArregloIzquierdaAbajo(casilla);
				veces++;
			}
		}
	}
	expect(3).toEqual(esperado.length);
	expect(1).toEqual(veces);
	expect(Casilla.maximo).toEqual(esperado[0].getX());
	expect(Casilla.minimo+1).toEqual(esperado[0].getY());
	expect(Casilla.maximo-1).toEqual(esperado[1].getX());
	expect(Casilla.minimo+1).toEqual(esperado[1].getY());
	expect(Casilla.maximo-1).toEqual(esperado[2].getX());
	expect(Casilla.minimo).toEqual(esperado[2].getY());
  });
  it("debeInicializarArregloADerechaAbajo", function() {
    bloque.inicializar();
	var esperado;
	var casilla;
	var veces=0;
	for (var i = 0; i<bloque.getDimensionX(); i++)
	{
		for (var j = 0; j<bloque.getDimensionY(); j++)
		{
			if(bloque.getCasillas()[i][j].esExtremoADerechaAbajo())
			{
				casilla=bloque.getCasillas()[i][j];
				esperado=bloque.getArregloDerechaAbajo(casilla);
				veces++;
			}
		}
	}
	expect(3).toEqual(esperado.length);
	expect(1).toEqual(veces);
	expect(Casilla.maximo).toEqual(esperado[0].getX());
	expect(Casilla.maximo-1).toEqual(esperado[0].getY());
	expect(Casilla.maximo-1).toEqual(esperado[1].getX());
	expect(Casilla.maximo-1).toEqual(esperado[1].getY());
	expect(Casilla.maximo-1).toEqual(esperado[2].getX());
	expect(Casilla.maximo).toEqual(esperado[2].getY());
  });
  it("debeInicializarArregloLateralArriba", function() {
    bloque.inicializar();
	var esperado;
	var casilla;
	for (var i = 0; i<bloque.getDimensionX(); i++)
	{
		for (var j = 0; j<bloque.getDimensionY(); j++)
		{
			if(bloque.getCasillas()[i][j].esExtremoLateralArriba())
			{
				casilla=bloque.getCasillas()[i][j];
				esperado=bloque.getArregloLateralArriba(casilla);
				expect(5).toEqual(esperado.length);
				expect(casilla.getX()).toEqual(esperado[0].getX());
				expect(casilla.getY()-1).toEqual(esperado[0].getY());
				expect(casilla.getX()).toEqual(esperado[1].getX());
				expect(casilla.getY()+1).toEqual(esperado[1].getY());
				expect(casilla.getX()+1).toEqual(esperado[2].getX());
				expect(casilla.getY()-1).toEqual(esperado[2].getY());
				expect(casilla.getX()+1).toEqual(esperado[3].getX());
				expect(casilla.getY()).toEqual(esperado[3].getY());
				expect(casilla.getX()+1).toEqual(esperado[4].getX());
				expect(casilla.getY()+1).toEqual(esperado[4].getY());
			}
		}
	}

  });
  it("debeInicializarArregloLateralAbajo", function() {
    bloque.inicializar();
	var esperado;
	var casilla;
	for (var i = 0; i<bloque.getDimensionX(); i++)
	{
		for (var j = 0; j<bloque.getDimensionY(); j++)
		{
			if(bloque.getCasillas()[i][j].esExtremoLateralAbajo())
			{
				casilla=bloque.getCasillas()[i][j];
				esperado=bloque.getArregloLateralAbajo(casilla);
				expect(5).toEqual(esperado.length);
				expect(Casilla.maximo).toEqual(esperado[0].getX());
				expect(casilla.getY()-1).toEqual(esperado[0].getY());
				expect(Casilla.maximo).toEqual(esperado[1].getX());
				expect(casilla.getY()+1).toEqual(esperado[1].getY());
				expect(Casilla.maximo-1).toEqual(esperado[2].getX());
				expect(casilla.getY()-1).toEqual(esperado[2].getY());
				expect(Casilla.maximo-1).toEqual(esperado[3].getX());
				expect(casilla.getY()).toEqual(esperado[3].getY());
				expect(Casilla.maximo-1).toEqual(esperado[4].getX());
				expect(casilla.getY()+1).toEqual(esperado[4].getY());
			}
		}
	}

  });
  it("debeInicializarArregloLateralIzquierda", function() {
    bloque.inicializar();
	var esperado;
	var casilla;
	for (var i = 0; i<bloque.getDimensionX(); i++)
	{
		for (var j = 0; j<bloque.getDimensionY(); j++)
		{
			if(bloque.getCasillas()[i][j].esExtremoLateralIzquierda())
			{
				casilla=bloque.getCasillas()[i][j];
				esperado=bloque.getArregloLateralIzquierda(casilla);
				expect(5).toEqual(esperado.length);
				expect(casilla.getX()-1).toEqual(esperado[0].getX());
				expect(Casilla.minimo).toEqual(esperado[0].getY());
				expect(casilla.getX()+1).toEqual(esperado[1].getX());
				expect(Casilla.minimo).toEqual(esperado[1].getY());
				expect(casilla.getX()-1).toEqual(esperado[2].getX());
				expect(Casilla.minimo+1).toEqual(esperado[2].getY());
				expect(casilla.getX()).toEqual(esperado[3].getX());
				expect(Casilla.minimo+1).toEqual(esperado[3].getY());
				expect(casilla.getX()+1).toEqual(esperado[4].getX());
				expect(Casilla.minimo+1).toEqual(esperado[4].getY());
			}
		}
	}

  });
  it("debeInicializarArregloLateralDerecha", function() {
    bloque.inicializar();
	var esperado;
	var casilla;
	for (var i = 0; i<bloque.getDimensionX(); i++)
	{
		for (var j = 0; j<bloque.getDimensionY(); j++)
		{
			if(bloque.getCasillas()[i][j].esExtremoLateralDerecha())
			{
				casilla=bloque.getCasillas()[i][j];
				esperado=bloque.getArregloLateralDerecha(casilla);
				expect(5).toEqual(esperado.length);
				expect(casilla.getX()-1).toEqual(esperado[0].getX());
				expect(Casilla.maximo).toEqual(esperado[0].getY());
				expect(casilla.getX()+1).toEqual(esperado[1].getX());
				expect(Casilla.maximo).toEqual(esperado[1].getY());
				expect(casilla.getX()-1).toEqual(esperado[2].getX());
				expect(Casilla.maximo-1).toEqual(esperado[2].getY());
				expect(casilla.getX()).toEqual(esperado[3].getX());
				expect(Casilla.maximo-1).toEqual(esperado[3].getY());
				expect(casilla.getX()+1).toEqual(esperado[4].getX());
				expect(Casilla.maximo-1).toEqual(esperado[4].getY());
			}
		}
	}

  });
  it("debeInicializarArregloNoExtremo", function() {
    bloque.inicializar();
	var esperado;
	var casilla;
	var veces=0;
	for (var i = 0; i<bloque.getDimensionX(); i++)
	{
		for (var j = 0; j<bloque.getDimensionY(); j++)
		{
			if(bloque.getCasillas()[i][j].esNoExtremo())
			{
				casilla=bloque.getCasillas()[i][j];
				esperado=bloque.getArregloNoExtremo(casilla);
				veces++;
				expect(casilla.getX()-1).toEqual(esperado[0].getX());
				expect(casilla.getY()-1).toEqual(esperado[0].getY());
				expect(casilla.getX()-1).toEqual(esperado[1].getX());
				expect(casilla.getY()).toEqual(esperado[1].getY());
				expect(casilla.getX()-1).toEqual(esperado[2].getX());
				expect(casilla.getY()+1).toEqual(esperado[2].getY());
				expect(casilla.getX()).toEqual(esperado[3].getX());
				expect(casilla.getY()-1).toEqual(esperado[3].getY());
				expect(casilla.getX()).toEqual(esperado[4].getX());
				expect(casilla.getY()+1).toEqual(esperado[4].getY());
				expect(casilla.getX()+1).toEqual(esperado[5].getX());
				expect(casilla.getY()-1).toEqual(esperado[5].getY());
				expect(casilla.getX()+1).toEqual(esperado[6].getX());
				expect(casilla.getY()).toEqual(esperado[6].getY());
				expect(casilla.getX()+1).toEqual(esperado[7].getX());
				expect(casilla.getY()+1).toEqual(esperado[7].getY());
			}
		}
	}
	expect(8).toEqual(esperado.length);

  });
  it("deberiaMorirPorEstarSola", function() {
    bloque.inicializar();
	bloque.getCasillas()[0][0].setEstadoActual(true);
	bloque.getCasillas()[0][0].setEstadoActual(true);
	var esperado;
	var casilla;
	var veces=0;
	for (var i = 0; i<bloque.getDimensionX(); i++)
	{
		for (var j = 0; j<bloque.getDimensionY(); j++)
		{
			if(bloque.getCasillas()[i][j].esExtremoAIzquierdaArriba())
			{
				bloque.getArregloIzquierdaArriba(bloque.getCasillas()[i][j]);
			}
		}
	}
	bloque.actualizarEstadoCasillas();
	expect(false).toEqual(bloque.getCasillas()[0][0].getEstadoActual());

  });
   it("deberiaMantenerseMuertaPorEstarSola", function() {
    bloque.inicializar();
	bloque.getCasillas()[0][0].setEstadoActual(false);
	bloque.getCasillas()[0][0].setEstadoActual(false);
	var esperado;
	var casilla;
	var veces=0;
	for (var i = 0; i<bloque.getDimensionX(); i++)
	{
		for (var j = 0; j<bloque.getDimensionY(); j++)
		{
			if(bloque.getCasillas()[i][j].esExtremoAIzquierdaArriba())
			{
				bloque.getArregloIzquierdaArriba(bloque.getCasillas()[i][j]);
			}
		}
	}
	bloque.actualizarEstadoCasillas();
	expect(false).toEqual(bloque.getCasillas()[0][0].getEstadoActual());

  });
  it("deberiaVivirPorEstarRodeada3PorCasillasVivas", function() {
    bloque.inicializar();
	bloque.getCasillas()[0][0].setEstadoActual(false);
	bloque.getCasillas()[0][0].setEstadoSiguiente(false);
	bloque.getCasillas()[0][1].setEstadoActual(true);
	bloque.getCasillas()[0][1].setEstadoSiguiente(true);
	bloque.getCasillas()[1][1].setEstadoActual(true);
	bloque.getCasillas()[1][1].setEstadoSiguiente(true);
	bloque.getCasillas()[1][0].setEstadoActual(true);
	bloque.getCasillas()[1][0].setEstadoSiguiente(true);

	var esperado;
	var casilla;
	var veces=0;
	for (var i = 0; i<bloque.getDimensionX(); i++)
	{
		for (var j = 0; j<bloque.getDimensionY(); j++)
		{
			if(bloque.getCasillas()[i][j].esExtremoAIzquierdaArriba())
			{
				bloque.getArregloIzquierdaArriba(bloque.getCasillas()[i][j]);
			}
		}
	}
	bloque.actualizarEstadoCasillas();
	expect(true).toEqual(bloque.getCasillas()[0][0].getEstadoActual());

  });
  it("deberiaMorirPorEstarRodeadaPor2CasillasVivas", function() {
    bloque.inicializar();
	bloque.getCasillas()[0][0].setEstadoActual(true);
	bloque.getCasillas()[0][0].setEstadoSiguiente(true);
	bloque.getCasillas()[0][1].setEstadoActual(false);
	bloque.getCasillas()[0][1].setEstadoSiguiente(false);
	bloque.getCasillas()[1][1].setEstadoActual(true);
	bloque.getCasillas()[1][1].setEstadoSiguiente(true);
	bloque.getCasillas()[1][0].setEstadoActual(false);
	bloque.getCasillas()[1][0].setEstadoSiguiente(false);

	var esperado;
	var casilla;
	var veces=0;
	for (var i = 0; i<bloque.getDimensionX(); i++)
	{
		for (var j = 0; j<bloque.getDimensionY(); j++)
		{
			if(bloque.getCasillas()[i][j].esExtremoAIzquierdaArriba())
			{
				bloque.getArregloIzquierdaArriba(bloque.getCasillas()[i][j]);
			}
		}
	}
	bloque.actualizarEstadoCasillas();
	expect(false).toEqual(bloque.getCasillas()[0][0].getEstadoActual());

  });

  it("deberiaMantenerseVivaPorEstarRodeadaPor3CasillasVivas", function() {
    bloque.inicializar();
	bloque.getCasillas()[0][0].setEstadoActual(true);
	bloque.getCasillas()[0][0].setEstadoSiguiente(true);
	bloque.getCasillas()[0][1].setEstadoActual(true);
	bloque.getCasillas()[0][1].setEstadoSiguiente(true);
	bloque.getCasillas()[1][1].setEstadoActual(true);
	bloque.getCasillas()[1][1].setEstadoSiguiente(true);
	bloque.getCasillas()[1][0].setEstadoActual(true);
	bloque.getCasillas()[1][0].setEstadoSiguiente(true);

	var esperado;
	var casilla;
	var veces=0;
	for (var i = 0; i<bloque.getDimensionX(); i++)
	{
		for (var j = 0; j<bloque.getDimensionY(); j++)
		{
			if(bloque.getCasillas()[i][j].esExtremoAIzquierdaArriba())
			{
				bloque.getArregloIzquierdaArriba(bloque.getCasillas()[i][j]);
			}
		}
	}
	bloque.actualizarEstadoCasillas();
	expect(true).toEqual(bloque.getCasillas()[0][0].getEstadoActual());

  });

});


text:
import { Auth, expiredAtKey } from './auth-service';
import { MockRouter } from '../mocks/router.mock';

describe('Auth Service', () => {
    let authService: Auth;
    let mockRouter: any;

    beforeEach(() => {
        mockRouter = new MockRouter();
        authService = new Auth(mockRouter, null);
    });

    describe('authenticated', () => {
        it('should be expired', () => {
            localStorage.setItem(expiredAtKey, '');
            expect(authService.authenticated()).toBeFalsy();
        });

        it('should not be expired', () => {
            localStorage.setItem('expiredAtKey', (new Date().getTime() + 10000).toString());
            expect(authService.authenticated()).toBeFalsy();
            localStorage.setItem(expiredAtKey, '');
        });
    });
});


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="primary_dark">#2E7D32</color>
    <color name="primary">#43A047</color>
    <color name="accent">#66BB6A</color>
    <color name="primary_light">#A5D6A7</color>
    <color name="primary_background">#E8F5E9</color>
    <color name="like_black">#212121</color>
    <color name="secondary_text">#727272</color>
    <color name="divider">#B6B6B6</color>
    <color name="background">#EEEEEE</color>
    <color name="set_off">#FFFFFF</color>

    <color name="shadow">#88555555</color>
    <color name="ripple_primary">@color/primary_light</color>
    <color name="ripple_high_light">#FFF59D</color>
</resources>


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactIconBase = require('react-icon-base');

var _reactIconBase2 = _interopRequireDefault(_reactIconBase);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var GoJumpDown = function GoJumpDown(props) {
    return _react2.default.createElement(
        _reactIconBase2.default,
        _extends({ viewBox: '0 0 40 40' }, props),
        _react2.default.createElement(
            'g',
            null,
            _react2.default.createElement('path', { d: 'm35 7.5h-30l15 15 15-15z m-30 20v5h30v-5h-30z' })
        )
    );
};

exports.default = GoJumpDown;
module.exports = exports['default'];


text: export { default } from 'shared/components/empty-table/component';


text:
"""Routines to create data."""

from .random_tensor import randn_ktensor, rand_ktensor, randexp_ktensor


text:
package org.jivesoftware.openfire.carbons;

import org.jivesoftware.openfire.forward.Forwarded;
import org.xmpp.packet.PacketExtension;

/**
 * The implementation of the {@code <received xmlns="urn:xmpp:carbons:2"/>} extension.
 * It indicates, that a message has been received by another resource.
 *
 * @author Christian Schudt
 */
public final class Received extends PacketExtension {
    public Received(Forwarded forwarded) {
        super("received", "urn:xmpp:carbons:2");
        element.add(forwarded.getElement());
    }
}


text:
<?php defined('SYSPATH') OR die('No direct script access.');

class Notice extends Notice_Core {}


text:
"""OneHot in python"""
import numpy as np

def one_hot(indices, on_value, off_value, depth, axis, dtype):
    """one_hot operator implemented in numpy.

    Returns a one-hot tensor where the locations repsented by indices take value on_value,
    other locations take value off_value.
    Final dimension is <indices outer dimensions> x depth x <indices inner dimensions>.

    Parameters
    ----------
    indices : numpy.ndarray
        Locations to set to on_value.

    on_value : int/float
        Value to fill at indices.

    off_value : int/float
        Value to fill at all other positions besides indices.

    depth : int
        Depth of the one-hot dimension.

    axis : int
        Axis to fill.

    dtype : str
        Data type of the output tensor.

    Returns
    -------
    ret : relay.Expr
        The one-hot tensor.
    """
    oshape = []
    true_axis = len(indices.shape) if axis == -1 else axis
    ndim = len(indices.shape) + 1
    indices_index = 0
    for i in range(0, ndim):
        if i == true_axis:
            oshape.append(depth)
        else:
            oshape.append(indices.shape[indices_index])
            indices_index += 1

    out = np.empty(oshape)
    output_indices = list(np.ndindex(out.shape))
    for output_index in output_indices:
        indices_indices = []
        for i, out_idx in enumerate(output_index):
            if i == true_axis:
                continue
            indices_indices.append(out_idx)

        index = output_index[true_axis]
        if indices[tuple(indices_indices)] == index:
            out[output_index] = on_value
        else:
            out[output_index] = off_value

    return out.astype(dtype)


text:
/**
 * @file classifier.h
 * @author Sean Massung
 *
 * All files in META are released under the MIT license. For more details,
 * consult the file LICENSE in the root of the project.
 */

#ifndef META_CLASSIFIER_H_
#define META_CLASSIFIER_H_

#include <vector>
#include "classify/confusion_matrix.h"

namespace meta
{
namespace classify
{

/**
 * A classifier uses a document's feature space to identify which group it
 * belongs to.
 */
class classifier
{
  public:
    /**
     * @param idx The index to run the classifier on
     */
    classifier(std::shared_ptr<index::forward_index> idx);

    /**
     * Classifies a document into a specific group, as determined by
     * training data.
     * @param d_id The document to classify
     * @return the class it belongs to
     */
    virtual class_label classify(doc_id d_id) = 0;

    /**
     * Creates a classification model based on training documents.
     * @param docs The training documents
     */
    virtual void train(const std::vector<doc_id>& docs) = 0;

    /**
     * Classifies a collection document into specific groups, as determined
     * by training data; this function will make repeated calls to
     * classify().
     * @param docs The documents to classify
     * @return a confusion_matrix detailing the performance of the
     * classifier
     */
    virtual confusion_matrix test(const std::vector<doc_id>& docs);

    /**
     * Performs k-fold cross-validation on a set of documents. When using
     * this function, it is not necessary to call train() or test() first.
     * @param input_docs Testing documents
     * @param k The number of folds
     * @param even_split Whether to evenly split the data by class for a fair
     * baseline
     * @param seed The seed for the RNG used to shuffle the documents
     * @return a confusion_matrix containing the results over all the folds
     */
    virtual confusion_matrix
        cross_validate(const std::vector<doc_id>& input_docs, size_t k,
                       bool even_split = false, int seed = 1);

    /**
     * Clears any learning data associated with this classifier.
     */
    virtual void reset() = 0;

  protected:
    /** the index that the classifer is run on */
    std::shared_ptr<index::forward_index> idx_;

  private:
    /**
     * Modifies input_docs to be a vector of size <= the original vector size
     * with an even distribution of class labels per document
     * @param input_docs
     * @param seed The seed for the RNG used to shuffle the documents
     */
    void create_even_split(std::vector<doc_id>& docs, int seed = 2) const;
};
}
}
#endif


text:
<?xml version="1.0"?>
<package format="2">
  <name>fanuc_lrmate200ib_support</name>
  <version>0.1.0</version>
  <description>

      ROS-Industrial support for the Fanuc LR Mate 200iB (and variants).

      This package contains configuration data, 3D models and launch files
      for Fanuc LR Mate 200iB manipulators. This currently includes the base
      model and the /3L.

      Joint limits and maximum joint velocities are based on the information in
      the Fanuc LR Mate 200iB-200iB/3L datasheet, dated 24-Feb-2003.
      All urdfs are based on the default motion and joint velocity limits,
      unless noted otherwise (ie: no support for high speed joints,
      extended / limited motion ranges or other options).

      Before using any of the configuration files and / or meshes included
      in this package, be sure to check they are correct for the particular
      robot model and configuration you intend to use them with.

Contributors:

      This support package has received contributions from: Victor Lamoine.

  </description>
  <author>G.A. vd. Hoorn (TU Delft Robotics Institute)</author>
  <maintainer email="g.a.vanderhoorn@tudelft.nl">G.A. vd. Hoorn (TU Delft Robotics Institute)</maintainer>
  <license>BSD</license>

  <url type="website">http://ros.org/wiki/fanuc_lrmate200ib_support</url>
  <url type="bugtracker">https://github.com/ros-industrial/fanuc_experimental/issues</url>
  <url type="repository">https://github.com/ros-industrial/fanuc_experimental</url>

  <buildtool_depend>catkin</buildtool_depend>

  <test_depend version_gte="1.9.55">roslaunch</test_depend>

  <exec_depend>fanuc_driver</exec_depend>
  <exec_depend>fanuc_resources</exec_depend>
  <exec_depend>joint_state_publisher</exec_depend>
  <exec_depend>robot_state_publisher</exec_depend>
  <exec_depend>rviz</exec_depend>
  <exec_depend>xacro</exec_depend>

  <export>
    <architecture_independent />
    <rosindex>
      <tags>
        <tag>support_package</tag>
        <tag>description</tag>
        <tag>fanuc</tag>
        <tag>industrial</tag>
        <tag>ros-industrial</tag>
        <tag>lrmate200ib</tag>
        <tag>experimental</tag>
      </tags>
    </rosindex>
  </export>
</package>


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var platform_browser_dynamic_1 = require("@angular/platform-browser-dynamic");
var app_module_1 = require("./app/app.module");
platform_browser_dynamic_1.platformBrowserDynamic().bootstrapModule(app_module_1.AppModule);
//# sourceMappingURL=E:/Sonicwall/project/Sonicwall_demo/Sonicwall_demo/typescript-angular2-client/bootstrap.jit.js.map


text:
"""Base test class for Johnny Cache Tests."""

from __future__ import print_function
from pprint import pformat

from django.test import TestCase, TransactionTestCase
from django.conf import settings
from django.core.management import call_command
from django.db.models.loading import load_app

from johnny import settings as johnny_settings
from johnny.compat import Queue
from johnny.decorators import wraps, available_attrs
from johnny.signals import qc_hit, qc_miss, qc_skip

# order matters here;  I guess we aren't deferring foreign key checking :\
johnny_fixtures = ['authors.json', 'genres.json', 'publishers.json', 'books.json']

def show_johnny_signals(hit=None, miss=None):
    """A decorator that can be put on a test function that will show the
    johnny hit/miss signals by default, or do what is provided by the hit
    and miss keyword args."""
    def _hit(*args, **kwargs):
        print("hit:\n\t%s\n\t%s\n" % (pformat(args), pformat(kwargs)))
    def _miss(*args, **kwargs):
        print("miss:\n\t%s\n\t%s\n" % (pformat(args), pformat(kwargs)))
    hit = hit or _hit
    miss = miss or _miss
    def deco(func):
        @wraps(func, assigned=available_attrs(func))
        def wrapped(*args, **kwargs):
            qc_hit.connect(hit)
            qc_miss.connect(miss)
            try:
                ret = func(*args, **kwargs)
            finally:
                qc_hit.disconnect(hit)
                qc_miss.disconnect(miss)
            return ret
        return wrapped
    return deco

def _pre_setup(self):
    self.saved_INSTALLED_APPS = settings.INSTALLED_APPS
    self.saved_DEBUG = settings.DEBUG
    test_app = 'johnny.tests.testapp'
    settings.INSTALLED_APPS = tuple(
        list(self.saved_INSTALLED_APPS) + [test_app]
    )
    settings.DEBUG = True
    # load our fake application and syncdb
    load_app(test_app)
    call_command('syncdb', verbosity=0, interactive=False)
    if hasattr(settings, 'DATABASES'):
        for dbname in settings.DATABASES:
            if dbname != 'default':
                call_command('syncdb', verbosity=0, interactive=False, database=dbname)

def _post_teardown(self):
    settings.INSTALLED_APPS = self.saved_INSTALLED_APPS
    settings.DEBUG = self.saved_DEBUG

class JohnnyTestCase(TestCase):
    def _pre_setup(self):
        _pre_setup(self)
        super(JohnnyTestCase, self)._pre_setup()

    def _post_teardown(self):
        _post_teardown(self)
        super(JohnnyTestCase, self)._post_teardown()

class TransactionJohnnyTestCase(TransactionTestCase):
    def _pre_setup(self):
        _pre_setup(self)
        super(TransactionJohnnyTestCase, self)._pre_setup()

    def _post_teardown(self):
        _post_teardown(self)
        super(TransactionJohnnyTestCase, self)._post_teardown()

class TransactionJohnnyWebTestCase(TransactionJohnnyTestCase):
    def _pre_setup(self):
        self.saved_MIDDLEWARE_CLASSES = settings.MIDDLEWARE_CLASSES
        if getattr(self, 'middlewares', None):
            settings.MIDDLEWARE_CLASSES = self.middlewares
        self.saved_DISABLE_SETTING = getattr(johnny_settings, 'DISABLE_QUERYSET_CACHE', False)
        johnny_settings.DISABLE_QUERYSET_CACHE = False
        self.saved_TEMPLATE_LOADERS = settings.TEMPLATE_LOADERS
        if 'django.template.loaders.app_directories.Loader' not in settings.TEMPLATE_LOADERS:
            settings.TEMPLATE_LOADERS += ('django.template.loaders.app_directories.Loader',)
        self.saved_ROOT_URLCONF = settings.ROOT_URLCONF
        settings.ROOT_URLCONF = 'johnny.tests.testapp.urls'
        super(TransactionJohnnyWebTestCase, self)._pre_setup()

    def _post_teardown(self):
        johnny_settings.DISABLE_QUERYSET_CACHE = self.saved_DISABLE_SETTING
        settings.MIDDLEWARE_CLASSES = self.saved_MIDDLEWARE_CLASSES
        settings.ROOT_URLCONF = self.saved_ROOT_URLCONF
        settings.TEMPLATE_LOADERS = self.saved_TEMPLATE_LOADERS
        super(TransactionJohnnyWebTestCase, self)._post_teardown()

class message_queue(object):
    """Return a message queue that gets 'hit' or 'miss' messages.  The signal
    handlers use weakrefs, so if we don't save references to this object they
    will get gc'd pretty fast."""
    def __init__(self):
        self.q = Queue()
        qc_hit.connect(self._hit)
        qc_miss.connect(self._miss)
        qc_skip.connect(self._skip)

    def _hit(self, *a, **k): self.q.put(True)
    def _miss(self, *a, **k): self.q.put(False)
    def _skip(self, *a, **k): self.q.put(False)

    def clear(self):
        while not self.q.empty():
            self.q.get_nowait()
    def get(self): return self.q.get()
    def get_nowait(self): return self.q.get_nowait()
    def qsize(self): return self.q.qsize()
    def empty(self): return self.q.empty()

def supports_transactions(con):
    """A convenience function which will work across multiple django versions
    that checks whether or not a connection supports transactions."""
    features = con.features
    vendor = con.vendor
    if features.supports_transactions:
        if vendor == 'mysql':
            engine = getattr(features, '_mysql_storage_engine', '')
            if callable(engine):
                # Oracle's mysql.connector.django backend uses a method call
                # instead of a property.
                engine = engine()
            if engine != 'InnoDB':
                print('MySQL connection reports transactions supported '
                      'but storage engine != InnoDB.')
                return False
        return True
    return False


text:
package environment

import (
	"fmt"

	"github.com/pkg/errors"
	kerrors "k8s.io/apimachinery/pkg/api/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

	"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
	"github.com/fission/fission/pkg/fission-cli/cmd"
	"github.com/fission/fission/pkg/fission-cli/console"
	flagkey "github.com/fission/fission/pkg/fission-cli/flag/key"
)

type DeleteSubCommand struct {
	cmd.CommandActioner
}

func Delete(input cli.Input) error {
	return (&DeleteSubCommand{}).do(input)
}

func (opts *DeleteSubCommand) do(input cli.Input) (err error) {

	_, currentContextNS, err := opts.GetResourceNamespace(input, flagkey.NamespaceEnvironment)
	if err != nil {
		return errors.Wrap(err, "error creating environment")
	}
	console.Verbose(2, "Searching for resource in  %s Namespace", currentContextNS)
	envName := input.String(flagkey.EnvName)

	if !input.Bool(flagkey.EnvForce) {
		fns, err := opts.Client().FissionClientSet.CoreV1().Functions(metav1.NamespaceAll).List(input.Context(), metav1.ListOptions{})
		if err != nil {
			return errors.Wrap(err, "Error getting functions wrt environment.")
		}

		for _, fn := range fns.Items {
			if fn.Spec.Environment.Name == envName &&
				fn.Spec.Environment.Namespace == currentContextNS {
				return errors.New("Environment is used by at least one function.")
			}
		}
	}

	err = opts.Client().FissionClientSet.CoreV1().Environments(currentContextNS).Delete(input.Context(), envName, metav1.DeleteOptions{})
	if err != nil {
		if input.Bool(flagkey.IgnoreNotFound) && kerrors.IsNotFound(err) {
			return nil
		}
		return errors.Wrap(err, "error deleting environment")
	}

	fmt.Printf("environment '%s' deleted\n", envName)

	return nil
}


text:
package com.amazonaws.services.fms.model.transform;

import java.util.List;
import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.fms.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * ResourceSetMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class ResourceSetMarshaller {

    private static final MarshallingInfo<String> ID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Id").build();
    private static final MarshallingInfo<String> NAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Name").build();
    private static final MarshallingInfo<String> DESCRIPTION_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("Description").build();
    private static final MarshallingInfo<String> UPDATETOKEN_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("UpdateToken").build();
    private static final MarshallingInfo<List> RESOURCETYPELIST_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ResourceTypeList").build();
    private static final MarshallingInfo<java.util.Date> LASTUPDATETIME_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("LastUpdateTime").timestampFormat("unixTimestamp").build();

    private static final ResourceSetMarshaller instance = new ResourceSetMarshaller();

    public static ResourceSetMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(ResourceSet resourceSet, ProtocolMarshaller protocolMarshaller) {

        if (resourceSet == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(resourceSet.getId(), ID_BINDING);
            protocolMarshaller.marshall(resourceSet.getName(), NAME_BINDING);
            protocolMarshaller.marshall(resourceSet.getDescription(), DESCRIPTION_BINDING);
            protocolMarshaller.marshall(resourceSet.getUpdateToken(), UPDATETOKEN_BINDING);
            protocolMarshaller.marshall(resourceSet.getResourceTypeList(), RESOURCETYPELIST_BINDING);
            protocolMarshaller.marshall(resourceSet.getLastUpdateTime(), LASTUPDATETIME_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
{% extends 'base.html' %}
{% load static %}
{% load crispy_forms_tags %}

{% block page-title %}
  {{ advert.get_ad_type_display }}
  ID number: {{ advert.pk }}
{% endblock %}

{% block content %}
  {% if advert.is_side %}

  {% else %}

  {% endif %}

        Advert link

                    Current Url

                  {{ advert.url }}

                    Edit URL

                  {% crispy form %}

        Advert created
        {{ advert.created }}

        Advert updated
        {{ advert.updated }}

        Status

          {% if advert.status == advert.ACTIVE %}
            {{ advert.get_status_display }}
          {% elif advert.status == advert.INACTIVE %}
            {{ advert.get_status_display }}
          {% else %}
            {{ advert.get_status_display }}
          {% endif %}

{% endblock %}

{% block extra_js %}

{% endblock %}


text:
import sqlite3

#tables:
## CREATE TABLE sub_log(submission_id CHAR(6), timestamp DATETIME DEFAULT CURRENT_TIMESTAMP);
## CREATE TABLE com_log(comment_id CHAR(7), timestamp DATETIME DEFAULT CURRENT_TIMESTAMP);

#inserts into table reddit submission.id
def intoDB2(sub_id):
    conn = sqlite3.connect('log.db')
    c = conn.cursor()
    c.execute("INSERT INTO sub_log(submission_id) VALUES(?)", [sub_id])
    conn.commit()
    conn.close()

#inserts into table reddit comment.id
def intoDB3(com_id):
    conn = sqlite3.connect('log.db')
    c = conn.cursor()
    c.execute("INSERT INTO com_log(comment_id) VALUES(?)", [com_id])
    conn.commit()
    conn.close()

#checks table for a submission.id/comment.id
def checkDB(sub_id, table):
    conn = sqlite3.connect('log.db')
    c = conn.cursor()
    if table == "sub_log":
        c.execute('SELECT * FROM sub_log WHERE submission_id=?', [sub_id])
    elif table == "com_log":
        c.execute('SELECT * FROM com_log WHERE comment_id=?', [sub_id])
    if c.fetchone() == None:
        conn.close()
        return True
    else:
        conn.close()
        return False


text:
package org.uberfire.shared;

public class Mood {

    private final String text;

    public Mood( String text ) {
        this.text = text;
    }

    public String getText() {
        return text;
    }

    @Override
    public String toString() {
        return text;
    }
}


text:
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from api.pollingdistricts import PollingDistrictViewSet

class PollingDistrictsTest(TestCase):
    fixtures = ['polling_stations/apps/api/fixtures/test_api_pollingdistricts_stations.json']

    def test_bad_request(self):
        # passing a district_id param with no council_id param should throw
        # 400 Bad Request
        factory = APIRequestFactory()
        request = factory.get(
            '/foo?district_id=FOO', format='json')
        response = PollingDistrictViewSet.as_view({'get': 'list'})(request)
        self.assertEqual(400, response.status_code)

    def test_unknown_council(self):
        # council that matches no districts should return empty array []
        factory = APIRequestFactory()
        request = factory.get(
            '/foo?council_id=X01000002', format='json')
        response = PollingDistrictViewSet.as_view({'get': 'list'})(request)
        self.assertEqual(200, response.status_code)
        self.assertEqual(0, len(response.data))

    def test_valid_council(self):
        factory = APIRequestFactory()
        request = factory.get(
            '/foo?council_id=X01000001', format='json')
        response = PollingDistrictViewSet.as_view({'get': 'list'})(request)
        self.assertEqual(200, response.status_code)
        self.assertEqual(3, len(response.data))

    def test_valid_council_geo(self):
        factory = APIRequestFactory()
        request = factory.get(
            '/foo?council_id=X01000001', format='json')
        response = PollingDistrictViewSet.as_view({'get': 'geo'})(request)
        self.assertEqual(200, response.status_code)
        # geo response should be a FeatureCollection, not an array
        self.assertEqual('FeatureCollection', response.data['type'])
        self.assertEqual(3, len(response.data['features']))

    def test_district_with_valid_station(self):
        factory = APIRequestFactory()
        request = factory.get(
            '/foo?council_id=X01000001&district_id=AA', format='json')
        response = PollingDistrictViewSet.as_view({'get': 'list'})(request)
        self.assertEqual(200, response.status_code)
        self.assertEqual('AA', response.data['district_id'])
        self.assertEqual(
            "St Foo's Church Hall, Bar Town",
            response.data['polling_station']['address']
        )

    def test_district_with_null_station(self):
        factory = APIRequestFactory()
        request = factory.get(
            '/foo?council_id=X01000001&district_id=CC', format='json')
        response = PollingDistrictViewSet.as_view({'get': 'list'})(request)
        self.assertEqual(200, response.status_code)
        self.assertEqual('CC', response.data['district_id'])
        self.assertEqual(None, response.data['polling_station'])

    def test_district_geo(self):
        factory = APIRequestFactory()

        # set up geojson request for district X01000001.AA
        geo_request = factory.get(
            '/foo?council_id=X01000001&district_id=AA', format='json')
        geo_response = PollingDistrictViewSet.as_view({'get': 'geo'})(geo_request)

        # set up json request for district X01000001.AA
        request = factory.get(
            '/foo?council_id=X01000001&district_id=AA', format='json')
        response = PollingDistrictViewSet.as_view({'get': 'list'})(request)

        # geo_response should contain geometry
        self.assertEqual(True, ('geometry' in geo_response.data))
        self.assertEqual('MultiPolygon', geo_response.data['geometry']['type'])

        # (non-geo) response should not contain gemoetry
        self.assertEqual(True, ('geometry' not in response.data))

        # properties key of geo_response should be the same as (non-geo) response
        self.assertEqual(response.data, geo_response.data['properties'])

        self.assertEqual('AA', response.data['district_id'])


text:
read -p "What is the name of the Docker machine you want to configure?" DEV_MACHINE_NAME
echo
read -p "What is the username for your Windows user account?" USER_NAME
echo
read -s -p "What is the password for the user account '$USER_NAME'?" USER_PASSWORD
echo
read -p "What is the IP of your client machine?" CLIENT_IP
echo

echo "Configuring $DEV_MACHINE_NAME"

docker-machine ssh $DEV_MACHINE_NAME wget http://distro.ibiblio.org/tinycorelinux/5.x/x86/tcz/cifs-utils.tcz
docker-machine ssh $DEV_MACHINE_NAME -- tce-load -i cifs-utils.tcz
docker-machine ssh $DEV_MACHINE_NAME mkdir project

CLIENT_DIR=`echo $PWD | cut -c 3-`
echo "Mounting //$CLIENT_IP$CLIENT_DIR as $PWD"
docker-machine ssh $DEV_MACHINE_NAME -- "sudo mount -t cifs //$CLIENT_IP$CLIENT_DIR $PWD -o user=$USER_NAME,password=$USER_PASSWORD"


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

using Android.App;
using Android.Content;
using Android.OS;
using Android.Support.V7.App;
using Android.Support.V7.Widget;
using Android.Util;

namespace iOrder.Activities
{
    public abstract class BaseActivity : AppCompatActivity
    {
        public Toolbar Toolbar
        {
            get;
            set;
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(LayoutResource);
            Toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);
            if (Toolbar != null)
            {
                SetSupportActionBar(Toolbar);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                SupportActionBar.SetHomeButtonEnabled(true);

            }
            //probably should run in background

        }

        protected abstract int LayoutResource
        {
            get;
        }

        protected int ActionBarIcon
        {
            set { Toolbar.SetNavigationIcon(value); }
        }
    }

}


text:
export {Doc} from './doc'
export {Chunk} from './chunk'
export {Main} from './main'


text:
package com.xiaofengguo.antlr.examples.starter;

/** Convert short array inits like {1,2,3} to "\u0001\u0002\u0003" */
public class ShortToUnicodeString extends ArrayInitBaseListener {
  /** Translate { to " */
  @Override
  public void enterInit(ArrayInitParser.InitContext ctx) {
    System.out.print('"');
  }

  /** Translate } to " */
  @Override
  public void exitInit(ArrayInitParser.InitContext ctx) {
    System.out.print('"');
  }

  /** Translate integers to 4-digit hexadecimal strings prefixed with \\u */
  @Override
    public void enterValue(ArrayInitParser.ValueContext ctx) {
        // Assumes no nested array initializers
      if (ctx.INT() != null) {
        int value = Integer.valueOf(ctx.INT().getText());
        System.out.printf("\\u%04x", value);
      } else {
        System.out.printf("{ ");
      }
    }
  @Override public void exitValue(ArrayInitParser.ValueContext ctx) {
    if (ctx.INT() == null) {
      System.out.printf(" }");
    }
  }
}


text:
package com.parse.starter;

import android.support.v4.app.FragmentManager;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBarActivity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;

import com.parse.ParseAnalytics;

public class MainActivity extends FragmentActivity {

  //Fragment signupFragment;
    //private static MainActivity mMainActivity;
    SignupFragment newSignupFragment = new SignupFragment();
    //ClassListFragment newClassListFragment = new ClassListFragment();

//    public static MainActivity getInstance() {
//        if (mMainActivity == null) {
//            mMainActivity = new MainActivity();
//        }
//        return mMainActivity;
//    }

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

    ParseAnalytics.trackAppOpenedInBackground(getIntent());

    FragmentManager fm = getSupportFragmentManager();
    //signupFragment = fm.findFragmentByTag("SignupFragment");
    //if (signupFragment == null) {
        FragmentTransaction ft = fm.beginTransaction();
        ft.add(R.id.main_activity_layout,newSignupFragment,"SignupFragment");
        ft.commit();
    //}

  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_main, menu);
    return true;
  }

  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
      return true;
    }

    return super.onOptionsItemSelected(item);
  }

//  public void changeFragment(String fragmentTag) {
//      FragmentManager fm = getSupportFragmentManager();
//      Fragment old = fm.findFragmentByTag(fragmentTag);
//      //signupFragment = fm.findFragmentByTag("SignupFragment");
//      //if (signupFragment == null) {
//      FragmentTransaction ft = fm.beginTransaction();
//      ft.add(R.id.main_activity_layout,old,fragmentTag);
//      ft.commit();
//    };
}


text:
package sample.config;

import com.hazelcast.config.AttributeConfig;
import com.hazelcast.config.Config;
import com.hazelcast.config.IndexConfig;
import com.hazelcast.config.IndexType;
import com.hazelcast.config.NetworkConfig;
import com.hazelcast.config.SerializerConfig;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.MapSession;
import org.springframework.session.hazelcast.HazelcastIndexedSessionRepository;
import org.springframework.session.hazelcast.HazelcastSessionSerializer;
import org.springframework.session.hazelcast.PrincipalNameExtractor;

// tag::class[]
@Configuration
public class SessionConfig {

	@Bean
	public Config hazelcastConfig() {
		Config config = new Config();
		NetworkConfig networkConfig = config.getNetworkConfig();
		networkConfig.setPort(0);
		networkConfig.getJoin().getAutoDetectionConfig().setEnabled(false);
		AttributeConfig attributeConfig = new AttributeConfig()
				.setName(HazelcastIndexedSessionRepository.PRINCIPAL_NAME_ATTRIBUTE)
				.setExtractorClassName(PrincipalNameExtractor.class.getName());
		config.getMapConfig(HazelcastIndexedSessionRepository.DEFAULT_SESSION_MAP_NAME)
				.addAttributeConfig(attributeConfig).addIndexConfig(
						new IndexConfig(IndexType.HASH, HazelcastIndexedSessionRepository.PRINCIPAL_NAME_ATTRIBUTE));
		SerializerConfig serializerConfig = new SerializerConfig();
		serializerConfig.setImplementation(new HazelcastSessionSerializer()).setTypeClass(MapSession.class);
		config.getSerializationConfig().addSerializerConfig(serializerConfig);
		return config;

	}

}
// end::class[]


text:
<!DOCTYPE html>

  <title>Evan Druce's Phase 0 Blog</title>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="your-stylesheet-link-here.css">

Assignment 1.7

Technical Blog: Version Control

February 16, 2016

        Version control, using a service like git, is an important tool for programmers. Version control allows for developers to view the entire history of revisions to one or more files, and merge revisions made by different people. Developers use version control in order to be able to track changes made to code, separate out (and branch off) changes made to different features, and work on different versions of the code at the same time.

          Git helps developers track changes by allowing them to create "save points" for their code, known as commits. Each time a change is made to code, a developer can create a new commit in git, while still retaining all of the previous commits. That way, if there is some kind of error, the developer can just revert to a previous version rather than having to root out the error before continuing with any other work.

          Developers should use GitHub to store their code because GitHub makes that code available for any other GitHub user to see, download, and work on. That way, multiple users can work on the same code at the same time, and use their own experimentation to engage in a sort of dialogue with the developer and perhaps persuade developers to incorporate new features into their code.


text:
#ifndef POSIX_PLATFORM_RADIO_HPP_
#define POSIX_PLATFORM_RADIO_HPP_

#include "posix/platform/radio_url.hpp"

namespace ot {
namespace Posix {

/**
 * This class manages Thread radio.
 *
 */
class Radio
{
public:
    /**
     * This method creates the radio manager.
     *
     * @param[in]   aUrl    A pointer to the null-terminated URL.
     *
     */
    explicit Radio(const char *aUrl);

    /**
     * This method initialize the Thread radio.
     *
     */
    void Init(void);

private:
    RadioUrl mRadioUrl;
};

} // namespace Posix
} // namespace ot

#endif // POSIX_PLATFORM_RADIO_HPP_


text:
<?php

/*
* <auto-generated>
*     This code was generated by a Codezu.
*
*     Changes to this file may cause incorrect behavior and will be lost if
*     the code is regenerated.
* </auto-generated>
*/

namespace Mozu\Api\Contracts\SiteSettings\General;

/**
*	Settings related to the CDN cache.
*/
class CacheSettings
{
	/**
	*A random string value appended to the URLs of CDN content. When a user clicks the Bust Cache button in , the random number in the URL forces the cache to point to the latest version of the CDN content.
	*/
	public $cdnCacheBustKey;

}

?>


text:
using Newtonsoft.Json;

namespace IBM.Watson.Assistant.v2.Model
{
    /// <summary>
    /// Properties describing any spelling corrections in the user input that was received.
    /// </summary>
    public class MessageOutputSpelling
    {
        /// <summary>
        /// The user input text that was used to generate the response. If spelling autocorrection is enabled, this text
        /// reflects any spelling corrections that were applied.
        /// </summary>
        [JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)]
        public string Text { get; set; }
        /// <summary>
        /// The original user input text. This property is returned only if autocorrection is enabled and the user input
        /// was corrected.
        /// </summary>
        [JsonProperty("original_text", NullValueHandling = NullValueHandling.Ignore)]
        public string OriginalText { get; set; }
        /// <summary>
        /// Any suggested corrections of the input text. This property is returned only if spelling correction is
        /// enabled and autocorrection is disabled.
        /// </summary>
        [JsonProperty("suggested_text", NullValueHandling = NullValueHandling.Ignore)]
        public string SuggestedText { get; set; }
    }

}


text:
package me.antonle.telegrambot.itbot.telegram.model;

import java.io.Serializable;

public class GroupChat implements Serializable {

    public Long id;

    public String title;

    public GroupChat() {
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        GroupChat groupChat = (GroupChat) o;

        return id.equals(groupChat.id);

    }

    @Override
    public int hashCode() {
        return id.hashCode();
    }

    @Override
    public String toString() {
        return "GroupChat{" +
                "id=" + id +
                ", title='" + title + '\'' +
                '}';
    }
}


text:
<?php

/**
 * Open PDF file [deprecated]
 *
 * @phpstub
 *
 * @param resource $pdfdoc
 * @param string $filename
 * @param string $optlist
 * @param int $len
 *
 * @return int
 */
function PDF_open_pdi($pdfdoc, $filename, $optlist, $len)
{
}


text:
module SetupDisplays {

    var myModule = angular.module("displays", []);

    // Register factory to provide the md converter
    myModule.factory("Showdown", function () {
        return new Showdown.converter();
    });
    var mdFilesCache = {};
    // Register markdown directive
    myModule.directive('mdInclude', ['Showdown', function (Showdown) {
        return {
            restrict: 'AE',
            link: function (scope, element, attrs) {
                var fileName = attrs.mdInclude;

                if (mdFilesCache.hasOwnProperty(fileName)) {
                    element.html(mdFilesCache[fileName]);
                } else {
                    $.get('/mdfiles/' + fileName + ".md.html", null,
                        function (data) { // Success
                            var html = data ? Showdown.makeHtml(data) : '';
                            mdFilesCache[fileName] = html;
                            element.html(html);
                        });
                }
            }
        }
    }]);

    // Register specs directive
    myModule.directive('specsInclude', ['loader', function (loader) {
        return {
            restrict: 'AE',
            link: function (scope, element, attrs) {
                var iFrame = $("<iframe src='http://dev.webinos.org/specifications/api/" + attrs.specsInclude + ".html' frameborder='0'/>");
                loader.SetMessage("Loading specs");
                loader.Show();
                iFrame.load(function () {
                    loader.Hide();
                });
                element.html(iFrame);
            }
        }
    }]);

    var RegisterSection = function (sectionName: string, items: IDisplayItemMeta[]) {
        var rootAction = "/" + sectionName + "/";

        var sideMenuLinks: INavigationItem = {
            link: '/' + sectionName,
            text: sectionName + " reference",
            sectionName: sectionName,
            subItems: []
        };
        for (var i = 0; i < items.length; i++) {
            sideMenuLinks.subItems.push({
                link: rootAction + items[i].name,
                text: items[i].name,
                keywords: items[i].keywords
            });
        }

        Globals.RegisterSection(sectionName, function ($routeProvider, $locationProvider) {

            $routeProvider.when(rootAction + ':itemName/:tab?', {
                    templateUrl: '/templates/displayItem.html',
                    controller: ['$scope', '$routeParams', '$filter', '$location', 'titleSetter', 'activeSection', function ($scope, $routeParams, $filter, $location, titleSetter, activeSection) {
                        var results: IDisplayItemMeta[] = $filter('filter')(Configuration[sectionName], { name: $routeParams.itemName });
                        if (results.length != 1) $location.path(rootAction);
                        var item = results[0];
                        $scope.activeTab = $routeParams.tab ? $routeParams.tab : "descr";
                        titleSetter(item.name);
                        activeSection(sectionName);
                        angular.extend($scope, item);

                        Globals.LoadDisqus(sectionName + "_" + item.name);
                    }]
                }).when(rootAction, {
                        templateUrl: '/templates/' + sectionName+ '.html',
                        controller: ['$scope', 'titleSetter', 'activeSection', function ($scope, titleSetter, activeSection) {
                            titleSetter(sectionName);
                            activeSection(sectionName);
                            $scope.sectionName = sectionName;
                            $scope.sectionItems = sideMenuLinks.subItems;
                        }]
                    });

        });

        Globals.RegisterSideNavigationItem(sideMenuLinks);

    };

    for (var i in Configuration) {
        RegisterSection(i, Configuration[i]);
    }
}


text:
"""
redis-contrib
======

Missing contrib packages for redis-py.
"""

from setuptools import setup, find_packages

setup(
    name='redis-contrib',
    version='0.0.0',
    author='Matt Robenolt',
    author_email='matt@ydekproductions.com',
    url='https://github.com/mattrobenolt/redis-py-contrib',
    description='Missing contrib packages for redis-py',
    long_description=__doc__,
    packages=find_packages(),
    zip_safe=False,
    license='BSD',
    install_requires=[
        'redis',
    ],
    include_package_data=True,
    classifiers=[
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'Operating System :: OS Independent',
        'Topic :: Software Development'
    ],
)