text:
// <copyright file="BenchmarkTestExecutor.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using System;
using System.Linq;
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Loggers;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
using Xunit;
using Xunit.Abstractions;

namespace App.Metrics.Concurrency.Benchmarks.Support
{
    // ReSharper disable UnusedMember.Global
    public class BenchmarkTestExecutor
        // ReSharper restore UnusedMember.Global
    {
        private readonly ITestOutputHelper _output;

        public BenchmarkTestExecutor() { }

        protected BenchmarkTestExecutor(ITestOutputHelper output) { _output = output; }

        /// <summary>
        ///     Runs Benchmarks with the most simple config (SingleRunFastConfig)
        ///     combined with any benchmark config applied to TBenchmark (via an attribute)
        ///     By default will verify if every benchmark was successfully executed
        /// </summary>
        /// <typeparam name="TBenchmark">type that defines Benchmarks</typeparam>
        /// <param name="config">Optional custom config to be used instead of the default</param>
        /// <param name="fullValidation">Optional: disable validation (default = true/enabled)</param>
        /// <returns>The summary from the benchmark run</returns>
        // ReSharper disable UnusedMember.Global
        internal Summary CanExecute<TBenchmark>(IConfig config = null, bool fullValidation = true)
            // ReSharper restore UnusedMember.Global
        {
            return CanExecute(typeof(TBenchmark), config, fullValidation);
        }

        /// <summary>
        ///     Runs Benchmarks with the most simple config (SingleRunFastConfig)
        ///     combined with any benchmark config applied to Type (via an attribute)
        ///     By default will verify if every benchmark was successfully executed
        /// </summary>
        /// <param name="type">type that defines Benchmarks</param>
        /// <param name="config">Optional custom config to be used instead of the default</param>
        /// <param name="fullValidation">Optional: disable validation (default = true/enabled)</param>
        /// <returns>The summary from the benchmark run</returns>
        private Summary CanExecute(Type type, IConfig config = null, bool fullValidation = true)
        {
            // Add logging, so the Benchmark execution is in the TestRunner output (makes Debugging easier)
            if (config == null)
            {
                config = CreateSimpleConfig();
            }

            if (!config.GetLoggers().OfType<OutputLogger>().Any())
            {
                config = config.AddLogger(_output != null ? new OutputLogger(_output) : ConsoleLogger.Default);
            }

            if (!config.GetColumnProviders().Any())
            {
                config = config.AddColumnProvider(DefaultColumnProviders.Instance);
            }

            // Make sure we ALWAYS combine the Config (default or passed in) with any Config applied to the Type/Class
            var summary = BenchmarkRunner.Run(type, BenchmarkConverter.GetFullConfig(type, config));

            if (!fullValidation)
            {
                return summary;
            }

            Assert.False(summary.HasCriticalValidationErrors, "The \"Summary\" should have NOT \"HasCriticalValidationErrors\"");

            Assert.True(summary.Reports.Any(), "The \"Summary\" should contain at least one \"BenchmarkReport\" in the \"Reports\" collection");

            Assert.True(
                summary.Reports.All(r => r.BuildResult.IsBuildSuccess),
                "The following benchmarks are failed to build: " + string.Join(", ", summary.Reports.Where(r => !r.BuildResult.IsBuildSuccess).Select(r => r.BenchmarkCase.DisplayInfo)));

            Assert.True(
                summary.Reports.All(r => r.ExecuteResults.Any(er => er.FoundExecutable && er.Data.Any())),
                "All reports should have at least one \"ExecuteResult\" with \"FoundExecutable\" = true and at least one \"Data\" item");

            Assert.True(
                summary.Reports.All(report => report.AllMeasurements.Any()),
                "All reports should have at least one \"Measurement\" in the \"AllMeasurements\" collection");

            return summary;
        }

        private IConfig CreateSimpleConfig(OutputLogger logger = null)
        {
            return new SingleRunFastConfig()
                .AddLogger(logger ?? (_output != null ? new OutputLogger(_output) : ConsoleLogger.Default))
                .AddColumnProvider(DefaultColumnProviders.Instance);
        }
    }
}


text:
import React, { Component } from 'react';

/* Bootstrap */
import { Grid, Row, Col } from 'react-bootstrap';

/* Styles */
import '../styles/bootstrap.min.css';
import '../styles/style.scss';

/* My Components */
import Header from './Header';
import Footer from './Footer';

export default class App extends Component {
    render() {
	/* For child routers */
	const { children } = this.props;
	return (

		    <Grid>
			<Row className="show-grid">
			    <Col xs={12} md={12}>
				{ children }
			    </Col>
			</Row>
		    </Grid>

	);
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.camunda.bpm.engine.impl.bpmn.parser;

import java.util.ArrayList;
import java.util.List;
import java.util.TreeMap;

import org.camunda.bpm.engine.BpmnParseException;
import org.camunda.bpm.engine.ProcessEngineException;
import org.camunda.bpm.engine.impl.context.Context;
import org.camunda.bpm.engine.impl.core.variable.mapping.InputParameter;
import org.camunda.bpm.engine.impl.core.variable.mapping.IoMapping;
import org.camunda.bpm.engine.impl.core.variable.mapping.OutputParameter;
import org.camunda.bpm.engine.impl.core.variable.mapping.value.ListValueProvider;
import org.camunda.bpm.engine.impl.core.variable.mapping.value.MapValueProvider;
import org.camunda.bpm.engine.impl.core.variable.mapping.value.NullValueProvider;
import org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider;
import org.camunda.bpm.engine.impl.el.ElValueProvider;
import org.camunda.bpm.engine.impl.el.ExpressionManager;
import org.camunda.bpm.engine.impl.scripting.ExecutableScript;
import org.camunda.bpm.engine.impl.scripting.ScriptValueProvider;
import org.camunda.bpm.engine.impl.util.ScriptUtil;
import org.camunda.bpm.engine.impl.util.xml.Element;

/**
 * Helper methods to reused for common parsing tasks.
 */
public final class BpmnParseUtil {

  /**
   * Returns the camunda extension element in the camunda namespace
   * and the given name.
   *
    * @param element the parent element of the extension element
   * @param extensionElementName the name of the extension element to find
   * @return the extension element or null if not found
   */
  public static Element findCamundaExtensionElement(Element element, String extensionElementName) {
    Element extensionElements = element.element("extensionElements");
    if(extensionElements != null) {
      return extensionElements.elementNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, extensionElementName);
    } else {
      return null;
    }
  }

  /**
   * Returns the {@link IoMapping} of an element.
   *
   * @param element the element to parse
   * @return the input output mapping or null if non defined
   * @throws BpmnParseException if a input/output parameter element is malformed
   */
  public static IoMapping parseInputOutput(Element element) {
    Element inputOutputElement = element.elementNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "inputOutput");
    if(inputOutputElement != null) {
      IoMapping ioMapping = new IoMapping();
      parseCamundaInputParameters(inputOutputElement, ioMapping);
      parseCamundaOutputParameters(inputOutputElement, ioMapping);
      return ioMapping;
    }
    return null;
  }

  /**
   * Parses all input parameters of an input output element and adds them to
   * the {@link IoMapping}.
   *
   * @param inputOutputElement the input output element to process
   * @param ioMapping the input output mapping to add input parameters to
   * @throws BpmnParseException if a input parameter element is malformed
   */
  public static void parseCamundaInputParameters(Element inputOutputElement, IoMapping ioMapping) {
    List<Element> inputParameters = inputOutputElement.elementsNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "inputParameter");
    for (Element inputParameterElement : inputParameters) {
      parseInputParameterElement(inputParameterElement, ioMapping);
    }
  }

  /**
   * Parses all output parameters of an input output element and adds them to
   * the {@link IoMapping}.
   *
   * @param inputOutputElement the input output element to process
   * @param ioMapping the input output mapping to add input parameters to
   * @throws BpmnParseException if a output parameter element is malformed
   */
  public static void parseCamundaOutputParameters(Element inputOutputElement, IoMapping ioMapping) {
    List<Element> outputParameters = inputOutputElement.elementsNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "outputParameter");
    for (Element outputParameterElement : outputParameters) {
      parseOutputParameterElement(outputParameterElement, ioMapping);
    }
  }

  /**
   * Parses a input parameter and adds it to the {@link IoMapping}.
   *
   * @param inputParameterElement the input parameter element
   * @param ioMapping the mapping to add the element
   * @throws BpmnParseException if the input parameter element is malformed
   */
  public static void parseInputParameterElement(Element inputParameterElement, IoMapping ioMapping) {
    String nameAttribute = inputParameterElement.attribute("name");
    if(nameAttribute == null || nameAttribute.isEmpty()) {
      throw new BpmnParseException("Missing attribute 'name' for inputParameter", inputParameterElement);
    }

    ParameterValueProvider valueProvider = parseNestedParamValueProvider(inputParameterElement);

    // add parameter
    ioMapping.addInputParameter(new InputParameter(nameAttribute, valueProvider));
  }

  /**
   * Parses a output parameter and adds it to the {@link IoMapping}.
   *
   * @param outputParameterElement the output parameter element
   * @param ioMapping the mapping to add the element
   * @throws BpmnParseException if the output parameter element is malformed
   */
  public static void parseOutputParameterElement(Element outputParameterElement, IoMapping ioMapping) {
    String nameAttribute = outputParameterElement.attribute("name");
    if(nameAttribute == null || nameAttribute.isEmpty()) {
      throw new BpmnParseException("Missing attribute 'name' for outputParameter", outputParameterElement);
    }

    ParameterValueProvider valueProvider = parseNestedParamValueProvider(outputParameterElement);

    // add parameter
    ioMapping.addOutputParameter(new OutputParameter(nameAttribute, valueProvider));
  }

  /**
   * @throws BpmnParseException if the parameter is invalid
   */
  protected static ParameterValueProvider parseNestedParamValueProvider(Element element) {
    // parse value provider
    if(element.elements().size() == 0) {
      return parseParamValueProvider(element);

    } else if(element.elements().size() == 1) {
      return parseParamValueProvider(element.elements().get(0));

    } else {
      throw new BpmnParseException("Nested parameter can at most have one child element", element);
    }
  }

  /**
   * @throws BpmnParseException if the parameter is invalid
   */
  protected static ParameterValueProvider parseParamValueProvider(Element parameterElement) {

    // LIST
    if("list".equals(parameterElement.getTagName())) {
      List<ParameterValueProvider> providerList = new ArrayList<ParameterValueProvider>();
      for (Element element : parameterElement.elements()) {
        // parse nested provider
        providerList.add(parseParamValueProvider(element));
      }
      return new ListValueProvider(providerList);
    }

    // MAP
    if("map".equals(parameterElement.getTagName())) {
      TreeMap<ParameterValueProvider, ParameterValueProvider> providerMap = new TreeMap<ParameterValueProvider, ParameterValueProvider>();
      for (Element entryElement : parameterElement.elements("entry")) {
        // entry must provide key
        String keyAttribute = entryElement.attribute("key");
        if(keyAttribute == null || keyAttribute.isEmpty()) {
          throw new BpmnParseException("Missing attribute 'key' for 'entry' element", entryElement);
        }
        // parse nested provider
        providerMap.put(new ElValueProvider(getExpressionManager().createExpression(keyAttribute)), parseNestedParamValueProvider(entryElement));
      }
      return new MapValueProvider(providerMap);
    }

    // SCRIPT
    if("script".equals(parameterElement.getTagName())) {
      ExecutableScript executableScript = parseCamundaScript(parameterElement);
      if (executableScript != null) {
        return new ScriptValueProvider(executableScript);
      }
      else {
        return new NullValueProvider();
      }
    }

    String textContent = parameterElement.getText().trim();
    if(!textContent.isEmpty()) {
        // EL
        return new ElValueProvider(getExpressionManager().createExpression(textContent));
    } else {
      // NULL value
      return new NullValueProvider();
    }

  }

  /**
   * Parses a camunda script element.
   *
   * @param scriptElement the script element ot parse
   * @return the generated executable script
   * @throws BpmnParseException if the a attribute is missing or the script cannot be processed
   */
  public static ExecutableScript parseCamundaScript(Element scriptElement) {
    String scriptLanguage = scriptElement.attribute("scriptFormat");
    if (scriptLanguage == null || scriptLanguage.isEmpty()) {
      throw new BpmnParseException("Missing attribute 'scriptFormat' for 'script' element", scriptElement);
    }
    else {
      String scriptResource = scriptElement.attribute("resource");
      String scriptSource = scriptElement.getText();
      try {
        return ScriptUtil.getScript(scriptLanguage, scriptSource, scriptResource, getExpressionManager());
      }
      catch (ProcessEngineException e) {
        throw new BpmnParseException("Unable to process script", scriptElement, e);
      }
    }
  }

  protected static ExpressionManager getExpressionManager() {
    return Context.getProcessEngineConfiguration().getExpressionManager();
  }

}


