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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>io.descoped</groupId>
        <artifactId>parent-bom</artifactId>
        <version>1.0.6-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>weld-cdi-bom</artifactId>
    <packaging>pom</packaging>
    <name>Descoped Weld CDI BOM</name>
    <url>http://www.descoped.io</url>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>javax</groupId>
                <artifactId>javaee-web-api</artifactId>
                <version>${javaee.web.api}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>javax.inject</groupId>
                <artifactId>javax.inject</artifactId>
                <version>${javax.inject.version}</version>
                <scope>compile</scope>
            </dependency>

            <dependency>
                <groupId>javax.enterprise</groupId>
                <artifactId>cdi-api</artifactId>
                <version>${cdi.version}</version>
                <scope>compile</scope>
            </dependency>

            <dependency>
                <groupId>javax.el</groupId>
                <artifactId>javax.el-api</artifactId>
                <version>${javax.el.version}</version>
                <scope>compile</scope>
            </dependency>

            <dependency>
                <groupId>javax.interceptor</groupId>
                <artifactId>javax.interceptor-api</artifactId>
                <version>${javax.interceptor.version}</version>
                <scope>compile</scope>
            </dependency>

            <dependency>
                <groupId>javax.annotation</groupId>
                <artifactId>javax.annotation-api</artifactId>
                <version>${javax.annotation.version}</version>
                <scope>compile</scope>
            </dependency>

            <dependency>
                <groupId>org.jboss.weld.se</groupId>
                <artifactId>weld-se-core</artifactId>
                <version>${weld.version}</version>
                <scope>compile</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.deltaspike.cdictrl</groupId>
                <artifactId>deltaspike-cdictrl-api</artifactId>
                <version>${deltaspike.version}</version>
                <scope>compile</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.deltaspike.cdictrl</groupId>
                <artifactId>deltaspike-cdictrl-weld</artifactId>
                <version>${deltaspike.version}</version>
                <scope>runtime</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

</project>


text:
package types

type Record struct {
	Target Field
}

func (b *Record) SetBoolean(v bool) {
	b.Target.SetBoolean(v)
}

func (b *Record) SetInt(v int32) {
	b.Target.SetInt(v)
}

func (b *Record) SetLong(v int64) {
	b.Target.SetLong(v)
}

func (b *Record) SetFloat(v float32) {
	b.Target.SetFloat(v)
}

func (b *Record) SetDouble(v float64) {
	b.Target.SetDouble(v)
}

func (b *Record) SetBytes(v []byte) {
	b.Target.SetBytes(v)
}

func (b *Record) SetString(v string) {
	b.Target.SetString(v)
}

func (b *Record) Get(i int) Field {
	return b.Target.Get(i)
}

func (b *Record) SetDefault(i int) {
	b.Target.SetDefault(i)
}

func (b *Record) AppendMap(key string) Field {
	return b.Target.AppendMap(key)
}

func (b *Record) AppendArray() Field {
	return b.Target.AppendArray()
}

func (b *Record) NullField(v int) {
	b.Target.NullField(v)
}

func (b *Record) Finalize() {
	b.Target.Finalize()
}

redpajama_set_name: RedPajamaGithub


text:
function createFakeDatabase() {

  var _generateRandomNumber = function (len) {
    var i = 1,
        multiplier = 10;

    while (i < len) {
        multiplier = multiplier * 10;
        i++;
    }

    return Math.round(Math.random() * multiplier);
  };

  var _generateLargeData = function () {
    var arr = [],
        i = 0;

    var size = 500000;
    while (i < size) {
        arr.push({
          name: _generateRandomNumber(6)
        });

        i++;
    }

    return arr;
  };

  var _items = _generateLargeData();

  return {
    totalSize: _items.length,
    load: function(offset, count, callback) {
      setTimeout(function() {
        var items = _items.slice(offset, offset+count);
        callback(items);
      }, 2000);
    }
  };
}


text:
package org.elasticsearch.http.action.admin.indices.stats;

import org.elasticsearch.action.admin.indices.stats.IndicesStatsRequest;
import org.elasticsearch.action.admin.indices.stats.IndicesStats;
import org.elasticsearch.action.support.HttpAction;
import org.elasticsearch.action.support.HttpRequest;
import org.elasticsearch.action.support.HttpResponse;
import org.elasticsearch.common.xcontent.XContentHelper;

import java.io.IOException;
import java.util.Map;

public class HttpIndicesStatsAction extends HttpAction<IndicesStatsRequest, IndicesStats> {

    public static final String NAME = "indices_stats";
    private static final String ENDPOINT = "_stats";

    @Override
    protected HttpRequest toRequest(IndicesStatsRequest request) {
        String endpoint = ENDPOINT;
        if (!request.isAll() && !request.isAll()) {
            if (request.docs()) {
                endpoint += "/docs";
            } else if (request.store()) {
                endpoint += "/store";
            } else if (request.indexing()) {
                endpoint += "/indexing";
            } else if (request.search()) {
                endpoint += "/search";
            } else if (request.get()) {
                endpoint += "/get";
            } else if (request.refresh()) {
                endpoint += "/refresh";
            } else if (request.merge()) {
                endpoint += "/merge";
            } else if (request.flush()) {
                endpoint += "/flush";
            } else if (request.warmer()) {
                endpoint += "/warner";
            }
        }
        HttpRequest httpRequest = new HttpRequest(GET, endpoint)
                .index(request.indices())
                .type(request.types())
                .param("clear", request.isClear())
                .param("all", request.isAll());
        if (request.ignoreIndices() != null) {
            httpRequest.param("ignore_indices", request.ignoreIndices().name().toLowerCase());
        }
        if (request.groups() != null) {
            httpRequest.param("groups", request.groups());
        }
        return httpRequest;
    }

    @Override
    protected IndicesStats toResponse(HttpResponse response) throws IOException {
        Map<String, Object> map = XContentHelper.convertToMap(response.getBody(), false).v2();
        logger.info("response = {}", map);
        return null;
    }
}


text:
.annotation {
  display: flex;
  width: 100%;
  padding-top: 4px;

  align-items: center;
}

.mat-icon {
  font-size: 40px;
  width: 40px;
  height: 40px;
  user-select: none;
}

.mat-icon.clickable:hover {
  background: rgb(193, 236, 250);
  cursor: pointer;
}

.speaker {
  align-self: flex-end; /* Otherwise it will strangely be up higher than the caption field */
  margin: 0 5px 0 7px;
  max-width: 80px;
}

.caption {
  flex: 1 1 100%;
}

.caption textarea {
  height: 24px;
}

.disabled {
  background: lightgrey;
}

.selected {
  background: lightblue;
}

.disabled.selected {
  background: lightyellow;
}


text:
import bleach

from django import template
from django.conf import settings
from django.utils.safestring import mark_safe

register = template.Library()

tags = getattr(settings, 'BLEACH_ALLOWED_TAGS', bleach.ALLOWED_TAGS)
attributes = getattr(settings, 'BLEACH_ALLOWED_ATTRIBUTES',
                     bleach.ALLOWED_ATTRIBUTES)

def bleach_value(value):
    bleached_value = bleach.clean(value, tags=tags, attributes=attributes)
    return mark_safe(bleached_value)

register.filter('bleach', bleach_value)


text:
package app

import (
	"github.com/docker/libcompose/cli/command"
	"github.com/docker/libcompose/docker/client"
	"github.com/docker/libcompose/docker/ctx"
	"github.com/sirupsen/logrus"
	"github.com/urfave/cli"
)

// DockerClientFlags defines the flags that are specific to the docker client,
// like configdir or tls related flags.
func DockerClientFlags() []cli.Flag {
	return []cli.Flag{
		cli.BoolFlag{
			Name:  "tls",
			Usage: "Use TLS; implied by --tlsverify",
		},
		cli.BoolFlag{
			Name:   "tlsverify",
			Usage:  "Use TLS and verify the remote",
			EnvVar: "DOCKER_TLS_VERIFY",
		},
		cli.StringFlag{
			Name:  "tlscacert",
			Usage: "Trust certs signed only by this CA",
		},
		cli.StringFlag{
			Name:  "tlscert",
			Usage: "Path to TLS certificate file",
		},
		cli.StringFlag{
			Name:  "tlskey",
			Usage: "Path to TLS key file",
		},
		cli.StringFlag{
			Name:  "configdir",
			Usage: "Path to docker config dir, default ${HOME}/.docker",
		},
	}
}

