text:
// Helpers...
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using TwainDirect.Support;

namespace TwainDirect.Scanner
{
    /// <summary>
    /// Our entry point.  From here we'll dispatch to the mode: window, terminal
    /// or service, along with any interesting arguments...
    /// </summary>
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        /// <param name="a_aszArgs">interesting arguments</param>
        [STAThread]
        static void Main(string[] a_aszArgs)
        {
            string szExecutableName;
            string szWriteFolder;
            float fScale;
            FormMain form1;

            // Are we already running?
            Process[] aprocess = Process.GetProcessesByName(System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location));
            foreach (Process process in aprocess)
            {
                // If it ain't us, it's somebody else...
                if (process.Id != Process.GetCurrentProcess().Id)
                {
                    MessageBox.Show("This program is already running.  If you don't see it on the screen, check the system tray for the TWAIN Direct icon, and right click on it for the list of options.", "TWAIN Direct on TWAIN Bridge");
                    Environment.Exit(1);
                }
            }

            // Load our configuration information and our arguments,
            // so that we can access them from anywhere in the code...
            if (!Config.Load(Application.ExecutablePath, a_aszArgs, "appdata.txt"))
            {
                MessageBox.Show("Error starting.  Try uninstalling and reinstalling this software.", "Error");
                Environment.Exit(1);
            }

            // Set up our data folders...
            szWriteFolder = Config.Get("writeFolder", "");
            szExecutableName = Config.Get("executableName", "");

            // Turn on logging...
            Log.Open(szExecutableName, szWriteFolder, 1);
            Log.SetLevel((int)Config.Get("logLevel", 0));
            Log.Info(szExecutableName + " Log Started...");

            // Make sure that any stale TwainDirectOnTwain processes are gone...
            foreach (Process processTwainDirectOnTwain in Process.GetProcessesByName("TwainDirect.OnTwain"))
            {
                try
                {
                    processTwainDirectOnTwain.Kill();
                }
                catch (Exception exception)
                {
                    Log.Error("unable to kill TwainDirect.OnTwain - " + exception.Message);
                }
            }

            // Figure out what we're doing...
            string szCommand;
            Mode mode = SelectMode(out szCommand, out fScale);

            // Pick our command...
            switch (mode)
            {
                // Uh-oh...
                default:
                    Log.Error("Unrecognized mode: " + mode);
                    break;

                case Mode.SERVICE:
                    //Service service = new Service();
                    //ServiceBase.Run(service);
                    break;

                case Mode.TERMINAL:
                    if (TwainLocalScanner.GetPlatform() == TwainLocalScanner.Platform.WINDOWS)
                    {
                        Interpreter.CreateConsole();
                    }
                    Terminal terminal = new TwainDirect.Scanner.Terminal();
                    switch (szCommand.ToLower())
                    {
                        default:
                            Log.Error("Unrecognized command: " + szCommand);
                            break;
                        case "register":
                            terminal.Register();
                            break;
                        case "start":
                            terminal.Start();
                            break;
                    }
                    terminal.Dispose();
                    break;

                // Fire up our application window...
                case Mode.WINDOW:
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    form1 = new FormMain();
                    Application.Run(form1);
                    form1.Dispose();
                    break;
            }