text:
package ssa

// Stub implementation used for testing.
type TypeImpl struct {
	Size_   int64
	Align   int64
	Boolean bool
	Integer bool
	Signed  bool
	Float   bool
	Ptr     bool
	string  bool
	Elem_   Type

	Name string
}

func (t *TypeImpl) Size() int64      { return t.Size_ }
func (t *TypeImpl) Alignment() int64 { return t.Align }
func (t *TypeImpl) IsBoolean() bool  { return t.Boolean }
func (t *TypeImpl) IsInteger() bool  { return t.Integer }
func (t *TypeImpl) IsSigned() bool   { return t.Signed }
func (t *TypeImpl) IsFloat() bool    { return t.Float }
func (t *TypeImpl) IsPtr() bool      { return t.Ptr }
func (t *TypeImpl) IsString() bool   { return t.string }
func (t *TypeImpl) IsMemory() bool   { return false }
func (t *TypeImpl) IsFlags() bool    { return false }
func (t *TypeImpl) String() string   { return t.Name }
func (t *TypeImpl) Elem() Type       { return t.Elem_ }
func (t *TypeImpl) PtrTo() Type      { panic("not implemented") }

func (t *TypeImpl) Equal(u Type) bool {
	x, ok := u.(*TypeImpl)
	if !ok {
		return false
	}
	return x == t
}

var (
	// shortcuts for commonly used basic types
	TypeInt8    = &TypeImpl{Size_: 1, Align: 1, Integer: true, Signed: true, Name: "int8"}
	TypeInt16   = &TypeImpl{Size_: 2, Align: 2, Integer: true, Signed: true, Name: "int16"}
	TypeInt32   = &TypeImpl{Size_: 4, Align: 4, Integer: true, Signed: true, Name: "int32"}
	TypeInt64   = &TypeImpl{Size_: 8, Align: 8, Integer: true, Signed: true, Name: "int64"}
	TypeUInt8   = &TypeImpl{Size_: 1, Align: 1, Integer: true, Name: "uint8"}
	TypeUInt16  = &TypeImpl{Size_: 2, Align: 2, Integer: true, Name: "uint16"}
	TypeUInt32  = &TypeImpl{Size_: 4, Align: 4, Integer: true, Name: "uint32"}
	TypeUInt64  = &TypeImpl{Size_: 8, Align: 8, Integer: true, Name: "uint64"}
	TypeBool    = &TypeImpl{Size_: 1, Align: 1, Boolean: true, Name: "bool"}
	TypeBytePtr = &TypeImpl{Size_: 8, Align: 8, Ptr: true, Name: "*byte"}
)


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>io.aigar</groupId>
    <artifactId>Aigar-Java-Client</artifactId>
    <version>1.0</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>libs/</classpathPrefix>
                            <mainClass>io.aigar.Play</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.1.1</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <!-- exclude junit, we need runtime dependency only -->
                            <includeScope>runtime</includeScope>
                            <outputDirectory>${project.build.directory}/libs/</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.0</version>
                <dependencies>
                    <dependency>
                        <groupId>org.junit.platform</groupId>
                        <artifactId>junit-platform-surefire-provider</artifactId>
                        <version>1.2.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.junit.jupiter</groupId>
                        <artifactId>junit-jupiter-engine</artifactId>
                        <version>${junit-version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <properties>
        <jackson-version>2.9.5</jackson-version>
        <junit-version>5.1.0</junit-version>
        <retrofit-version>2.4.0</retrofit-version>
        <slf4j-version>1.7.25</slf4j-version>
    </properties>

    <dependencies>
        <!-- Jackson -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${jackson-version}</version>
        </dependency>

        <!-- Retrofit -->
        <dependency>
            <groupId>com.squareup.retrofit2</groupId>
            <artifactId>retrofit</artifactId>
            <version>${retrofit-version}</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.retrofit2</groupId>
            <artifactId>converter-jackson</artifactId>
            <version>${retrofit-version}</version>
        </dependency>

        <!-- SLF4J -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j-version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4j-version}</version>
        </dependency>

        <!-- Vectors -->
        <dependency>
            <groupId>org.mini2Dx</groupId>
            <artifactId>gdx-math</artifactId>
            <version>1.9.8</version>
        </dependency>

        <!-- Tests -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>mockwebserver</artifactId>
            <version>3.10.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.6</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>


text:
/* Determine the wordsize from the preprocessor defines.  */

#if defined __powerpc64__
# define __WORDSIZE	64
# define __WORDSIZE_TIME64_COMPAT32	1
#else
# define __WORDSIZE	32
# define __WORDSIZE_TIME64_COMPAT32	0
# define __WORDSIZE32_SIZE_ULONG	0
# define __WORDSIZE32_PTRDIFF_LONG	0
#endif


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<TITLE>Grafikoptionen (Menü Optionen)</TITLE>
<link rel="stylesheet" type="text/css" href="CrypTool_Help.css">

<OBJECT TYPE="application/x-oleobject" CLASSID="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" VIEWASTEXT>
	<PARAM NAME="Keyword" VALUE="Optionen">
	<PARAM NAME="Keyword" VALUE="Linienstärke">
	<PARAM NAME="Keyword" VALUE="Grafikoptionen">
</OBJECT>

Grafikoptionen (Menü Optionen)

Mit diesem Befehl wird der Dialog Grafikoptionen geöffnet. In diesem Dialog kann die Stärke der Linien in Balken- und Kurvendiagrammen (zur Anzeige von Histogrammen) geändert werden.


text:
"""
This module handles the import of mitmproxy flows generated by old versions.
"""

from typing import Any

from mitmproxy import version
from mitmproxy.utils import strutils

def convert_011_012(data):
    data[b"version"] = (0, 12)
    return data

def convert_012_013(data):
    data[b"version"] = (0, 13)
    return data

def convert_013_014(data):
    data[b"request"][b"first_line_format"] = data[b"request"].pop(b"form_in")
    data[b"request"][b"http_version"] = b"HTTP/" + ".".join(
        str(x) for x in data[b"request"].pop(b"httpversion")).encode()
    data[b"response"][b"http_version"] = b"HTTP/" + ".".join(
        str(x) for x in data[b"response"].pop(b"httpversion")).encode()
    data[b"response"][b"status_code"] = data[b"response"].pop(b"code")
    data[b"response"][b"body"] = data[b"response"].pop(b"content")
    data[b"server_conn"].pop(b"state")
    data[b"server_conn"][b"via"] = None
    data[b"version"] = (0, 14)
    return data

def convert_014_015(data):
    data[b"version"] = (0, 15)
    return data

def convert_015_016(data):
    for m in (b"request", b"response"):
        if b"body" in data[m]:
            data[m][b"content"] = data[m].pop(b"body")
    if b"msg" in data[b"response"]:
        data[b"response"][b"reason"] = data[b"response"].pop(b"msg")
    data[b"request"].pop(b"form_out", None)
    data[b"version"] = (0, 16)
    return data

def convert_016_017(data):
    data[b"server_conn"][b"peer_address"] = None
    data[b"version"] = (0, 17)
    return data

def convert_017_018(data):
    # convert_unicode needs to be called for every dual release and the first py3-only release
    data = convert_unicode(data)

    data["server_conn"]["ip_address"] = data["server_conn"].pop("peer_address")
    data["marked"] = False
    data["version"] = (0, 18)
    return data