// Populate updates the specified docker context based on command line arguments and subcommands.
func Populate(context *ctx.Context, c *cli.Context) {
	command.Populate(&context.Context, c)

	context.ConfigDir = c.String("configdir")

	opts := client.Options{}
	opts.TLS = c.GlobalBool("tls")
	opts.TLSVerify = c.GlobalBool("tlsverify")
	opts.TLSOptions.CAFile = c.GlobalString("tlscacert")
	opts.TLSOptions.CertFile = c.GlobalString("tlscert")
	opts.TLSOptions.KeyFile = c.GlobalString("tlskey")

	clientFactory, err := client.NewDefaultFactory(opts)
	if err != nil {
		logrus.Fatalf("Failed to construct Docker client: %v", err)
	}

	context.ClientFactory = clientFactory
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.SpaServices.Webpack;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using tracktor.app.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Authentication.Cookies;
using System.Net;
using System.ServiceModel;
using Microsoft.IdentityModel.Protocols;
using System.ServiceModel.Description;
using System.ServiceModel.Channels;
using tracktor.app.Helpers;

namespace tracktor.app
{
    public class Startup
    {
        private IHostingEnvironment _env;

        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext<ApplicationDbContext>(options =>
                options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));

            services.AddAuthentication().AddCookie(o =>
            {
                o.Events = new CookieAuthenticationEvents
                {
                    OnValidatePrincipal = context =>
                    {
                        return SecurityStampValidator.ValidatePrincipalAsync(context);
                    },
                    OnRedirectToAccessDenied = context =>
                    {
                        if (context.Request.Path.StartsWithSegments("/api"))
                        {
                            context.Response.StatusCode = (int)HttpStatusCode.Unauthorized;
                        }
                        else
                        {
                            context.Response.Redirect(context.RedirectUri);
                        }
                        return Task.FromResult(0);
                    },
                    OnRedirectToLogin = context =>
                    {
                        if (context.Request.Path.StartsWithSegments("/api"))
                        {
                            context.Response.StatusCode = (int)HttpStatusCode.Unauthorized;
                        }
                        else
                        {
                            context.Response.Redirect(context.RedirectUri);
                        }
                        return Task.FromResult(0);
                    }
                };
            });

            services.AddIdentity<ApplicationUser, IdentityRole>(o =>
            {
                o.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromHours(1);
                o.Lockout.MaxFailedAccessAttempts = 3;
                o.Lockout.AllowedForNewUsers = true;
            }).AddEntityFrameworkStores<ApplicationDbContext>().AddDefaultTokenProviders();

            services.AddMvc(options =>
            {
                options.Filters.AddService(typeof(AngularAntiforgeryCookieResultFilter));
                options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute());
            });

            services.Configure<SecurityStampValidatorOptions>(o =>
            {
                o.ValidationInterval = TimeSpan.Zero;
            });

            services.AddAntiforgery(options => options.HeaderName = "X-XSRF-Token");

            services.AddTransient<IEmailSender, EmailSender>(sp => new EmailSender(
                Configuration["Tracktor:SmtpHost"],
                Int32.Parse(Configuration["Tracktor:SmtpPort"]),
                Boolean.Parse(Configuration["Tracktor:SmtpSsl"]),
                Configuration["Tracktor:SmtpSender"],
                Configuration["Tracktor:SmtpUsername"],
                Configuration["Tracktor:SmtpPassword"]));

            services.AddSingleton(CreateServiceClient());

            services.AddSingleton(Configuration);

            services.AddTransient<AngularAntiforgeryCookieResultFilter>();
        }

        private ITracktorService CreateServiceClient()
        {
            var uri = new Uri(Configuration["Tracktor:ServiceUrl"]);
            HttpBindingBase httpBinding;

            if (uri.Scheme == "http")
            {
                var binding = new BasicHttpBinding();
                binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
                httpBinding = binding;
            }
            else
            {
                var binding = new BasicHttpsBinding(BasicHttpsSecurityMode.Transport);
                binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
                httpBinding = binding;
            }
            var identity = new DnsEndpointIdentity("");
            var address = new EndpointAddress(uri, identity, new AddressHeader[0]);
            var factory = new ChannelFactory<ITracktorService>(httpBinding, address);
            ClientCredentials loginCredentials = new ClientCredentials();
            loginCredentials.UserName.UserName = "tracktor";
            loginCredentials.UserName.Password = Configuration["Tracktor:ServicePassword"];
            var defaultCredentials = factory.Endpoint.EndpointBehaviors.OfType<ClientCredentials>().First();
            factory.Endpoint.EndpointBehaviors.Remove(defaultCredentials);
            factory.Endpoint.EndpointBehaviors.Add(loginCredentials);
            return factory.CreateChannel();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            _env = env;

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
                {
                    HotModuleReplacement = true
                });
            }
            else
            {
                app.UseMiddleware(typeof(ExceptionHandling));
            }

            app.UseStaticFiles();

            app.UseAuthentication();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");

                routes.MapSpaFallbackRoute(
                    name: "spa-fallback",
                    defaults: new { controller = "Home", action = "Index" });
            });

            Initialize(app.ApplicationServices).Wait();
        }

        protected async Task Initialize(IServiceProvider serviceProvider)
        {
            using (var serviceScope = serviceProvider.GetRequiredService<IServiceScopeFactory>().CreateScope())
            {
                var dbContext = serviceScope.ServiceProvider.GetService<ApplicationDbContext>();

                // drop test db
                if (_env.IsEnvironment("Test"))
                {
                    await dbContext.Database.EnsureDeletedAsync();
                }

                if (dbContext.Database.GetPendingMigrations().Any())
                {
                    await dbContext.Database.MigrateAsync();

                    var roleManager = serviceScope.ServiceProvider.GetRequiredService<RoleManager<IdentityRole>>();

                    foreach (var role in new string[] { "User" })
                    {
                        if (!await roleManager.RoleExistsAsync(role))
                        {
                            await roleManager.CreateAsync(new IdentityRole(role));
                        }
                    }
                }
            }
        }
    }
}


text:
'''
Created on Aug 1, 2013

@author: Olga Botvinnik
'''
import unittest

from gscripts.qtools import Submitter
import subprocess
from subprocess import PIPE
import os
import shutil

import tests

HOSTNAME = subprocess.Popen('HOSTNAME', stdout=subprocess.PIPE).communicate()[
    0].strip()

# Global variable to test if we're on a server, e.g. TSCC or oolite (
# "compute" means one of the oolite compute nodes)
ON_SERVER = set([HOSTNAME]) & set(['tscc', 'oolite', 'compute'])