            // All done...
            Log.Info(szExecutableName + " Log Ended...");
            Log.Close();
            Environment.Exit(0);
        }

        /// <summary>
        /// Select the mode for this session window, terminal or service based on the arguments.
        /// </summary>
        /// <param name="a_szCommand">command to perform</param>
        /// <param name="a_fScale">scale a window, if we have one</param>
        /// <returns>mode to use</returns>
        private static Mode SelectMode
        (
            out string a_szCommand,
            out float a_fScale
        )
        {
            Mode mode;

            // Init stuff...
            mode = Mode.WINDOW;
            a_szCommand = null;
            a_fScale = 1;

            // Sleep so we can attach and debug stuff...
            int iDelay = (int)Config.Get("delayTwainDirect.Scanner", 0);
            if (iDelay > 0)
            {
                Thread.Sleep(iDelay);
            }

            // Check for a command...
            a_szCommand = Config.Get("command", null);
            if (!string.IsNullOrEmpty(a_szCommand))
            {
                a_szCommand = a_szCommand.ToLower();
            }

            // Check for a mode...
            string szMode = Config.Get("mode", null);
            if (!string.IsNullOrEmpty(szMode))
            {
                switch (szMode.ToLower())
                {
                    default:
                        mode = Mode.UNKNOWN;
                        break;
                    case "terminal":
                        mode = Mode.TERMINAL;
                        break;
                    case "window":
                        mode = Mode.WINDOW;
                        break;
                    case "service":
                        mode = Mode.SERVICE;
                        break;
                }
            }

            // More arguments...
            a_fScale = (float)Config.Get("scale", 1.0);

            // Otherwise let the user interact with us...
            Log.Info("Mode: " + mode + " " + "command=" + ((a_szCommand == null) ? "*none*" : a_szCommand));
            return (mode);
        }

        /// <summary>
        /// The mode we'll run in...
        /// </summary>
        private enum Mode
        {
            UNKNOWN,
            SERVICE,
            TERMINAL,
            WINDOW
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<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>

    <groupId>me.alb-i986.cucumber</groupId>
    <artifactId>cucumber-java-junit-archetype</artifactId>
    <version>1.2.5</version>
    <packaging>maven-archetype</packaging>

    <name>cucumber-java-junit-archetype</name>
    <description>
        Maven Archetype for creating Cucumber Java projects, featuring JUnit. Entirely based on https://github.com/cucumber/cucumber-java-skeleton
    </description>
    <url>https://github.com/alb-i986/cucumber-java-junit-archetype</url>
    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Alberto Scotto</name>
            <email>scotto.alberto.86@gmail.com</email>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:https://github.com/alb-i986/cucumber-java-junit-archetype.git</connection>
        <developerConnection>scm:git:git@github.com:alb-i986/cucumber-java-junit-archetype.git</developerConnection>
        <url>https://github.com/alb-i986/cucumber-java-junit-archetype</url>
    </scm>

    <build>
        <extensions>
            <extension>
                <groupId>org.apache.maven.archetype</groupId>
                <artifactId>archetype-packaging</artifactId>
                <version>3.0.0</version>
            </extension>
        </extensions>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-archetype-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.7</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>gpg.passphrase</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>

redpajama_set_name: RedPajamaGithub


text:
from django.db import models
from django.conf import settings
from django.core.urlresolvers import reverse

from carbon.compounds.email.models import EmailTemplate as BaseEmailTemplate
from carbon.compounds.email.models import EmailCategory as BaseEmailCategory
from carbon.compounds.email.models import EmailReceipt as BaseEmailReceipt
from carbon.compounds.email.models import UserSubscriptionSettings as BaseUserSubscriptionSettings
from carbon.compounds.email.models import EmailCategorySubscriptionSettings as BaseEmailCategorySubscriptionSettings

class EmailTemplate(BaseEmailTemplate):
    pass

class EmailCategory(BaseEmailCategory):
    pass

class EmailReceipt(BaseEmailReceipt):
    pass

class UserSubscriptionSettings(BaseUserSubscriptionSettings):
	pass

class EmailCategorySubscriptionSettings(BaseEmailCategorySubscriptionSettings):
    pass


text:
// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/common/secure_origin_allowlist.h"

#include <set>
#include <string>

#include "chrome/common/pref_names.h"
#include "components/prefs/pref_registry_simple.h"
#include "extensions/buildflags/buildflags.h"

#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "extensions/common/constants.h"
#endif

namespace secure_origin_allowlist {

std::set<std::string> GetSchemesBypassingSecureContextCheck() {
  std::set<std::string> schemes;
#if BUILDFLAG(ENABLE_EXTENSIONS)
  schemes.insert(extensions::kExtensionScheme);
#endif
  return schemes;
}

void RegisterPrefs(PrefRegistrySimple* local_state) {
  local_state->RegisterStringPref(prefs::kUnsafelyTreatInsecureOriginAsSecure,
                                  /* default_value */ "");
}

}  // namespace secure_origin_allowlist


text:
package docker

import (
	"github.com/dotcloud/docker/utils"
	"runtime"
	"testing"
)

func displayFdGoroutines(t *testing.T) {
	t.Logf("Fds: %d, Goroutines: %d", utils.GetTotalUsedFds(), runtime.NumGoroutine())
}

func TestFinal(t *testing.T) {
	nuke(globalDaemon)
	t.Logf("Start Fds: %d, Start Goroutines: %d", startFds, startGoroutines)
	displayFdGoroutines(t)
}


text:
/**
  * Automatically generated file. Please do not edit.
  * @author Highcharts Config Generator by Karasiq
  * @see [[http://api.highcharts.com/highcharts]]
  */
package com.highcharts.config

import scalajs.js, js.`|`
import com.highcharts.CleanJsObject
import com.highcharts.HighchartsUtils._

/**
  * @note JavaScript name: series<wordcloud>-rotation
  */
@js.annotation.ScalaJSDefined
class SeriesWordcloudRotation extends com.highcharts.HighchartsGenericObject {

  /**
    *
The smallest degree of rotation for a word.

    */
  val from: js.UndefOr[Double] = js.undefined

  /**
    *
The number of possible orientations for a word, within the range of
    * rotation.from and rotation.to.

    */
  val orientations: js.UndefOr[Double] = js.undefined

  /**
    *
The largest degree of rotation for a word.

    */
  val to: js.UndefOr[Double] = js.undefined
}

object SeriesWordcloudRotation {
  /**
    * @param from
The smallest degree of rotation for a word.

    * @param orientations
The number of possible orientations for a word, within the range of. rotation.from and rotation.to.

    * @param to
The largest degree of rotation for a word.

    */
  def apply(from: js.UndefOr[Double] = js.undefined, orientations: js.UndefOr[Double] = js.undefined, to: js.UndefOr[Double] = js.undefined): SeriesWordcloudRotation = {
    val fromOuter: js.UndefOr[Double] = from
    val orientationsOuter: js.UndefOr[Double] = orientations
    val toOuter: js.UndefOr[Double] = to
    com.highcharts.HighchartsGenericObject.toCleanObject(new SeriesWordcloudRotation {
      override val from: js.UndefOr[Double] = fromOuter
      override val orientations: js.UndefOr[Double] = orientationsOuter
      override val to: js.UndefOr[Double] = toOuter
    })
  }
}


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

namespace Heap
{
    public class Heap<T> where T : IComparable
    {
        private T[] _values;
        private int _heapSize;

        public Heap(T[] values)
        {
            _values = values;
        }

        /**
         * Turns the heap into a sorted array.
         *
         * The max element in the heap is always at position 1.
         * Repeatedly swaps it with the element at the end of the heap,
         * then calls heapify on the remainder of the heap.
         *
         * Runs in time O(nlgn) since BuildHeap takes O(n) and each of the
         * n - 1 calls to Heapify takes time O(lgn).
         */
        public void HeapSort()
        {
            BuildHeap();
            for (int i = Length; i >= 2; --i)
            {
                Swap(1, i);
                --_heapSize;
                Heapify(1);
            }
        }

        public int Length
        {
            get
            {
                return _values.Length;
            }
        }

        /** Returns the heap element at the given index (starting at 1)
         *
         * Index of element i's parent = floor(i/2)
         * Index of element i's left child = 2i
         * Index of element i's right child = 2i+1
         *
         * Heap indexing must start at 1 or these formula's won't work
         * (e.g. left child of element 0 is 2*0 = 0)
         */

        private T this[int i]
        {
            get { return _values[i - 1]; }
            set { _values[i - 1] = value; }
        }

        private int Left(int i)
        {
            return i * 2;
        }

        private int Right(int i)
        {
            return i * 2 + 1;
        }

        private int Parent(int i)
        {
            return (int)Math.Floor((decimal)i / 2);
        }

        /**
         * Makes the binary tree rooted at i a heap by letting the value
         * at node i "float down" until it's at the right place.
         *
         * Precondition: the binary trees rooted at Left(i) and Right(i)
         * are heaps, but that this[i] may be smaller than its children,
         * thus violating the heap property.
         *
         * Recall that the heap property says that for every node i other
         * than the root, this[Parent(i)] >= this[i].
         *
         * Postcondition: the binary tree rooted at i is a heap.
         *
         * Runs in lg(n) time.
         */
        private void Heapify(int i)
        {
            int left = Left(i);
            int right = Right(i);
            int largest = i;
            if (left <= _heapSize && this[left].CompareTo(this[i]) > 0)
            {
                largest = left;
            }
            if (right <= _heapSize && this[right].CompareTo(this[largest]) > 0)
            {
                largest = right;
            }
            if (largest != i)
            {
                Swap(largest, i);
                Heapify(largest);
            }
        }

        private void Swap(int lhs, int rhs)
        {
            T tempV = this[lhs];
            this[lhs] = this[rhs];
            this[rhs] = tempV;
        }

        /**
         * Turns an array into a heap.
         *
         * Since the elements in the latter half of the array are all leaf
         * nodes, they're automatically 1-element heaps, so we can skip them.
         * This method goes through the remaining elements in a bottom-up manner
         * and runs Heapify on each. The order in which they are processed
         * guarantees that the children of each node are heaps before Heapify
         * is run on it.
         *
         * Looks like it runs in O(nlgn) time, but can be proven to actually
         * run in O(n).
         */
        private void BuildHeap()
        {
            _heapSize = Length;
            for (int i = Length / 2; i > 0; --i)
            {
                Heapify(i);
            }
        }

        public override string ToString()
        {
            return "[" + string.Join(",", _values) + "]";
        }
    }
}


text:
{-# OPTIONS_GHC -Wall #-}
module Reader
    ( readSExpr )
where

import Control.Applicative
import Text.Parsec hiding (spaces, space, (<|>), many)

import SExpr

-- Allowed symbols.
symbol :: Parsec String () Char
symbol = oneOf "!#$%&|*+-/:<=>?@^_~."

-- Whitespace. ',' is also treated as whitespace.
space :: Parsec String () Char
space = oneOf " \t\n\r,"

-- Skip comment
comment :: Parsec String () ()
comment = (char ';' *> skipMany (noneOf "\n") *> char '\n' *> pure ()) <?> ""

-- Skip spaces.
spaces :: Parsec String () ()
spaces = skipMany space *> skipMany comment

-- Parse an atom.
atom :: Parsec String () SExpr
atom = liftA pick $ (:) <$> (symbol <|> letter) <*> many (symbol <|> alphaNum)
       where
         pick name =
             case name of
               "true"  -> Bool True
               "false" -> Bool False
               "nil"   -> Nil
               _       -> Atom name

-- Parse a container separated by l and r
container :: String -> String -> Parsec String () [SExpr]
container l r = left *> expr `sepEndBy` spaces <* right
    where
      left  = spaces *> string l *> spaces
      right = spaces <* string r <* spaces

-- Parse a list.
list :: Parsec String () SExpr
list = List <$> container "(" ")"

-- Parse a quoted list.
quotList :: Parsec String () SExpr
quotList = liftA (\l -> List $ Atom "quote" : [List l]) $ container "'(" ")"

-- Parse a number.
int :: Parsec String () SExpr
int = (Int . read) <$> many1 digit

str :: Parsec String () SExpr
str = liftA String $ char '"' *> many (noneOf "\"") <* char '"'

-- Parse an expression.
expr :: Parsec String () SExpr
expr = ex <* (optionMaybe eof <?> "") <?> "expression"
    where
      ex = quotList <|> list <|> atom <|> int <|> str

-- Read S-Expression from string.
-- It works by reading a sequence of instructions into a do-block.
readSExpr :: String -> SExpr
readSExpr text = either (\e -> Err $ "Parse error in " ++ show e)
                        (\e -> List $ Atom "do" : e)
                        (parse exprs "" text)
    where
      exprs = spaces *> expr `sepEndBy` spaces


text:
<!DOCTYPE html>

	<meta charset="utf-8">

	<title>UMAnalyticsConfig Class Reference</title>

	<link rel="stylesheet" href="../css/style.css">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
	<meta name="generator" content="appledoc 2.2.1 (build 1334)">

				MobClick

				umeng

Index

Hierarchy

							On This Page

							<select id="jump-to">
	<option value="top">Jump To…</option>

	<option value="overview">Overview</option>

	<option value="tasks">Tasks</option>

	<optgroup label="Properties">

		<option value="//api/name/appKey">appKey</option>

		<option value="//api/name/bCrashReportEnabled">bCrashReportEnabled</option>

		<option value="//api/name/channelId">channelId</option>

		<option value="//api/name/ePolicy">ePolicy</option>

		<option value="//api/name/eSType">eSType</option>

		<option value="//api/name/secret">secret</option>

		<option value="//api/name/token">token</option>

	</optgroup>

</select>

UMAnalyticsConfig Class Reference

	Inherits from
	NSObject

	Declared in
	MobClick.h

  appKey

required:  appkey string

@property (nonatomic, copy) NSString *appKey

Discussion

required:  appkey string

Declared In

MobClick.h

  token

required:  token string

@property (nonatomic, copy) NSString *token

Discussion

required:  token string

Declared In

MobClick.h

  secret

optional:  default: nil

@property (nonatomic, copy) NSString *secret

Discussion

optional:  default: nil

Declared In

MobClick.h

  channelId

optional:  default: “App Store”

@property (nonatomic, copy) NSString *channelId

Discussion

optional:  default: “App Store”

Declared In

MobClick.h

  bCrashReportEnabled

optional:  default: YES

@property (nonatomic) BOOL bCrashReportEnabled

Discussion

optional:  default: YES

Declared In

MobClick.h

  ePolicy

optional:  default: BATCH

@property (nonatomic) ReportPolicy ePolicy

Discussion

optional:  default: BATCH

Declared In

MobClick.h

  eSType

optional:  default: E_UM_NORMAL

@property (nonatomic) eScenarioType eSType

Discussion

optional:  default: E_UM_NORMAL

Declared In

MobClick.h

Copyright © 2016 umeng. All rights reserved. Updated: 2016-04-07

Generated by appledoc 2.2.1 (build 1334).


text:
/* ====================================================================
 * Copyright (c) 1998-2007 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. All advertising materials mentioning features or use of this
 *    software must display the following acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
 *
 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please contact
 *    openssl-core@openssl.org.
 *
 * 5. Products derived from this software may not be called "OpenSSL"
 *    nor may "OpenSSL" appear in their names without prior written
 *    permission of the OpenSSL Project.
 *
 * 6. Redistributions of any form whatsoever must retain the following
 *    acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
 *
 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 * ====================================================================
 *
 * This product includes cryptographic software written by Eric Young
 * (eay@cryptsoft.com).  This product includes software written by Tim
 * Hudson (tjh@cryptsoft.com).
 *
 */
/* ====================================================================
 * Copyright 2005 Nokia. All rights reserved.
 *
 * The portions of the attached software ("Contribution") is developed by
 * Nokia Corporation and is licensed pursuant to the OpenSSL open source
 * license.
 *
 * The Contribution, originally written by Mika Kousa and Pasi Eronen of
 * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites
 * support (see RFC 4279) to OpenSSL.
 *
 * No patent licenses or other rights except those expressly stated in
 * the OpenSSL open source license shall be deemed granted or received
 * expressly, by implication, estoppel, or otherwise.
 *
 * No assurances are provided by Nokia that the Contribution does not
 * infringe the patent or other intellectual property rights of any third
 * party or that the license provides you with all the necessary rights
 * to make use of the Contribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN
 * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA
 * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY
 * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
 * OTHERWISE. */

#include <openssl/ssl.h>

#include <assert.h>
#include <string.h>

#include <utility>

#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <openssl/md5.h>
#include <openssl/mem.h>
#include <openssl/nid.h>
#include <openssl/rand.h>

#include "../crypto/fipsmodule/tls/internal.h"
#include "../crypto/internal.h"
#include "internal.h"

BSSL_NAMESPACE_BEGIN

bool tls1_prf(const EVP_MD *digest, Span<uint8_t> out,
              Span<const uint8_t> secret, Span<const char> label,
              Span<const uint8_t> seed1, Span<const uint8_t> seed2) {
  return 1 == CRYPTO_tls1_prf(digest, out.data(), out.size(), secret.data(),
                              secret.size(), label.data(), label.size(),
                              seed1.data(), seed1.size(), seed2.data(),
                              seed2.size());
}

static bool get_key_block_lengths(const SSL *ssl, size_t *out_mac_secret_len,
                                  size_t *out_key_len, size_t *out_iv_len,
                                  const SSL_CIPHER *cipher) {
  const EVP_AEAD *aead = NULL;
  if (!ssl_cipher_get_evp_aead(&aead, out_mac_secret_len, out_iv_len, cipher,
                               ssl_protocol_version(ssl), SSL_is_dtls(ssl))) {
    OPENSSL_PUT_ERROR(SSL, SSL_R_CIPHER_OR_HASH_UNAVAILABLE);
    return false;
  }

  *out_key_len = EVP_AEAD_key_length(aead);
  if (*out_mac_secret_len > 0) {
    // For "stateful" AEADs (i.e. compatibility with pre-AEAD cipher suites) the
    // key length reported by |EVP_AEAD_key_length| will include the MAC key
    // bytes and initial implicit IV.
    if (*out_key_len < *out_mac_secret_len + *out_iv_len) {
      OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR);
      return false;
    }
    *out_key_len -= *out_mac_secret_len + *out_iv_len;
  }

  return true;
}

static bool generate_key_block(const SSL *ssl, Span<uint8_t> out,
                               const SSL_SESSION *session) {
  auto secret = MakeConstSpan(session->secret, session->secret_length);
  static const char kLabel[] = "key expansion";
  auto label = MakeConstSpan(kLabel, sizeof(kLabel) - 1);

  const EVP_MD *digest = ssl_session_get_digest(session);
  // Note this function assumes that |session|'s key material corresponds to
  // |ssl->s3->client_random| and |ssl->s3->server_random|.
  return tls1_prf(digest, out, secret, label, ssl->s3->server_random,
                  ssl->s3->client_random);
}

bool tls1_configure_aead(SSL *ssl, evp_aead_direction_t direction,
                         Array<uint8_t> *key_block_cache,
                         const SSL_SESSION *session,
                         Span<const uint8_t> iv_override) {
  size_t mac_secret_len, key_len, iv_len;
  if (!get_key_block_lengths(ssl, &mac_secret_len, &key_len, &iv_len,
                             session->cipher)) {
    return false;
  }

  // Ensure that |key_block_cache| is set up.
  const size_t key_block_size = 2 * (mac_secret_len + key_len + iv_len);
  if (key_block_cache->empty()) {
    if (!key_block_cache->Init(key_block_size) ||
        !generate_key_block(ssl, MakeSpan(*key_block_cache), session)) {
      return false;
    }
  }
  assert(key_block_cache->size() == key_block_size);

  Span<const uint8_t> key_block = *key_block_cache;
  Span<const uint8_t> mac_secret, key, iv;
  if (direction == (ssl->server ? evp_aead_open : evp_aead_seal)) {
    // Use the client write (server read) keys.
    mac_secret = key_block.subspan(0, mac_secret_len);
    key = key_block.subspan(2 * mac_secret_len, key_len);
    iv = key_block.subspan(2 * mac_secret_len + 2 * key_len, iv_len);
  } else {
    // Use the server write (client read) keys.
    mac_secret = key_block.subspan(mac_secret_len, mac_secret_len);
    key = key_block.subspan(2 * mac_secret_len + key_len, key_len);
    iv = key_block.subspan(2 * mac_secret_len + 2 * key_len + iv_len, iv_len);
  }

  if (!iv_override.empty()) {
    if (iv_override.size() != iv_len) {
      return false;
    }
    iv = iv_override;
  }

  UniquePtr<SSLAEADContext> aead_ctx =
      SSLAEADContext::Create(direction, ssl->version, SSL_is_dtls(ssl),
                             session->cipher, key, mac_secret, iv);
  if (!aead_ctx) {
    return false;
  }

  if (direction == evp_aead_open) {
    return ssl->method->set_read_state(ssl, ssl_encryption_application,
                                       std::move(aead_ctx),
                                       /*secret_for_quic=*/{});
  }

  return ssl->method->set_write_state(ssl, ssl_encryption_application,
                                      std::move(aead_ctx),
                                      /*secret_for_quic=*/{});
}

bool tls1_change_cipher_state(SSL_HANDSHAKE *hs,
                              evp_aead_direction_t direction) {
  return tls1_configure_aead(hs->ssl, direction, &hs->key_block,
                             ssl_handshake_session(hs), {});
}

int tls1_generate_master_secret(SSL_HANDSHAKE *hs, uint8_t *out,
                                Span<const uint8_t> premaster) {
  static const char kMasterSecretLabel[] = "master secret";
  static const char kExtendedMasterSecretLabel[] = "extended master secret";

  const SSL *ssl = hs->ssl;
  auto out_span = MakeSpan(out, SSL3_MASTER_SECRET_SIZE);
  if (hs->extended_master_secret) {
    auto label = MakeConstSpan(kExtendedMasterSecretLabel,
                               sizeof(kExtendedMasterSecretLabel) - 1);
    uint8_t digests[EVP_MAX_MD_SIZE];
    size_t digests_len;
    if (!hs->transcript.GetHash(digests, &digests_len) ||
        !tls1_prf(hs->transcript.Digest(), out_span, premaster, label,
                  MakeConstSpan(digests, digests_len), {})) {
      return 0;
    }
  } else {
    auto label =
        MakeConstSpan(kMasterSecretLabel, sizeof(kMasterSecretLabel) - 1);
    if (!tls1_prf(hs->transcript.Digest(), out_span, premaster, label,
                  ssl->s3->client_random, ssl->s3->server_random)) {
      return 0;
    }
  }

  return SSL3_MASTER_SECRET_SIZE;
}

BSSL_NAMESPACE_END

using namespace bssl;

size_t SSL_get_key_block_len(const SSL *ssl) {
  // See |SSL_generate_key_block|.
  if (SSL_in_init(ssl)) {
    return 0;
  }

  size_t mac_secret_len, key_len, fixed_iv_len;
  if (!get_key_block_lengths(ssl, &mac_secret_len, &key_len, &fixed_iv_len,
                             SSL_get_current_cipher(ssl))) {
    ERR_clear_error();
    return 0;
  }

  return 2 * (mac_secret_len + key_len + fixed_iv_len);
}

int SSL_generate_key_block(const SSL *ssl, uint8_t *out, size_t out_len) {
  // Which cipher state to use is ambiguous during a handshake. In particular,
  // there are points where read and write states are from different epochs.
  // During a handshake, before ChangeCipherSpec, the encryption states may not
  // match |ssl->s3->client_random| and |ssl->s3->server_random|.
  if (SSL_in_init(ssl)) {
    OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
    return 0;
  }

  return generate_key_block(ssl, MakeSpan(out, out_len), SSL_get_session(ssl));
}

int SSL_export_keying_material(SSL *ssl, uint8_t *out, size_t out_len,
                               const char *label, size_t label_len,
                               const uint8_t *context, size_t context_len,
                               int use_context) {
  // Exporters may be used in False Start and server 0-RTT, where the handshake
  // has progressed enough. Otherwise, they may not be used during a handshake.
  if (SSL_in_init(ssl) &&
      !SSL_in_false_start(ssl) &&
      !(SSL_is_server(ssl) && SSL_in_early_data(ssl))) {
    OPENSSL_PUT_ERROR(SSL, SSL_R_HANDSHAKE_NOT_COMPLETE);
    return 0;
  }

  if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) {
    if (!use_context) {
      context = nullptr;
      context_len = 0;
    }
    return tls13_export_keying_material(
        ssl, MakeSpan(out, out_len),
        MakeConstSpan(ssl->s3->exporter_secret, ssl->s3->exporter_secret_len),
        MakeConstSpan(label, label_len), MakeConstSpan(context, context_len));
  }

  size_t seed_len = 2 * SSL3_RANDOM_SIZE;
  if (use_context) {
    if (context_len >= 1u << 16) {
      OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW);
      return 0;
    }
    seed_len += 2 + context_len;
  }
  Array<uint8_t> seed;
  if (!seed.Init(seed_len)) {
    OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE);
    return 0;
  }

  OPENSSL_memcpy(seed.data(), ssl->s3->client_random, SSL3_RANDOM_SIZE);
  OPENSSL_memcpy(seed.data() + SSL3_RANDOM_SIZE, ssl->s3->server_random,
                 SSL3_RANDOM_SIZE);
  if (use_context) {
    seed[2 * SSL3_RANDOM_SIZE] = static_cast<uint8_t>(context_len >> 8);
    seed[2 * SSL3_RANDOM_SIZE + 1] = static_cast<uint8_t>(context_len);
    OPENSSL_memcpy(seed.data() + 2 * SSL3_RANDOM_SIZE + 2, context, context_len);
  }

  const SSL_SESSION *session = SSL_get_session(ssl);
  const EVP_MD *digest = ssl_session_get_digest(session);
  return tls1_prf(digest, MakeSpan(out, out_len),
                  MakeConstSpan(session->secret, session->secret_length),
                  MakeConstSpan(label, label_len), seed, {});
}