def convert_018_019(data):
    # convert_unicode needs to be called for every dual release and the first py3-only release
    data = convert_unicode(data)

    data["request"].pop("stickyauth", None)
    data["request"].pop("stickycookie", None)
    data["client_conn"]["sni"] = None
    data["client_conn"]["alpn_proto_negotiated"] = None
    data["client_conn"]["cipher_name"] = None
    data["client_conn"]["tls_version"] = None
    data["server_conn"]["alpn_proto_negotiated"] = None
    data["mode"] = "regular"
    data["metadata"] = dict()
    data["version"] = (0, 19)
    return data

def convert_019_100(data):
    data["version"] = (1, 0, 0)
    return data

def convert_100_200(data):
    data["version"] = (2, 0, 0)
    return data

def _convert_dict_keys(o: Any) -> Any:
    if isinstance(o, dict):
        return {strutils.always_str(k): _convert_dict_keys(v) for k, v in o.items()}
    else:
        return o

def _convert_dict_vals(o: dict, values_to_convert: dict) -> dict:
    for k, v in values_to_convert.items():
        if not o or k not in o:
            continue
        if v is True:
            o[k] = strutils.always_str(o[k])
        else:
            _convert_dict_vals(o[k], v)
    return o

def convert_unicode(data: dict) -> dict:
    """
    This method converts between Python 3 and Python 2 dumpfiles.
    """
    data = _convert_dict_keys(data)
    data = _convert_dict_vals(
        data, {
            "type": True,
            "id": True,
            "request": {
                "first_line_format": True
            },
            "error": {
                "msg": True
            }
        }
    )
    return data

converters = {
    (0, 11): convert_011_012,
    (0, 12): convert_012_013,
    (0, 13): convert_013_014,
    (0, 14): convert_014_015,
    (0, 15): convert_015_016,
    (0, 16): convert_016_017,
    (0, 17): convert_017_018,
    (0, 18): convert_018_019,
    (0, 19): convert_019_100,
    (1, 0): convert_100_200,
}

def migrate_flow(flow_data):
    while True:
        flow_version = tuple(flow_data.get(b"version", flow_data.get("version")))
        if flow_version[:2] == version.IVERSION[:2]:
            break
        elif flow_version[:2] in converters:
            flow_data = converters[flow_version[:2]](flow_data)
        else:
            v = ".".join(str(i) for i in flow_version)
            raise ValueError(
                "{} cannot read files serialized with version {}.".format(version.MITMPROXY, v)
            )
    return flow_data


text:
package com.intellij.openapi.externalSystem.util;

import com.intellij.AbstractBundle;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.PropertyKey;

/**
 * @author Denis Zhdanov
 * @since 8/1/11 2:44 PM
 */
public class ExternalSystemBundle extends AbstractBundle {

  public static String message(@NotNull @PropertyKey(resourceBundle = PATH_TO_BUNDLE) String key, @NotNull Object... params) {
    return BUNDLE.getMessage(key, params);
  }

  public static final String PATH_TO_BUNDLE = "i18n.ExternalSystemBundle";
  private static final ExternalSystemBundle BUNDLE = new ExternalSystemBundle();

  public ExternalSystemBundle() {
    super(PATH_TO_BUNDLE);
  }
}


text:
// Copyright (c) 2003-present, Jodd Team (jodd.org). All Rights Reserved.

package jodd.joy.auth;

import jodd.servlet.tag.TagUtil;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;

/**
 * Execute tag body if user is (or is not) authenticated.
 */
public class AuthTag extends SimpleTagSupport {

	protected boolean auth = true;

	/**
	 * Defines if body should be invoked if user is authenticated.
	 */
	public void setAuth(boolean auth) {
		this.auth = auth;
	}

	@Override
	public void doTag() throws JspException {
		PageContext pageContext = ((PageContext) getJspContext());
		HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
		HttpSession httpSession = request.getSession();

		Object userSession = AuthUtil.getUserSession(httpSession);
		boolean invokeBody =  (userSession != null) ?  auth : !auth;
		if (invokeBody) {
			TagUtil.invokeBody(getJspBody());
		}
	}

}


text:
FROM zooniverse/passenger

RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get -y -q install build-essential ruby1.9.1 ruby1.9.1-dev imagemagick libsqlite3-dev libmagickwand-dev libcurl3 libxml2 libxslt1-dev libcurl4-gnutls-dev git-core mysql-client libmysqlclient-dev

RUN gem install bundler -v "<1.17"


text:
<!DOCTYPE html>

  <title>Actile Test</title>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8">

Actile Test

  Home


text:
package org.wso2.developerstudio.eclipse.general.project.utils;

import org.apache.commons.io.FilenameUtils;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.wizards.IWizardDescriptor;
import org.wso2.developerstudio.eclipse.general.project.Activator;
import org.wso2.developerstudio.eclipse.general.project.ui.wizard.GeneralProjectWizard;
import org.wso2.developerstudio.eclipse.logging.core.IDeveloperStudioLog;
import org.wso2.developerstudio.eclipse.logging.core.Logger;

public class GeneralProjectUtils {

	private static IDeveloperStudioLog log=Logger.getLog(Activator.PLUGIN_ID);

	public static IProject createGeneralProject(Shell shell){
		IWizardDescriptor wizardDesc = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard("org.wso2.developerstudio.eclipse.general.project");
		if (wizardDesc!=null) {
			try {
				IProject newProject= null;
				GeneralProjectWizard basicProjectWizard = (GeneralProjectWizard) wizardDesc.createWizard();
				IStructuredSelection selection = (IStructuredSelection) PlatformUI
						.getWorkbench().getActiveWorkbenchWindow()
						.getSelectionService().getSelection();
				basicProjectWizard.init(PlatformUI.getWorkbench(), selection);
				WizardDialog dialog = new WizardDialog(shell, basicProjectWizard);
				dialog.create();
				if(dialog.open() ==Dialog.OK){
					String projectName = basicProjectWizard.getModel().getProjectName();
					newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
				}
				return newProject;
			} catch (CoreException e) {
				log.error("CoreException has occurred", e);
			}
		}
		return null;
	}

	public static String getFilenameWOExtension(String filename){
		String fileNameWOExt=null;
		if(FilenameUtils.indexOfExtension(filename)==-1){
			fileNameWOExt=filename;
		}else{
			fileNameWOExt=FilenameUtils.removeExtension(filename);
		}
		return fileNameWOExt;
	}

	public static String getFilenameExtension(String filename){
		String fileNameExt="";
		if(FilenameUtils.indexOfExtension(filename) != -1){
			fileNameExt=FilenameUtils.getExtension(filename);
		}
		return fileNameExt;
	}
}


text:
define([ "jquery" ], function($) {

  function ImageLoader() {
    this.promise = $.Deferred();
    this.imageLoadCount = 0;
  }

  function loadFinished(self) {
    self.imageLoadCount -= 1;
    if (self.loadsStarted && self.imageLoadCount == 0) {
      self.promise.resolve();
    }
  }

  function getImage(self, url) {
    var img = new Image();
    img.onload = function() {
      loadFinished(self);
    };
    img.onerror = function(error) {
      loadFinished(self);
    }
    img.crossOrigin = "anonymous";
    img.src = url;
    return img;
  }

  ImageLoader.prototype = {
    loadImage: function(url) {
      var self = this;
      self.imageLoadCount += 1;
      return getImage(self, url);
    },
    allLoaded: function() {
      var self = this;
      if (self.imageLoadCount == 0) {
        self.promise.resolve();
      }
      else {
        self.loadsStarted = true;
      }
      return self.promise;
    }
  }

  return ImageLoader;
});


text:
package brick

// Initializer init a service
type Initializer interface {
	Init() error
}

// Disposable dispose a service that release all resources which used
type Disposable interface {
	Dispose() error
}


text: class Species::SourceSerializer < Species::TradeCodeSerializer; end


text:
namespace ImageNet.Drawing
{
    using System.Drawing;
    using System.Drawing.Drawing2D;

    public struct BorderStyle
    {
        private readonly Color color;

        public BorderStyle(Color color) : this()
        {
            this.color = color;
            this.BorderWidth = 0;
            this.DashStyle = DashStyle.Solid;
        }

        public Pen Pen
        {
            get
            {
                var widthInPixelUnit = this.BorderWidth * 2;
                return new Pen(this.color) { Width = widthInPixelUnit, DashStyle = this.DashStyle };
            }
        }

        public int BorderWidth { get; set; }
        public DashStyle DashStyle { get; set; }
    }
}


text:
Saturday, 01/23/16
* Took an online CSS flexbox layout crash-course with TeamTreehouse

* Page one - form input - first draft with html and responsive css