class Test(unittest.TestCase):
    commands = ['date', 'echo testing']
    out_dir = 'test_output'

    def setUp(self):
        os.mkdir(self.out_dir)

    def tearDown(self):
        shutil.rmtree(self.out_dir)

    def test_pbs(self):
        """Test PBS queue (TSCC)
        """
        job_name = 'test_qtools_submitter_pbs'
        submit_sh = '{}/{}.sh'.format(self.out_dir, job_name)
        sub = Submitter(queue_type='PBS', sh_filename=submit_sh,
                        commands=self.commands,
                        job_name=job_name, nodes=1, ppn=1,
                        queue='home-yeo', walltime='0:01:00'
        )
        job_id = sub.job(submit=False)
        true_result_string = '''#!/bin/bash
#PBS -N test_qtools_submitter_pbs
#PBS -o {0}/test_qtools_submitter_pbs.sh.out
#PBS -e {0}/test_qtools_submitter_pbs.sh.err
#PBS -V
#PBS -l walltime=0:01:00
#PBS -l nodes=1:ppn=1
#PBS -A yeo-group
#PBS -q home-yeo

# Go to the directory from which the script was called
cd $PBS_O_WORKDIR
date
echo testing
'''.format(self.out_dir)
        true_result = true_result_string.split('\n')

        # with open(submit_sh) as f:
        #     for x in f.readlines():
        #         print x,

        for true, test in zip(true_result, open(submit_sh)):
            self.assertEqual(true.strip().split(), test.strip().split())

        # Make sure the job ID is a single (potentially multi-digit) integer
        # But only do this if we're on TSCC or oolite
        if ON_SERVER:
            self.assertRegexpMatches(job_id, '^\d+$')
            subprocess.Popen(["qdel", job_id],
                             stdout=PIPE)

    def test_sge(self):
        """Test SGE queue (oolite)
        """
        job_name = 'test_qtools_submitter_sge'
        submit_sh = '{}/{}.sh'.format(self.out_dir, job_name)
        sub = Submitter(queue_type='SGE', sh_filename=submit_sh,
                        commands=self.commands,
                        job_name=job_name, nodes=1, ppn=1,
                        queue='home-yeo', walltime='0:01:00'
        )
        job_id = sub.job(submit=False)
        true_result_string = '''#!/bin/bash
#$ -N test_qtools_submitter_sge
#$ -o {0}/test_qtools_submitter_sge.sh.out
#$ -e {0}/test_qtools_submitter_sge.sh.err
#$ -V
#$ -S /bin/bash
#$ -cwd
#$ -l bigmem
#$ -l h_vmem=16G
date
echo testing
'''.format(self.out_dir)
        true_result = true_result_string.split('\n')

        # with open(submit_sh) as f:
        #     for x in f.readlines():
        #         print x,
        for true, test in zip(true_result, open(submit_sh)):
            self.assertEqual(true.strip().split(), test.strip().split())

        # Make sure the job ID is a single (potentially multi-digit) integer
        # But only do this if we're on TSCC or oolite
        if ON_SERVER:
            self.assertRegexpMatches(job_id, '^\d+$')
            subprocess.Popen(["qdel", job_id],
                             stdout=PIPE)

#     def test_wait_for_pbs(self):
#         commands = ['date', 'echo testing PBS']
#         job_name = 'test_qtools_submitter_wait_for_pbs'
#         submit_sh = '%s.sh' % (job_name)
#         sub = Submitter(queue_type='PBS', sh_filename= submit_sh,
#                         commands=commands,
#                         job_name=job_name, wait_for=['11111'])
#         job_id = sub.write_sh(submit=False, nodes=1, ppn=16,
#                               queue='home-yeo', walltime='0:01:00')
#         true_result_string = '''#!/bin/bash
# #PBS -N test_qtools_submitter_wait_for_pbs
# #PBS -o test_qtools_submitter_wait_for_pbs.sh.out
# #PBS -e test_qtools_submitter_wait_for_pbs.sh.err
# #PBS -V
# #PBS -l walltime=0:01:00
# #PBS -l nodes=1:ppn=16
# #PBS -A yeo-group
# #PBS -q home-yeo
# #PBS -W depend=afterok:11111
#
# # Go to the directory from which the script was called
# cd $PBS_O_WORKDIR
# date
# echo testing PBS
# '''
#         true_result = true_result_string.split('\n')
#
#         # with open(submit_sh) as f:
#         #     for x in f.readlines():
#         #         print x,
#
#         for true, test in zip(true_result, open(submit_sh)):
#             self.assertEqual(true.strip().split(), test.strip().split())
#
#         # Make sure the job ID is a single (potentially multi-digit) integer
#         if ON_SERVER:
#             self.assertRegexpMatches(job_id, '^\d+$')
#             subprocess.Popen(["qdel", job_id], stdout=PIPE)
#
#     def test_wait_for_array_pbs(self):
#         commands = ['date', 'echo testing PBS']
#         job_name = 'test_qtools_submitter_wait_for_pbs'
#         submit_sh = '%s.sh' % (job_name)
#         sub = Submitter(queue_type='PBS', sh_filename= submit_sh,
#                         commands=commands,
#                         job_name=job_name, wait_for_array=['11111'])
#         job_id = sub.write_sh(submit=False, nodes=1, ppn=16,
#                               queue='home-yeo', walltime='0:01:00')
#         true_result_string = '''#!/bin/bash
# #PBS -N test_qtools_submitter_wait_for_pbs
# #PBS -o test_qtools_submitter_wait_for_pbs.sh.out
# #PBS -e test_qtools_submitter_wait_for_pbs.sh.err
# #PBS -V
# #PBS -l walltime=0:01:00
# #PBS -l nodes=1:ppn=16
# #PBS -A yeo-group
# #PBS -q home-yeo
# #PBS -W depend=afterokarray:11111
#
# # Go to the directory from which the script was called
# cd $PBS_O_WORKDIR
# date
# echo testing PBS
# '''
#         true_result = true_result_string.split('\n')
#
#         # with open(submit_sh) as f:
#         #     for x in f.readlines():
#         #         print x,
#
#         for true, test in zip(true_result, open(submit_sh)):
#             self.assertEqual(true.strip().split(), test.strip().split())
#
#         # Make sure the job ID is a single (potentially multi-digit) integer
#         if ON_SERVER:
#             self.assertRegexpMatches(job_id, '^\d+$')
#             subprocess.Popen(["qdel", job_id], stdout=PIPE)

if __name__ == "__main__":
    # import sys;sys.argv = ['', 'Test.test_main']
    unittest.main()


text:
module.exports = function (grunt) {
	function getPackage() {
		return grunt.file.readJSON('./package.json');
	}

	// Try ENV variables (export SAUCE_ACCESS_KEY=XXXX), if key doesn't exist, try key file
	var sauceKey = process.env.SAUCE_ACCESS_KEY ? process.env.SAUCE_ACCESS_KEY : grunt.file.exists('SAUCE_API_KEY.yml') ? grunt.file.readYAML('SAUCE_API_KEY.yml').key : undefined;

	// https://github.com/axemclion/grunt-saucelabs/issues/215
	var getSaucekey = function getSaucekey () {
		return sauceKey;
	};

	return {
		defaultBrowsers: {
			options: {
				username: '<%= sauceUser %>',
				key: getSaucekey,
				tunnelTimeout: 45,
				testInterval: 3000,
				tags: [getPackage().version, '<%= sauceUser %>' + '@' + process.env.TRAVIS_BRANCH || '<%= sauceUser %>@local'],
				browsers: grunt.file.readYAML('sauce_browsers.yml'),
				build: process.env.TRAVIS_BUILD_NUMBER || getPackage().version,
				testname: process.env.TRAVIS_JOB_ID || getPackage().version + '-<%= grunt.template.today("dddd, mmmm dS, yyyy, h:MM:ss TT") %>',
				urls: ['http://localhost:<%= connect.testServer.options.port %>/test/?testdist=true&hidepassed=true'],
				maxPollRetries: 4,
				throttled: 3,
				maxRetries: 3
			}
		},
		all: {
			options: {
				username: '<%= sauceUser %>',
				key: getSaucekey,
				browsers: grunt.file.readYAML('sauce_browsers.yml'),
				build: process.env.TRAVIS_BUILD_NUMBER || '<%= pkg.version %>',
				testname: 'grunt-<%= grunt.template.today("dddd, mmmm dS, yyyy, h:MM:ss TT") %>',
				urls: '<%= allTestUrls %>'
			}
		}
	};
};


text:
using Asp5AspId.AspId;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IdentityServer3.AspNetIdentity;
using IdentityServer3.Core.Configuration;
using IdentityServer3.Core.Services;

namespace Asp5AspId.IdSvr
{
    public static class UserServiceExtensions
    {
        public static void ConfigureUserService(this IdentityServerServiceFactory factory, string connString)
        {
            factory.UserService = new Registration<IUserService, UserService>();
            factory.Register(new Registration<UserManager>());
            factory.Register(new Registration<UserStore>());
            factory.Register(new Registration<Context>(resolver => new Context(connString)));
        }
    }

    public class UserService : AspNetIdentityUserService<User, string>
    {
        public UserService(UserManager userMgr)
            : base(userMgr)
        {
        }
    }
}


text:
@implementation NSValueTransformer (PKTConstants)