text:
describe Spaceship::Tunes::IAPSubscriptionPricingTier do
  before { TunesStubbing.itc_stub_iap }
  before { Spaceship::Tunes.login }

  let(:client)        { Spaceship::AppVersion.client }
  let(:app)           { Spaceship::Application.all.first }
  let(:pricing_tiers) { client.subscription_pricing_tiers(app.apple_id) }

  describe "In-App-Purchase Subscription Pricing Tier" do
    subject { pricing_tiers }

    it "inspect works" do
      expect(subject.inspect).to include("Tunes::IAPSubscriptionPricingTier")
      expect(subject.inspect).to include("Tunes::IAPSubscriptionPricingInfo")
    end

    it "correctly creates all 200 subscription pricing tiers" do
      expect(subject).to all(be_an(Spaceship::Tunes::IAPSubscriptionPricingTier))
      expect(subject.size).to eq(200)
    end

    describe "Subscription Pricing Tier Info" do
      subject { pricing_tiers.flat_map(&:pricing_info) }

      it "correctly creates all 155 pricing infos for each country" do
        expect(subject).to all(be_an(Spaceship::Tunes::IAPSubscriptionPricingInfo))
        expect(subject.size).to eq(155 * 200)
      end
    end
  end

  describe "parsing the first subscription pricing tier" do
    subject { pricing_tiers.first }

    it "correctly parses the pricing tier information" do
      expect(subject).to have_attributes(
        tier_stem:    "1",
        tier_name:    "ITC.addons.pricing.tier.1",
        pricing_info: be_an(Array)
      )
    end

    it "correctly parses the pricing info" do
      expect(subject.pricing_info.first).to have_attributes(
        country_code:       "IN",
        currency_symbol:    "R",
        wholesale_price:    6.09,
        wholesale_price2:   7.39,
        retail_price:       10,
        f_retail_price:     "Rs 10",
        f_wholesale_price:  "Rs 6.09",
        f_wholesale_price2: "Rs 7.39"
      )
    end
  end