* Included a normalize.css file from Skeleton (see below diff between normalize.css and reset.css
  *http://stackoverflow.com/questions/6887336/what-is-the-difference-between-normalize-css-and-reset-css)

* Discuss the favicon icon with the team

01/25/16
* index.html - page 1 radio buttons - add js functions to uncheck one button when the other is checked

* integrated form https://w3layouts.com/elegant-login-register-forms-template/

* form is responsive. Logo is centered for screens smaller than 1024px and aligned to left for bigger screens

* form icon house from https://www.iconfinder.com/icons/36507/green_home_house_icon#size=128

* get variables from the input form and store them in variables. Used source code from
 * *http://stackoverflow.com/questions/831030/how-to-get-get-request-parameters-in-javascript

*found an interesting tutorial on making HTTP requests with js http://www.kirupa.com/html5/making_http_requests_js.htm

* Notes regarding css and structure for page1 and the input form:

* flexbox used throughout the page

* Included a normalize.css file from Skeleton

* The submit button wires up to results.html

* fav-icon placeholder included - to decide on the icon

* section "header-container" is a placeholder for the logo

* empty h1 tag inside the "login-head" if we want to add some text, otherwise will take it out

* same as above for terms and conditions checkbox before submit button

* nav bar at the bottom of the page only for the layout purposes - Greg is working on this issue

01/26/16
* input validation for address implemented

* property type adds to local storage

01/28/16
* on my own today

* added the style for index.html, deleted the css for the older template form

* moved history.js and history.css to their respective folders

* added fav icon to all html pages

* fixed the address validation to include period

* it looks like there are a couple of bugs in the submitButton.js file on the data retrieved from local storage and used by the google maps.

* I will make a list of addresses which check out with both zillow api and google maps and we'll roll with those for the presentation

* I have commented out line 133 in submitButton.js it was returning error 'cannot read property of undefined' - NOW this is back in code and the validation is working

* property addresses to use for the presentation (I have checked for which which ones zillow has a zestimate - as zestimate is not available for some, it will appear that the zestimate is 0!!!) - this is not a problem anymore

  * - 1437 Bellevue Way NE WA 98004

  * - 3419 W Ames Lake Dr NE, Redmond, WA 98053 3 beds 2 baths 1,620 sqft Rent Zestimate 2,495

  * - 3604 SW Graham St. Seattle, WA 98126 gets a zestimate of $2495 - WORKING!!!


text:
"""
Copyright 2013 Parse.ly, 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.
"""

import sys
import atexit
import logging
import os
import shutil
import tempfile
import time

from testinstances.exceptions import ProcessNotStartingError, ProcessRunningError

log = logging.getLogger(__name__)
running_instances = {} # keep track of what we've got
instance_tmpdir = tempfile.mkdtemp()

def _cleanup(exiting=False):
    """Stop all running instances and delete the temp dir"""
    global running_instances
    for instance in list(running_instances.values()):
        instance.terminate()
    running_instances = {}
    if exiting:
        shutil.rmtree(instance_tmpdir)
atexit.register(_cleanup, exiting=True)

class ManagedInstance(object):
    """Container for mongo/redis/whatever testing instances"""
    def __init__(self, name, use_gevent=False):
        if name in running_instances:
            raise ProcessRunningError("Process %s is already running!", name)

        self._process = None
        self._root_dir = os.path.join(instance_tmpdir, name)

        self.conn = None
        self.log = logging.getLogger('testinstances.%s' % name)
        self.logfile = os.path.join(instance_tmpdir, '%s.log' % name)
        self.name = name
        self.use_gevent = use_gevent

        if self.use_gevent:
            from gevent import monkey
            monkey.patch_all()

        os.mkdir(self._root_dir)
        try:
            self._start_process()
        except ProcessNotStartingError:
            shutil.rmtree(self._root_dir)
            os.remove(self.logfile)
            raise
        self._start_log_watcher()
        running_instances[self.name] = self

    def _watcher_threading(self, logfile):
        while True:
            line = logfile.readline().strip()
            if not line:
                time.sleep(.1)
                continue
            self.log.info(line)

    def _watcher_gevent(self, logfile):
        import gevent.socket
        while True:
            gevent.socket.wait_read(logfile.fileno())
            line = logfile.readline().strip()
            if not line:
                continue
            self.log.info(line)

    def _start_log_watcher(self):
        """Watch the logfile and forward it to python logging"""
        logfile = open(self.logfile, 'r')
        if self.use_gevent:
            import gevent
            self._watch_thread = gevent.spawn(self._watcher_gevent, logfile)
        else:
            import threading
            self._watch_thread = threading.Thread(target=self._watcher_threading,
                                                  args=[logfile])
            self._watch_thread.daemon = True
            self._watch_thread.start()

    def _start_process(self):
        raise NotImplementedError('nope, try a subclass')

    def flush(self):
        """Clear all data in underlying database"""
        raise NotImplementedError("This needs an implementation")

    def get_logs(self):
        """Get the process's logs"""
        return open(self.logfile).read()

    def terminate(self):
        if self._process:
            self._process.terminate()
            self._process.wait()
            self._process = None
            shutil.rmtree(self._root_dir)
            os.remove(self.logfile)
        del running_instances[self.name]


text:
<?php

namespace Findx\Bundle\ProductBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class FindxProductBundle extends Bundle
{
}


text:
namespace doris {

HttpService::HttpService(ExecEnv* env, int port, int num_threads)
        : _env(env),
        _ev_http_server(new EvHttpServer(port, num_threads)),
        _web_page_handler(new WebPageHandler(_ev_http_server.get())) {
}

HttpService::~HttpService() {
}

Status HttpService::start() {
    add_default_path_handlers(_web_page_handler.get(), _env->process_mem_tracker());

    // register load
    _ev_http_server->register_handler(
        HttpMethod::PUT, "/api/{db}/{table}/_load", new MiniLoadAction(_env));
    _ev_http_server->register_handler(
        HttpMethod::PUT, "/api/{db}/{table}/_stream_load", new StreamLoadAction(_env));

    // register download action
    std::vector<std::string> allow_paths;
    for (auto& path : _env->store_paths()) {
        allow_paths.emplace_back(path.path);
    }
    DownloadAction* download_action = new DownloadAction(_env, allow_paths);
    _ev_http_server->register_handler(HttpMethod::HEAD, "/api/_download_load", download_action);
    _ev_http_server->register_handler(HttpMethod::GET, "/api/_download_load", download_action);

    DownloadAction* tablet_download_action = new DownloadAction(_env, allow_paths);
    _ev_http_server->register_handler(
        HttpMethod::HEAD, "/api/_tablet/_download", tablet_download_action);
    _ev_http_server->register_handler(
        HttpMethod::GET, "/api/_tablet/_download", tablet_download_action);

    DownloadAction* error_log_download_action = new DownloadAction(
            _env, _env->load_path_mgr()->get_load_error_file_dir());
    _ev_http_server->register_handler(
            HttpMethod::GET, "/api/_load_error_log", error_log_download_action);
    _ev_http_server->register_handler(
            HttpMethod::HEAD, "/api/_load_error_log", error_log_download_action);

    // Register BE health action
    HealthAction* health_action = new HealthAction(_env);
    _ev_http_server->register_handler(HttpMethod::GET, "/api/health", health_action);

    // register pprof actions
    PprofActions::setup(_env, _ev_http_server.get());

    // register metrics
    {
        auto action = new MetricsAction(DorisMetrics::metrics());
        _ev_http_server->register_handler(HttpMethod::GET, "/metrics", action);
    }

    MetaAction* meta_action = new MetaAction(HEADER);
    _ev_http_server->register_handler(HttpMethod::GET, "/api/meta/header/{tablet_id}/{schema_hash}", meta_action);

#ifndef BE_TEST
    // Register BE checksum action
    ChecksumAction* checksum_action = new ChecksumAction(_env);
    _ev_http_server->register_handler(HttpMethod::GET, "/api/checksum", checksum_action);

    // Register BE reload tablet action
    ReloadTabletAction* reload_tablet_action = new ReloadTabletAction(_env);
    _ev_http_server->register_handler(HttpMethod::GET, "/api/reload_tablet", reload_tablet_action);

    RestoreTabletAction* restore_tablet_action = new RestoreTabletAction(_env);
    _ev_http_server->register_handler(HttpMethod::POST, "/api/restore_tablet", restore_tablet_action);

    // Register BE snapshot action
    SnapshotAction* snapshot_action = new SnapshotAction(_env);
    _ev_http_server->register_handler(HttpMethod::GET, "/api/snapshot", snapshot_action);
#endif

    RETURN_IF_ERROR(_ev_http_server->start());
    return Status::OK();
}

}


text:
<?php
namespace Kartenmacherei\RestFramework\Request\Method;

class GetRequestMethod extends AbstractRequestMethod
{
    /**
     * @return string
     */
    public function asString(): string
    {
        return RequestMethod::GET;
    }
}


text:
<?php

namespace Swarming\SubscribePro\Test\Unit\Platform\Webhook\Handler\PaymentProfile;

use Magento\Customer\Api\CustomerRepositoryInterface;
use Magento\Customer\Api\Data\CustomerInterface;
use Magento\Vault\Api\Data\PaymentTokenInterface;
use Magento\Vault\Api\PaymentTokenManagementInterface;
use Magento\Vault\Api\PaymentTokenRepositoryInterface;
use SubscribePro\Service\PaymentProfile\PaymentProfileInterface;
use SubscribePro\Service\Webhook\EventInterface;
use Swarming\SubscribePro\Gateway\Config\ConfigProvider;
use Swarming\SubscribePro\Platform\Webhook\Handler\PaymentProfile\RedactHandler;
use SubscribePro\Service\Customer\CustomerInterface as PlatformCustomerInterface;

class RedactHandlerTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \Swarming\SubscribePro\Platform\Webhook\Handler\PaymentProfile\RedactHandler
     */
    protected $redactHandler;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Vault\Api\PaymentTokenManagementInterface
     */
    protected $paymentTokenManagementMock;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Vault\Api\PaymentTokenRepositoryInterface
     */
    protected $paymentTokenRepositoryMock;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Customer\Api\CustomerRepositoryInterface
     */
    protected $customerRepositoryMock;

    protected function setUp()
    {
        $this->paymentTokenManagementMock = $this->getMockBuilder(PaymentTokenManagementInterface::class)->getMock();
        $this->paymentTokenRepositoryMock = $this->getMockBuilder(PaymentTokenRepositoryInterface::class)->getMock();
        $this->customerRepositoryMock = $this->getMockBuilder(CustomerRepositoryInterface::class)->getMock();

        $this->redactHandler = new RedactHandler(
            $this->paymentTokenManagementMock,
            $this->paymentTokenRepositoryMock,
            $this->customerRepositoryMock
        );
    }

    /**
     * @expectedException \Magento\Framework\Exception\NoSuchEntityException
     * @expectedExceptionMessage Saved card is not found for payment_id=4422 and customer_id=5566
     */
    public function testExecuteIfPaymentTokenNotFound()
    {
        $paymentProfileId = 4422;
        $customerId = 5566;
        $profileData = [
            'key' => 'value',
            PaymentProfileInterface::MAGENTO_CUSTOMER_ID => $customerId
        ];

        $webhookEventMock = $this->createWebhookEventMock();
        $webhookEventMock->expects($this->at(0))
            ->method('getEventData')
            ->with('payment_profile')
            ->willReturn($profileData);
        $webhookEventMock->expects($this->at(1))
            ->method('getEventData')
            ->with('payment_profile_id')
            ->willReturn($paymentProfileId);
        $webhookEventMock->expects($this->at(2))
            ->method('getEventData')
            ->with('payment_profile_id')
            ->willReturn($paymentProfileId);

        $this->paymentTokenManagementMock->expects($this->once())
            ->method('getByGatewayToken')
            ->with($paymentProfileId, ConfigProvider::CODE, $customerId)
            ->willReturn(null);

        $this->paymentTokenRepositoryMock->expects($this->never())->method('delete');

        $this->redactHandler->execute($webhookEventMock);
    }

    public function testExecuteIfCustomerIdIsInProfileData()
    {
        $paymentProfileId = 424234;
        $customerId = 4341;
        $profileData = [
            'key' => 'value',
            PaymentProfileInterface::MAGENTO_CUSTOMER_ID => $customerId
        ];

        $paymentTokenMock = $this->createPaymentTokenMock();

        $webhookEventMock = $this->createWebhookEventMock();
        $webhookEventMock->expects($this->at(0))
            ->method('getEventData')
            ->with('payment_profile')
            ->willReturn($profileData);
        $webhookEventMock->expects($this->at(1))
            ->method('getEventData')
            ->with('payment_profile_id')
            ->willReturn($paymentProfileId);

        $this->paymentTokenManagementMock->expects($this->once())
            ->method('getByGatewayToken')
            ->with($paymentProfileId, ConfigProvider::CODE, $customerId)
            ->willReturn($paymentTokenMock);

        $this->paymentTokenRepositoryMock->expects($this->once())
            ->method('delete')
            ->with($paymentTokenMock);

        $this->redactHandler->execute($webhookEventMock);
    }

    public function testExecuteIfCustomerIdIsInCustomerData()
    {
        $paymentProfileId = 424234;
        $customerId = 4341;
        $profileData = ['profile data'];
        $customerData = [PlatformCustomerInterface::MAGENTO_CUSTOMER_ID => $customerId];

        $paymentTokenMock = $this->createPaymentTokenMock();

        $webhookEventMock = $this->createWebhookEventMock();
        $webhookEventMock->expects($this->at(0))
            ->method('getEventData')
            ->with('payment_profile')
            ->willReturn($profileData);
        $webhookEventMock->expects($this->at(1))
            ->method('getEventData')
            ->with('customer')
            ->willReturn($customerData);
        $webhookEventMock->expects($this->at(2))
            ->method('getEventData')
            ->with('payment_profile_id')
            ->willReturn($paymentProfileId);

        $this->paymentTokenManagementMock->expects($this->once())
            ->method('getByGatewayToken')
            ->with($paymentProfileId, ConfigProvider::CODE, $customerId)
            ->willReturn($paymentTokenMock);

        $this->paymentTokenRepositoryMock->expects($this->once())
            ->method('delete')
            ->with($paymentTokenMock);

        $this->redactHandler->execute($webhookEventMock);
    }

    /**
     * @param array $profileData
     * @param array $customerData
     * @param int $paymentProfileId
     * @param string $email
     * @param int $customerId
     * @dataProvider executeWithCustomerEmailDataProvider
     */
    public function testExecuteWithCustomerEmail($profileData, $customerData, $paymentProfileId, $email, $customerId)
    {
        $customerMock = $this->createCustomerMock();
        $customerMock->expects($this->once())->method('getId')->willReturn($customerId);

        $paymentTokenMock = $this->createPaymentTokenMock();

        $webhookEventMock = $this->createWebhookEventMock();
        $webhookEventMock->expects($this->at(0))
            ->method('getEventData')
            ->with('payment_profile')
            ->willReturn($profileData);
        $webhookEventMock->expects($this->at(1))
            ->method('getEventData')
            ->with('customer')
            ->willReturn($customerData);
        $webhookEventMock->expects($this->at(2))
            ->method('getEventData')
            ->with('payment_profile_id')
            ->willReturn($paymentProfileId);

        $this->paymentTokenManagementMock->expects($this->once())
            ->method('getByGatewayToken')
            ->with($paymentProfileId, ConfigProvider::CODE, $customerId)
            ->willReturn($paymentTokenMock);

        $this->customerRepositoryMock->expects($this->once())
            ->method('get')
            ->with($email)
            ->willReturn($customerMock);

        $this->paymentTokenRepositoryMock->expects($this->once())
            ->method('delete')
            ->with($paymentTokenMock);

        $this->redactHandler->execute($webhookEventMock);
    }

    /**
     * @return array
     */
    public function executeWithCustomerEmailDataProvider()
    {
        return [
            'Email is in profile data' => [
                'profileData' => [
                    PaymentProfileInterface::CUSTOMER_EMAIL => 'some@mail.com',
                    'key' => 'field'
                ],
                'paymentProfileId' => 5123123,
                'customerData' => ['name' => 'Bob'],
                'email' => 'some@mail.com',
                'customerId' => 123123
            ],
            'Email is in customer data' => [
                'profileData' => ['profile', 'data'],
                'customerData' => [
                    PlatformCustomerInterface::EMAIL => 'some@mail.email',
                    'key' => 'val'
                ],
                'paymentProfileId' => 53453,
                'email' => 'some@mail.email',
                'customerId' => 123123
            ],
        ];
    }

    /**
     * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\Vault\Api\Data\PaymentTokenInterface
     */
    private function createPaymentTokenMock()
    {
        return $this->getMockBuilder(PaymentTokenInterface::class)->getMock();
    }

    /**
     * @return \PHPUnit_Framework_MockObject_MockObject|\SubscribePro\Service\Webhook\EventInterface
     */
    private function createWebhookEventMock()
    {
        return $this->getMockBuilder(EventInterface::class)->getMock();
    }

    /**
     * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\Customer\Api\Data\CustomerInterface
     */
    private function createCustomerMock()
    {
        return $this->getMockBuilder(CustomerInterface::class)->getMock();
    }
}