+ (PKTReferenceType)pkt_referenceTypeFromString:(NSString *)string {
  id referenceTypeValue = [[NSValueTransformer pkt_referenceTypeTransformer] transformedValue:string];

  PKTReferenceType referenceType = PKTReferenceTypeUnknown;
  if ([referenceTypeValue isKindOfClass:[NSNumber class]]) {
    referenceType = [referenceTypeValue unsignedIntegerValue];
  }

  return referenceType;
}

+ (NSString *)pkt_stringFromReferenceType:(PKTReferenceType)referenceType {
  return [[NSValueTransformer pkt_referenceTypeTransformer] reverseTransformedValue:@(referenceType)];
}

+ (PKTNotificationType)pkt_notificationTypeFromString:(NSString *)string {
  id notificationTypeValue = [[NSValueTransformer pkt_notificationTypeTransformer] transformedValue:string];

  PKTNotificationType notificationType = PKTNotificationTypeUnknown;
  if ([notificationTypeValue isKindOfClass:[NSNumber class]]) {
    notificationType = [notificationTypeValue unsignedIntegerValue];
  }

  return notificationType;
}

+ (NSString *)pkt_stringFromNotificationType:(PKTNotificationType)notificationType {
  return [[NSValueTransformer pkt_notificationTypeTransformer] reverseTransformedValue:@(notificationType)];
}

@end


text:
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.build;

import com.intellij.build.progress.BuildProgress;
import com.intellij.build.progress.BuildProgressDescriptor;
import com.intellij.build.progress.BuildRootProgressImpl;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;

import javax.annotation.Nonnull;

/**
 * @author Vladislav.Soroka
 */
@Singleton
public class SyncViewManager extends AbstractViewManager {
  @Inject
  public SyncViewManager(Project project, BuildContentManager buildContentManager) {
    super(project, buildContentManager);
  }

  @Nonnull
  @Override
  public String getViewName() {
    return BuildBundle.message("sync.view.title");
  }

  // @ApiStatus.Experimental
  public static BuildProgress<BuildProgressDescriptor> createBuildProgress(@Nonnull Project project) {
    return new BuildRootProgressImpl(ServiceManager.getService(project, SyncViewManager.class));
  }
}


text:
package org.wxportal.message.factory;

import java.util.Map;

public abstract class MessageReceiver {
	/**
	 * Abstract class for manager all receivers
	 *
	 * @author Dawei Zhang
	 * @date 2012-10-04
	 */

	/**
	 * Get the object of request and return the object of response
	 *
	 * @return
	 */
	public abstract String returnResp(Map<String, String> requestMap);

}


text:
namespace BeckyTypes.ExportEnums
{
    public enum BeckyOnSend {
        /// <summary>
        ///   Did nothing.
        /// </summary>
        NOTHING = 0,
        /// <summary>
        ///    Return BKC_ONSEND_ERROR, if you want to cancel the sending operation.
        ///   You are responsible for displaying an error message.
        /// </summary>
        BKC_ONSEND_ERROR = -1,
        /// <summary>
        ///   if you have processed this message
        ///   and don't need Becky! to send it.
        ///   Becky! will move this message to Sent box when the sending
        ///   operation is done.
        /// </summary>
        /// <remarks>
        ///   CAUTION: You are responsible for the destination of this
        ///       message if you return BKC_ONSEND_PROCESSED.
        /// </remarks>
        BKC_ONSEND_PROCESSED = -2,
    }
}


text:
#region Copyright © 2010, 2011,2012, 2013 ThoughtWorks, Inc.

//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#endregion

using System;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Shell;
using ThoughtWorksCoreLib;

namespace ThoughtWorks.VisualStudio
{
    /// <summary>
    /// This class implements the tool window exposed by this package and hosts a user control.
    ///
    /// In Visual Studio tool windows are composed of a frame (implemented by the shell) and a pane,
    /// usually implemented by the package implementer.
    ///
    /// This class derives from the ToolWindowPane class provided from the MPF in order to use its
    /// implementation of the IVsUIElementPane interface.
    /// </summary>
    [Guid("E818D76B-46CE-42F4-AF85-DF1198A36C6D")]
    internal class CardViewWindowPane : ToolWindowPane
    {
        /// <summary>
        /// Standard constructor for the tool window.
        /// </summary>
        public CardViewWindowPane()
            : base(null)
        {
            try
            {
                base.Content = new CardViewControl();
            }
            catch (Exception e)
            {
                TraceLog.Exception(new StackFrame().GetMethod().Name, e);
                throw;
            }
        }

        /// <summary>
        /// Binds the CardViewControl content of this window to its data.
        /// </summary>
        internal void Bind(Card card, Action refreshMurmurs)
        {
            var window = (CardViewControl) base.Content;

            Caption = string.Format(CultureInfo.CurrentCulture, Resources.CardWindowCaption, card.Number,
                                    card.Name);
            window.Bind(card);
            window.RefreshMurmurs = refreshMurmurs;
        }

        /// <summary>
        /// This is called after our control has been created and sited.
        /// This is a good place to initialize the control with data gathered
        /// from Visual Studio services.
        /// </summary>
        public override void OnToolWindowCreated()
        {
            base.OnToolWindowCreated();
            var window = (CardViewControl) base.Content;
            window.ToolPane = this;
            // Set the text that will appear in the title bar of the tool window.
            // Note that because we need access to the package for localization,
            // we have to wait to do this here. If we used a constant string,
            // we could do this in the constructor.
        }
    }
}


text:
var android = (Ti.Platform.osname == 'android') ?1 :0;

function singleRozrahBlock(offsetFrame, left, top, right, size, title, hint, Z, type) {
    var delta = Ti.Platform.displayCaps.platformWidth / 320;

    if (offsetFrame) offsetFrame *= delta;
    if (left) left *= delta;
    if (top) top *= delta;
    if (right) right *= delta;
    if (size) size *= delta;

    if (!size) size = 115 * delta;
    if (!Z) Z = 0;

    var self = Ti.UI.createView({
        height : 200*delta,
        width : 200*delta,
        left : left,
        top : top,
        right : right,
        //backgroundColor : 'red',
        zIndex : Z
    });

    var speedo = Ti.UI.createView({
        height : size,
        width : size,
        backgroundImage : '/images/i4_0/speedo.png'
    });

    var frame = Ti.UI.createView({
        height : 42*delta,
        width : 101*delta,
        backgroundImage : '/images/i4_0/frame.png',
        bottom : 35*delta,
        left : offsetFrame,
    });

    var text = Ti.UI.createLabel({
        text : title || "Text",
        color : 'white',
        font : {
            fontSize : 13*delta
        },
        height : 15*delta
    });

    var hint = Ti.UI.createLabel({
        text : hint || "Hint",
        bottom : 25 * delta,
        color : 'white',
        font : {
            fontSize : 12*delta
        }
    });

    if (type) {
        var path = '/images/i4_0/city.png';
        var top = 65*delta;

        if (type == 2) {
            path = '/images/i4_0/highway.png';
            frame.bottom = 30*delta;
            hint.bottom = 20*delta;
            top = 75*delta;
        };
        if (type == 3) {
            path = '/images/i4_0/mix.png';
        };

        var ico = Ti.UI.createImageView({
            image : path,
            top : top
        });
        speedo.add(ico);
    } else {
        var list = Ti.App.Properties.getString('history');
        list = eval(list);
        if (list) {
            text.text = list[list.length - 1].consumption;
        } else {
            text.text = '10л/100км'
        }
    }

    self.add(speedo);
    frame.add(text);
    self.add(frame);
    self.add(hint);

    return self;
}