end


text:
<?php

namespace Freshmail\Command\Campaign;

use Freshmail\Command\AbstractCommand;
use Freshmail\Model\Campaign;

class Delete extends AbstractCommand
{
    /**
     * @var Campaign
     */
    private $campaign;

    public function __construct(Campaign $campaign)
    {
        $this->campaign = $campaign;
    }

    /**
     * @return Campaign
     */
    public function getCampaign()
    {
        return $this->campaign;
    }

    public function getMethod()
    {
        return Delete::METHOD_POST;
    }

    public function validate()
    {
        if (empty($this->campaign->getHash())) {
            $this->addErrorMessage('Cannot delete campaign without hash');
        }
    }

    public function getPath()
    {
        return '/campaigns/delete';
    }

    public function getData()
    {
        return [
            'hash' => $this->campaign->getHash(),
        ];
    }
}


text:
namespace pony.events._Signal0
{
	public sealed class Signal0_Impl_
	{
		public static   global::pony.events.Signal _new<Target>(global::pony.events.Signal s)
		{
			unchecked
			{
				#line 43 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				return s;
			}
			#line default
		}

		public static   bool _get_silent<Target>(global::pony.events.Signal this1)
		{
			unchecked
			{
				#line 45 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				return this1.silent;
			}
			#line default
		}

		public static   bool _set_silent<Target>(global::pony.events.Signal this1, bool b)
		{
			unchecked
			{
				#line 46 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				return this1.silent = b;
			}
			#line default
		}

		public static   global::pony.events.Signal _get_lostListeners<Target>(global::pony.events.Signal this1)
		{
			unchecked
			{
				#line 48 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				return ((global::pony.events.Signal) (this1.lostListeners) );
			}
			#line default
		}

		public static   global::pony.events.Signal _get_takeListeners<Target>(global::pony.events.Signal this1)
		{
			unchecked
			{
				#line 49 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				return ((global::pony.events.Signal) (this1.takeListeners) );
			}
			#line default
		}

		public static   bool _get_haveListeners<Target>(global::pony.events.Signal this1)
		{
			unchecked
			{
				#line 50 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				return ((bool) ( ! ((( this1.listeners.data.length == 0 ))) ) );
			}
			#line default
		}

		public static   object _get_data<Target>(global::pony.events.Signal this1)
		{
			unchecked
			{
				#line 52 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				return this1.data;
			}
			#line default
		}

		public static   object _set_data<Target>(global::pony.events.Signal this1, object d)
		{
			unchecked
			{
				#line 53 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				return this1.data = d;
			}
			#line default
		}

		public static   Target _get_target<Target>(global::pony.events.Signal this1)
		{
			unchecked
			{
				#line 54 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				return global::haxe.lang.Runtime.genericCast<Target>(this1.target);
			}
			#line default
		}

		public static   int _get_listenersCount<Target>(global::pony.events.Signal this1)
		{
			unchecked
			{
				#line 55 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				return this1.listeners.data.length;
			}
			#line default
		}

		public static   Target @add<Target>(global::pony.events.Signal this1, object listener, global::haxe.lang.Null<int> priority)
		{
			unchecked
			{
				#line 57 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				int __temp_priority107 = ( (global::haxe.lang.Runtime.eq((priority).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic())) ? (((int) (0) )) : (priority.@value) );
				this1.@add(((object) (listener) ), new global::haxe.lang.Null<int>(__temp_priority107, true));
				return global::haxe.lang.Runtime.genericCast<Target>(this1.target);
			}
			#line default
		}

		public static   Target once<Target>(global::pony.events.Signal this1, object listener)
		{
			unchecked
			{
				#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				{
					#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					int priority = 0;
					#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					object listener1 = ((object) (listener) );
					#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					object __temp_stmt458 = default(object);
					#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					{
						#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						object f = global::haxe.lang.Runtime.getField(listener1, "f", 102, true);
						#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						object this2 = default(object);
						#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						{
							#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							object __temp_getvar200 = f;
							#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							double __temp_ret201 = ((double) (global::haxe.lang.Runtime.getField_f(__temp_getvar200, "used", 1303220797, true)) );
							#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							object __temp_expr459 = ((object) (global::haxe.lang.Runtime.setField(__temp_getvar200, "used", 1303220797, ( __temp_ret201 + 1.0 ))) );
							#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							double __temp_expr460 = __temp_ret201;
						}

						#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						{
							#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							bool __temp_odecl456 = ((bool) (global::haxe.lang.Runtime.getField(listener1, "event", 1975830554, true)) );
							#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							bool __temp_odecl457 = ((bool) (global::haxe.lang.Runtime.getField(listener1, "ignoreReturn", 98429794, true)) );
							#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							this2 = new global::haxe.lang.DynamicObject(new global::Array<int>(new int[]{102, 98429794, 373703110, 1247723251, 1975830554}), new global::Array<object>(new object[]{f, __temp_odecl457, true, default(global::pony.events.Event), __temp_odecl456}), new global::Array<int>(new int[]{1248019663, 1303220797}), new global::Array<double>(new double[]{((double) (1) ), ((double) (0) )}));
						}