text:
"""Plotting multiple datas in a same figure"""

import matplotlib.pylab as plt

def _get_attr_args_and_kwargs_from_ax_call_item(ax_call_item):
    if isinstance(ax_call_item, dict):
        attr = ax_call_item['attr']
        args = ax_call_item.pop('args', ())
        kwargs = ax_call_item.pop('kwargs', {})
    else:
        attr = ax_call_item[0]
        if len(ax_call_item) == 2:
            if isinstance(ax_call_item[1], dict):
                args = ()
                kwargs = ax_call_item[1]
            else:
                args = ax_call_item[1]
                kwargs = {}
        else:
            args, kwargs = ax_call_item[1:]
    return attr, args, kwargs

def multi_row_plot(
    data_list=(), plot_func=plt.plot, figsize=3, plot_func_kwargs=None, ax_calls=()
):
    """
    Quickly plotting multiple rows of data.

    :param data_list: The list of datas to plot. For each "row_data" of data_list, a row will be created and plot_func
        will be called, using that item as input. If row_data is:
            * a dict, plot_func(**dict(plot_func_kwargs, **row_data)) will be called to populate that row
            * a tuple, plot_func(*row_data, **plot_func_kwargs) will be called to populate that row
            * if not, plot_func(row_data, **plot_func_kwargs) will be called to populate that row
    :param plot_func: The plotting function to use.
    :param figsize: The figsize to use. If
        * a tuple of length 2, figure(figsize=figsize) will be called to create the figure
        * a number (int or float), figure(figsize=(16, n_rows * figsize_units_per_row)) will be called
        * If None, figure won't be called (we assume therefore, it's been created already, for example
    :param plot_func_kwargs: The kwargs to use as arguments of plot_func for every data row.
    :param ax_calls: A list of (attr, args, kwargs) triples that will result in calling
            getattr(ax, attr)(*args, **kwargs)
        for every ax in ax_list (the list of row axes)
    :return: ax_list, the list of axes for each row
    """
    if plot_func_kwargs is None:
        plot_func_kwargs = {}
    n_rows = len(data_list)
    if isinstance(figsize, (int, float)):
        figsize_units_per_row = figsize
        figsize = (16, n_rows * figsize_units_per_row)
    if isinstance(figsize, (tuple, list)) and len(figsize) == 2:
        plt.figure(figsize=figsize)

    ax_list = list()
    for row_idx, row_data in enumerate(data_list, 1):
        #         print(row_data)
        plt.subplot(n_rows, 1, row_idx)
        specific_ax_calls = ()
        if isinstance(row_data, dict):
            specific_ax_calls = row_data.pop('ax_calls', ())
            if 'row_data' in row_data:
                row_data = row_data['row_data']

        if isinstance(row_data, dict):
            plot_func(**dict(plot_func_kwargs, **row_data))
        elif isinstance(row_data, tuple):
            plot_func(*row_data, **plot_func_kwargs)
        else:
            plot_func(row_data, **plot_func_kwargs)

        ax = plt.gca()
        for attr, args, kwargs in map(
            _get_attr_args_and_kwargs_from_ax_call_item, specific_ax_calls
        ):
            getattr(ax, attr)(*args, **kwargs)

        ax_list.append(ax)

    for ax in ax_list:
        for attr, args, kwargs in map(
            _get_attr_args_and_kwargs_from_ax_call_item, ax_calls
        ):
            getattr(ax, attr)(*args, **kwargs)

    return ax_list

import numpy as np

def ax_func_to_plot(
    list_func_per_ax,
    n_per_row=3,
    title=None,
    title_font_size=10,
    width=15,
    height_row=10,
    saving_path=None,
    rec_padding=(0, 0, 0, 0),
    x_labels=None,
    y_labels=None,
    outer_axis_labels_only=False,
    show=True,
):
    """
    Each function in list_func_per_ax takes an ax as input and draw something on it

    outer_axis_labels_only: if set to true, only the axis labels on the left column and bottom row will show
    x_labels: the label on all x-axis
    y_labels: the label on all the y-axis
    """
    n_rows = int(np.ceil(len(list_func_per_ax) / n_per_row))
    fig, axes = plt.subplots(
        nrows=n_rows, ncols=n_per_row, figsize=(width, height_row * n_rows)
    )
    for ax, func in zip(axes.flatten(), list_func_per_ax):
        func(ax)
    # fig.legend(fancybox=True, framealpha=1, shadow=True, borderpad=1)

    fig.suptitle(title, fontsize=title_font_size)

    for ax in axes.flat:
        ax.set(xlabel=x_labels, ylabel=y_labels)
    if outer_axis_labels_only:
        for ax in axes.flat:
            ax.label_outer()
    handles, labels = ax.get_legend_handles_labels()
    fig.legend(handles, labels, loc=1)
    if rec_padding:
        fig.tight_layout(rect=rec_padding)
    if saving_path:
        fig.savefig(saving_path)
    if show:
        plt.show()

