text:
my $PREFIX     = "@@PREFIX@@";
my $portfiles  = "$PREFIX/files";
my $portindex  = "$PREFIX/index";
my $portpasswd = "$PREFIX/index/.portpasswd";

use CGI;
use Fcntl;
use Digest::MD5 qw(md5_hex);
my $cgi = new CGI;

sub validate_param() {
        my ($regex, $str) = @_;
        $str = "" if !$str;
        $str =~ s/$regex//g;
        # The following are escaped even if they are permitted
        # by the above regex, since they will choke the SQL.
        $str =~ s/\\/\\\\/g;
        $str =~ s/'/\\'/g;
        $str =~ s/"/\\"/g;
        return $str;
}

#
# These are the variables expected from the CGI client.
#

my $name         = &validate_param(qr[^A-Za-z0-9_.-], $cgi->param('name'));
my $version      = &validate_param(qr[^A-Za-z0-9_.-], $cgi->param('version'));
my $base_rev     = &validate_param(qr[^0-9], $cgi->param('base_rev'));
my $md5          = &validate_param(qr[^A-Fa-f0-9], $cgi->param('md5'));
my $submitted_by = &validate_param(qr[^A-Za-z0-9.!@#$%^&*_+=-],
		   $cgi->param('submitted_by'));
my $password     = $cgi->param('password') ? md5_hex($cgi->param('password')) :
		   "";
my $comment      = &validate_param(qr[^A-Za-z0-9 '",.!@#$%^&*_+=-],
                   $cgi->param('comment'));
my $description  = &validate_param(qr[^A-Za-z0-9 '",.!@#$%^&*_+=-],
                   $cgi->param('description'));
my $long_description = &validate_param(qr[^A-Za-z0-9 '",.!@#$%^&*_+=-],
                   $cgi->param('long_description'));

my @maintainers  = split(' ', &validate_param(qr[^A-Za-z0-9.!@#$%^&*_+=-],
		   $cgi->param('maintainers')));
my @categories   = split(' ', &validate_param(qr[^A-Za-z0-9_.-],
		   $cgi->param('categories')));

my @master_sites  = split(' ', &validate_param(qr[^A-Za-z0-9.!@#$%^&*_+=:/-],
		   $cgi->param('master_sites')));

#
# The atomic_serial subroutine atomically (from the
# perspective of portindex.cgi processes) reads the
# most recently allocated integer from the specified
# file (argument to this sub), increments it, writes
# the value back out to the file, and returns the
# value to the caller.
#
# The optional second parameter is used to detect
# conflicts.  If the existing serial does not equal
# the second parameter, then the serial is not
# updated and this function returns the existing
# serial number as a negative number.
#
sub atomic_serial($$) {
    my ($filename, $last_rev) = @_;
    sysopen(SERIAL, $filename, O_RDWR|O_CREAT|O_EXLOCK) or die "Unable to open $filename: $!";
    my $serial = <SERIAL>;
    chomp($serial);
    if (!$serial) {
        $serial = "1";
    } else {
        if (!defined($last_rev) or ($serial eq $last_rev)) {
            $serial = $serial + 1;
        } else {
            close(SERIAL);
            return -1 * $serial;
        }
    }
    # serials are monotonically increasing, so simply
    # over-writing the previous contents should be OK.
    seek(SERIAL, 0, 0);
    print SERIAL "$serial\n";
    print SERIAL "# DO NOT EDIT.\n";
    close(SERIAL);
    return $serial;
}

#
# This is almost the same as the atomic_serial sub
# except it uses the serial to name the portindex
# file to be appended/created.  Unfortunately this
# couldn't use the atomic_serial sub because of
# atomicity constraints.  We need to keep the serial
# locked during our open/create/open flailing.
#
sub atomic_index($) {
    my ($path) = @_;
    sysopen(SERIAL, "$path/.last_index", O_RDWR|O_CREAT|O_EXLOCK) or die "Unable to open $path/.last_index: $!";
    my $serial = <SERIAL>;
    if (!$serial) {
        $serial = "1";
    } else {
        chomp($serial);
    }

    sysopen(PORTINDEX, "$path/portindex-$serial.sql", O_WRONLY|O_APPEND|O_CREAT|O_EXLOCK) or die "Unable to open portindex-$serial.sql: $!";
    my $size = (stat(PORTINDEX))[7];
    # If the index file is greater than 1MB in size, rotate to the next one.
    if ($size > 1024*1024) {
        $serial = $serial + 1;
        close(PORTINDEX);
        sysopen(PORTINDEX, "$path/portindex-$serial.sql", O_WRONLY|O_APPEND|O_CREAT|O_EXLOCK) or die "Unable to open portindex-$serial.sql: $!";
    }
    # serials are monotonically increasing, so simply
    # over-writing the previous contents should be OK.
    seek(SERIAL, 0, 0);
    print SERIAL "$serial\n";
    print SERIAL "# DO NOT EDIT.\n";
    close(SERIAL);
    return PORTINDEX;
}

#####
#
# Here lies the real processing
#
#####

# We output in text/plain mode for easy parsing of the
# result by the client.
print $cgi->header('text/plain');

# Verify the submitter / password.
my $authenticated = 0;
$! = 0;
sysopen(PASSWD, "$portpasswd", O_RDONLY);
if ($! != 0) {
    print "ERROR: Unable to open $portpasswd: $!\n";
    die "ERROR: Unable to open $portpasswd: $!";
}
while (<PASSWD>) {
    my ($email, $hash) = split(':', $_);
    if ($email eq $submitted_by) {
        if ($hash eq $password) {
            $authenticated = 1;
            last;
        }
    }
}

if (!$authenticated) {
    print "ERROR: Invalid username or password.\n";
    exit 0;
}

# Start by obtaining a unique identifier for this transaction.

my $transaction = &atomic_serial("$portindex/.last_transaction");

#
# Create a destination directory for the new revision of the specified port.
#

my $dir = "$portfiles/$name/$version";
chdir("/");
foreach my $d (split('/', $dir)) {
    if ($d) {
        print STDERR "$d\n";
        if (!mkdir($d)) {
            die "Unable to mkdir: $!" if $! != 17; # EEXIST
        }
        chdir($d) or die "Unable to chdir: $!";
    }
}
$revision = &atomic_serial(".last_revision", $base_rev);

#
# If the new revision does not immediately follow the revision that the
# submission is based on, then someone else has submitted an intermediate
# change.  Therefore there is likely a conflict.  Report the conflict to the
# client, and indicate which revision the conflict must be resolved with.
#

if ($revision < 0) {
    print "CONFLICT: $transaction\n";
    print "revision: ", -1 * $revision, "\n";
    exit;
}

mkdir("$revision");
chdir("$revision");

#
# Copy the attachment to the destination
#

$attachparam = $cgi->param('attachment');
if (!$attachparam) {
	print "ERROR: Portfile attachment is missing.\n";
	die "ERROR: Portfile attachment is missing";
}
# basename
sysopen(ATTACHMENT, "Portfile.tar.gz", O_RDWR|O_CREAT|O_EXLOCK|O_TRUNC) or die "Unable to open Portfile.tar.gz: $!";
binmode(ATTACHMENT);
while (<$attachparam>) {
    print ATTACHMENT;
}
seek(ATTACHMENT,0,0);
my $md5tmp = Digest::MD5->new->addfile(ATTACHMENT)->hexdigest();
if ($md5tmp ne $md5) {
	print "ERROR: Portfile attachment checksum failed.  Expected $md5 but got $md5tmp\n";
	die "ERROR: Portfile attachment checksum failed.  Expected $md5 but got $md5tmp\n";
}
close(ATTACHMENT);

#
# Print the transaction out to the SQL logs
#

$handle = &atomic_index($portindex);

print $handle "-- BEGIN TRANSACTION #$transaction\n";
print $handle "INSERT INTO ports (pid, name, version, revision) VALUES ('$transaction', '$name', '$version', '$revision');\n";
print $handle "INSERT INTO keywords (pid,keyword,value) VALUES ('$transaction','submitter','$submitted_by');\n";
print $handle "INSERT INTO keywords (pid,keyword,value) VALUES ('$transaction','commit_log','$comment');\n";
foreach my $maintainer (@maintainers) {
    chomp($maintainer);
    print $handle "INSERT INTO keywords (pid,keyword,value) VALUES ('$transaction','maintainers','$maintainer');\n";
}
foreach my $category (@categories) {
    chomp($category);
    print $handle "INSERT INTO keywords (pid,keyword,value) VALUES ('$transaction','categories','$category');\n";
}
print $handle "INSERT INTO keywords (pid,keyword,value) VALUES ('$transaction','description','$description');\n";
print $handle "INSERT INTO keywords (pid,keyword,value) VALUES ('$transaction','long_description','$long_description');\n";
print $handle "INSERT INTO keywords (pid,keyword,value) VALUES ('$transaction','Portfile_md5','$md5');\n";
foreach my $master_site (@master_sites) {
    chomp($master_site);
    print $handle "INSERT INTO keywords (pid,keyword,value) VALUES ('$transaction','master_sites','$master_site');\n";
}

print $handle "-- END TRANSACTION #$transaction\n";

close($handle);

#
# Report normal, successful, completion.
#

print "OK: $transaction\n";
print "revision: $revision\n";


text:
<!DOCTYPE html>

    <title>SceneJS Example</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">

    <link href="css/styles.css" rel="stylesheet"/>

    SceneJS - physics using JigLibJS

    - learn more in this article

redpajama_set_name: RedPajamaGithub


text:
module Factory
  def self.create_user(params = {})
    User.create!(params.reverse_merge({
      email: "test@example.com",
      name: "Test User",
      password: "password",
      password_confirmation: "password",
      provider: "email",
      confirmed_at: DateTime.now
    }))
  end

  def self.create_admin(params = {})
    create_user(params.reverse_merge({
      email: "admin@example.com",
      admin: true,
    }))
  end

  def self.create_album(params = {})
    Album.create!(params.reverse_merge({
      title: "Test Album",
    }))
  end

  def self.create_photo(params = {})
    Photo.create!(params.reverse_merge({
      path: "test-album",
      filename: "P1080110.JPG",
    }))
  end

  def self.create_photo_version(params = {photo: create_photo})
    PhotoVersion.create!(params.reverse_merge({
      filename: "P1080110.JPG",
      size: PhotoSize.original.name,
      width: 4,
      height: 3,
    }))
  end

  def self.create_comment(params = {photo: create_photo})
    Comment.create!(params.reverse_merge({
      body: "example comment",
    }))
  end

  def self.create_google_auth(params = {user: create_admin})
    GoogleAuthorization.create!(params.reverse_merge({
      access_token: "access-token",
    }))
  end
end


text:
"""Constants for fritzbox tests."""
from homeassistant.components.fritzbox.const import DOMAIN
from homeassistant.const import CONF_DEVICES, CONF_HOST, CONF_PASSWORD, CONF_USERNAME

MOCK_CONFIG = {
    DOMAIN: {
        CONF_DEVICES: [
            {
                CONF_HOST: "fake_host",
                CONF_PASSWORD: "fake_pass",
                CONF_USERNAME: "fake_user",
            }
        ]
    }
}

CONF_FAKE_NAME = "fake_name"
CONF_FAKE_AIN = "12345 1234567"
CONF_FAKE_MANUFACTURER = "fake_manufacturer"
CONF_FAKE_PRODUCTNAME = "fake_productname"


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net;
using SimpleJSON;

namespace Uptred.Vimeo
{
    public partial class VimeoHook
    {
        string clientId;
        string apiRoot;
        string redirect;

        public static Action<string> VerboseCallback = null;
        public Action<VerifyFeedback> UploadCallback = null;

        /// <summary>
        /// This contains all JSON data that is received after login.
        /// </summary>
        public JSONNode AccessJson { get; private set; }

        /// <summary>
        /// User data. contains information such as display name, user uri, etc.
        /// </summary>
        public JSONNode User { get; private set; }

        /// <summary>
        /// Access token after login. Save this for relogins.
        /// </summary>
        public string AccessToken { get; private set; }

        /// <summary>
        /// Scopes (permissions) you have. e.g. "private public"
        /// </summary>
        //public
        string[] Scope { get; set; }

        /// <summary>
        /// token_type. e.g. "bearer"
        /// </summary>
        //public
        string TokenType { get; set; }

        void loadAccessData()
        {
            AccessToken = AccessJson["access_token"].Value;
            Scope = AccessJson["scope"].Value.Split(' ');
            TokenType = AccessJson["token_type"].Value;
            User = Request("/me", null, "GET");
        }

        /// <summary>
        /// Generates a new access token given the authorization code generated by the page
        /// at get_auth_url().
        ///
        /// In the context of a web server, the programmer should retrieve the auth_code
        /// generated by the page at get_auth_url() and use it as the input to this function.
        /// The programmer should then use the string returned from this function to
        /// authenticate calls to the API library on behalf of the corresponding user.
        ///
        /// Note: The following URLs must be identical:
        /// This function's redirect parameter
        /// The redirect parameter passed to get_access_token
        /// One of the redirect URIs listed on the app setup page
        /// </summary>
        /// <param name="authCode">The authorization code given in the 'code' query parameter of the page URI after redirecting from the result of get_auth_url</param>
        /// <param name="clientId">The client ID for the current app</param>
        /// <param name="secret">The client secret for the current app</param>
        /// <param name="redirect">The redirect URI for the app (see note)</param>
        /// <param name="apiRoot">The root url of the API being used (in OldVimeoClient, accessible via config['apiroot'])</param>
        /// <returns>Access Token JSON. result["access_token"] contains access token in string</returns>
        static JSONNode GetAccessToken(
            string authCode, string clientId, string secret, string redirect, string apiRoot = "https://api.vimeo.com")
        {
            string encoded = Core.ToBase64(String.Format("{0}:{1}", clientId, secret));
            Debug.WriteLine(String.Format("Encoded: {0}", encoded));

            var payload = new Dictionary<string, string>
            {
                {"grant_type", "authorization_code"},
                {"code", authCode},
                {"redirect_uri", redirect}
            };
            var headers = new WebHeaderCollection
            {
                {"Authorization", String.Format("Basic {0}", encoded)}
            };

            string[] responseHeaders;
            var response = Core.HTTPFetch(
                String.Format("{0}/oauth/access_token", apiRoot),
                "POST", headers, payload, out responseHeaders);

            if (VerboseCallback != null) VerboseCallback(response);
            return JSON.Parse(response);
        }

        public static string GetClientCredentials(string clientId, string clientSecret, string scopes = null, string apiRoot = "https://api.vimeo.com")
        {
            var basicAuth = Core.ToBase64(string.Format("{0}:{1}", clientId, clientSecret));
            var payload = new Dictionary<string, string>
            {
                {"grant_type", "client_credentials"}
            };
            var headers = new WebHeaderCollection
            {
                //{"Accept", "application/vnd.vimeo.*+json; version=3.2"},
                {"Authorization", String.Format("Basic {0}", basicAuth)}
            };
            if (scopes != null) payload.Add("scope", scopes);
            string[] responseHeaders;
            var response = Core.HTTPFetch(String.Format("{0}/oauth/authorize/client", apiRoot),
                "POST", headers, payload, out responseHeaders);

            var json = JSON.Parse(response);
            return json["access_token"];
        }

        public static VimeoHook Authorize(
        string authCode,
        string clientId,
        string secret,
        string redirect,
        string apiRoot = "https://api.vimeo.com")
        {
            VimeoHook vc = new VimeoHook();
            vc.clientId = clientId;
            vc.apiRoot = apiRoot;
            vc.redirect = redirect;
            vc.AccessJson = GetAccessToken(authCode, clientId, secret, redirect, apiRoot);
            vc.loadAccessData();

            return vc;
        }

        public static VimeoHook ReAuthorize(
            string accessToken,
            string clientId,
            string redirect="",
            string apiRoot = "https://api.vimeo.com")
        {
            VimeoHook vc = new VimeoHook();
            vc.clientId = clientId;
            vc.redirect = redirect;
            vc.AccessToken = accessToken;
            vc.apiRoot = apiRoot;
            vc.User = vc.Request("/me", null, "GET");
            if (vc.User["error"].Value.Length > 0) throw new Exception(vc.User["error"]);

            return vc;
        }

        public static string GetLoginURL(
            string clientId,
            List<string> scopes = null,
            string redirect = "",
            string apiRoot = "https://api.vimeo.com")
        {
            List<string> choices = new List<string>{"interact", "private", "public", "create",
                "edit", "delete", "upload"};
            string authUrl = String.Format("{0}/oauth/authorize?response_type=code&client_id={1}&scope=",
                apiRoot, clientId);

            if (scopes == null) scopes = choices;
            foreach (var scope in scopes)
            {
                if (!choices.Contains(scope))
                    throw new FormatException(String.Format("Scope must be one of {0} (found scope '{1}')", choices, scope));
                authUrl += String.Format("{0}+", scope);
            }
            authUrl += String.Format("&redirect_uri={0}", redirect);
            return authUrl;
        }

        /// <summary>
        /// This is your portal to Vimeo. Use it to call a method with a bunch of parameters.
        /// Example: get your own profile by calling
        /// Request("/me", null, "GET")
        /// </summary>
        /// <param name="url">The endpoint. It should be a relative URL specifying the API method you want to call, such as "/me"</param>
        /// <param name="parameters">Call parameters. Put null if you don't feel like it.</param>
        /// <param name="method">HTTP method: e.g. "GET", "POST", "PUT", etc.</param>
        /// <param name="jsonBody">true: set content type to json</param>
        /// <returns>Deserialized JSON as Dictionary of strings to objects</returns>
        public JSONNode Request(
            string url,
            Dictionary<string, string> parameters,
            string method,
            bool jsonBody = true)
        {
            string body = "";

            if (parameters != null && parameters.Count > 0)
            {
                if (method == "GET")
                {
                    url += "?" + Core.KeyValueToString(parameters);
                }
                else if (method == "POST" || method == "PATCH" || method == "PUT" || method == "DELETE")
                {
                    if (jsonBody)
                    {
                        body = Core.JsonEncode(parameters);
                    }
                    else
                    {
                        body = Core.KeyValueToString(parameters);
                    }
                }
            }

            return Request(url, method, jsonBody, body);
        }

        public JSONNode Request(
            string url,
            string method,
            bool jsonBody,
            string body)
        {
            string[] responseHeaders;
            return Request(url, method, jsonBody, body, out responseHeaders);
        }

        public JSONNode Request(
            string url,
            string method,
            bool jsonBody,
            string body,
            out string[] responseHeaders)
        {
            string fetch = RequestRaw(url, method, jsonBody, body, out responseHeaders);
            return JSON.Parse(fetch);
        }

        public string RequestRaw(
            string url,
            string method,
            bool jsonBody,
            string body,
            out string[] responseHeaders)
        {
            string contentType = "application/x-www-form-urlencoded";
            if (jsonBody) contentType = "application/json";
            var headers = new WebHeaderCollection()
            {
                { "Authorization", String.Format("Bearer {0}", AccessToken) }
            };
            method = method.ToUpper();
            url = apiRoot + url;

            var fetch = Core.HTTPFetch(url, method, headers, body, out responseHeaders, contentType);
            if (VerboseCallback != null) VerboseCallback(fetch);
            return fetch;
        }

        protected static VerifyFeedback Verify(string url)
        {
            WebHeaderCollection headers = new WebHeaderCollection();
            headers.Add("Content-Range: bytes */*");

            string[] responseHeaders;
            Core.HTTPFetch(url, "PUT", headers, "", out responseHeaders);

            VerifyFeedback v = new VerifyFeedback();
            foreach (var item in responseHeaders)
            {
                if (item.StartsWith("Range:"))
                {
                    var s = item.Split(':')[1].Trim();
                    var rangestr = s.Split('=')[1].Split('-');
                    v.FirstByte = long.Parse(rangestr[0]);
                    v.LastByte = long.Parse(rangestr[1]);
                }
            }

            return v;
        }

        protected static void Upload(
            string url,
            long contentLength,
            long startByte,
            byte[] payload)
        {
            WebHeaderCollection headers = new WebHeaderCollection();
            headers.Add(String.Format("Content-Range: bytes {0}-{1}/{2}",
                startByte, startByte + payload.Length, contentLength));

            string[] responseHeaders;
            var responseFromServer = Core.HTTPFetch(
                url, "PUT", headers, payload, payload.Length, out responseHeaders,
                "video/mp4");

            Debug.WriteLine(String.Format("Response from URL {0}:", url), "Upload");
            Debug.WriteLine(responseFromServer, "Upload");
            if (VerboseCallback != null) VerboseCallback(responseFromServer);

        }

        protected static string Complete(string url, WebHeaderCollection headers)
        {
            string[] responseHeaders;
            Core.HTTPFetch(
                url, "DELETE", headers, "", out responseHeaders,
                contentType: "application/x-www-form-urlencoded",
                requestAccept: "application/vnd.vimeo.*+json; version=3.2");

            string result = null;
            foreach (var item in responseHeaders)
            {
                if (item.Contains("Location"))
                {
                    result = item.Split(':')[1].Trim();
                    break;
                }
            }

            Debug.WriteLine(String.Format("Response from URL {0}:", url), "Complete");
            Debug.WriteLine(result, "Complete");
            if (VerboseCallback != null) VerboseCallback(result);
            return result;
        }

        public Ticket GetTicket(string videoid = null, bool? upgrade_to_1080 = null)
        {
            var payload = new Dictionary<string, string>();
            payload["type"] = "streaming";
            if (upgrade_to_1080.HasValue) payload["upgrade_to_1080"] = upgrade_to_1080.Value.ToString().ToLower();
            if (!Core.IsNullOrWhiteSpace(videoid))
            {
                var endpoint = String.Format("/videos/{0}/files", videoid);
                var response = Request(endpoint,payload,"PUT");
                return Ticket.FromJson(response);
            }
            else
            {
                var response = Request("/me/videos",payload,"POST");
                return Ticket.FromJson(response);
            }
        }

        public string Upload(string path, Ticket ticket = null,
            int chunkSize = Core.DEFAULT_CHUNK_SIZE,
            int maxAttempts = Core.DEFAULT_MAX_ATTEMPTS,
            long startByte = 0, bool step = false)
        {
            int attempts = 0;
            if (ticket == null) ticket = GetTicket();
            long contentLength = new FileInfo(path).Length;
            while (true)
            {
                var feedback = Verify(ticket.UploadLinkSecure);
                startByte = feedback.LastByte;
                feedback.ContentSize = contentLength;
                if (VerboseCallback != null) VerboseCallback(String.Format("{0}/{1} Uploaded.", feedback.LastByte, contentLength));
                if (UploadCallback != null) UploadCallback(feedback);
                if (feedback.LastByte >= contentLength)
                {
                    Debug.WriteLine("Done!");
                    break;
                }

                try
                {
                    var payload = Core.GetPayload(path, startByte, chunkSize);
                    Upload(ticket.UploadLinkSecure, contentLength, startByte, payload);
                }
                catch (Exception e)
                {
                    attempts++;
                    if (attempts > maxAttempts)
                    {
                        Debug.WriteLine(e.Message, "Upload");
                        return null;
                    }
                }

                if (step) return "";
            }

            var complete = Complete(apiRoot + ticket.CompleteUri,
                new WebHeaderCollection()
                {
                    { "Authorization", String.Format("Bearer {0}", AccessToken) }
                });
            return complete;
        }
    }
}


text:
<title>
  Package Index
</title>

API User's Guide  Class Hierarchy  Index

 Other Packages

<menu>

 package VisualNumerics.math
</menu>


text:
sap.ui.define([
	"./BaseController",
	"sap/ui/core/UIComponent"
], function(BaseController, UIComponent) {
	"use strict";

	return BaseController.extend("sap.ui.demo.cart.controller.NotFound", {
		onInit: function () {
			this._router = UIComponent.getRouterFor(this);
		}
	});
});


text:
using System;
using NUnit.Framework;
using ICSharpCode.NRefactory.CSharp.Refactoring;
using ICSharpCode.NRefactory.CSharp.CodeActions;

namespace ICSharpCode.NRefactory.CSharp.CodeIssues
{
	[TestFixture]
	public class ThreadStaticAtInstanceFieldTests : InspectionActionTestBase
	{
		[Test]
		public void TestInspectorCase1 ()
		{
			var input = @"using System;
class Foo
{
	[ThreadStatic]
	int bar;
}";
			TestRefactoringContext context;
			var issues = GetIssues (new ThreadStaticAtInstanceFieldIssue (), input, out context);
			Assert.AreEqual (1, issues.Count);

			CheckFix (context, issues [0], @"using System;
class Foo
{
	int bar;
}");
		}

		[Test]
		public void TestInspectorCase2 ()
		{
			var input = @"using System;
class Foo
{
	[Serializable, ThreadStatic]
	int bar;
}";
			TestRefactoringContext context;
			var issues = GetIssues (new ThreadStaticAtInstanceFieldIssue (), input, out context);
			Assert.AreEqual (1, issues.Count);

			CheckFix (context, issues [0], @"using System;
class Foo
{
	[Serializable]
	int bar;
}");
		}

		[Test]
		public void TestInspectorCase3 ()
		{
			var input = @"class Foo
{
	[System.ThreadStatic, System.Serializable]
	int bar;
}";
			TestRefactoringContext context;
			var issues = GetIssues (new ThreadStaticAtInstanceFieldIssue (), input, out context);
			Assert.AreEqual (1, issues.Count);

			CheckFix (context, issues [0], @"class Foo
{
	[System.Serializable]
	int bar;
}");
		}

		[Test]
		public void TestResharperSuppression ()
		{
			var input = @"using System;
class Foo
{
// ReSharper disable once ThreadStaticAtInstanceField
	[ThreadStatic]
	int bar;
}";
			TestRefactoringContext context;
			var issues = GetIssues (new ThreadStaticAtInstanceFieldIssue (), input, out context);
			Assert.AreEqual (0, issues.Count);

		}

        [Test]
        public void InstanceField()
        {
            var input = @"
using System;
class TestClass
{
	[ThreadStatic]
	string field;
}";
            TestRefactoringContext context;
            var issues = GetIssues(new ThreadStaticAtInstanceFieldIssue(), input, out context);
            Assert.AreEqual(1, issues.Count);
            var issue = issues[0];
            Assert.AreEqual(2, issue.Actions.Count);

            CheckFix(context, issues[0], @"
using System;
class TestClass
{
	string field;
}");
        }

        [Test]
        public void InstanceFieldWithMultiAttributeSection()
        {
            var input = @"
using System;
class TestClass
{
	[field: ThreadStatic, ContextStatic]
	string field;
}";
            TestRefactoringContext context;
            var issues = GetIssues(new ThreadStaticAtInstanceFieldIssue(), input, out context);
            Assert.AreEqual(1, issues.Count);
            var issue = issues[0];
            Assert.AreEqual(2, issue.Actions.Count);

            CheckFix(context, issues[0], @"
using System;
class TestClass
{
	[field: ContextStatic]
	string field;
}");
        }

        [Test]
        public void StaticField()
        {
            var input = @"
using System;
class TestClass
{
	[ThreadStatic]
	static string field;
}";
            TestRefactoringContext context;
            var issues = GetIssues(new ThreadStaticAtInstanceFieldIssue(), input, out context);
            Assert.AreEqual(0, issues.Count);
        }
	}
}


text:
<?xml version="1.0" ?>
<INPUT>

	<MEDALS>
		<MEDAL Id="1" MEDAL_THRESHOLD="52000" TYPE="Gold"/>
		<MEDAL Id="2" MEDAL_THRESHOLD="79000" TYPE="Silver"/>
		<MEDAL Id="3" MEDAL_THRESHOLD="102000" TYPE="Bronze"/>

	</MEDALS>

	<SpeedSettings Default="18" Max="150" Min="0"/>

	<PenaltySettings SpeedLost="0.1" TimeLost="15"/>

	<PROBLEM_SET>
		<PROBLEM_SUBSET>
			<TARGET TYPE="Fraction">
				<ContentSettings denominator="10" numerator="4"/>
			</TARGET>
			<QUESTION INDEX="1">
				<Content TYPE="String">
					<ContentSettings string="0.1"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="0.2"/>
				</Content>
				<Answer VALUE="2"/>
			</QUESTION>
			<QUESTION INDEX="2">
				<Content TYPE="String">
					<ContentSettings string="0"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="0.2"/>
				</Content>
				<Answer VALUE="2"/>
			</QUESTION>
			<QUESTION INDEX="3">
				<Content TYPE="String">
					<ContentSettings string="0.6"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="0.9"/>
				</Content>
				<Answer VALUE="0"/>
			</QUESTION>
		</PROBLEM_SUBSET>
		<PROBLEM_SUBSET>
			<TARGET TYPE="Fraction">
				<ContentSettings denominator="12" numerator="7"/>
			</TARGET>
			<QUESTION INDEX="4">
				<Content TYPE="String">
					<ContentSettings string="0.166"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="0.833"/>
				</Content>
				<Answer VALUE="1"/>
			</QUESTION>
			<QUESTION INDEX="5">
				<Content TYPE="String">
					<ContentSettings string="0.833"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="1"/>
				</Content>
				<Answer VALUE="0"/>
			</QUESTION>
			<QUESTION INDEX="6">
				<Content TYPE="String">
					<ContentSettings string="0.416"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="1"/>
				</Content>
				<Answer VALUE="1"/>
			</QUESTION>
		</PROBLEM_SUBSET>
		<PROBLEM_SUBSET>
			<TARGET TYPE="Fraction">
				<ContentSettings denominator="10" numerator="5"/>
			</TARGET>
			<QUESTION INDEX="7">
				<Content TYPE="String">
					<ContentSettings string="0.6"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="1.1"/>
				</Content>
				<Answer VALUE="0"/>
			</QUESTION>
			<QUESTION INDEX="8">
				<Content TYPE="String">
					<ContentSettings string="0.3"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="1.1"/>
				</Content>
				<Answer VALUE="1"/>
			</QUESTION>
			<QUESTION INDEX="9">
				<Content TYPE="String">
					<ContentSettings string="0.8"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="1.1"/>
				</Content>
				<Answer VALUE="0"/>
			</QUESTION>
		</PROBLEM_SUBSET>
		<PROBLEM_SUBSET>
			<TARGET TYPE="Fraction">
				<ContentSettings denominator="100" numerator="72"/>
			</TARGET>
			<QUESTION INDEX="10">
				<Content TYPE="String">
					<ContentSettings string="0.24"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="0.49"/>
				</Content>
				<Answer VALUE="2"/>
			</QUESTION>
			<QUESTION INDEX="11">
				<Content TYPE="String">
					<ContentSettings string="0.75"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="0.85"/>
				</Content>
				<Answer VALUE="0"/>
			</QUESTION>
			<QUESTION INDEX="12">
				<Content TYPE="String">
					<ContentSettings string="1"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="1.01"/>
				</Content>
				<Answer VALUE="0"/>
			</QUESTION>
		</PROBLEM_SUBSET>
		<PROBLEM_SUBSET>
			<TARGET TYPE="Fraction">
				<ContentSettings denominator="10" numerator="2"/>
			</TARGET>
			<QUESTION INDEX="13">
				<Content TYPE="String">
					<ContentSettings string="0.8"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="1"/>
				</Content>
				<Answer VALUE="0"/>
			</QUESTION>
			<QUESTION INDEX="14">
				<Content TYPE="String">
					<ContentSettings string="0.7"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="1"/>
				</Content>
				<Answer VALUE="0"/>
			</QUESTION>
			<QUESTION INDEX="15">
				<Content TYPE="String">
					<ContentSettings string="0"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="0.1"/>
				</Content>
				<Answer VALUE="2"/>
			</QUESTION>
		</PROBLEM_SUBSET>
		<PROBLEM_SUBSET>
			<TARGET TYPE="Fraction">
				<ContentSettings denominator="4" numerator="2"/>
			</TARGET>
			<QUESTION INDEX="16">
				<Content TYPE="String">
					<ContentSettings string="0"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="1.25"/>
				</Content>
				<Answer VALUE="1"/>
			</QUESTION>
			<QUESTION INDEX="17">
				<Content TYPE="String">
					<ContentSettings string="0"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="1.25"/>
				</Content>
				<Answer VALUE="1"/>
			</QUESTION>
			<QUESTION INDEX="18">
				<Content TYPE="String">
					<ContentSettings string="0"/>
				</Content>
				<Content TYPE="String">
					<ContentSettings string="0.25"/>
				</Content>
				<Answer VALUE="2"/>
			</QUESTION>
		</PROBLEM_SUBSET>

	</PROBLEM_SET>

</INPUT>


text:
const fs = require('fs');
const unirest = require('unirest');
const promiseRetry = require('promise-retry');

// Change below to use different data file!!
const wordData = require('./public/assets/json/college-words.json');

/* ----------- API calls to Twinword to get word details ----------- */

const getDefinition = (wordName) => {
  return new Promise((resolve, reject) => {
    unirest.get(`https://twinword-word-graph-dictionary.p.mashape.com/definition/?entry=${wordName}`)
      .header("X-Mashape-Key", process.env.X_MASHAPE_KEY)
      .header("Accept", "application/json")
      .end(result => {
        if (result.status === 200) resolve(result.body.meaning);
        else reject(`Failed to get definitions for: ${wordName}`);
      });
  })
}

const getExample = (wordName) => {
  return new Promise((resolve, reject) => {
    unirest.get(`https://twinword-word-graph-dictionary.p.mashape.com/example/?entry=${wordName}`)
      .header("X-Mashape-Key", process.env.X_MASHAPE_KEY)
      .header("Accept", "application/json")
      .end(result => {
        if (result.status === 200) resolve(result.body.example);
        else reject(`Failed to get examples for: ${wordName}`);
      });
  })
}

const getRelation = (wordName) => {
  return new Promise((resolve, reject) => {
    unirest.get(`https://twinword-word-graph-dictionary.p.mashape.com/reference/?entry=${wordName}`)
      .header("X-Mashape-Key", process.env.X_MASHAPE_KEY)
      .header("Accept", "application/json")
      .end(result => {
        if (result.status === 200) resolve(result.body.relation);
        else reject(`Failed to get relations for: ${wordName}`);
      });
  })
}

const retryCallsToApi = (getDetail, wordName) => {
  return promiseRetry(function (retry, number) {
      console.log('Attempt number:', number);

      return getDetail(wordName)
        .catch(retry);
  })
}

/* ----------- Use APIs to convert word data to data with word detail ----------- */

const wordsWithDetail = [];

const getWordDetailFromApi = async (wordData) => {

  const wordName = wordData.name;
  const newWordData = Object.assign({}, wordData);

  const meaning = await retryCallsToApi(getDefinition, wordName);
  const examples = await retryCallsToApi(getExample, wordName);
  const relations = await retryCallsToApi(getRelation, wordName);
  newWordData.definitions = meaning;
  newWordData.examples = examples;
  newWordData.relations = relations;

  wordsWithDetail.push(newWordData);
}

const wordPromiseArr = wordData.map(wordDatum => {
  return getWordDetailFromApi(wordDatum);
});

/* ----------- Create output file for seeding ----------- */

Promise.all(wordPromiseArr)
  .then(() => {
    // Change below to use different output file!!
    fs.writeFile("./public/assets/json/college-output.json",
      JSON.stringify(wordsWithDetail, null, 2),
      'utf-8',
      err => {
        if (err) {
          return console.error(err);
        }
        console.log("Output file was saved!");
      }
    );
  })
  .catch(console.error);


text:
'use strict';

/**
 * The object that represents the operation.
 *
 */
class OperationDisplay {
  /**
   * Create a OperationDisplay.
   * @property {string} [provider] Service provider: Microsoft.Solutions
   * @property {string} [resource] Resource on which the operation is
   * performed: Profile, endpoint, etc.
   * @property {string} [operation] Operation type: Read, write, delete, etc.
   */
  constructor() {
  }

  /**
   * Defines the metadata of OperationDisplay
   *
   * @returns {object} metadata of OperationDisplay
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Operation_display',
      type: {
        name: 'Composite',
        className: 'OperationDisplay',
        modelProperties: {
          provider: {
            required: false,
            serializedName: 'provider',
            type: {
              name: 'String'
            }
          },
          resource: {
            required: false,
            serializedName: 'resource',
            type: {
              name: 'String'
            }
          },
          operation: {
            required: false,
            serializedName: 'operation',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = OperationDisplay;


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<artifactId>wct-assembly</artifactId>
	<packaging>pom</packaging>
	<name>Web curator tool zip assembler</name>

	<parent>
		<artifactId>wct-parent</artifactId>
		<groupId>org.webcurator</groupId>
		<version>2.0.2</version>
	</parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.4</version>
				<executions>
					<execution>
						<configuration>
							<finalName>wct-package-bin-v${project.version}.zip</finalName>
							<descriptors>
								<descriptor>src/main/descriptors/bin.xml</descriptor>
							</descriptors>
						</configuration>
						<id>make-assembly-bin</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
					<execution>
						<configuration>
							<finalName>wct-package-src-v${project.version}.zip</finalName>
							<descriptors>
								<descriptor>src/main/descriptors/src.xml</descriptor>
							</descriptors>
						</configuration>
						<id>make-assembly-src</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

</project>


text:
package com.basgeekball.awesomevalidation.utility.custom;

public interface SimpleCustomValidation {

    boolean compare(String input);

}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@drawable/login_bg">

    <include layout="@layout/layout_topbar" />
	<LinearLayout
	    android:id="@+id/myinfo_toum"
	    android:layout_width="fill_parent"
	    android:layout_height="wrap_content"
	    android:orientation="vertical"
	    android:background="#ffffff">
	    <LinearLayout
	        android:id="@+id/layout_dt_head"
	        android:layout_width="fill_parent"
	        android:layout_height="wrap_content"
	        android:layout_marginTop="15dp"
	        android:layout_marginLeft="15dp"

	        android:gravity="center|left" >

	        <TextView
	            android:layout_width="wrap_content"
	            android:layout_height="wrap_content"

	            android:text="@string/add_avator"
	            android:textSize="18sp" />

	        <ImageView
	            android:id="@+id/dt_info_head_photo"
	            android:layout_width="wrap_content"
	            android:layout_height="wrap_content"
	            android:layout_marginLeft="200dp"
	            android:background="@drawable/default_head" />

	        <ImageView
	            android:id="@+id/dt_info_photo_go"
	            android:layout_width="wrap_content"
	            android:layout_height="wrap_content"
	            android:layout_marginLeft="10dp"
	            android:background="@drawable/register_bottom_arrow" />
	    </LinearLayout>

	    <View
	        android:layout_width="fill_parent"
	        android:layout_height="1px"
	        android:layout_marginBottom="5dp"
	        android:layout_marginTop="5dp"
	        android:background="@color/dark_grey" />

	    <LinearLayout
	        android:id="@+id/layout_dt_nick"
	        android:layout_width="fill_parent"
	        android:layout_height="wrap_content"
	        android:layout_marginTop="15dp"
	        android:layout_marginLeft="15dp"
	        android:gravity="center|left" >

	        <TextView
	            android:layout_width="wrap_content"
	            android:layout_height="wrap_content"

	            android:text="@string/add_nick"
	            android:textSize="18sp" />

	        <TextView
	            android:id="@+id/dt_info_add_nick"
	            android:layout_width="270dp"
	            android:layout_height="wrap_content"
	            android:background="@null"
	            android:gravity="center|right"/>

	        <ImageButton
	            android:id="@+id/dt_info_nick_go"
	            android:layout_width="wrap_content"
	            android:layout_height="wrap_content"
	            android:layout_marginLeft="10dp"
	            android:background="@drawable/register_bottom_arrow" />
	    </LinearLayout>

	    <View
	        android:layout_width="fill_parent"
	        android:layout_height="1px"
	        android:layout_marginBottom="5dp"
	        android:layout_marginTop="5dp"
	        android:background="@color/dark_grey" />

	    <LinearLayout
	        android:id="@+id/layout_dt_name"
	        android:layout_width="fill_parent"
	        android:layout_height="wrap_content"
	        android:layout_marginTop="15dp"
	        android:layout_marginLeft="15dp"
	        android:gravity="center|left"
	        >

	        <TextView
	            android:layout_width="wrap_content"
	            android:layout_height="wrap_content"

	            android:text="@string/add_name"
	            android:textSize="18sp" />

	        <TextView
	            android:id="@+id/dt_info_add_name"
	            android:layout_width="200dp"
	            android:layout_height="wrap_content"
	            android:layout_marginLeft="60dp"
	            android:gravity="center|right"
	            android:textSize="18sp"
	            android:background="@null"
	           />
	    </LinearLayout>

	    <View
	        android:layout_width="fill_parent"
	        android:layout_height="1px"
	        android:layout_marginBottom="5dp"
	        android:layout_marginTop="5dp"
	        android:background="@color/dark_grey" />

	    <LinearLayout
	        android:id="@+id/layout_dt_sex"
	        android:layout_width="fill_parent"
	        android:layout_height="wrap_content"
	        android:layout_marginTop="15dp"
	        android:layout_marginLeft="15dp"
	        android:gravity="center|left"
	        >

	        <TextView
	            android:layout_width="wrap_content"
	            android:layout_height="wrap_content"

	            android:text="@string/add_gender"
	            android:textSize="18sp" />

	        <TextView
	            android:id="@+id/dt_info_set_sex"
	            android:layout_width="210dp"
	            android:layout_height="wrap_content"
	            android:layout_marginLeft="60dp"
	            android:textSize="16sp"
	            android:background="@null"
	            android:gravity="center|right" />
	    </LinearLayout>
	    <View
	        android:layout_width="fill_parent"
	        android:layout_height="1px"
	        android:layout_marginBottom="5dp"
	        android:layout_marginTop="5dp"
	        android:background="@color/dark_grey" />
    </LinearLayout>

    <include
        android:id="@+id/set_head_photo"
        layout="@layout/activity_detail_head_photo"
        android:visibility="gone"/>

</LinearLayout>


text:
require "sinatodo/command"
require "sinatodo/command/options"
require "sinatodo/db"
require "sinatodo/task"
require "sinatodo/version"

#module Sinatodo
  # Your code goes here...
#end


text:
<?php

namespace Application\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Application\Model\Edital;

class EditalController extends AbstractActionController{

      public function indexAction()
      {
        $editais = $this->getServiceLocator()
        ->get('Application\Model\EditalTable')->findAll();
          return new ViewModel([
            'editais' => $editais
          ]);
      }
      public function indexuserAction()
      {
        $editais = $this->getServiceLocator()
        ->get('Application\Model\EditalTable')->findAll();
          return new ViewModel([
            'editais' => $editais
          ]);
      }

      public function createAction(){
        if($this->getRequest()->isPost()){
          $data = $this->params()->fromPost();
          $edital = new Edital();
          $edital->exchangeArray($data);
          $table = $this->getServiceLocator()
          ->get('Application\Model\EditalTable');
          $table->insert($edital);
          return $this->redirect()->toUrl('/application/edital/index');
        }
        return new ViewModel();
      }

      public function editAction(){
        $table = $this->getServiceLocator()
          ->get('Application\Model\EditalTable');
        if($this->getRequest()->isPost()){
          $data = $this->params()->fromPost();
          $edital = new Edital();
          $edital->exchangeArray($data);
          $table->update($edital);
          return $this->redirect()->toUrl('/application/edital/index');
        }
        $edital = $table->find($this->params()->fromRoute('id'));
        return new ViewModel([
          'edital' => $edital
        ]);
      }

      public function deleteAction(){
        $table = $this->getServiceLocator()
          ->get('Application\Model\EditalTable');

        $edital = $table->delete($this->params()->fromRoute('id'));
        return $this->redirect()->toUrl('/application/edital/index');
      }
}


text:
var _state = new WeakMap(); //https://habrahabr.ru/post/265847/
var _Authorization = new WeakMap();

class AuthController {
  constructor($state, Authorization) {
    this.name = 'auth';
    _state.set(this, $state);
    _Authorization.set(this, Authorization);
      }
  onLogin() {
    let credLogin = 'bosenko';
    let credPassword = '555444';
    let $login = $('.form-auth').find('.form-auth__input-login').val();
    let $password = $('.form-auth').find('.form-auth__input-password').val();

    if (credLogin !== $login || credPassword !== $password) {
      alert('Incorrect credentials!');
      return;
    }
    _Authorization.get(this).go('home');

  }
 }
AuthController.$inject = ['$state', 'Authorization'];
export default AuthController;


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Software on kshitij10496</title>
    <link>https://kshitij10496.github.io/tags/software/</link>
    <description>Recent content in Software on kshitij10496</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sun, 17 Dec 2017 00:00:00 +0530</lastBuildDate>

	<atom:link href="https://kshitij10496.github.io/tags/software/index.xml" rel="self" type="application/rss+xml" />

    <item>
      <title>For some Context</title>
      <link>https://kshitij10496.github.io/posts/for-some-context/</link>
      <pubDate>Sun, 17 Dec 2017 00:00:00 +0530</pubDate>

      <guid>https://kshitij10496.github.io/posts/for-some-context/</guid>
      <description>There are a lot of good resources about using context packages in software based on your programming language. However, I found that most of these do not address the basic questions of motivation behind the need of context: - How does the use of context help us in programming? - When should a programmer use context?
In this blog post, I will share what I understand about context.
Motivation Consider you are an event manager of a restaurant.</description>
    </item>

    <item>
      <title>Typing in Python, Go and JavaScript</title>
      <link>https://kshitij10496.github.io/posts/typing/</link>
      <pubDate>Sun, 10 Dec 2017 00:00:00 +0530</pubDate>

      <guid>https://kshitij10496.github.io/posts/typing/</guid>
      <description>Disclaimer: This post has been written from the point-of-view of a software developer rather than a theoretical computer science. So I &ldquo;ask for forgiveness&rdquo; if the post seems too colloquial and pragmatic.
 Reading through the articles on programming languages, you are bound to stumble upon statements similar to the following: 1. &ldquo;Python is a strongly typed, dynamic language.&rdquo; 2. &ldquo;Go is a statically typed, strong language.&rdquo; 3. &ldquo;JavaScript is a dynamic language which is weakly typed.</description>
    </item>

  </channel>
</rss>


text:
import os

komanda_feature = "SMILExtract -C ../MFCC12_E_D_A.conf -logfile smile_test.log -appendLogfile 1 " #-I input.wav -O output.mfcc.htk"

noisy_basepath = "/mnt/data/Fer/diplomski/CHiME2/aasp-chime-grid/test/isolated/"
noisy_dirpaths = ["0dB", "3dB", "6dB", "9dB", "m3dB", "m6dB"]

noisy_prefix = ""

input_prefix = ".wav"
output_prefix = ".mfcc.htk"

tmp_dirpath = "./tmp_test/"

mapfile = "test_map.txt"

os.system('rm -r ' + tmp_dirpath + "*")

for dr in noisy_dirpaths:
	if not os.path.exists(tmp_dirpath + dr):
		os.makedirs(tmp_dirpath + dr)

def get_filenames_dev(path):

	ret = []

	svpth = os.getcwd()
	os.chdir(path)
	# stolen from http://www.tutorialspoint.com/python/os_walk.htm
	for root, dirs, files in os.walk(".", topdown=False):
		for name in files:
			ret.append(os.path.join(root, name)[2:])

	os.chdir(svpth)
	return  [x.split('.')[0] for x in ret]

filenames = get_filenames_dev(noisy_basepath) # [0:10]

print (filenames)
htklist = []

os.chdir(tmp_dirpath)

for f in filenames:

	inputfile = noisy_basepath + noisy_prefix  + f + input_prefix

	outputfile = noisy_prefix + f + output_prefix

	komanda = komanda_feature + " -I " + inputfile + " -O " + outputfile

	os.system(komanda)

	htklist.append((f, outputfile))

print (htklist)

# write the mapfile for htk2nc
# in format "tag inputpath targetpath"
fajl = open(mapfile, "w")

for h in htklist:
	fajl.write(h[0] + ' 1 ' + h[1] +  " " + h[1] + "\n")


text:
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { componentPropType } from '@material-ui/utils';
import withStyles from '../styles/withStyles';
import Tablelvl2Context from '../Table/Tablelvl2Context';

export const styles = {
  /* Styles applied to the root element. */
  root: {
    display: 'table-header-group',
  },
};

const contextValue = { variant: 'head' };

function TableHead(props) {
  const { classes, className, component: Component, ...other } = props;

  return (
    <Tablelvl2Context.Provider value={contextValue}>
      <Component className={classNames(classes.root, className)} {...other} />
    </Tablelvl2Context.Provider>
  );
}

TableHead.propTypes = {
  /**
   * The content of the component, normally `TableRow`.
   */
  children: PropTypes.node,
  /**
   * Override or extend the styles applied to the component.
   * See [CSS API](#css-api) below for more details.
   */
  classes: PropTypes.object.isRequired,
  /**
   * @ignore
   */
  className: PropTypes.string,
  /**
   * The component used for the root node.
   * Either a string to use a DOM element or a component.
   */
  component: componentPropType,
};

TableHead.defaultProps = {
  component: 'thead',
};

export default withStyles(styles, { name: 'MuiTableHead' })(TableHead);


text:
import numpy as np
import errors

# TODO: Cache the covariance matrix
# TODO: Optionally warn, instead of error
# TODO: Check non-stationarity
# TODO: Dynamic threshold for condition number based on type?

def check(data=None, labels=None):
    rng = np.random.RandomState()
    init_rng_state = rng.get_state()
    np.random.seed(0)

    _data = None if data is None else np.array(data)
    _labels = None if labels is None else np.array(labels)

    if _data is not None:
        check_constant_columns(_data)
        check_ill_conditioned(_data)
    if _labels is not None:
        check_labels_are_1d_or_2d(_labels)
        if labels_are_one_hot(_labels):
            check_all_classes_used(_labels)
        elif labels_are_integer(_labels):
            check_classes_are_contiguous(_labels)
        elif labels_are_strings(_labels):
            continue
    if _labels is not None and _data is not None:
        check_statistically_significant_splits(_data,_labels)

    rng.set_state(init_rng_state)

def check_constant_columns(data):
    for i,column in enumerate(data.T):
        if np.all(column==column[0]):
            raise errors.ConstantVariableError("Column {} is constant. Is that intended?".format(i))

def check_ill_conditioned(data, bit_threshold=12):
    C = np.cov(data,rowvar=0)
    cond = np.linalg.cond(C)
    if np.log10(cond) >= bit_threshold:
        raise errors.IllConditionedError("Covariance matrix of data is ill conditioned: {:.2E}. Try whitening your data.".format(cond))

def check_labels_are_1d_or_2d(labels):
    if labels.ndim not in (1,2):
        raise errors.LabelsWrongSizeError("Label array dimension is {}. Should be 1 or 2.".format(labels.ndim))

def labels_are_one_hot(labels):
    if labels.ndim == 1:
        return False
    if np.all(np.sum(np.abs(labels),axis=1)==1):
        return True
    else:
        return False

def labels_are_strings(labels):
    return labels.dtype.kind == 'S'

def labels_are_integer(labels):
    return labels.dtype.kind == 'i'

def labels_are_float(labels):
    return labels.dtype.kind == 'f'

def check_all_classes_used(labels):
    return np.all(np.sum(labels,axis=0)>0)

def check_classes_are_contiguous(labels):
    return np.all(np.diff(np.unique(labels))==1)

def check_statistically_significant_splits(data, labels):
    pass

def check_stationarity(data_old, data_new):
    pass


text:
Issues
******

Dependency Injection
====================

`Injected Dependencies in Web Application are null`_

If an EJB is not being injected into a servlet, make sure the version of your
``web.xml`` is 2.5 e.g:

::

  <?xml version = '1.0'?>
  <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <servlet>
      <servlet-name>HelloClientServlet</servlet-name>
      <servlet-class>com.sample.HelloClientServlet</servlet-class>
    </servlet>
    <servlet-mapping>
      <servlet-name>HelloClientServlet</servlet-name>
      <url-pattern>/</url-pattern>
    </servlet-mapping>
  </web-app>

.. _`Injected Dependencies in Web Application are null`: http://www.nabble.com/Injected-Dependencies-in-Web-Application-are-null-tf3767788.html#a10651801


text: Ti.API.info("Hola desde un servicio.");


text:
from __future__ import unicode_literals, print_function, division
__author__ = 'dongliu'

class HttpType(object):
    REQUEST = 0
    RESPONSE = 1

# see http://www.tcpdump.org/linktypes.html
# http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html#appendixLinkTypes
class LinkLayerType(object):
    """LinkType"""
    ETHERNET = 1
    LINUX_SLL = 113

class NetworkProtocol(object):
    IP = 2048
    IPV6 = 34525
    # Virtual Bridged Local Area Networks
    P802_1Q = 33024

class TransferProtocol(object):
    TCP = 6

class FileFormat(object):
    PCAP = 0xA1B2C3D4
    PCAP_NG = 0x0A0D0D0A
    UNKNOWN = -1

class BlockType(object):
    SECTION_HEADER = 0x0A0D0D0A
    INTERFACE_DESCRIPTION = 0x00000001
    PACKET = 0x00000002
    SIMPLE_PACKET = 0x00000003
    NAME_RESOLUTION = 0x00000004
    INTERFACE_STATISTICS = 0x00000005
    ENHANCED_PACKET = 0x00000006
    IRIG_TIMESTAMP = 0x00000007
    ARINC_429 = 0x00000008


text:
function getTableTipoEmail(){
	return 'tb_tipo_email';
}

function dbLoad(){
	var db = Ti.Database.open(Ti.App.Properties.getString(DATABASE_FILE));
	return db;
}
function createTipoEmail() {
	db = dbLoad();
	db.execute('CREATE TABLE IF NOT EXISTS ' + getTableTipoEmail() + '(
		id INTEGER PRIMARY KEY, te_id INTEGER, te_nome TEXT, ep_id INTEGER
		);');
	db.close();
}

function dropTipoEmail() {
	db = dbLoad();
	db.execute('DROP TABLE IF EXISTS ' + getTableTipoEmail());
	db.close();
}

function insertTipoEmail(te_id , te_nome , ep_id) {
	db = dbLoad();
	db.execute('INSERT INTO ' + getTableTipoEmail() + ' (
		tpfn_id, tpfn_nome)
	VALUES (?,?,?)',
	te_id , te_nome , ep_id);
	db.close();
}

function selectallTipoEmail() {
	db = dbLoad();
	var tipoemail = db.execute('SELECT * FROM ' + getTableTipoEmail());
	if (Ti.Platform.osname == "android") {
		db.close();
	}
	return tipoemail;
}

function processTipoEmail(jsonTxt) {
	dropTipoEmail();
	createTipoEmail();
	var jsonObject = JSON.parse(jsonTxt);
	for (var j = 0; j < jsonObject.length; j++) {
		var te_id = jsonObject[j].te_id;
		var te_nome = jsonObject[j].te_nome;
		var ep_id = jsonObject[j].ep_id;
		insertTipoEmail(te_id , te_nome , ep_id);
	}
}


text:
title: "C#"
slug: "getting-started-with-csharp"
category: "languages"
ordinal: 300
---

## Installing C#

### Windows
There are a couple of different ways to get started using C#. The main way is to
install Visual Studio, the IDE for C# and related projects.

If you don't want to use the IDE, files can be compiled via command line using the
compiler provided by the .NET framework.

#### With Visual Studio

Install [Visual Studio Express 2013 for Windows Desktop](http://www.visualstudio.com/downloads/download-visual-studio-vs#d-express-windows-desktop). This will include the IDE and compiler for C#.

You can either start by creating your own project for working with the Exercism problems or you can download a Visual Studio solution that is already set up.

#### Exercism.io Visual Studio Template

This is a Visual Studio template that comes pre-configured to work on the problems in as many languages as Visual Studio supports.

![Solution Explorer](/img/setup/visualstudio/SolutionExplorer.png)

1. Download the [Exercism.io Visual Studio Template](https://github.com/rprouse/Exercism.VisualStudio) from GitHub by clicking the Download Zip button on the page.
2. Unzip the template into your exercises directory, for example `C:\src\exercises`
2. Install the [Exercism CLI](http://help.exercism.io/installing-the-cli.html)
3. Open a command prompt to your exercise directory
4. Add your API key to exercism `exercism configure --key=YOUR_API_KEY`
5. Configure your source directory in exercism `exercism configure --dir=C:\src\exercises`
6. [Fetch your first exercise](http://help.exercism.io/fetching-exercises.html) `exercism fetch csharp`
7. Open the Exercism solution in Visual Studio
8. Expand the Exercism.csharp project
9. Click on **Show All Files** in Solution Explorer (See below)
10. The exercise you just fetched will appear greyed out. Right click on the folder and **Include In Project**
11. Get coding...

![Add files](/img/setup/visualstudio/AddFiles.png)

The NUnit NuGet package is included in the project, so you will not need to install it.

If you have a paid version of Visual Studio install the [NUnit Visual Studio Test Adapter](https://visualstudiogallery.msdn.microsoft.com/6ab922d0-21c0-4f06-ab5f-4ecd1fe7175d). This will allow you to run the tests from within Visual Studio. If you have ReSharper installed, you can also [run the tests using ReSharper](https://www.jetbrains.com/resharper/features/unit_testing.html).

![Test Explorer](/img/setup/visualstudio/TestExplorer.png)

If you are using Visual Studio Express, install [NUnit 2.6.3](http://www.nunit.org/) and run the tests from the command line (see below).

#### Create a New Visual Studio Project

Once installed and started, click on "Create New Project" (alternatively, you can go to File->New->New Project).

![New Project](/img/setup/csharp/newProject.png)

Choose what language and project type (Visual C# and Class Library). Also name your project to whatever you'd like.

![Create Project](/img/setup/csharp/createNewProject.png)

Once created, feel free to drag and drop the C# Exercism folders into the project.

![Drag and Drop Folders](/img/setup/csharp/dragDropFolders.png)

In order to compile, get the [NUnit](http://nunit.org/) assembly referenced for the unit tests. This can be done via [NuGet](http://www.nuget.org/) - a package manager for Visual Studio. The best packages is to get the base [NUnit]() and the [NUnit.Runners](https://www.nuget.org/packages/NUnit.Runners/)
package since it includes the assemblies needed and a GUI test runner.

![Nuget](/img/setup/csharp/nugetMenu.png)

Two options to use Nuget - the NuGet manager or through the Package Manager Console.

The manager is the easiest way to get started.

![Nuget Manager](/img/setup/csharp/nugetManageNunitRunner.png)

The project should now be able to compile.

To start implementing the exercise, in Visual Studio, right click on where you want the file to go to and go to `Add` -> `Class`. Name it what you'd like.

![New Item](/img/setup/csharp/addNewClass.png)

Now you can start coding!

#### With the command line compiler
The .cs files can also be compiled without Visual Studio. Get the latest version of
[.NET installed](http://msdn.microsoft.com/en-us/library/5a4x27ek(v=vs.110).aspx) and there will be an executable called csc.exe.

The compiler executable is usually located in the Microsoft.NET\Framework\Version folder under the Windows directory.

Refer to this [MSDN article](http://msdn.microsoft.com/en-us/library/78f4aasd.aspx) for more information on the command line compiler.

### Mac

Install [Xamarin Studio](http://xamarin.com/download).

While Xamarin is most known for creating iOS and Android applications, it's still a perfect IDE to create C# console
or library projects which is all that's needed for Exercism.

Once installed and running, click on new solution and you'll find the C# library project to select.

![Xamarin New Project](/img/setup/csharp/xamarin-csharp.jpeg)

### Linux

[Mono Develop](http://www.mono-project.com/Mono_For_Linux_Developers) is available for Linux.

## Running Tests

### Windows
All tests have been ignored except the first one for you to work on. To continue, just remove the ```[Ignore]``` attribute on the test to start working on it.

Make sure [NUnit](http://nunit.org/?p=download) is installed, if not already installed from the setup from above.

This installation should include the NUnit-Gui executable. Run this and, after compiling, open the assembly from the Gui and you are able to run the tests.

**Note:** You may need to include the nunit-framework.dll in the same directory as the source code you're compiling if you get an error saying it can't find the ```nunit.framework.dll```.

If you installed the NUnit runner through NuGet, the runner will be located in the ```\packages\NUnit.Runners(version number)\tools``` folder where your project is.

If you installed NUnit manually the runner will be in the ```Program Files (x86)\NUnit(version number)\bin``` folder.

![NUnit Runner](/img/setup/csharp/nUnitRunner.png)

Once you have been able to compile the code it will create a DLL in the ```\bin\Debug``` folder of your project. In the NUnit runner, select "Open Project" and select the DLL that was created from compiling. This will load all the tests and allow you to run them.

![NUnit Runner Execute Tests](/img/setup/csharp/nUnitExecuteTests.png)

The NUnit runner will automatically reload the DLL if it has been updated.

### Mac
Xamarin Studio also ships with NUnit. From the new project dialog, just select an NUnit class library.

![Xamarin NUnit](/img/setup/csharp/xamarin-nunit.jpeg)

From here you can write NUnit tests right away. To run the tests open the `Unit Tests` pad within
Xamarin (View -> Pads -> Unit Tests).

## Code Analysis
Code Analysis can be turned on to run after a build of certain projects. This [MSDN article](http://msdn.microsoft.com/en-us/library/ms182066.aspx) is a good walkthrough on how to enable code analysis.

**NOTE:** This will add a bit of extra time to compile the project.

Code A uses FxCop to run the analysis. [FxCop](http://www.microsoft.com/en-us/download/details.aspx?id=6544) can be run separately as a stand alone program.

[StyleCop](https://stylecop.codeplex.com/) can be installed and run inside Visual Studio to analyze the code style.

## Recommended Learning Resources

Exercism provides exercises and feedback but can be difficult to jump into for those learning C# for the first time. These resources can help you get started:

* [Channel9 Series: C# Fundamentals](http://channel9.msdn.com/Series/C-Sharp-Fundamentals-Development-for-Absolute-Beginners)
* [MSDN Walkthrough: Getting Started with C#](http://msdn.microsoft.com/library/vstudio/dd492171(v=vs.120))
* [.NET Framework Development Guide](http://msdn.microsoft.com/library/vstudio/hh156542)
* [StackOverflow](http://stackoverflow.com/)
  * [C#](http://stackoverflow.com/questions/tagged/c%23)
  * [.NET](http://stackoverflow.com/questions/tagged/.net)
  * [NUnit](http://stackoverflow.com/questions/tagged/nunit)


text:
package com.hantsylabs.restexample.springmvc.test;

import org.junit.Before;
import org.springframework.boot.context.embedded.LocalServerPort;

/**
 *
 * @author hantsy
 */
public class WebIntegrationTestBase extends IntegrationTestBase {

    @LocalServerPort
    protected int port;

    @Before
    public void setup() {
        clearData();
        initData();
    }

}


text:
extern alias NuGetAlias;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using nH.Context;
using nH.Data.Models;
using nH.Data.Repositories;
using nH.Models;
using nH.Processing.Build;
using nH.Processing.Models;
using nH.Processing.Services;
using nH.Tracing;
using NuGetAlias::NuGet;
using NuGetAlias::NuGet.CommandLine;
using NuGetAlias::NuGet.Common;

namespace nH.Processing.Processors
{
	internal abstract class BaseProcessor : IProcessor<BaseMessage>
	{
		protected const string SourceExtension = ".zip";

		public abstract string VersionControl { get; }
		protected abstract string GetSources();
		protected abstract NhSession CreateSession();

		private readonly INhContext _context;
		private readonly IDataRepository<Session> _sessionRepository;
		private readonly IPublishService _publishService;
		private readonly IIOService _ioService;
		private readonly NuGetAlias::NuGet.Logging.ILogger _logger;
		private readonly IConsole _console;

		private readonly string _buildConfiguration;
		private string _basePath;

		protected BaseProcessor(INhContext context,
			IDataRepository<Session> sessionRepository,
			IPublishService publishService,
			IIOService ioService,
			NuGetAlias::NuGet.Logging.ILogger logger,
			IConsole console)
		{
			_context = context;
			_sessionRepository = sessionRepository;
			_publishService = publishService;
			_ioService = ioService;
			_logger = logger;
			_console = console;

			_buildConfiguration = context.AppSettings["BuildConfiguration"];
		}

		public void Run(BaseMessage message)
		{
			_context.Session = CreateSession();
			Session session = null;
			try
			{
				session = _sessionRepository.Find(_context.Session.Id);
				session.State = SessionState.InProgress;
				_sessionRepository.Update(session);

				Run(message.ApiKey);
				session.State = SessionState.Completed;
			}
			catch (Exception ex)
			{
				if (ex.InnerException != null)
				{
					_context.WriteTrace(LogEntryType.Critical, ex.InnerException.Message, ex.InnerException.StackTrace);
				}
				_context.WriteTrace(LogEntryType.Critical, ex.Message, ex.StackTrace);

				if (session != null)
				{
					session.State = SessionState.Failed;
				}
			}
			finally
			{
				if (session != null)
				{
					session.EndDate = DateTime.UtcNow;
					_sessionRepository.Update(session);
				}
			}
		}

		private void Run(string apiKey)
		{
			var sourceFolder = string.Empty;

			try
			{
				sourceFolder = GetSources();
				if (string.IsNullOrEmpty(sourceFolder))
				{
					return;
				}

				_basePath = _ioService.GetDirectoryName(_ioService.GetFullPath(sourceFolder));
				var packagePath = Build(sourceFolder);
				_publishService.Publish(packagePath, apiKey);
			}
			finally
			{
				_ioService.DeleteDirectory(sourceFolder, true);
			}
		}

		private string Build(string sourceFolder)
		{
			string package;

			using (var stopwatch = new NhStopwatch(_context,
				"Starting build package",
				"Package successfully built in {0} seconds"))
			{
				try
				{
					IPackageBuilder builder;
					var path = GetProjectFile(sourceFolder);
					if (path != null)
					{
						builder = GetBuilderFromProjectFile(path, _basePath);
					}
					else
					{
						var files = _ioService.GetFiles(sourceFolder, "*" + Constants.ManifestExtension, SearchOption.AllDirectories);
						if (files.Length == 1)
						{
							path = files.Single();
							builder = GetBuilderFromNuspec(path);
						}
						else
						{
							throw new Exception("Amount of input file incorrect");
						}
					}
					package = GetOutputPath(builder, _ioService.GetDirectoryName(path));
					BuildPackage(builder, package);
				}
				catch (Exception ex)
				{
					stopwatch.Reject();
					if (ex.InnerException == null)
					{
						throw;
					}
					throw ex.InnerException;
				}
			}

			return package;
		}

		private string GetProjectFile(string sourceFolder)
		{
			var allowedExtensions = ProjectHelper.SupportedProjectExtensions.Select(x => "*" + x);

			var files = allowedExtensions
				.SelectMany(filter => _ioService.GetFiles(sourceFolder, filter, SearchOption.AllDirectories))
				.Where(file => _ioService.IsExistFile(file.Replace(_ioService.GetFileExtension(file), Constants.ManifestExtension)))
				.ToList();

			return files.Count == 1 ? files.Single() : null;
		}

		private IPackageBuilder GetBuilderFromProjectFile(string path, string basePath)
		{
			var msbuildDirectory = MsBuildUtility.GetMsbuildDirectory(string.Empty, _console);
			var properties = new Dictionary<string, string>();

			if (_buildConfiguration != null)
			{
				properties.Add("Configuration", _buildConfiguration);
			}

			var factory = new ProjectFactory(msbuildDirectory, path, properties)
			{
				IsTool = false,
				Logger = _logger,
				Build = true,
				IncludeReferencedProjects = true
			};

			foreach (var property in properties)
			{
				if (factory.ProjectProperties.ContainsKey(property.Key))
				{
					_context.WriteTrace(LogEntryType.Warning, "Duplicate property key");
				}
				factory.ProjectProperties[property.Key] = property.Value;
			}

			return factory.CreateBuilder(basePath);
		}

		private IPackageBuilder GetBuilderFromNuspec(string path)
		{
			var properties = new Dictionary<string, string>();
			return new PackageBuilder(path, new DictionaryPropertyProvider(properties), false);
		}

		private string GetOutputPath(IPackageName builder, string outputDirectory)
		{
			var outputFile = $"{builder.Id}.{builder.Version}{Constants.PackageExtension}";
			return _ioService.CombinePath(outputDirectory, outputFile);
		}

		private void BuildPackage(IPackageBuilder builder, string outputPath)
		{
			ExcludeFiles(builder.Files);

			var isExistingPackage = _ioService.IsExistFile(outputPath);
			try
			{
				using (Stream stream = _ioService.CreateFile(outputPath))
				{
					builder.Save(stream);
				}
			}
			catch
			{
				if (!isExistingPackage && _ioService.IsExistFile(outputPath))
				{
					_ioService.DeleteFile(outputPath);
				}
				throw;
			}

			var package = new OptimizedZipPackage(outputPath);
			PrintVerbose(package);
		}

		private void ExcludeFiles(ICollection<IPackageFile> packageFiles)
		{
			var excludes = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
			{
				@"**\*" + Constants.ManifestExtension,
				@"**\*" + Constants.PackageExtension,
				@"**\\.**",
				".**"
			};

			PathResolver.FilterPackageFiles(packageFiles, ResolvePath, excludes);
		}

		private string ResolvePath(IPackageFile packageFile)
		{
			var physicalPackageFile = packageFile as PhysicalPackageFile;
			if (physicalPackageFile == null)
			{
				return packageFile.Path;
			}
			var path = physicalPackageFile.SourcePath;
			var index = path.IndexOf(_basePath.TrimEnd(_ioService.GetSeparator()) + _ioService.GetSeparator(), StringComparison.OrdinalIgnoreCase);
			if (index != -1)
			{
				path = path.Substring(index + _basePath.Length).TrimStart(_ioService.GetSeparator());
			}
			return path;
		}

		private void PrintVerbose(IPackage package)
		{
			var builder = new StringBuilder();
			builder.AppendLine($"Id: {package.Id}");
			builder.AppendLine($"Version: {package.Version}");
			builder.AppendLine($"Authors: {string.Join(", ", package.Authors)}");
			builder.AppendLine($"Description: {package.Description}");
			if (package.LicenseUrl != null)
			{
				builder.AppendLine($"License Url: {package.LicenseUrl}");
			}
			if (package.ProjectUrl != null)
			{
				builder.AppendLine($"Project Url: {package.ProjectUrl}");
			}
			if (!string.IsNullOrEmpty(package.Tags))
			{
				builder.AppendLine($"Tags: {package.Tags.Trim()}");
			}

			builder.AppendLine(
				package.DependencySets.Any()
					? $"Dependencies: {string.Join(", ", package.DependencySets.SelectMany(d => d.Dependencies).Select(d => d.ToString()))}"
					: "Dependencies: None");

			foreach (var file in package.GetFiles().OrderBy(p => p.Path))
			{
				builder.AppendLine($"AddedFile: {file.Path}");
			}
			_context.WriteTrace(LogEntryType.Verbose, builder.ToString());
		}
	}
}


text:
package dotty.tools.dotc
package transform

import core.*
import Contexts.Context
import Phases.Phase

/** A phase that can be inserted directly after a phase that cannot
 *  be checked, to enable a -Ycheck as soon as possible afterwards
 */
class EmptyPhase extends Phase:

  def phaseName: String = "dummy"

  override def isEnabled(using Context) = prev.isEnabled

  override def run(using Context) = ()

end EmptyPhase


text:
fw_depends stack

cd yesod-mysql-mongo

${IROOT}/stack --allow-different-user build --install-ghc

${IROOT}/stack --allow-different-user exec yesod-mysql-mongo -- ${MAX_THREADS} ${DBHOST} +RTS -A32m -N${MAX_THREADS} &


text:
<?php

namespace Phug\Lexer;

interface HandleTokenInterface
{
    public function isHandled();

    public function markAsHandled();
}


text: <test>assertion</test>


text:
"""
    Swaggy Jenkins

    Jenkins API clients generated from Swagger / Open API specification  # noqa: E501

    The version of the OpenAPI document: 1.5.1-pre.0
    Contact: blah@cliffano.com
    Generated by: https://openapi-generator.tech
"""

try:
    from inspect import getfullargspec
except ImportError:
    from inspect import getargspec as getfullargspec
import pprint
import re  # noqa: F401
import six

from openapi_client.configuration import Configuration

class ListView(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    openapi_types = {
        '_class': 'str',
        'description': 'str',
        'jobs': 'list[FreeStyleProject]',
        'name': 'str',
        'url': 'str'
    }

    attribute_map = {
        '_class': '_class',
        'description': 'description',
        'jobs': 'jobs',
        'name': 'name',
        'url': 'url'
    }

    def __init__(self, _class=None, description=None, jobs=None, name=None, url=None, local_vars_configuration=None):  # noqa: E501
        """ListView - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration.get_default_copy()
        self.local_vars_configuration = local_vars_configuration

        self.__class = None
        self._description = None
        self._jobs = None
        self._name = None
        self._url = None
        self.discriminator = None

        if _class is not None:
            self._class = _class
        if description is not None:
            self.description = description
        if jobs is not None:
            self.jobs = jobs
        if name is not None:
            self.name = name
        if url is not None:
            self.url = url

    @property
    def _class(self):
        """Gets the _class of this ListView.  # noqa: E501

        :return: The _class of this ListView.  # noqa: E501
        :rtype: str
        """
        return self.__class

    @_class.setter
    def _class(self, _class):
        """Sets the _class of this ListView.

        :param _class: The _class of this ListView.  # noqa: E501
        :type _class: str
        """

        self.__class = _class

    @property
    def description(self):
        """Gets the description of this ListView.  # noqa: E501

        :return: The description of this ListView.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this ListView.

        :param description: The description of this ListView.  # noqa: E501
        :type description: str
        """

        self._description = description

    @property
    def jobs(self):
        """Gets the jobs of this ListView.  # noqa: E501

        :return: The jobs of this ListView.  # noqa: E501
        :rtype: list[FreeStyleProject]
        """
        return self._jobs

    @jobs.setter
    def jobs(self, jobs):
        """Sets the jobs of this ListView.

        :param jobs: The jobs of this ListView.  # noqa: E501
        :type jobs: list[FreeStyleProject]
        """

        self._jobs = jobs

    @property
    def name(self):
        """Gets the name of this ListView.  # noqa: E501

        :return: The name of this ListView.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this ListView.

        :param name: The name of this ListView.  # noqa: E501
        :type name: str
        """

        self._name = name

    @property
    def url(self):
        """Gets the url of this ListView.  # noqa: E501

        :return: The url of this ListView.  # noqa: E501
        :rtype: str
        """
        return self._url

    @url.setter
    def url(self, url):
        """Sets the url of this ListView.

        :param url: The url of this ListView.  # noqa: E501
        :type url: str
        """

        self._url = url

    def to_dict(self, serialize=False):
        """Returns the model properties as a dict"""
        result = {}

        def convert(x):
            if hasattr(x, "to_dict"):
                args = getfullargspec(x.to_dict).args
                if len(args) == 1:
                    return x.to_dict()
                else:
                    return x.to_dict(serialize)
            else:
                return x

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            attr = self.attribute_map.get(attr, attr) if serialize else attr
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: convert(x),
                    value
                ))
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], convert(item[1])),
                    value.items()
                ))
            else:
                result[attr] = convert(value)

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, ListView):
            return False

        return self.to_dict() == other.to_dict()

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        if not isinstance(other, ListView):
            return True

        return self.to_dict() != other.to_dict()