function RozrahMenuWindow() {
    //create component instance
    var self = Ti.UI.createWindow({
        navBarHidden : false,
        backgroundColor : '#000',
        title : L('rozrah_menu_title'),
        barColor : '#0c4e8d',
        backButtonTitle : L('back')
    });
    if (android) {
        self.navBarHidden = true;
    }

    var backView = Ti.UI.createView({
        backgroundImage : '/images/i4_0/back.png',
        bottom : 0
    });

    var btnHistory = Ti.UI.createButton({
        title : L('rozrah_menu_history'),
        bottom : 11 + 46 + 11,
        backgroundImage : '/images/i4_0/btn.png',
        width : 278,
        height : 46,
        color : "#fff"
    });

    btnHistory.addEventListener('singletap', function() {
        Ti.App.fireEvent('openHistoryWindow');
    });

    var btnRozrah = Ti.UI.createButton({
        title : L('rozrah_menu_calc'),
        bottom : 11,
        backgroundImage : '/images/i4_0/btn.png',
        width : 278,
        height : 46,
        color : "#fff"
    });

    btnRozrah.addEventListener('singletap', function() {
        Ti.App.fireEvent('openRozrahWindow');
    });

    // params - 			offsetFrame, left, top, right, size, title, hint, z-index, type
    var speedo1 = singleRozrahBlock(55, -50, 1, null, 115, "07л/100км", L('rozrah_menu_city'), 1, 1);
    var speedo2 = singleRozrahBlock(null, null, -30, null, 130, "10л/100км", L('rozrah_menu_highway'), null, 2);
    var speedo3 = singleRozrahBlock(45, null, 1, -50, 115, "08л/100км", L('rozrah_menu_mix'), 1, 3);
    var speedo4 = singleRozrahBlock(null, null, 120, null, 115, null, L('rozrah_menu_last'));

    Ti.App.addEventListener('refreshSpeedoBySavedData', function(e) {
        //Ti.API.info(e.consumption)
        speedo4.children[1].children[0].text = e.consumption;
        //Ti.API.info(speedo4.children[1].children[0]);
    });

    self.add(backView);

    self.add(speedo1);
    self.add(speedo2);
    self.add(speedo3);
    self.add(speedo4);

    self.add(btnHistory);
    self.add(btnRozrah);

    return self;
}

module.exports = RozrahMenuWindow;


text:
=head1 LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2022] EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=cut

package EnsEMBL::Web::JSONServer::Tools::VEP;

use strict;
use warnings;

use parent qw(EnsEMBL::Web::JSONServer::Tools);

sub object_type { 'VEP' }

# Used in species selector (Taxonselector)
sub json_fetch_species {
  my $self = shift;
  my $hub = $self->hub;
  $self->{species_selector_data} = $self->getSpeciesSelectorData();
  $self->{species_selector_data}->{internal_node_select} = 0;
  my @dyna_tree = $self->create_tree();
  return { json => \@dyna_tree };
}

1;


text:
/**
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.hadoop.hive.ql.io.parquet.write;

import java.util.HashMap;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hive.serde2.io.ParquetHiveRecord;

import org.apache.parquet.hadoop.api.WriteSupport;
import org.apache.parquet.io.api.RecordConsumer;
import org.apache.parquet.schema.MessageType;
import org.apache.parquet.schema.MessageTypeParser;

/**
 *
 * DataWritableWriteSupport is a WriteSupport for the DataWritableWriter
 *
 */
public class DataWritableWriteSupport extends WriteSupport<ParquetHiveRecord> {

  public static final String PARQUET_HIVE_SCHEMA = "parquet.hive.schema";

  private DataWritableWriter writer;
  private MessageType schema;

  public static void setSchema(final MessageType schema, final Configuration configuration) {
    configuration.set(PARQUET_HIVE_SCHEMA, schema.toString());
  }

  public static MessageType getSchema(final Configuration configuration) {
    return MessageTypeParser.parseMessageType(configuration.get(PARQUET_HIVE_SCHEMA));
  }

  @Override
  public WriteContext init(final Configuration configuration) {
    schema = getSchema(configuration);
    return new WriteContext(schema, new HashMap<String, String>());
  }

  @Override
  public void prepareForWrite(final RecordConsumer recordConsumer) {
    writer = new DataWritableWriter(recordConsumer, schema);
  }

  @Override
  public void write(final ParquetHiveRecord record) {
    writer.write(record);
  }
}


text:
class CParser;

struct fragment_program_exec
{
	u32 data[4];
};

struct fragment_program_data
{
	u32 offset;
	s32 index;
	s32 user;
};

class CCompilerFP
{
public:
	CCompilerFP();
	virtual ~CCompilerFP();

	void Compile(CParser *pParser);

	int GetNumRegs() const { return m_nNumRegs; }
	int GetFPControl() const { return m_nFPControl; }
	int GetTexcoords() const { return m_nTexcoords; }
	int GetTexcoord2D() const { return m_nTexcoord2D; }
	int GetTexcoord3D() const { return m_nTexcoord3D; }

	int GetInstructionCount() const {return m_nInstructions;}
	std::list<struct fragment_program_data> GetConstRelocations() const { return m_lConstData; }
	struct fragment_program_exec* GetInstructions() const { return m_pInstructions; }

private:
	void Prepare(CParser *pParser);

	void emit_insn(u8 op,struct nvfx_insn *insn);
	void emit_dst(struct nvfx_reg *dst,bool *have_const);
	void emit_src(s32 pos,struct nvfx_src *src,bool *have_const);
	void emit_brk(struct nvfx_insn *insn);
	void emit_rep(struct nvfx_insn *insn);
	void emit_if(struct nvfx_insn *insn);
	void fixup_rep();
	void fixup_if();
	void fixup_else();

	void grow_insns(int count);

	struct nvfx_reg temp();
	void release_temps();

	inline param GetImmData(int index)
	{
		s32 i;
		std::list<param>::iterator it = m_lParameters.begin();
		for(;it!=m_lParameters.end();it++) {
			for(i=0;i<it->count;i++) {
				if((int)(it->index + i)==index) {
					if(it->is_const && it->is_internal)
						return *it;
				}
			}
		}
		return param();
	}

	inline param GetInputAttrib(int index)
	{
		s32 i;
		std::list<param>::iterator it = m_lParameters.begin();
		for(;it!=m_lParameters.end();it++) {
			for(i=0;i<it->count;i++) {
				if((int)(it->index + i)==index) {
					if(!it->is_const && !it->is_internal)
						return *it;
				}
			}
		}
		return param();
	}

	int m_nNumRegs;
	int m_nFPControl;
	int m_nSamplers;
	int m_nTexcoords;
	int m_nTexcoord2D;
	int m_nTexcoord3D;
	int m_nInstructions;
	int m_nCurInstruction;
	struct fragment_program_exec *m_pInstructions;

	int m_rTemps;
	int m_rTempsDiscard;

	struct nvfx_reg *m_rTemp;

	std::list<param> m_lParameters;
	std::list<struct fragment_program_data> m_lConstData;
	std::stack<int> m_repStack;
	std::stack<int> m_ifStack;
};