if __name__ == '__main__':

    def ax_func(ax):
        ax.plot([1, 5, 3])
        ax.set_title('test_test')

    ax_func_to_plot([ax_func] * 6, title='Test', x_labels='x_name_here')


text:
int main()
{
	Bubblewrap::Game::GameSettings settings;
	settings.WindowCount_ = 1;
	settings.WindowSettings_ = new Bubblewrap::Render::Window::WindowSettings[ 1 ];
	settings.WindowSettings_[ 0 ].Width_ = 800;
	settings.WindowSettings_[ 0 ].Height_ = 600;
	settings.WindowSettings_[ 0 ].Title_ = "Ludum Dare #32 - Mind Like A Bot";
	settings.WindowSettings_[ 0 ].Name_ = "Main";
	settings.WindowSettings_[ 0 ].Colour_ = Bubblewrap::Render::Colour( 0.8f, 0.8f, 0.8f );
	settings.WindowSettings_[ 0 ].Colour_ = Bubblewrap::Render::Colour( 1.0f, 0.0f, 0.0f );
	Bubblewrap::Logs::StaticLog::Instance()->SetLogLevel( Bubblewrap::Logs::StaticLog::WARNING );
	settings.Registers_.push_back( Bubblewrap::Registers::SfmlRegisters::RegisterUtilities );
	settings.Registers_.push_back( Bubblewrap::Registers::SfmlRegisters::RegisterAudio );
	settings.Registers_.push_back( Bubblewrap::Registers::SfmlRegisters::RegisterGraphics );
	settings.Resources_.push_back( "textures" );
	settings.Resources_.push_back( "shaders" );
	//settings.Paths_.push_back("MindLikeABot.exe");
	settings.Paths_.push_back("assets");
	settings.TypeRegistration_ = ( [ ]( Bubblewrap::Base::ObjectRegister* Register )
	{

	} );
	settings.Packages_.push_back( "basics.json" );
	settings.BaseObject_ = "basics:MainMenu";
	Bubblewrap::Game::Game Game;
	Game.Run( settings );
}


text:
package org.teavm.junit;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ConcurrentMap;

class CRunStrategy implements TestRunStrategy {
    private String compilerCommand;
    private ConcurrentMap<String, Compilation> compilationMap = new ConcurrentHashMap<>();

    CRunStrategy(String compilerCommand) {
        this.compilerCommand = compilerCommand;
    }

    @Override
    public void beforeAll() {
    }

    @Override
    public void afterAll() {
    }

    @Override
    public void beforeThread() {
    }

    @Override
    public void afterThread() {
    }

    @Override
    public void runTest(TestRun run) throws IOException {
        try {
            String exeName = "run_test";
            if (System.getProperty("os.name").toLowerCase().contains("win")) {
                exeName += ".exe";
            }

            File outputFile = new File(run.getBaseDirectory(), exeName);
            boolean compilerSuccess = compile(run.getBaseDirectory());
            if (!compilerSuccess) {
                run.getCallback().error(new RuntimeException("C compiler error"));
                return;
            }

            List<String> runtimeOutput = new ArrayList<>();
            List<String> stdout = new ArrayList<>();
            outputFile.setExecutable(true);
            synchronized (this) {
                List<String> runCommand = new ArrayList<>();
                runCommand.add(outputFile.getPath());
                if (run.getArgument() != null) {
                    runCommand.add(run.getArgument());
                }
                runProcess(new ProcessBuilder(runCommand.toArray(new String[0])).start(), runtimeOutput, stdout);
            }
            if (!stdout.isEmpty() && stdout.get(stdout.size() - 1).equals("SUCCESS")) {
                writeLines(runtimeOutput);
                run.getCallback().complete();
            } else {
                run.getCallback().error(new RuntimeException("Test failed:\n" + mergeLines(runtimeOutput)));
            }
        } catch (InterruptedException e) {
            run.getCallback().complete();
        }
    }

    private String mergeLines(List<String> lines) {
        StringBuilder sb = new StringBuilder();
        for (String line : lines) {
            sb.append(line).append('\n');
        }
        return sb.toString();
    }

    private void writeLines(List<String> lines) {
        for (String line : lines) {
            System.out.println(line);
        }
    }

    private boolean compile(File inputDir) throws IOException, InterruptedException {
        Compilation compilation = compilationMap.computeIfAbsent(inputDir.getPath(), k -> new Compilation());
        synchronized (compilation) {
            if (!compilation.started) {
                compilation.started = true;
                compilation.success = doCompile(inputDir);
            }
        }
        return compilation.success;
    }

    private boolean doCompile(File inputDir) throws IOException, InterruptedException {
        List<String> compilerOutput = new ArrayList<>();
        boolean compilerSuccess = runCompiler(inputDir, compilerOutput);
        writeLines(compilerOutput);
        return compilerSuccess;
    }

    private boolean runCompiler(File inputDir, List<String> output)
            throws IOException, InterruptedException {
        String command = new File(compilerCommand).getAbsolutePath();
        return runProcess(new ProcessBuilder(command).directory(inputDir).start(), output, new ArrayList<>());
    }

    private boolean runProcess(Process process, List<String> output, List<String> stdout) throws InterruptedException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(process.getInputStream()));
        BufferedReader stderr = new BufferedReader(new InputStreamReader(process.getErrorStream()));
        ConcurrentLinkedQueue<String> lines = new ConcurrentLinkedQueue<>();

        Thread thread = new Thread(() -> {
            try {
                while (true) {
                    String line = stderr.readLine();
                    if (line == null) {
                        break;
                    }
                    lines.add(line);
                }
            } catch (IOException e) {
                // do nothing
            }
        });
        thread.setDaemon(true);
        thread.start();

        try {
            while (true) {
                String line = stdin.readLine();
                if (line == null) {
                    break;
                }
                lines.add(line);
                stdout.add(line);
                if (lines.size() > 10000) {
                    output.addAll(lines);
                    process.destroy();
                    return false;
                }
            }
        } catch (IOException e) {
            // do nothing
        }

        boolean result = process.waitFor() == 0;
        output.addAll(lines);
        return result;
    }

    static class Compilation {
        volatile boolean started;
        volatile boolean success;
    }
}


text:
body {
    padding-top: 60px;
    padding-bottom: 40px;
}

.zf-green {
    color: #68b604;
}