						#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						__temp_stmt458 = this2;
					}

					#line 63 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					this1.@add(((object) (__temp_stmt458) ), new global::haxe.lang.Null<int>(priority, true));
				}

				return global::haxe.lang.Runtime.genericCast<Target>(this1.target);
			}
			#line default
		}

		public static   Target @remove<Target>(global::pony.events.Signal this1, object listener)
		{
			unchecked
			{
				#line 68 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				this1.@remove(((object) (listener) ));
				return global::haxe.lang.Runtime.genericCast<Target>(this1.target);
			}
			#line default
		}

		public static   Target changePriority<Target>(global::pony.events.Signal this1, object listener, global::haxe.lang.Null<int> priority)
		{
			unchecked
			{
				#line 72 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				int __temp_priority108 = ( (global::haxe.lang.Runtime.eq((priority).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic())) ? (((int) (0) )) : (priority.@value) );
				{
					#line 73 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					this1.listeners.changeElement(((object) (listener) ), new global::haxe.lang.Null<int>(__temp_priority108, true));
					#line 73 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					global::pony.events.Signal __temp_expr461 = this1;
				}

				return global::haxe.lang.Runtime.genericCast<Target>(this1.target);
			}
			#line default
		}

		public static   Target dispatch<Target>(global::pony.events.Signal this1)
		{
			unchecked
			{
				#line 78 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				this1.dispatchEmpty(default(object));
				return global::haxe.lang.Runtime.genericCast<Target>(this1.target);
			}
			#line default
		}

		public static   Target dispatchEvent<Target>(global::pony.events.Signal this1, global::pony.events.Event @event)
		{
			unchecked
			{
				#line 83 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				this1.dispatchEvent(@event);
				return global::haxe.lang.Runtime.genericCast<Target>(this1.target);
			}
			#line default
		}

		public static   Target dispatchArgs<Target>(global::pony.events.Signal this1)
		{
			unchecked
			{
				#line 88 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				this1.dispatchEmpty(default(object));
				return global::haxe.lang.Runtime.genericCast<Target>(this1.target);
			}
			#line default
		}

		public static   Target dispatchEmpty<Target>(global::pony.events.Signal this1, object _)
		{
			unchecked
			{
				#line 93 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				this1.dispatchEmpty(default(object));
				return global::haxe.lang.Runtime.genericCast<Target>(this1.target);
			}
			#line default
		}

		public static   Target removeAllListeners<Target>(global::pony.events.Signal this1)
		{
			unchecked
			{
				#line 98 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				this1.removeAllListeners();
				return global::haxe.lang.Runtime.genericCast<Target>(this1.target);
			}
			#line default
		}

		public static   Target listen<T, Target>(global::pony.events.Signal this1, global::pony.events.Signal s)
		{
			unchecked
			{
				#line 103 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				{
					#line 103 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					int priority = 0;
					#line 103 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					object listener = default(object);
					#line 103 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					object __temp_stmt462 = default(object);
					#line 103 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					{
						#line 103 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						object l = global::pony.events._Listener.Listener_Impl_._fromFunction(global::pony._Function.Function_Impl_.@from(((global::haxe.lang.Function) (new global::haxe.lang.Closure(((object) (this1) ), global::haxe.lang.Runtime.toString("dispatchEvent"), ((int) (1181009664) ))) ), 1), true);
						#line 103 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						__temp_stmt462 = l;
					}

					#line 103 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					listener = ((object) (__temp_stmt462) );
					#line 103 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					s.@add(((object) (listener) ), new global::haxe.lang.Null<int>(priority, true));
					#line 103 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					object __temp_expr463 = s.target;
				}

				return global::haxe.lang.Runtime.genericCast<Target>(this1.target);
			}
			#line default
		}

		public static   Target sw<Target>(global::pony.events.Signal this1, object l1, object l2)
		{
			unchecked
			{
				#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				{
					#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					int priority = 0;
					#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					object listener = ((object) (l1) );
					#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					object __temp_stmt468 = default(object);
					#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					{
						#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						object f = global::haxe.lang.Runtime.getField(listener, "f", 102, true);
						#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						object this2 = default(object);
						#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						{
							#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							object __temp_getvar202 = f;
							#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							double __temp_ret203 = ((double) (global::haxe.lang.Runtime.getField_f(__temp_getvar202, "used", 1303220797, true)) );
							#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							object __temp_expr469 = ((object) (global::haxe.lang.Runtime.setField(__temp_getvar202, "used", 1303220797, ( __temp_ret203 + 1.0 ))) );
							#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							double __temp_expr470 = __temp_ret203;
						}

						#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						{
							#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							bool __temp_odecl464 = ((bool) (global::haxe.lang.Runtime.getField(listener, "event", 1975830554, true)) );
							#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							bool __temp_odecl465 = ((bool) (global::haxe.lang.Runtime.getField(listener, "ignoreReturn", 98429794, true)) );
							#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							this2 = new global::haxe.lang.DynamicObject(new global::Array<int>(new int[]{102, 98429794, 373703110, 1247723251, 1975830554}), new global::Array<object>(new object[]{f, __temp_odecl465, true, default(global::pony.events.Event), __temp_odecl464}), new global::Array<int>(new int[]{1248019663, 1303220797}), new global::Array<double>(new double[]{((double) (1) ), ((double) (0) )}));
						}

						#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						__temp_stmt468 = this2;
					}

					#line 108 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					this1.@add(((object) (__temp_stmt468) ), new global::haxe.lang.Null<int>(priority, true));
				}

				{
					#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					int priority1 = 0;
					#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					object listener1 = default(object);
					#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					{
						#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						global::haxe.lang.Function __temp_stmt471 = default(global::haxe.lang.Function);
						#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						{
							#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							global::Array<object> l21 = new global::Array<object>(new object[]{((object) (l1) )});
							#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							global::Array<object> l11 = new global::Array<object>(new object[]{((object) (l2) )});
							#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							global::Array<object> f2 = new global::Array<object>(new object[]{((global::haxe.lang.Function) (new global::haxe.lang.Closure(((object) (this1) ), global::haxe.lang.Runtime.toString("sw"), ((int) (25764) ))) )});
							#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							__temp_stmt471 = new global::pony.events._Signal0.Signal0_Impl__sw_109__Fun(((global::Array<object>) (global::Array<object>.__hx_cast<object>(((global::Array) (f2) ))) ), ((global::Array<object>) (global::Array<object>.__hx_cast<object>(((global::Array) (l11) ))) ), ((global::Array<object>) (global::Array<object>.__hx_cast<object>(((global::Array) (l21) ))) ));
						}

						#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						object f1 = global::pony._Function.Function_Impl_.@from(__temp_stmt471, 0);
						#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						listener1 = global::pony.events._Listener.Listener_Impl_._fromFunction(f1, false);
					}

					#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					object __temp_stmt472 = default(object);
					#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					{
						#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						object f3 = global::haxe.lang.Runtime.getField(listener1, "f", 102, true);
						#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						object this3 = default(object);
						#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						{
							#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							object __temp_getvar204 = f3;
							#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							double __temp_ret205 = ((double) (global::haxe.lang.Runtime.getField_f(__temp_getvar204, "used", 1303220797, true)) );
							#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							object __temp_expr473 = ((object) (global::haxe.lang.Runtime.setField(__temp_getvar204, "used", 1303220797, ( __temp_ret205 + 1.0 ))) );
							#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							double __temp_expr474 = __temp_ret205;
						}

						#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						{
							#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							bool __temp_odecl466 = ((bool) (global::haxe.lang.Runtime.getField(listener1, "event", 1975830554, true)) );
							#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							bool __temp_odecl467 = ((bool) (global::haxe.lang.Runtime.getField(listener1, "ignoreReturn", 98429794, true)) );
							#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
							this3 = new global::haxe.lang.DynamicObject(new global::Array<int>(new int[]{102, 98429794, 373703110, 1247723251, 1975830554}), new global::Array<object>(new object[]{f3, __temp_odecl467, true, default(global::pony.events.Event), __temp_odecl466}), new global::Array<int>(new int[]{1248019663, 1303220797}), new global::Array<double>(new double[]{((double) (1) ), ((double) (0) )}));
						}

						#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
						__temp_stmt472 = this3;
					}

					#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
					this1.@add(((object) (__temp_stmt472) ), new global::haxe.lang.Null<int>(priority1, true));
				}

				return global::haxe.lang.Runtime.genericCast<Target>(this1.target);
			}
			#line default
		}

		public static   void enableSilent<Target>(global::pony.events.Signal this1)
		{
			unchecked
			{
				#line 113 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				this1.silent = true;
			}
			#line default
		}

		public static   void disableSilent<Target>(global::pony.events.Signal this1)
		{
			unchecked
			{
				#line 114 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				this1.silent = false;
			}
			#line default
		}

		public static   Target destroy<Target>(global::pony.events.Signal this1)
		{
			unchecked
			{
				#line 117 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				this1.destroy();
				return global::haxe.lang.Runtime.genericCast<Target>(this1.target);
			}
			#line default
		}

		public static   global::pony.events.Signal @from<A>(global::pony.events.Signal s)
		{
			unchecked
			{
				#line 121 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				return ((global::pony.events.Signal) (s) );
			}
			#line default
		}

	}
}