#endif


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 ServiceObjectivesRestOperations
    {
        private readonly TelemetryDetails _userAgent;
        private readonly HttpPipeline _pipeline;
        private readonly Uri _endpoint;
        private readonly string _apiVersion;

        /// <summary> Initializes a new instance of ServiceObjectivesRestOperations. </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 ServiceObjectivesRestOperations(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 CreateGetRequest(string subscriptionId, string resourceGroupName, string serverName, string serviceObjectiveName)
        {
            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("/serviceObjectives/", false);
            uri.AppendPath(serviceObjectiveName, true);
            uri.AppendQuery("api-version", _apiVersion, true);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            _userAgent.Apply(message);
            return message;
        }

        /// <summary> Gets a database service objective. </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="serviceObjectiveName"> The name of the service objective to retrieve. </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="serviceObjectiveName"/> is null. </exception>
        /// <exception cref="ArgumentException"> <paramref name="subscriptionId"/>, <paramref name="resourceGroupName"/>, <paramref name="serverName"/> or <paramref name="serviceObjectiveName"/> is an empty string, and was expected to be non-empty. </exception>
        public async Task<Response<ServiceObjectiveData>> GetAsync(string subscriptionId, string resourceGroupName, string serverName, string serviceObjectiveName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
            Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName));
            Argument.AssertNotNullOrEmpty(serverName, nameof(serverName));
            Argument.AssertNotNullOrEmpty(serviceObjectiveName, nameof(serviceObjectiveName));

            using var message = CreateGetRequest(subscriptionId, resourceGroupName, serverName, serviceObjectiveName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        ServiceObjectiveData value = default;
                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
                        value = ServiceObjectiveData.DeserializeServiceObjectiveData(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                case 404:
                    return Response.FromValue((ServiceObjectiveData)null, message.Response);
                default:
                    throw new RequestFailedException(message.Response);
            }
        }

        /// <summary> Gets a database service objective. </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="serviceObjectiveName"> The name of the service objective to retrieve. </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="serviceObjectiveName"/> is null. </exception>
        /// <exception cref="ArgumentException"> <paramref name="subscriptionId"/>, <paramref name="resourceGroupName"/>, <paramref name="serverName"/> or <paramref name="serviceObjectiveName"/> is an empty string, and was expected to be non-empty. </exception>
        public Response<ServiceObjectiveData> Get(string subscriptionId, string resourceGroupName, string serverName, string serviceObjectiveName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
            Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName));
            Argument.AssertNotNullOrEmpty(serverName, nameof(serverName));
            Argument.AssertNotNullOrEmpty(serviceObjectiveName, nameof(serviceObjectiveName));

            using var message = CreateGetRequest(subscriptionId, resourceGroupName, serverName, serviceObjectiveName);
            _pipeline.Send(message, cancellationToken);
            switch (message.Response.Status)
            {
                case 200:
                    {
                        ServiceObjectiveData value = default;
                        using var document = JsonDocument.Parse(message.Response.ContentStream);
                        value = ServiceObjectiveData.DeserializeServiceObjectiveData(document.RootElement);
                        return Response.FromValue(value, message.Response);
                    }
                case 404:
                    return Response.FromValue((ServiceObjectiveData)null, message.Response);
                default:
                    throw new RequestFailedException(message.Response);
            }
        }

        internal HttpMessage CreateListByServerRequest(string subscriptionId, string resourceGroupName, string serverName)
        {
            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("/serviceObjectives", false);
            uri.AppendQuery("api-version", _apiVersion, true);
            request.Uri = uri;
            request.Headers.Add("Accept", "application/json");
            _userAgent.Apply(message);
            return message;
        }

        /// <summary> Returns database service objectives. </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="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="subscriptionId"/>, <paramref name="resourceGroupName"/> or <paramref name="serverName"/> is null. </exception>
        /// <exception cref="ArgumentException"> <paramref name="subscriptionId"/>, <paramref name="resourceGroupName"/> or <paramref name="serverName"/> is an empty string, and was expected to be non-empty. </exception>
        public async Task<Response<ServiceObjectiveListResult>> ListByServerAsync(string subscriptionId, string resourceGroupName, string serverName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
            Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName));
            Argument.AssertNotNullOrEmpty(serverName, nameof(serverName));

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

        /// <summary> Returns database service objectives. </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="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="subscriptionId"/>, <paramref name="resourceGroupName"/> or <paramref name="serverName"/> is null. </exception>
        /// <exception cref="ArgumentException"> <paramref name="subscriptionId"/>, <paramref name="resourceGroupName"/> or <paramref name="serverName"/> is an empty string, and was expected to be non-empty. </exception>
        public Response<ServiceObjectiveListResult> ListByServer(string subscriptionId, string resourceGroupName, string serverName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
            Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName));
            Argument.AssertNotNullOrEmpty(serverName, nameof(serverName));

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


text:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" href="/images/logo.ico">
<title>animate5</title>
<style>
body {
  margin: 0;
  overflow: hidden;
  background: #000;
}
body canvas {
  -webkit-filter: url("#turbulence");
  filter: url("#turbulence");
}

</style>
</head>

<body>
<canvas id="c" width="1366" height="589"></canvas>
<svg xlmns="http://www.w3.org/2000/svg" version="1.1">
  <defs>
    <filter id="turbulence">
      <feturbulence type="fractalNoise" baseFrequency="0.05 0.05" numOctaves="1" result="noice"></feturbulence>
      <fedisplacementmap xChannelSelector="R" yChannelSelector="G" scale="20" in="SourceGraphic"></fedisplacementmap>
    </filter>
  </defs>
</svg>
<script>
var c = document.getElementById('c'),
  ctx = c.getContext('2d'),
  points = [],
  count = 40,
  size = 3,
  delta = 4,
  distance = 170;
window.requestAnimFrame = (function() {
  return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
  function(callback) {
    window.setTimeout(callback, 1000 / 60)
  }
})();

function checkDistance(x1, y1, x2, y2) {
  return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2))
}

function setColor() {
  return 'rgb(' + Math.round(255 * Math.random()) + ',' + Math.round(255 * Math.random()) + ',' + Math.round(255 * Math.random()) + ')'
}

function Point(x, y, dx, dy, color) {
  this.x = x;
  this.y = y;
  this.dx = dx;
  this.dy = dy;
  this.color = color
}

function initPoint(x, y) {
  var x = x || c.width * Math.random(),
    y = y || c.height * Math.random(),
    dx = -delta / 2 + delta * Math.random(),
    dy = -delta / 2 + delta * Math.random(),
    color = setColor();
  points.push(new Point(x, y, dx, dy, color))
}

function drawPoint(point) {
  ctx.fillStyle = point.color;
  ctx.beginPath();
  ctx.arc(point.x, point.y, size, 0, 2 * Math.PI);
  ctx.fill()
}

function drawLines(point, index) {
  for (var i = 0; i < index; i++) {
    var opacity = 1 - checkDistance(point.x, point.y, points[i].x, points[i].y) / distance;
    if (opacity > 0) {
      var grad = ctx.createLinearGradient(point.x, point.y, points[i].x, points[i].y);
      grad.addColorStop(0, point.color);
      grad.addColorStop(1, points[i].color);
      ctx.strokeStyle = grad;
      ctx.globalAlpha = opacity;
      ctx.beginPath();
      ctx.moveTo(point.x, point.y);
      ctx.lineTo(points[i].x, points[i].y);
      ctx.stroke();
      ctx.globalAlpha = 1
    }
  }
}

function updatePosition() {
  for (var i = 0; i < points.length; i++) {
    var xDx = points[i].x + points[i].dx,
      yDy = points[i].y + points[i].dy;
    if (xDx - size < 0 || xDx + size > c.width) {
      points[i].dx = -points[i].dx
    }
    if (yDy - size < 0 || yDy + size > c.height) {
      points[i].dy = -points[i].dy
    }
    points[i].x += points[i].dx;
    points[i].y += points[i].dy;
    drawPoint(points[i]);
    drawLines(points[i], i)
  }
}

function init() {
  points.length = 0;
  for (var i = 0; i < count; i++) {
    initPoint()
  }
}

function resize() {
  c["width"] = window["innerWidth"];
  c["height"] = window["innerHeight"];
  init()
}

function draw() {
  ctx.clearRect(0, 0, c.width, c.height);
  updatePosition();
  window.requestAnimFrame(draw)
}
window.addEventListener("resize", resize);
c.addEventListener("mouseup", function(e) {
  initPoint(e.pageX - c.offsetLeft, e.pageY - c.offsetTop)
});
resize();
draw();
</script>
</body>
</html>


text:
const HostedPark = require('../hostedPark');

/**
 * Universal's Islands Of Adventure
 * @class
 * @extends HostedPark
 */
class UniversalIslandsOfAdventure extends HostedPark {
  /**
   * Create a new UniversalIslandsOfAdventure object
   */
  constructor(options = {}) {
    options.name = options.name || "Universal's Islands Of Adventure";
    options.timezone = options.timezone || 'America/New_York';

    // set park's location as it's entrance
    options.latitude = options.latitude || 28.4722430;
    options.longitude = options.longitude || -81.4678556;

    // inherit from base class
    super(options);
  }
}

module.exports = UniversalIslandsOfAdventure;


text:
CREATE TABLE pokemon_form_generations (
	pokemon_form_id INTEGER NOT NULL,
	generation_id INTEGER NOT NULL,
	game_index INTEGER NOT NULL,
	CONSTRAINT pk_pokemon_form_generations_pokemon_form_id_generation_id PRIMARY KEY (pokemon_form_id, generation_id),
	CONSTRAINT fk_pokemon_form_generations_pokemon_form_id_generation_id FOREIGN KEY(pokemon_form_id) REFERENCES pokemon_forms (id),
	CONSTRAINT fk_pokemon_form_generations_generations FOREIGN KEY(generation_id) REFERENCES generations (id)
);