.btn-success {
    background-color: #57a900;
    background-image: -moz-linear-gradient(top, #70d900, #57a900);
    background-image: -ms-linear-gradient(top, #70d900, #57a900);
    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#70d900), to(#57a900));
    background-image: -webkit-linear-gradient(top, #70d900, #57a900);
    background-image: -o-linear-gradient(top, #70d900, #57a900);
    background-image: linear-gradient(top, #70d900, #57a900);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#70d900', endColorstr='#57a900', GradientType=0);
}

.btn-success:hover,
.btn-success:active,
.btn-success.active,
.btn-success.disabled,
.btn-success[disabled] {
    background-color: #57a900;
}

.btn-success:active, .btn-success.active {
    background-color: #57a900;
}

div.container a.brand {
    background: url("../img/zf2-logo.png") no-repeat scroll 0 10px transparent;
    margin-left: 0;
    padding: 8px 20px 12px 40px;
}

ul.error li
{
    list-style: none;
    color: red;
}

.block-header{margin-bottom: 5px;}
div.list-header div.title{width: 90%;float: left;border-bottom: 1px solid gray;}

div.list-header div.title h3{margin: 0;padding: 0}
div.list-header div.add-button{width: 10%;float:right;}
div.list-header div.add-button a.add{float:right;}
.controls label.checkbox {width: 150px;float: left}

table.table thead .sorting,
table.table thead .sorting_asc,
table.table thead .sorting_desc,
table.table thead .sorting_asc_disabled,
table.table thead .sorting_desc_disabled {
    cursor: pointer;
    *cursor: hand;
}

table.table thead .sorting { background: url('../img/sort_both.png') no-repeat center right;background-color: lightcoral }
table.table thead .sorting_asc { background: url('../img/sort_asc.png') no-repeat center right;background-color: lightcoral  }
table.table thead .sorting_desc { background: url('../img/sort_desc.png') no-repeat center right; background-color: lightcoral }

table.table thead .sorting_asc_disabled { background: url('../img/sort_asc_disabled.png') no-repeat center right; }
table.table thead .sorting_desc_disabled { background: url('../img/sort_desc_disabled.png') no-repeat center right; }
table.dataTable tr.odd{background-color: #F9F9F9}
table.dataTable tr.even{background-color: #fff!important}


text:
<!--This script builds a zip for ModeShape server Installation -->
<assembly>
	<id>jboss-wf-dist</id>
	<formats>
		<format>zip</format>
	</formats>
	<includeBaseDirectory>false</includeBaseDirectory>
	<baseDirectory>/</baseDirectory>

	<fileSets>
		<!-- The modules part of the kit -->
		<fileSet>
			<directory>../deploy/jbossas/kit/jboss-wf</directory>
			<outputDirectory>modules</outputDirectory>
            <excludes>
                <exclude>standalone/**</exclude>
                <exclude>domain/**</exclude>
            </excludes>
            <filtered>true</filtered>
		</fileSet>

		<!-- The configuration part -->
		<fileSet>
			<directory>../deploy/jbossas/kit/jboss-wf</directory>
			<outputDirectory>./</outputDirectory>
            <includes>
                <include>standalone/**</include>
                <include>domain/**</include>
            </includes>
            <filtered>false</filtered>
		</fileSet>

		<!-- ModeShape subsystem XSD(s) -->
		<fileSet>
			<directory>../deploy/jbossas/modeshape-jbossas-subsystem/src/main/resources/schema/</directory>
			<includes>
				<include>modeshape_*.xsd</include>
			</includes>
			<outputDirectory>docs/schema</outputDirectory>
		</fileSet>
    </fileSets>

    <files>
        <!-- Deployment for the ModeShape RESTful service WAR -->
        <file>
            <source>
                ../deploy/jbossas/modeshape-jbossas-web-rest-war/target/modeshape-jbossas-web-rest-war-${project.version}.war
            </source>
            <outputDirectory>modules/org/modeshape/main/deployments</outputDirectory>
            <destName>modeshape-rest.war</destName>
        </file>

        <!-- Deployment for the ModeShape WebDAV service WAR -->
        <file>
            <source>
                ../deploy/jbossas/modeshape-jbossas-web-webdav-war/target/modeshape-jbossas-web-webdav-war-${project.version}.war
            </source>
            <outputDirectory>modules/org/modeshape/main/deployments</outputDirectory>
            <destName>modeshape-webdav.war</destName>
        </file>

        <!-- Deployment for the ModeShape CMIS service WAR -->
        <file>
            <source>../deploy/jbossas/modeshape-jbossas-cmis-war/target/modeshape-jbossas-cmis-war-${project.version}.war
            </source>
            <outputDirectory>modules/org/modeshape/main/deployments</outputDirectory>
            <destName>modeshape-cmis.war</destName>
        </file>

        <!-- Deployment for the ModeShape Explorer -->
        <file>
            <source>../deploy/jbossas/modeshape-jbossas-explorer-war/target/modeshape-jbossas-explorer-war-${project.version}.war
            </source>
            <outputDirectory>modules/org/modeshape/main/deployments</outputDirectory>
            <destName>modeshape-explorer.war</destName>
        </file>
    </files>

    <dependencySets>

        <!-- Module for the standard JCR API -->
		<dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/javax/jcr/main</outputDirectory>
			<includes>
				<include>javax.jcr:jcr</include>
			</includes>
			<unpack>false</unpack>
		</dependencySet>

        <!-- Module for the ModeShape schematic -->
        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/schematic/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-schematic:jar</include>
            </includes>
            <unpack>false</unpack>
        </dependencySet>

        <!--Relational persistence module -->
        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/persistence/relational/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-persistence-relational:jar</include>
            </includes>
        </dependencySet>

        <!--File persistence module -->
        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/persistence/file/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-persistence-file:jar</include>
                <include>com.h2database:h2:jar</include>
            </includes>
        </dependencySet>

		<!-- Module for the ModeShape API (extension of the JCR API) -->
		<dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/jcr/api/main</outputDirectory>
			<includes>
				<include>org.modeshape:modeshape-jcr-api:jar</include>
			</includes>
			<unpack>false</unpack>
		</dependencySet>

        <!--Commons module-->
        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/common/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-common:jar</include>
            </includes>
            <unpack>false</unpack>
        </dependencySet>

        <!-- Module for the ModeShape engine (and dependencies) -->
        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-jcr:jar</include>
                <include>org.modeshape:modeshape-jbossas-subsystem:jar</include>
                <include>org.mapdb:mapdb:jar</include>
                <include>com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar</include>
            </includes>
            <unpack>false</unpack>
        </dependencySet>

        <!--Module for Hikari connection pool -->
        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/com/zaxxer/hikari/${version.com.zaxxer.HikariCP}</outputDirectory>
            <includes>
                <include>com.zaxxer:HikariCP:jar</include>
            </includes>
        </dependencySet>

        <!-- Module for Tika (self-contained) -->
        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/apache/tika/${version.org.apache.tika}</outputDirectory>
            <includes>
                <include>org.apache.tika:*:jar</include>
                <include>org.apache.commons:*:jar</include>
                <include>org.tukaani:*:jar</include>
                <include>org.apache.james:apache-mime4j-core:jar</include>
                <include>org.apache.james:apache-mime4j-dom:jar</include>
                <include>org.apache.pdfbox:*:jar</include>
                <include>org.apache.poi:*:jar</include>
                <include>org.apache.xmlbeans:*:jar</include>
                <include>commons-codec:commons-codec:jar</include>
                <include>commons-io:commons-io:jar</include>
                <include>commons-logging:commons-logging:jar</include>
                <include>*:juniversalchardet:jar</include>
                <include>org.ccil.cowan.tagsoup:*:jar</include>
                <include>org.gagravarr:*:jar</include>
                <include>org.ow2.asm:asm:jar</include>
                <!--
                The following are not currently included by default; see ModeShape's parent POM
                <include>org.bouncycastle:*:jar</include>
                -->
            </includes>
        </dependencySet>

        <!--Connectors-->
        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/connector/git/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-connector-git:jar</include>
                <include>org.eclipse.jgit:org.eclipse.jgit:jar</include>
                <include>com.jcraft:jsch:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/connector/jdbc/metadata/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-connector-jdbc-metadata:jar</include>
            </includes>
        </dependencySet>

        <!--Sequencers-->
        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/sequencer/ddl/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-sequencer-ddl:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/sequencer/image/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-sequencer-images:jar</include>
                <include>com.drewnoakes:metadata-extractor:jar</include>
                <include>com.adobe.xmp:xmpcore:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/sequencer/java/main</outputDirectory>
            <useTransitiveDependencies>true</useTransitiveDependencies>
            <includes>
                <include>org.modeshape:modeshape-sequencer-java:jar</include>
                <include>org.javassist:javassist:jar</include>
                <include>org.eclipse*:common:jar:${version.org.eclipse.equinox.common}</include>
                <include>org.eclipse*:core:jar:${version.org.eclipse.jdt.core}</include>
                <include>org.eclipse*:resources:jar:${version.org.eclipse.core.resources}</include>
                <include>org.eclipse*:expressions:jar:${version.org.eclipse.core.expressions}</include>
                <include>org.eclipse*:preferences:jar:${version.org.eclipse.equinox.preferences}</include>
                <include>org.eclipse*:runtime:jar:${version.org.eclipse.core.runtime}</include>
                <include>org.eclipse*:osgi:jar:${version.org.eclipse.osgi}</include>
                <include>org.eclipse*:jobs:jar:${version.org.eclipse.core.jobs}</include>
                <include>org.eclipse*:registry:jar:${version.org.eclipse.equinox.registry}</include>
                <include>org.eclipse*:contenttype:jar:${version.org.eclipse.core.contenttype}</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/sequencer/mp3/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-sequencer-mp3:jar</include>
                <include>org:jaudiotagger:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/sequencer/msoffice/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-sequencer-msoffice:jar</include>
                <include>org.apache*:poi:jar</include>
                <include>org.apache*:poi-scratchpad:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/sequencer/sramp/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-sequencer-sramp:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/sequencer/text/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-sequencer-text:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/sequencer/wsdl/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-sequencer-wsdl:jar</include>
                <include>wsdl4j:wsdl4j:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/sequencer/xml/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-sequencer-xml:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/sequencer/xsd/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-sequencer-xsd:jar</include>
                <include>org.eclipse*:xsd:jar:${version.org.eclipse.xsd}</include>
                <include>org.eclipse*:common:jar:${version.org.eclipse.emf.common}</include>
                <include>org.eclipse*:ecore:jar:${version.org.eclipse.emf.ecore}</include>
                <include>org.eclipse*:ecore-change:jar:${version.org.eclipse.emf.ecore-change}</include>
                <include>org.eclipse*:ecore-xmi:jar:${version.org.eclipse.emf.ecore-xmi}</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/sequencer/zip/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-sequencer-zip:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/sequencer/video/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-sequencer-video:jar</include>
                <include>io.humble:humble-video-all:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <outputDirectory>modules/org/modeshape/sequencer/pdf/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-sequencer-pdf:jar</include>
                <include>org.apache.pdfbox:pdfbox:jar</include>
                <include>org.apache.pdfbox:xmpbox:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/sequencer/audio/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-sequencer-audio:jar</include>
                <include>org:jaudiotagger:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <outputDirectory>modules/org/modeshape/sequencer/epub/main</outputDirectory>
            <includes>
                <include>org.modeshape:modeshape-sequencer-epub:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/extractor/tika/main</outputDirectory>
            <useTransitiveDependencies>true</useTransitiveDependencies>
            <includes>
                <include>org.modeshape:modeshape-extractor-tika:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/index-provider/lucene/main</outputDirectory>
            <useTransitiveDependencies>true</useTransitiveDependencies>
            <includes>
                <include>org.modeshape:modeshape-lucene-index-provider:jar</include>
                <include>org.apache.lucene:*:jar</include>
            </includes>
        </dependencySet>

        <dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/index-provider/elasticsearch/main</outputDirectory>
            <useTransitiveDependencies>true</useTransitiveDependencies>
            <includes>
                <include>org.modeshape:modeshape-elasticsearch-index-provider:jar</include>
            </includes>
        </dependencySet>

		<!-- Module for the ModeShape JDBC driver -->
		<dependencySet>
            <useProjectArtifact>false</useProjectArtifact>
            <outputDirectory>modules/org/modeshape/jdbc/main</outputDirectory>
			<includes>
				<include>org.modeshape:modeshape-jdbc-local:jar</include>
			</includes>
			<unpack>false</unpack>
		</dependencySet>
    </dependencySets>
</assembly>


text:
package br.com.alura.loja.modelo;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

import com.google.gson.Gson;
import com.thoughtworks.xstream.XStream;

@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class Carrinho {

	private List<Produto> produtos = new ArrayList<Produto>();
	private String rua;
	private String cidade;
	private long id;

	public Carrinho() {
	}

	public Carrinho adiciona(Produto produto) {
		produtos.add(produto);
		return this;
	}

	public Carrinho para(String rua, String cidade) {
		this.rua = rua;
		this.cidade = cidade;
		return this;
	}

	public Carrinho setId(long id) {
		this.id = id;
		return this;
	}

	public String getRua() {
		return rua;
	}

	public void setRua(String rua) {
		this.rua = rua;
	}
	public void setCidade(String cidade) {
		this.cidade = cidade;
	}

	public long getId() {
		return id;
	}

	public void remove(long id) {
		for (Iterator iterator = produtos.iterator(); iterator.hasNext();) {
			Produto produto = (Produto) iterator.next();
			if(produto.getId() == id) {
				iterator.remove();
			}
		}
	}

	public void troca(Produto produto) {
		remove(produto.getId());
		adiciona(produto);
	}

	public void trocaQuantidade(Produto produto) {
		for (Iterator iterator = produtos.iterator(); iterator.hasNext();) {
			Produto p = (Produto) iterator.next();
			if(p.getId() == produto.getId()) {
				p.setQuantidade(produto.getQuantidade());
				return;
			}
		}
	}

	public List<Produto> getProdutos() {
		return produtos;
	}

	public String toXML() {
		return new XStream().toXML(this);
	}

	public String toJson() {
		return new Gson().toJson(this);
	}

}


text:
"use strict";

import "./client.less";
import Stats from "stats.js";
import {GUI} from "dat.gui";

import FlockIo from "./lib/FlockIo";
import DomeRenderer from "./client/DomeRenderer";
import DesktopRenderer from "./client/DesktopRenderer";

function main() {

    let showStats = false;

    // GAME
    let options = {};
    let renderer;

    // QUICK & DIRTY ROUTER
    switch ( location.pathname.substring( 1 ) ) {
        case 'dome':

            // GAME SETUP
            options.spectator = true;

            // RENDERER
            renderer = new DomeRenderer(210);

            // DAT.GUI
            const gui           = new GUI();
            //gui.remember( renderer );
            var domeRendererGUI = gui.addFolder( 'Dome Renderer' );
            domeRendererGUI.open();
            domeRendererGUI.add( renderer, 'north', 0, 360, 1 );
            domeRendererGUI.add( renderer, 'domeAngle', 230, 270, 1 );
            domeRendererGUI.add( renderer, 'showGrid' );
            domeRendererGUI.add( renderer, 'gridResolution', 8, 128, 1 );
            domeRendererGUI.add( renderer, 'mapResolution', [128, 256, 512, 1024, 2048, 4096] );
            domeRendererGUI.add( renderer, 'mainView', renderer.availableViews );
            domeRendererGUI.add( renderer, 'showDebugViews' );

            break;

        case 'desktop':
            // GAME SETUP
            options.desktop = true;

            // RENDERER
            renderer = new DesktopRenderer();

            break;

        case 'mobile':
        default:
            // GAME SETUP
            options.desktop = false;

            break;
    }

    // GAME SETUP
    options.renderer = renderer;
    const game = new FlockIo( options );

    // STATS
    if ( showStats ) {
        const stats = new Stats();
        stats.showPanel( 0 );
        document.body.appendChild( stats.dom );

        game.beforeUpdate = () => stats.begin();
        game.afterUpdate = () => stats.end();
    }

    // GAME INIT
    game.initialize();

    document.body.appendChild( renderer.renderer.domElement );
    function onWindowResize() {
        renderer.setSize( window.innerWidth, window.innerHeight );
    }

    window.addEventListener( 'resize', onWindowResize, false );
    onWindowResize();
}

if ( __DEV__ ) {
    // Webpack server relaunches forces us to wait a while otherwise the static resources aren't available
    window.addEventListener( "load", setTimeout.bind( this, main, 250 ) );
} else {
    document.addEventListener( "DOMContentLoaded", main.bind( this ) );
}


text:
package getopt

import (
	"fmt"
	"strconv"
)

type int32Value int32

func (i *int32Value) Set(value string, opt Option) error {
	v, err := strconv.ParseInt(value, 0, 32)
	if err != nil {
		if e, ok := err.(*strconv.NumError); ok {
			switch e.Err {
			case strconv.ErrRange:
				err = fmt.Errorf("value out of range: %s", value)
			case strconv.ErrSyntax:
				err = fmt.Errorf("not a valid number: %s", value)
			}
		}
		return err
	}
	*i = int32Value(v)
	return nil
}

func (i *int32Value) String() string {
	return strconv.FormatInt(int64(*i), 10)
}

// Int32 creates an option that parses its value as an int32.
func Int32(name rune, value int32, helpvalue ...string) *int32 {
	return CommandLine.Int32(name, value, helpvalue...)
}

func (s *Set) Int32(name rune, value int32, helpvalue ...string) *int32 {
	return s.Int32Long("", name, value, helpvalue...)
}

func Int32Long(name string, short rune, value int32, helpvalue ...string) *int32 {
	return CommandLine.Int32Long(name, short, value, helpvalue...)
}

func (s *Set) Int32Long(name string, short rune, value int32, helpvalue ...string) *int32 {
	s.Int32VarLong(&value, name, short, helpvalue...)
	return &value
}

func Int32Var(p *int32, name rune, helpvalue ...string) Option {
	return CommandLine.Int32Var(p, name, helpvalue...)
}

func (s *Set) Int32Var(p *int32, name rune, helpvalue ...string) Option {
	return s.Int32VarLong(p, "", name, helpvalue...)
}

func Int32VarLong(p *int32, name string, short rune, helpvalue ...string) Option {
	return CommandLine.Int32VarLong(p, name, short, helpvalue...)
}

func (s *Set) Int32VarLong(p *int32, name string, short rune, helpvalue ...string) Option {
	return s.VarLong((*int32Value)(p), name, short, helpvalue...)
}


text:
<?xml version="1.0" encoding="utf-8"?>

<!--
  Copyright (c) 2017 Google Inc. All Rights Reserved.

  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.
-->

<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:clickable="false"
    android:longClickable="false"
    android:padding="@dimen/list_item_padding"
    tools:layout_editor_absoluteX="0dp"
    tools:layout_editor_absoluteY="0dp">

    <TextView
        android:id="@+id/noteItemTitleTextView"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="0dp"
        android:layout_marginRight="0dp"
        android:layout_marginTop="0dp"
        android:ellipsize="end"
        android:maxLines="1"
        android:text="Title"
        android:textAppearance="@style/TextAppearance.AppCompat.Title"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/noteItemContentTextView"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="0dp"
        android:layout_marginRight="0dp"
        android:layout_marginTop="@dimen/element_spacing"
        android:ellipsize="end"
        android:maxLines="1"
        android:text="Content"
        android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/noteItemTitleTextView" />

</android.support.constraint.ConstraintLayout>


text:
<?php

namespace li3_quality\qa\rules\syntax;

use li3_quality\analysis\Parser;

class HasCorrectCommentStyle extends \li3_quality\qa\Rule {

	/**
	 * Will iterate tokens looking for comments and if found will determine the regex
	 * to test the comment against.
	 *
	 * @param  Testable $testable The testable object
	 * @return void
	 */
	public function apply($testable, array $config = array()) {
		$tokens = $testable->tokens();

		$comments = $testable->findAll(array(T_COMMENT));
		foreach ($comments as $tokenId) {
			$token = $tokens[$tokenId];
			$parentId = $tokens[$tokenId]['parent'];

			if ($parentId === -1 || $tokens[$parentId]['id'] !== T_FUNCTION) {
				$this->addViolation(array(
					'message' => 'Inline comments should never appear.',
					'line' => $token['line'],
				));
			} elseif (preg_match('/^test/', Parser::label($parentId, $tokens)) === 0) {
				$this->addViolation(array(
					'message' => 'Inline comments should only appear in testing methods.',
					'line' => $token['line'],
				));
			}
		}

	}

}

?>


text:
from ._Say import *
from ._AvailableVoices import *


text:
package org.apache.activemq.openwire.v3;

import org.apache.activemq.command.DataResponse;

/**
 * Test case for the OpenWire marshalling for DataResponse
 *
 *
 * NOTE!: This file is auto generated - do not modify!
 * if you need to make a change, please see the modify the groovy scripts in the
 * under src/gram/script and then use maven openwire:generate to regenerate
 * this file.
 */
public class DataResponseTest extends ResponseTest {

   public static final DataResponseTest SINGLETON = new DataResponseTest();

   @Override
   public Object createObject() throws Exception {
      DataResponse info = new DataResponse();
      populateObject(info);
      return info;
   }

   @Override
   protected void populateObject(Object object) throws Exception {
      super.populateObject(object);
      DataResponse info = (DataResponse) object;

      info.setData(createDataStructure("Data:1"));
   }
}


text:
package org.wso2.carbon.uiserver.internal.exception;

import org.wso2.carbon.uiserver.api.exception.UiServerRuntimeException;

/**
 * Indicates an error occurred when invoking an app deployment event listener.
 *
 * @see org.wso2.carbon.uiserver.internal.deployment.AppDeploymentEventListener
 * @since 0.18.0
 */
public class AppDeploymentEventListenerException extends UiServerRuntimeException {

    /**
     * Constructs a new exception with {@code null} as its detail message. The cause is not initialized, and may
     * subsequently be initialized by a call to {@link #initCause(Throwable)}.
     */
    public AppDeploymentEventListenerException() {
    }

    /**
     * Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently
     * be initialized by a call to {@link #initCause}.
     *
     * @param message the detail message of the exception
     */
    public AppDeploymentEventListenerException(String message) {
        super(message);
    }

    /**
     * Constructs a new exception with the specified cause and a detail message of {@code (cause==null ? null :
     * cause.toString())} which typically contains the class and detail message of the {@code cause}.
     *
     * @param cause the cause of the exception
     */
    public AppDeploymentEventListenerException(Throwable cause) {
        super(cause);
    }

    /**
     * Constructs a new exception with the specified detail message and cause.
     *
     * @param message the detail message of the exception
     * @param cause   the cause of the exception
     */
    public AppDeploymentEventListenerException(String message, Throwable cause) {
        super(message, cause);
    }
}


text:
package com.cdesigner.util;

import java.security.MessageDigest;

public class MD5Encrypt {

    public MD5Encrypt() {
    }

    private final static String[] hexDigits = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d",
            "e", "f" };

    public static String byteArrayToString(byte[] b) {
        StringBuffer resultSb = new StringBuffer();
        for (int i = 0; i < b.length; i++) {
            resultSb.append(byteToHexString(b[i]));
        }
        return resultSb.toString();
    }

    private static String byteToHexString(byte b) {
        int n = b;
        if (n < 0) {
            n = 256 + n;
        }
        int d1 = n / 16;
        int d2 = n % 16;
        return hexDigits[d1] + hexDigits[d2];
    }

    public static String MD5Encode(String origin) {
        String resultString = null;

        try {
            resultString = new String(origin);
            MessageDigest md = MessageDigest.getInstance("MD5");
            resultString = byteArrayToString(md.digest(resultString.getBytes()));
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return resultString;
    }
}