#pragma warning disable 109, 114, 219, 429, 168, 162
namespace pony.events._Signal0
{
	public  class Signal0_Impl__sw_109__Fun : global::haxe.lang.Function
	{
		public    Signal0_Impl__sw_109__Fun(global::Array<object> f2, global::Array<object> l11, global::Array<object> l21) : base(0, 0)
		{
			unchecked
			{
				#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				this.f2 = f2;
				#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				this.l11 = l11;
				#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				this.l21 = l21;
			}
			#line default
		}

		public override   object __hx_invoke0_o()
		{
			unchecked
			{
				#line 109 "C:\\HaxeToolkit\\haxe\\lib\\pony/git/pony/events/Signal0.hx"
				return ((global::pony.events.Signal) (((global::haxe.lang.Function) (this.f2[0]) ).__hx_invoke2_o(default(double), default(double), this.l11[0], this.l21[0])) );
			}
			#line default
		}

		public  global::Array<object> f2;

		public  global::Array<object> l11;

		public  global::Array<object> l21;

	}
}


text:
var path = require('path')

module.exports = {
  build: {
    env: require('./prod.env'),
    index: path.resolve(__dirname, '../dist/index.html'),
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: '',
    assetsPublicPath: '/',
    // productionSourceMap: true,
    productionSourceMap: false,
    // Gzip off by default as many popular static hosts such as
    // Surge or Netlify already gzip all static assets for you.
    // Before setting to `true`, make sure to:
    // npm install --save-dev compression-webpack-plugin
    productionGzip: false,
    productionGzipExtensions: ['js', 'css'],
    // Run the build command with an extra argument to
    // View the bundle analyzer report after build finishes:
    // `npm run build --report`
    // Set to `true` or `false` to always turn it on or off
    bundleAnalyzerReport: process.env.npm_config_report
  }
}


text:
package com.github.mdr.mash.ns.json

import com.github.mdr.mash.functions.{ BoundParams, MashFunction, ParameterModel }
import com.github.mdr.mash.ns.core.ObjectClass
import com.github.mdr.mash.ns.http.ResponseClass.Wrapper
import com.github.mdr.mash.ns.http._
import com.github.mdr.mash.ns.json.ReadFunction.parseJson
import com.github.mdr.mash.runtime._
import org.apache.http.client.methods.HttpPatch

object PatchFunction extends MashFunction("json.patch") {
  import HttpFunctions.Params._

  val params = ParameterModel(Url, Body, File, BasicAuth, Headers, Cookies, QueryParams)

  def call(boundParams: BoundParams): MashValue = {
    val headers = Header.getHeaders(boundParams, Headers)
    val cookies = Cookie.getCookies(boundParams, Cookies)
    val url = QueryParameters.getUrl(boundParams)
    val bodySource = HttpFunctions.getBodySource(boundParams)
    val basicCredentialsOpt = BasicCredentials.getBasicCredentials(boundParams, BasicAuth)
    val result = HttpOperations.runRequest(new HttpPatch(url), headers, cookies, basicCredentialsOpt, Some(bodySource), json = true)
    parseJson(Wrapper(result).body)
  }

  override def typeInferenceStrategy = ObjectClass

  override def summaryOpt = Some("PATCH some JSON to an HTTP endpoint, and parse the result as JSON")

}


text:
"""Python command."""
# Part of Clockwork MUD Server (https://github.com/whutch/cwmud)
# :copyright: (c) 2008 - 2017 Will Hutcheson
# :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt)

from .. import Command, COMMANDS
from ...characters import CharacterShell

@COMMANDS.register
class PyCommand(Command):

    """A command for executing Python code."""

    no_parse = True

    def _action(self):
        # this is super dangerous don't commit this!!
        if not self.args[0]:
            self.session.send("No code to execute.")
            return
        import os  # noqa
        import re  # noqa
        import sys  # noqa
        from ...accounts import Account  # noqa
        from ...entities import ENTITIES, Entity, Unset  # noqa
        from ...storage import STORES  # noqa
        from ...shells import SHELLS  # noqa
        from ...commands import COMMANDS  # noqa
        from ...server import SERVER  # noqa
        from ...world import Room  # noqa
        char = self.session.char  # noqa
        s = self.session.send  # noqa
        try:
            code = compile(self.args[0][1:].strip('"') + "\n",
                           "<string>", "exec")
            result = exec(code) or "Ok."
            self.session.send(result)
        except Exception as exc:
            self.session.send(type(exc).__name__, ": ", exc.args[0], sep="")

CharacterShell.add_verbs(PyCommand, "py", "python", truncate=False)


text:
//
// Copyright 2015 Dropbox, 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.
//

//
// Note: This is a sample implementation which interacts with Djinni-generated code.
// You may need to adjust names and packages to match the settings of code
// generation in your project.
//

package com.dropbox.djinni.extension_libs.platform_threads;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;

import android.os.Looper;

/**
 * Cross-language platform thread implementation for Android Java.
 * Create a subclass and override configureThread() to customize the created threads.
 */
public class AndroidPlatformThreads extends JavaPlatformThreads {
    private static Looper sMainLooper = Looper.getMainLooper();

    /**
     * Creates an instance.
     */
    public AndroidPlatformThreads() {}

    /**
     * Determines whether the calling thread is the main UI thread of the
     * app.  Some platforms do not have a notion of a main thread, in which
     * case this method returns null.
     *
     * This implementation returns true or false based on the Android UI's
     * notion of a main thread.
     */
    @Override
    @Nonnull
    public Boolean isMainThread() {
        return Looper.myLooper() == sMainLooper;
    }
}


text:
function theElemelons() {
    class Melon{
        constructor(weight, melonSort){
            if(new.target == Melon){
                throw new Error("abstract class Melon cannot be instantiated");
            }
            this.weight = weight;
            this.melonSort = melonSort;
        }

        get elementIndex(){
            return this.weight * this.melonSort.length;
        }

        toString(){
            return `Sort: ${this.melonSort}\n` + `Element Index: ${this.elementIndex}`;
        }
    }

    class Watermelon extends Melon{
        constructor(weight, melonSort){
            super(weight, melonSort);
            this.element = "Water";
        }

        toString(){
            return `Element: ${this.element}\n` + super.toString();
        }
    }

    class Firemelon extends Melon{
        constructor(weight, melonSort){
            super(weight, melonSort);
            this.element = "Fire";
        }

        toString(){
            return `Element: ${this.element}\n` + super.toString();
        }
    }

    class Earthmelon extends Melon{
        constructor(weight, melonSort){
            super(weight, melonSort);
            this.element = "Earth";
        }

        toString(){
            return `Element: ${this.element}\n` + super.toString();
        }
    }

    class Airmelon extends Melon{
        constructor(weight, melonSort){
            super(weight, melonSort);
            this.element = "Air";
        }

        toString(){
            return `Element: ${this.element}\n` + super.toString();
        }
    }

    class Melolemonmelon extends Watermelon{
        constructor(weight, melonSort){
            super(weight, melonSort);
        }

        morph(){
            if(this.element == "Water"){
                this.element = "Fire";
            } else if (this.element == "Fire"){
                this.element = "Earth";
            } else if(this.element == "Earth"){
                this.element = "Air";
            } else {
                this.element = "Water";
            }
        }
    }

    return {Melon, Watermelon, Firemelon, Earthmelon, Airmelon, Melolemonmelon}
}


text:
{% extends "base.html" %}
{% load apps_player %}
{% load apps_enemy %}

{% block title %}Leveling{% endblock title %}
{% block content %}

          {% mini_profile request.user %}

          {% for level in levels %}

Level {{ level.level }}: {{ level.xp }}XP (difference: {{ level.diff }})

          {% endfor %}

{% endblock content %}


text:
"""WSGI module."""
from run import app as application

if __name__ == "__main__":
    application.run(debug=False, host='0.0.0.0')


text:
package org.openehealth.ipf.commons.ihe.xds.core.transform.ebxml;

import org.junit.Before;
import org.junit.Test;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.*;

import static org.junit.Assert.*;

/**
 * Tests for {@link RecipientTransformer}.
 * @author Jens Riemschneider
 */
public class RecipientTransformerTest {
    private RecipientTransformer transformer;
    private Recipient recipient;

    @Before
    public void setUp() {
        transformer = new RecipientTransformer();

        AssigningAuthority assigningAuthority1 = new AssigningAuthority("uni1", "uniType1");
        Organization organization = new Organization("orgName", "orgId", assigningAuthority1);

        AssigningAuthority assigningAuthority2 = new AssigningAuthority("uni2", "uniType2");
        Identifiable id = new Identifiable("personId", assigningAuthority2);
        Name name = new XpnName("familyName", "givenName", "second", "suffix", "prefix", "degree");
        Person person = new Person(id, name);
        Telecom telecom = new Telecom("2:465/193.8", "Fidonet");

        recipient = new Recipient();
        recipient.setOrganization(organization);
        recipient.setPerson(person);
        recipient.setTelecom(telecom);
    }