text:
using System;
using UnityEngine;

namespace UnityUtilities
{
    /// <summary>
    /// Provides input for a float value range in the editor and various convencience functions to work with that range.
    /// </summary>
    [Serializable]
    public class RangeFloat
    {
        /// <summary>
        /// The range start.
        /// </summary>
        [SerializeField] float from;

        /// <summary>
        /// The range end.
        /// </summary>
        [SerializeField] float to;

        /// <summary>
        /// The range start.
        /// </summary>
        public float From { get { return from; } }

        /// <summary>
        /// The range end.
        /// </summary>
        public float To { get { return to; } }

        /// <summary>
        /// Returns how wide the range between from and to is.
        /// </summary>
        public float Range { get { return to - from; } }

        /// <summary>
        /// Returns a random number between from [inclusive] and to [inclusive].
        /// </summary>
        public float RandomInclusive { get { return UnityEngine.Random.Range(from, to); } }

        /// <summary>
        /// Create a RangeFloat with 0-0 as the range. Needed for the editor.
        /// </summary>
        public RangeFloat()
        {
        }

        /// <summary>
        /// Create a RangeFloat with a certain range.
        /// </summary>
        /// <param name="from">Lower range bound.</param>
        /// <param name="to">Upper range bound.</param>
        public RangeFloat(float @from, float to)
        {
            this.@from = @from;
            this.to = to;
        }

        /// <summary>
        /// Linearly interpolates between to and from by t.
        /// </summary>
        /// <param name="t">How much to interpolate. Clamped between 0 and 1. 0 is [to] and 1 is [from].</param>
        /// <returns></returns>
        public float Lerp(float t)
        {
            return Mathf.Lerp(from, to, t);
        }

        /// <summary>
        /// Linearly interpolates between to and from by t.
        /// </summary>
        /// <param name="t">How much to interpolate. 0 is [to] and 1 is [from].</param>
        /// <returns></returns>
        public float LerpUnclamped(float t)
        {
            return Mathf.LerpUnclamped(from, to, t);
        }

        /// <summary>
        /// Calculates the linear parameter t that produces the interpolant value within the range [from, to].
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public float InverseLerp(float value)
        {
            return Mathf.InverseLerp(from, to, value);
        }
    }
}


text:
"use strict";

module Affecto.BusyIndication
{
    export var BusyIndicatorFactory: angular.IDirectiveFactory = (): BusyIndicator =>
    {
        return new BusyIndicator();
    }

    export class BusyIndicator extends Base.Directive
    {
        constructor()
        {
            super(Base.DirectiveRestriction.Attribute | Base.DirectiveRestriction.Element, "App/Packages/BusyIndication/Directives/BusyIndicator.html");
        }

        protected linkDirective($scope: IBusyIndicatorScope, element: JQuery, attributes?: angular.IAttributes, controller?: any): any
        {
            $scope.$on(Events.toggleBusyIndicator,(event: any, show: boolean, text: string) =>
            {
                $scope.isBusy = show;
                $scope.busyIndicatorText = text;
            });

            var enabled: string = attributes["enabled"];
            if (enabled != undefined)
            {
                $scope.isBusy = enabled === "" || $scope.$eval(enabled);
            }
            if (attributes["text"] != null)
            {
                $scope.busyIndicatorText = attributes["text"];
            }
        }
    }
}


text:
<?php declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
final class Version20211030114716 extends AbstractMigration
{
    public function up(Schema $schema) : void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

        $this->addSql('ALTER TABLE page_page DROP FOREIGN KEY FK_93CEAAFA727ACA70');
        $this->addSql('ALTER TABLE page_page ADD CONSTRAINT FK_93CEAAFA727ACA70 FOREIGN KEY (parent_id) REFERENCES page_page (id) ON DELETE SET NULL');
        $this->addSql('ALTER TABLE app_person ADD occupation_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE app_person ADD CONSTRAINT FK_D1DFBCF622C8FC20 FOREIGN KEY (occupation_id) REFERENCES taxonomy_term (id)');
        $this->addSql('CREATE INDEX IDX_D1DFBCF622C8FC20 ON app_person (occupation_id)');
    }

    public function down(Schema $schema) : void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

        $this->addSql('ALTER TABLE app_person DROP FOREIGN KEY FK_D1DFBCF622C8FC20');
        $this->addSql('DROP INDEX IDX_D1DFBCF622C8FC20 ON app_person');
        $this->addSql('ALTER TABLE app_person DROP occupation_id');
        $this->addSql('ALTER TABLE page_page DROP FOREIGN KEY FK_93CEAAFA727ACA70');
        $this->addSql('ALTER TABLE page_page ADD CONSTRAINT FK_93CEAAFA727ACA70 FOREIGN KEY (parent_id) REFERENCES page_page (id)');
    }
}


text:
layout: default
title: "Thank you!"
route: thank-you
---

        Thank you!


text:
package org.anon.designpatterns;

import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;

import org.anon.designpatterns.Holding.HoldingType;

/**
 * This class demonstrates on how to do separating of concerns with Lambda expressions.
 * Strategy pattern example without creating your own interfaces
 * @author averma
 *
 */
public class StrategyPatternHoldingUtil {

	/**
	 * Problem here
	 * Getting entangled with concerns
	 * How to iterate, what to total, how to total
	 * @param assets
	 * @return
	 */
	public static int totalHoldingValues(final List<Holding> assets) {
		return assets.stream()
				.mapToInt(Holding::getValue)
				.sum();
	}

	/**
	 * Only difference between totalAssetValues and totalBondValues is the lambda expression
	 * that we send to mapToInt
	 * @param assets
	 * @return
	 */
	public static int totalBondValues(final List<Holding> assets) {
		return assets.stream()
				.mapToInt(asset -> asset.getType() == HoldingType.BOND ? asset.getValue() : 0)
				.sum();
	}

	/**
	 * Using strategy pattern
	 * @param assets - list of assets
	 * @param assetSelector - predicate to evaluate whether an asset should be considered
	 * Rather than creating our own interface, we have resued java.util.function.Predicate interface
	 * @return
	 */
	public static int totalHoldingValues(final List<Holding> assets,
			final Predicate<Holding> assetSelector) {
		return assets.stream()
				.filter(assetSelector)
				.mapToInt(Holding::getValue)
				.sum();
	}

	public static void main (String [] args) {
		final List<Holding> assets = Arrays.asList(
				new Holding(Holding.HoldingType.BOND, 1000),
				new Holding(Holding.HoldingType.BOND, 2000),
				new Holding(Holding.HoldingType.STOCK, 3000),
				new Holding(Holding.HoldingType.STOCK, 4000)
				);
		System.out.println("Total asset Values:" + totalHoldingValues(assets));
		System.out.println("Total of all assets:" + totalHoldingValues(assets, asset->true));
		System.out.println("Total of bonds:" +  totalHoldingValues(assets, asset-> asset.getType() == HoldingType.BOND));
		System.out.println("Total of stocks:" +  totalHoldingValues(assets, asset-> asset.getType() == HoldingType.STOCK));
	}

}


text:
// CodeGear C++Builder
// Copyright (c) 1995, 2017 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'AbCView.pas' rev: 32.00 (Windows)

#ifndef AbcviewHPP
#define AbcviewHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member
#pragma pack(push,8)
#include <System.hpp>
#include <SysInit.hpp>
#include <Winapi.Windows.hpp>
#include <System.Classes.hpp>
#include <AbView.hpp>
#include <AbCBrows.hpp>
#include <AbCabTyp.hpp>
#include <AbArcTyp.hpp>
#include <Vcl.Grids.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.Forms.hpp>
#include <System.UITypes.hpp>
#include <Vcl.Graphics.hpp>
#include <Vcl.Menus.hpp>

//-- user supplied -----------------------------------------------------------

namespace Abcview
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS TAbCabView;
//-- type declarations -------------------------------------------------------
class PASCALIMPLEMENTATION TAbCabView : public Abview::TAbBaseViewer
{
	typedef Abview::TAbBaseViewer inherited;

protected:
	Abcbrows::TAbCustomCabBrowser* FCabComponent;
	Abarctyp::TAbArchiveList* FEmptyItemList;
	Abcabtyp::TAbCabItem* __fastcall GetItem(int RowNum);
	void __fastcall SetCabComponent(Abcbrows::TAbCustomCabBrowser* Value);
	virtual void __fastcall Notification(System::Classes::TComponent* AComponent, System::Classes::TOperation Operation);
	virtual void __fastcall DoChange(System::TObject* Sender);

public:
	__fastcall virtual TAbCabView(System::Classes::TComponent* AOwner);
	__fastcall virtual ~TAbCabView(void);
	__property Abcabtyp::TAbCabItem* Items[int RowNum] = {read=GetItem};

__published:
	__property Align = {default=0};
	__property Attributes;
	__property BorderStyle = {default=1};
	__property Color = {default=-16777211};
	__property Colors;
	__property Ctl3D;
	__property Cursor = {default=0};
	__property Headings;
	__property DefaultColWidth = {default=64};
	__property DefaultRowHeight = {default=24};
	__property DisplayOptions;
	__property HeaderRowHeight;
	__property SortAttributes;
	__property DragCursor = {default=-12};
	__property DragMode = {default=0};
	__property Enabled = {default=1};
	__property Font;
	__property ParentColor = {default=0};
	__property ParentCtl3D = {default=1};
	__property ParentFont = {default=1};
	__property ParentShowHint = {default=1};
	__property PopupMenu;
	__property ShowHint;
	__property TabOrder = {default=-1};
	__property TabStop = {default=1};
	__property Version = {default=0};
	__property Abcbrows::TAbCustomCabBrowser* CabComponent = {read=FCabComponent, write=SetCabComponent};
	__property OnChange;
	__property OnClick;
	__property OnDblClick;
	__property OnEnter;
	__property OnExit;
	__property OnKeyDown;
	__property OnKeyPress;
	__property OnKeyUp;
	__property OnMouseDown;
	__property OnMouseMove;
	__property OnMouseUp;
	__property OnSorted;
	__property OnDrawSortArrow;
public:
	/* TWinControl.CreateParented */ inline __fastcall TAbCabView(HWND ParentWindow) : Abview::TAbBaseViewer(ParentWindow) { }

};

//-- var, const, procedure ---------------------------------------------------
}	/* namespace Abcview */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_ABCVIEW)
using namespace Abcview;
#endif
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// AbcviewHPP


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright 2021 Google LLC

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<project version="4">
    <component name="RemoteRepositoriesConfiguration">
        <remote-repository>
            <option name="id" value="central" />
            <option name="name" value="Maven Central repository" />
            <option name="url" value="https://repo1.maven.org/maven2" />
        </remote-repository>
        <remote-repository>
            <option name="id" value="jboss.community" />
            <option name="name" value="JBoss Community repository" />
            <option name="url"
                value="https://repository.jboss.org/nexus/content/repositories/public/" />
        </remote-repository>
        <remote-repository>
            <option name="id" value="BintrayJCenter" />
            <option name="name" value="BintrayJCenter" />
            <option name="url" value="https://jcenter.bintray.com/" />
        </remote-repository>
        <remote-repository>
            <option name="id" value="Google" />
            <option name="name" value="Google" />
            <option name="url" value="https://dl.google.com/dl/android/maven2/" />
        </remote-repository>
    </component>
</project>


text:
import { Component, Input, ViewChild, OnChanges, SimpleChanges, Output, EventEmitter } from '@angular/core';

declare let $: any; // jquery

@Component({
  selector: 'taskana-general-message-modal',
  templateUrl: './general-message-modal.component.html',
  styleUrls: ['./general-message-modal.component.scss']
})
export class GeneralMessageModalComponent implements OnChanges {
  @Input() message: string;
  @Output() messageChange = new EventEmitter<string>();

  @Input()
  title: string;

  @Input()
  type: string;

  @ViewChild('generalModal', { static: true })
  private modal;

  ngOnChanges(changes: SimpleChanges) {
    if (this.message) {
      $(this.modal.nativeElement).modal('toggle');
    }
  }

  removeMessage() {
    this.message = '';
    this.messageChange.emit(this.message);
  }
}


text:
from model.new_user_data import N_u_d
import random
import string
import os.path
import json
import getopt
import sys
import jsonpickle

try:
    opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contacts", "file"])
except getopt.GetoptError as err:
    getopt.usage()
    sys.exit(2)

n = 5
f = "data/contacts.json"

for o, a in opts:
    if o == "-n":
        n = int(a)
    elif o == "-f":
        f = a

def random_string(prefix, maxlen):
    symbols = string.ascii_letters + string.digits + string.punctuation + " "*20
    return prefix + "".join([random.choice(symbols) for i in range (random.randrange(maxlen))])

testdata = [
            N_u_d(namef=random_string("namef", 10), namem=random_string("namem", 10), namel=random_string("namel", 10),
                  nick=random_string("nick", 6), title=random_string("title", 9), firm=random_string("firm", 12),
                  addr=random_string("address", 20), phone_h=random_string("phoneh", 7),
                  phone_m=random_string("phone_m", 7), phone_work=random_string("phone_w", 7),
                  phone_fax=random_string("phone_fax", 7), email_1=random_string("email1", 7),
                  email_2=random_string("email_2", 10), email_3=random_string("email_3", 10),
                  homep=random_string("home_page", 12), day_1 = "//div[@id='content']/form/select[1]//option[3]",
                  month_1 = "//div[@id='content']/form/select[2]//option[2]", year_1 = random_string("year", 6),
                  day_2 = "//div[@id='content']/form/select[3]//option[3]",
                  month_2 = "//div[@id='content']/form/select[4]//option[2]",
                  year_2 = random_string("year", 6), address_2=random_string("address", 15),
                  phone_h2=random_string("phone_h2", 6), notes=random_string("notes", 20))
            for i in range(5)
]

file = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", f)

with open(file, "w") as out:
    jsonpickle.set_encoder_options('json', indent=2)
    out.write(jsonpickle.encode(testdata))


text:
package com.github.horrorho.inflatabledonkey.data.der;

import java.math.BigInteger;
import java.util.Objects;
import javax.annotation.concurrent.Immutable;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Integer;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.DERSequence;

/**
 * ECDSA signature.
 * <p>
 * ECDSASignature ::= SEQUENCE { r INTEGER, s INTEGER }
 *
 * @author Ahseya
 */
@Immutable
public final class ECDSASignature extends ASN1Object {

    private final BigInteger r;
    private final BigInteger s;

    public ECDSASignature(BigInteger r, BigInteger s) {
        this.r = Objects.requireNonNull(r);
        this.s = Objects.requireNonNull(s);
    }

    public ECDSASignature(ASN1Primitive primitive) {
        DERIterator i = DER.asSequence(primitive);

        r = DER.as(ASN1Integer.class, i)
                .getValue();

        s = DER.as(ASN1Integer.class, i)
                .getValue();
    }

    public BigInteger r() {
        return r;
    }

    public BigInteger s() {
        return s;
    }

    @Override
    public ASN1Primitive toASN1Primitive() {
        ASN1EncodableVector vector = DER.vector(
                new ASN1Integer(r),
                new ASN1Integer(s));

        return new DERSequence(vector);
    }

    @Override
    public String toString() {
        return "Signature{"
                + "r=0x" + r.toString(16)
                + ", s=0x" + s.toString(16)
                + '}';
    }
}


text:
from sqlalchemy import Boolean, Column, Integer, String
from sqlalchemy.orm import relationship

from model.base import Base

class Group(Base):
    __tablename__ = "group"
    uid = Column(Integer(), primary_key=True)
    name = Column(String(255), index=True, nullable=False, unique=True)
    description = Column(String(255))
    users = relationship("User", secondary="assoc_user_group")
    important = Column(Boolean, default=False)

    def __init__(self, name):
        self.name = name

    def __repr__(self):
        return "<Group name=%s>" % self.name