    @Test
    public void testToEbXML() {
        String ebXML = transformer.toEbXML(recipient);
        assertNotNull(ebXML);

        assertEquals("orgName^^^^^&uni1&uniType1^^^^orgId|personId^familyName^givenName^second^suffix^prefix^degree^^&uni2&uniType2|^^Fidonet^2:465/193.8",
                ebXML);
    }

    @Test
    public void testToEbXMLNoPerson() {
        recipient.setPerson(null);
        String ebXML = transformer.toEbXML(recipient);
        assertNotNull(ebXML);

        assertEquals("orgName^^^^^&uni1&uniType1^^^^orgId||^^Fidonet^2:465/193.8", ebXML);
    }

    @Test
    public void testToEbXMLNoOrganization() {
        recipient.setOrganization(null);
        String ebXML = transformer.toEbXML(recipient);
        assertNotNull(ebXML);

        assertEquals("|personId^familyName^givenName^second^suffix^prefix^degree^^&uni2&uniType2|^^Fidonet^2:465/193.8",
                ebXML);
    }

    @Test
    public void testToEbXMLNoTelecom() {
        recipient.setTelecom(null);
        String ebXML = transformer.toEbXML(recipient);
        assertNotNull(ebXML);

        assertEquals("orgName^^^^^&uni1&uniType1^^^^orgId|personId^familyName^givenName^second^suffix^prefix^degree^^&uni2&uniType2",
                ebXML);
    }

    @Test
    public void testToEbXMLEmpty() {
        assertNull(transformer.toEbXML(new Recipient()));
    }

    @Test
    public void testToEbXMLNull() {
        assertNull(transformer.toEbXML(null));
    }

    @Test
    public void testFromEbXML() {
        assertEquals(recipient,
                transformer.fromEbXML("orgName^^^^^namespace1&uni1&uniType1^^^^orgId|personId^familyName^givenName^second^suffix^prefix^degree^^namespace2&uni2&uniType2|^^Fidonet^2:465/193.8"));
    }

    @Test
    public void testFromEbXMLNoPerson() {
        recipient.setPerson(null);
        assertEquals(recipient,
                transformer.fromEbXML("orgName^^^^^namespace1&uni1&uniType1^^^^orgId||^^Fidonet^2:465/193.8"));
    }

    @Test
    public void testFromEbXMLNoOrganization() {
        recipient.setOrganization(null);
        assertEquals(recipient,
                transformer.fromEbXML("|personId^familyName^givenName^second^suffix^prefix^degree^^namespace2&uni2&uniType2|^^Fidonet^2:465/193.8"));
    }

    @Test
    public void testFromEbXMLNoTelecom() {
        recipient.setTelecom(null);
        assertEquals(recipient,
                transformer.fromEbXML("orgName^^^^^namespace1&uni1&uniType1^^^^orgId|personId^familyName^givenName^second^suffix^prefix^degree^^namespace2&uni2&uniType2"));
    }

    @Test
    public void testFromEbXMLEmpty() {
        assertNull(transformer.fromEbXML(""));
    }

    @Test
    public void testFromEbXMLNull() {
        assertNull(transformer.fromEbXML(null));
    }
}


text:
'use strict';

import { localize } from 'vs/nls';
import { Registry } from 'vs/platform/registry/common/platform';
import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions';
import { DirtyDiffDecorator } from './dirtydiffDecorator';
import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor, ToggleViewletAction } from 'vs/workbench/browser/viewlet';
import { VIEWLET_ID } from 'vs/workbench/parts/scm/common/scm';
import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions';
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { StatusUpdater, StatusBarController } from './scmActivity';
import { SCMViewlet } from 'vs/workbench/parts/scm/electron-browser/scmViewlet';

class OpenSCMViewletAction extends ToggleViewletAction {

	static ID = VIEWLET_ID;
	static LABEL = localize('toggleGitViewlet', "Show Git");

	constructor(id: string, label: string, @IViewletService viewletService: IViewletService, @IWorkbenchEditorService editorService: IWorkbenchEditorService) {
		super(id, label, VIEWLET_ID, viewletService, editorService);
	}
}

Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench)
	.registerWorkbenchContribution(DirtyDiffDecorator);

const viewletDescriptor = new ViewletDescriptor(
	SCMViewlet,
	VIEWLET_ID,
	localize('source control', "Source Control"),
	'scm',
	36
);

Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets)
	.registerViewlet(viewletDescriptor);

Registry.as(WorkbenchExtensions.Workbench)
	.registerWorkbenchContribution(StatusUpdater);

Registry.as(WorkbenchExtensions.Workbench)
	.registerWorkbenchContribution(StatusBarController);

// Register Action to Open Viewlet
Registry.as<IWorkbenchActionRegistry>(WorkbenchActionExtensions.WorkbenchActions).registerWorkbenchAction(
	new SyncActionDescriptor(OpenSCMViewletAction, VIEWLET_ID, localize('toggleSCMViewlet', "Show SCM"), {
		primary: null,
		win: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G },
		linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G },
		mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_G }
	}),
	'View: Show SCM',
	localize('view', "View")
);


text:
using System.ComponentModel;
using System.Web.UI;
using ClientDependency.Core;

namespace Umbraco.Web._Legacy.Controls
{

    [ClientDependency(ClientDependencyType.Css, "menuicon/style.css", "UmbracoClient")]
    internal class MenuIcon : System.Web.UI.WebControls.Image, MenuIconI
    {
        private string _OnClickCommand = "";
        private string _AltText = "init";

        public string AltText {
            get { return this.AlternateText; }
            set {
                _AltText = value;
                this.AlternateText = value;
                this.Attributes.Add("title", value);
            }
        }
        public int IconWidth {
            get { return (int)this.Width.Value; }
            set { this.Width = value; }
        }
        public int IconHeight {
            get { return (int)this.Height.Value; }
            set { this.Height = value; }
        }

        public string ImageURL {
            get { return this.ImageUrl; }
            set { this.ImageUrl = value; }
        }

        public string OnClickCommand {
            get { return _OnClickCommand; }
            set { _OnClickCommand = value; }
        }

        protected override void OnLoad(System.EventArgs EventArguments) {

            // NH 17-01-2007. Trying to avoid inline styling soup
            //        Me.Width = WebControls.Unit.Pixel(22)
            //       Me.Height = WebControls.Unit.Pixel(23)
            //Me.Style.Add("border", "0px")
            this.Attributes.Add("class", "editorIcon");
            this.Attributes.Add("onMouseover", "this.className='editorIconOver'");
            string holder = "";
//            if (this.ID != "") {
                //holder = this.ID.Substring(0, this.ID.LastIndexOf("_")) + "_menu";
                this.Attributes.Add("onMouseout", "hoverIconOut('" + holder + "','" + this.ID + "');");
                this.Attributes.Add("onMouseup", "hoverIconOut('" + holder + "','" + this.ID + "');");
//            } else {
                this.Attributes.Add("onMouseout", "this.className='editorIcon'");
                this.Attributes.Add("onMouseup", "this.className='editorIcon'");
//            }
            this.Attributes.Add("onMouseDown", "this.className='editorIconDown'; return false;");
            this.AlternateText = _AltText;
            this.Attributes.Add("title", _AltText);

            if (_OnClickCommand != "") {
                this.Attributes.Add("onClick", OnClickCommand);
            }
        }

    }
}


text:
package com.meucarro.model;

public class SimpleCar {

	private String placa;
	private String desc;
	private double lat;
	private double lng;

	public String getPlaca() {
		return placa;
	}

	public void setPlaca(String placa) {
		this.placa = placa;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public double getLat() {
		return lat;
	}

	public void setLat(double lat) {
		this.lat = lat;
	}

	public double getLng() {
		return lng;
	}

	public void setLng(double lng) {
		this.lng = lng;
	}
}


text:
/* Style the list */
/* Display list items side by side */
/* Add a slash symbol (>) before/behind each list item */
/* Add a color to all links inside the list */
/* Add a color on mouse-over */
ul.breadcrumb {
  padding: 10px 16px;
  list-style: none;
  background-color: orange;
  font-family: "Avenir", Gotham, Serif;
  font-style: oblique;
  font-size: 25px;
  font-weight: bold; }
  ul.breadcrumb li {
    display: inline; }
    ul.breadcrumb li a {
      color: #0275d8;
      text-decoration: blink; }
      ul.breadcrumb li a:hover {
        color: #008000;
        text-decoration: overline underline; }
  ul.breadcrumb li + li:before {
    padding: 10px;
    color: #FF0000;
    content: ">"; }

/*# sourceMappingURL=breadcrambs.css.map */


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace GameEngine
{
    public struct SphereCollision
    {
        public bool IsCollide;
        public List<BoundingBox> CollisionWith;
    }

    public struct RayCollision
    {
        public bool IsCollide;
        public float Distance;
        public BoundingBox CollisionWith;
    }

    /// <summary>
    /// Manage all the BoundingBox in the game
    /// </summary>
    public class CollisionManager
    {
        #region Fields

        private static List<BoundingBox> _masterList = new List<BoundingBox>();
        private static List<BoundingBox> _currentList = new List<BoundingBox>();

#if DEBUG
        private static BasicEffect _effect;

        private static short[] bBoxIndices =
        {
            0, 1, 1, 2, 2, 3, 3, 0,
            4, 5, 5, 6, 6, 7, 7, 4,
            0, 4, 1, 5, 2, 6, 3, 7
        };
#endif

        public static List<BoundingBox> MasterList
        {
            get { return _masterList; }
        }

        public static int Count
        {
            get { return _masterList.Count; }
        }

        #endregion

        #region Initialization

        /// <summary>
        /// Initializes the manager
        /// </summary>
        public static void Initialize()
        {
#if DEBUG
            _effect = new BasicEffect(GameServices.GraphicsDevice);
            _effect.World = Matrix.Identity;
            _effect.VertexColorEnabled = true;

            XConsole.AddDebug(Debug);
#endif
        }

        #endregion

        #region Update and Draw

        public static void Update(GameTime gameTime)
        {
            _currentList.Clear();
            _currentList.AddRange(_masterList);
        }

#if DEBUG
        /// <summary>
        /// Draws all BoundingBox in the manager
        /// </summary>
        public static void Draw(GameTime gameTime, ICamera camera)
        {
            if (DebugConfig.DisplayBox)
            {
                _effect.View = camera.View;
                _effect.Projection = camera.Projection;

                foreach (BoundingBox box in _currentList)
                {
                    Vector3[] corners = box.GetCorners();
                    VertexPositionColor[] primitiveList = new VertexPositionColor[corners.Length];

                    // Assign the 8 box vertices
                    for (int i = 0; i < corners.Length; i++)
                    {
                        primitiveList[i] = new VertexPositionColor(corners[i], Color.Red);
                    }

                    // Draw the box with a LineList
                    foreach (EffectPass pass in _effect.CurrentTechnique.Passes)
                    {
                        pass.Apply();
                        GameServices.GraphicsDevice.DrawUserIndexedPrimitives(
                            PrimitiveType.LineList, primitiveList, 0, 8,
                            bBoxIndices, 0, 12);
                    }
                }
            }
        }
#endif

        public static string Debug(GameTime gameTime)
        {
            return ("N_Box: " + Count);
        }

        #endregion

        #region Collision Methods

        public static SphereCollision IsCollision(BoundingSphere sphere)
        {
            SphereCollision c = new SphereCollision { CollisionWith = new List<BoundingBox>() };

            foreach (BoundingBox box in _currentList)
            {
                if (box.Intersects(sphere))
                    c.CollisionWith.Add(box);
            }

            c.IsCollide = (c.CollisionWith.Count > 0);
            return c;
        }

        public static RayCollision IsCollision(Ray ray)
        {
            RayCollision c = new RayCollision();
            c.Distance = float.MaxValue;
            float? tmp;

            foreach (BoundingBox box in _currentList)
            {
                tmp = box.Intersects(ray);

                if (tmp.HasValue && tmp.Value < c.Distance)
                {
                    c.Distance = tmp.Value;
                    c.CollisionWith = box;
                }
            }

            c.IsCollide = (c.CollisionWith != null);
            return c;
        }

        #endregion

        #region Public Methods

        /// <summary>
        /// Adds a BoundingBox to the manager
        /// </summary>
        public static void AddBox(BoundingBox box)
        {
            _masterList.Add(box);
        }

        public static void AddBox(IEnumerable<BoundingBox> box)
        {
            _masterList.AddRange(box);
        }

        public static bool Contains(BoundingBox box)
        {
            return _masterList.Contains(box);
        }

        public static void Remove(BoundingBox box)
        {
            _masterList.Remove(box);
            _currentList.Remove(box);
        }

        public static void Remove(IEnumerable<BoundingBox> box)
        {
            foreach (BoundingBox item in box)
                Remove(item);
        }

        /// <summary>
        /// Clear all the lists in the manager.
        /// </summary>
        public static void Clear()
        {
            _masterList.Clear();
            _currentList.Clear();
        }

        #endregion
    }
}


text:
from twisted.logger import Logger
from autobahn.twisted.wamp import ApplicationSession

class MySession(ApplicationSession):

    log = Logger()

    def __init__(self, config):
        self.log.info("MySession.__init__()")
        ApplicationSession.__init__(self, config)

    @inlineCallbacks
    def onJoin(self, details):
        self.log.info("MySession.onJoin()")


text:
package io.renren.common.xss;

import org.jsoup.Jsoup;
import org.jsoup.safety.Whitelist;

/**
 * XSS过滤工具类
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0
 */
public class XssUtils extends Whitelist {

    /**
     * XSS过滤
     */
    public static String filter(String html){
        return Jsoup.clean(html, xssWhitelist());
    }

    /**
     * XSS过滤白名单
     */
    private static Whitelist xssWhitelist(){
        return new Whitelist()
            //支持的标签
            .addTags("a", "b", "blockquote", "br", "caption", "cite", "code", "col", "colgroup", "dd", "div", "dl",
                    "dt", "em", "h1", "h2", "h3", "h4", "h5", "h6", "i", "img", "li", "ol", "p", "pre", "q", "small",
                    "strike", "strong","sub", "sup", "table", "tbody", "td","tfoot", "th", "thead", "tr", "u","ul",
                    "embed","object","param","span")

            //支持的标签属性
            .addAttributes("a", "href", "class", "style", "target", "rel", "nofollow")
            .addAttributes("blockquote", "cite")
            .addAttributes("code", "class", "style")
            .addAttributes("col", "span", "width")
            .addAttributes("colgroup", "span", "width")
            .addAttributes("img", "align", "alt", "height", "src", "title", "width", "class", "style")
            .addAttributes("ol", "start", "type")
            .addAttributes("q", "cite")
            .addAttributes("table", "summary", "width", "class", "style")
            .addAttributes("tr", "abbr", "axis", "colspan", "rowspan", "width", "style")
            .addAttributes("td", "abbr", "axis", "colspan", "rowspan", "width", "style")
            .addAttributes("th", "abbr", "axis", "colspan", "rowspan", "scope","width", "style")
            .addAttributes("ul", "type", "style")
            .addAttributes("pre", "class", "style")
            .addAttributes("div", "class", "id", "style")
            .addAttributes("embed", "src", "wmode", "flashvars", "pluginspage", "allowFullScreen", "allowfullscreen",
                "quality", "width", "height", "align", "allowScriptAccess", "allowscriptaccess", "allownetworking", "type")
            .addAttributes("object", "type", "id", "name", "data", "width", "height", "style", "classid", "codebase")
            .addAttributes("param", "name", "value")
            .addAttributes("span", "class", "style")

            //标签属性对应的协议
            .addProtocols("a", "href", "ftp", "http", "https", "mailto")
            .addProtocols("img", "src", "http", "https")
            .addProtocols("blockquote", "cite", "http", "https")
            .addProtocols("cite", "cite", "http", "https")
            .addProtocols("q", "cite", "http", "https")
            .addProtocols("embed", "src", "http", "https");
    }

    public static void main(String[] args) {
        StringBuilder html = new StringBuilder();
        html.append("人人开源");

        System.out.println(filter(html.toString()));
    }

}


text:
layout: page
title: Land Citadel Productions Trade Fair
date: 2016-05-24
author: Janet Rice
tags: weekly links, java
status: published
summary: Duis consequat in nulla sit amet ornare. Quisque.
banner: images/banner/leisure-05.jpg
booking:
  startDate: 07/19/2017
  endDate: 07/20/2017
  ctyhocn: MCOLVHX
  groupCode: LCPTF
published: true
---
Fusce sagittis ligula eget risus eleifend facilisis. Sed enim justo, accumsan ac tincidunt eget, ornare ullamcorper enim. Sed vel purus ipsum. Quisque scelerisque enim sed lorem efficitur, ut tempor metus gravida. Nulla in orci tristique, suscipit ante vitae, convallis turpis. Suspendisse vitae aliquet ex. Sed magna purus, iaculis ac ex sed, consectetur aliquam leo. Mauris consectetur bibendum tempor. Curabitur nec tincidunt erat. Integer et lectus sed justo auctor mattis.

* Suspendisse aliquet eros id arcu convallis, aliquam pretium ex aliquet
* Praesent laoreet dolor eget elit ultricies bibendum ut sed odio.

Proin tincidunt scelerisque mi non tristique. Curabitur semper tempus neque nec euismod. Phasellus a ornare dolor. Quisque elit quam, ullamcorper convallis arcu quis, dapibus cursus leo. Suspendisse rutrum blandit nisl ut euismod. Vivamus et enim at dolor fringilla blandit nec ac mi. Nullam mollis sem sed odio tempus, lacinia congue magna rutrum. Fusce pretium dolor a finibus efficitur. Quisque quam leo, hendrerit vitae magna non, pretium aliquam magna. Phasellus pellentesque felis a risus lobortis, maximus luctus odio auctor.