text:
namespace Ui {
class OptionsDialog;
}

class OptionsDialog : public QDialog
{
    Q_OBJECT

public:
    explicit OptionsDialog(QWidget *parent = 0);
    ~OptionsDialog();

    int GetThresh() const;
    void SetThresh(int value);

    QString GetPath() const;
    void SetPath(const QString &path_);

    int GetThreads() const;
    void SetThreads(int threads);

signals:
    void detectStars(int);

private slots:
    void handleButtonDetectStars();
    void valuesChanged(int thresh);
    void setDetectedStars(int stars);

    void on_buttonBrowse_released();

    void on_spinboxThreads_valueChanged(int value);

    void on_lineEditFileName_textChanged(const QString &text);

private:
    Ui::OptionsDialog *ui;
    int thresh;
    int threads;
    QString path;
};

#endif // OPTIONSDIALOG_H


text:
package com.ibm.watson.developer_cloud.conversation.v1.model;

import java.util.Date;

import com.google.gson.annotations.SerializedName;
import com.ibm.watson.developer_cloud.service.model.GenericModel;

/**
 * Example.
 */
public class Example extends GenericModel {

  @SerializedName("text")
  private String exampleText;
  private Date created;
  private Date updated;

  /**
   * Gets the exampleText.
   *
   * The text of the example.
   *
   * @return the exampleText
   */
  public String getExampleText() {
    return exampleText;
  }

  /**
   * Gets the created.
   *
   * The timestamp for creation of the example.
   *
   * @return the created
   */
  public Date getCreated() {
    return created;
  }

  /**
   * Gets the updated.
   *
   * The timestamp for the last update to the example.
   *
   * @return the updated
   */
  public Date getUpdated() {
    return updated;
  }

  /**
   * Sets the exampleText.
   *
   * @param exampleText the new exampleText
   */
  public void setExampleText(final String exampleText) {
    this.exampleText = exampleText;
  }
}

redpajama_set_name: RedPajamaGithub


text:
<?php
require_once('../modules/ctomas/core/FrontController.php');
require_once('../modules/ctomas/models/ExperienciaMapper.php');

class Experiencia
{

    function insert()
    {
        if($_POST){
            $experiencia = new ExperienciaMapper();
            $experiencia->insertExperiencia(FrontController::getInstance()->request[3]["cv"]);

            header('Location: /curriculums/update/id/'.FrontController::getInstance()->request[3]["cv"]);
        }
    }

    function delete()
    {
        $experiencia = new ExperienciaMapper();
        $experiencia->borrarExperiencia(FrontController::getInstance()->request[3]["exp"]);

        header('Location: /curriculums/update/id/'.FrontController::getInstance()->request[3]["cv"]);
    }

    function update()
    {
        if($_POST){
             $experiencia = new ExperienciaMapper();
             $experiencia->updateExperiencia(FrontController::getInstance()->request[3]["exp"]);

            header('Location: /curriculums/update/id/'.FrontController::getInstance()->request[3]["cv"]);
        }
    }

}


text:
import { config } from '@grafana/runtime';

import {
  AzureAuthType,
  AzureCloud,
  AzureCredentials,
  AzureDataSourceInstanceSettings,
  AzureDataSourceSettings,
  ConcealedSecret,
} from './types';

const concealed: ConcealedSecret = Symbol('Concealed client secret');

export function getAuthType(options: AzureDataSourceSettings | AzureDataSourceInstanceSettings): AzureAuthType {
  if (!options.jsonData.azureAuthType) {
    // If authentication type isn't explicitly specified and datasource has client credentials,
    // then this is existing datasource which is configured for app registration (client secret)
    if (options.jsonData.tenantId && options.jsonData.clientId) {
      return 'clientsecret';
    }

    // For newly created datasource with no configuration, managed identity is the default authentication type
    // if they are enabled in Grafana config
    return config.azure.managedIdentityEnabled ? 'msi' : 'clientsecret';
  }

  return options.jsonData.azureAuthType;
}

function getDefaultAzureCloud(): string {
  switch (config.azure.cloud) {
    case AzureCloud.Public:
    case AzureCloud.None:
    case undefined:
      return 'azuremonitor';
    case AzureCloud.China:
      return 'chinaazuremonitor';
    case AzureCloud.USGovernment:
      return 'govazuremonitor';
    case AzureCloud.Germany:
      return 'germanyazuremonitor';
    default:
      throw new Error(`The cloud '${config.azure.cloud}' not supported.`);
  }
}

export function getAzurePortalUrl(azureCloud: string): string {
  switch (azureCloud) {
    case 'azuremonitor':
      return 'https://portal.azure.com';
    case 'chinaazuremonitor':
      return 'https://portal.azure.cn';
    case 'govazuremonitor':
      return 'https://portal.azure.us';
    case 'germanyazuremonitor':
      return 'https://portal.microsoftazure.de';
    default:
      throw new Error('The cloud not supported.');
  }
}

export function getAzureCloud(options: AzureDataSourceSettings | AzureDataSourceInstanceSettings): string {
  const authType = getAuthType(options);
  switch (authType) {
    case 'msi':
      // In case of managed identity, the cloud is always same as where Grafana is hosted
      return getDefaultAzureCloud();
    case 'clientsecret':
      return options.jsonData.cloudName || getDefaultAzureCloud();
  }
}

function getSecret(options: AzureDataSourceSettings): undefined | string | ConcealedSecret {
  if (options.secureJsonFields.clientSecret) {
    // The secret is concealed on server
    return concealed;
  } else {
    const secret = options.secureJsonData?.clientSecret;
    return typeof secret === 'string' && secret.length > 0 ? secret : undefined;
  }
}

export function isCredentialsComplete(credentials: AzureCredentials): boolean {
  switch (credentials.authType) {
    case 'msi':
      return true;
    case 'clientsecret':
      return !!(credentials.azureCloud && credentials.tenantId && credentials.clientId && credentials.clientSecret);
  }
}

export function getCredentials(options: AzureDataSourceSettings): AzureCredentials {
  const authType = getAuthType(options);
  switch (authType) {
    case 'msi':
      if (config.azure.managedIdentityEnabled) {
        return {
          authType: 'msi',
          defaultSubscriptionId: options.jsonData.subscriptionId,
        };
      } else {
        // If authentication type is managed identity but managed identities were disabled in Grafana config,
        // then we should fallback to an empty app registration (client secret) configuration
        return {
          authType: 'clientsecret',
          azureCloud: getDefaultAzureCloud(),
        };
      }
    case 'clientsecret':
      return {
        authType: 'clientsecret',
        azureCloud: options.jsonData.cloudName || getDefaultAzureCloud(),
        tenantId: options.jsonData.tenantId,
        clientId: options.jsonData.clientId,
        clientSecret: getSecret(options),
        defaultSubscriptionId: options.jsonData.subscriptionId,
      };
  }
}

export function updateCredentials(
  options: AzureDataSourceSettings,
  credentials: AzureCredentials
): AzureDataSourceSettings {
  switch (credentials.authType) {
    case 'msi':
      if (!config.azure.managedIdentityEnabled) {
        throw new Error('Managed Identity authentication is not enabled in Grafana config.');
      }

      options = {
        ...options,
        jsonData: {
          ...options.jsonData,
          azureAuthType: 'msi',
          subscriptionId: credentials.defaultSubscriptionId,
        },
      };

      return options;

    case 'clientsecret':
      options = {
        ...options,
        jsonData: {
          ...options.jsonData,
          azureAuthType: 'clientsecret',
          cloudName: credentials.azureCloud || getDefaultAzureCloud(),
          tenantId: credentials.tenantId,
          clientId: credentials.clientId,
          subscriptionId: credentials.defaultSubscriptionId,
        },
        secureJsonData: {
          ...options.secureJsonData,
          clientSecret: typeof credentials.clientSecret === 'string' ? credentials.clientSecret : undefined,
        },
        secureJsonFields: {
          ...options.secureJsonFields,
          clientSecret: typeof credentials.clientSecret === 'symbol',
        },
      };

      return options;
  }
}


text:
using System;

namespace Azure.ResourceManager.Synapse.Models
{
    /// <summary> Details of the data lake storage account associated with the workspace. </summary>
    public partial class DataLakeStorageAccountDetails
    {
        /// <summary> Initializes a new instance of DataLakeStorageAccountDetails. </summary>
        public DataLakeStorageAccountDetails()
        {
        }

        /// <summary> Initializes a new instance of DataLakeStorageAccountDetails. </summary>
        /// <param name="accountUri"> Account URL. </param>
        /// <param name="filesystem"> Filesystem name. </param>
        /// <param name="resourceId"> ARM resource Id of this storage account. </param>
        /// <param name="createManagedPrivateEndpoint"> Create managed private endpoint to this storage account or not. </param>
        internal DataLakeStorageAccountDetails(Uri accountUri, string filesystem, string resourceId, bool? createManagedPrivateEndpoint)
        {
            AccountUri = accountUri;
            Filesystem = filesystem;
            ResourceId = resourceId;
            CreateManagedPrivateEndpoint = createManagedPrivateEndpoint;
        }

        /// <summary> Account URL. </summary>
        public Uri AccountUri { get; set; }
        /// <summary> Filesystem name. </summary>
        public string Filesystem { get; set; }
        /// <summary> ARM resource Id of this storage account. </summary>
        public string ResourceId { get; set; }
        /// <summary> Create managed private endpoint to this storage account or not. </summary>
        public bool? CreateManagedPrivateEndpoint { get; set; }
    }
}


text:
from __future__ import unicode_literals

from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('accelerator', '0006_remove_userrole_url_slug'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='programfamily',
            name='physical_address',
        ),
        migrations.RemoveField(
            model_name='programfamily',
            name='timezone',
        ),
    ]


text:
<CartClearResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2011-08-01">
  <OperationRequest>
    <HTTPHeaders>
      <Header Name="UserAgent" Value="Python-urllib/2.6"/>
    </HTTPHeaders>
    <RequestId>02C703E40MC5HSNZ7YZJ</RequestId>
    <Arguments>
      <Argument Name="Timestamp" Value="2011-11-08T21:48:32Z"/>
      <Argument Name="Version" Value="2011-08-01"/>
      <Argument Name="Signature" Value="XXXXXXXXXXXXXXX"/>
      <Argument Name="CartId" Value="377-2836557-1663211"/>
      <Argument Name="AWSAccessKeyId" Value="XXXXXXXXXXXXXXX"/>
      <Argument Name="Service" Value="AWSECommerceService"/>
      <Argument Name="Operation" Value="CartClear"/>
      <Argument Name="AssociateTag" Value="XXXXXXXXXXXXXXX"/>
      <Argument Name="HMAC" Value="fXgs9lPVcHZ9JqAbgEHqmwj6+eU="/>
    </Arguments>
    <RequestProcessingTime>0.0321860313415527</RequestProcessingTime>
  </OperationRequest>
  <Cart>
    <Request>
      <IsValid>True</IsValid>
      <CartClearRequest>
        <CartId>377-2836557-1663211</CartId>
        <HMAC>fXgs9lPVcHZ9JqAbgEHqmwj6+eU=</HMAC>
      </CartClearRequest>
    </Request>
    <CartId>377-2836557-1663211</CartId>
    <HMAC>fXgs9lPVcHZ9JqAbgEHqmwj6+eU=</HMAC>
    <URLEncodedHMAC>fXgs9lPVcHZ9JqAbgEHqmwj6%2BeU%3D</URLEncodedHMAC>
  </Cart>
</CartClearResponse>


text:
#include <sys/types.h>

#ifndef	NULL
#define	NULL	0
#endif

char	*strcat (char *, const char *);
char	*strncat (char *, const char *, size_t);
char	*strcpy (char *, const char *);
char	*strncpy (char *, const char *, size_t);

char	*strstr (const char *, const char *);

int	strcmp (const char *, const char *);
int	strncmp (const char *, const char *, size_t);
size_t	strlen (const char *);

int	memcmp (const void *, const void *, size_t);

void    *memmove (void *, const void *, size_t);
void	*memccpy (void *, const void *, int, size_t);
void	*memchr (const void *, int, size_t);
void	*memcpy (void *, const void *, size_t);
void	*memset (void *, int, size_t);
char	*strchr (const char *, int);

char	*strdup (const char *);
char	*strpbrk (const char *, const char *);
char	*strrchr (const char *, int);
char	*strsep (char **, const char *);
char	*strtok (char *, const char *);
char	*strtok_r (char *, const char *, char **);

size_t	strcspn (const char *, const char *);
size_t	strspn (const char *, const char *);

char *strerror (int);
const char *syserrlst (int);


text:
module CanCan
  module ModelAdapters
    class MongoidAdapter < AbstractAdapter
      def self.for_class?(model_class)
        model_class <= Mongoid::Document
      end

      def self.override_conditions_hash_matching?(subject, conditions)
        conditions.any? { |k,v| !k.kind_of?(Symbol) }
      end

      def self.matches_conditions_hash?(subject, conditions)
        # To avoid hitting the db, retrieve the raw Mongo selector from
        # the Mongoid Criteria and use Mongoid::Matchers#matches?
        subject.matches?( subject.class.where(conditions).selector )
      end

      def database_records
        @model_class.where(conditions)
      end

      def conditions
        if @rules.size == 0
          false_query
        else
          @rules.first.conditions
        end
      end

      def false_query
        # this query is sure to return no results
        {:_id => {'$exists' => false, '$type' => 7}}  # type 7 is an ObjectID (default for _id)
      end
    end
  end
end

# simplest way to add `accessible_by` to all Mongoid Documents
module Mongoid::Document::ClassMethods
  include CanCan::ModelAdditions::ClassMethods
end


text:
package il.ac.technion.ie.measurements.matchers;

import cern.colt.matrix.DoubleMatrix1D;
import cern.colt.matrix.impl.SparseDoubleMatrix1D;
import il.ac.technion.ie.exception.MatrixSizeException;
import org.apache.log4j.Logger;

import java.util.Map;
import java.util.TreeMap;

/**
 * Created by XPS_Sapir on 04/06/2015.
 */
public class MaxMatcher extends AbstractMatcher {
    private static final Logger logger = Logger.getLogger(MaxMatcher.class);

    @Override
    public DoubleMatrix1D match(DoubleMatrix1D matrix1D) throws MatrixSizeException {
        SparseDoubleMatrix1D matchedMatrix = new SparseDoubleMatrix1D(matrix1D.size());
        int windowSize;
        try {
            windowSize = getWindowSize(matrix1D);
        } catch (MatrixSizeException e) {
            logger.error(String.format("Similarity Vector has %d cells. It cannot be generated from NxN matrix",
                    matrix1D.size()), e);
            throw e;
        }
        for (int startigIndex = 0; startigIndex < matrix1D.size(); startigIndex += windowSize) {
            DoubleMatrix1D row = matrix1D.viewPart(startigIndex, windowSize);
            Map.Entry<Double, Integer> maxScoreEntry = getMaxEntryInRow(windowSize, startigIndex, row);
            matchedMatrix.setQuick(maxScoreEntry.getValue(), maxScoreEntry.getKey());
        }
        return matchedMatrix;
    }

    private Map.Entry<Double, Integer> getMaxEntryInRow(int windowSize, int startigIndex, DoubleMatrix1D row) {
        TreeMap<Double, Integer> map = new TreeMap<>();
        for (int i = 0; i < windowSize; i++) {
            map.put(row.getQuick(i), i + startigIndex);
        }
        return map.lastEntry();
    }

}


text:
<?php

namespace Hail\Database\Console\Migration;

class SeedRun extends AbstractCommand
{
    public function brief(): string
    {
        return 'Run database seeders';
    }

    public function help()
    {
        return <<<EOT
The <info>seed:run</info> command runs all available or individual seeders

<info>migration seed:run -e development</info>
<info>migration seed:run -e development -s UserSeeder</info>
<info>migration seed:run -e development -s UserSeeder -s PermissionSeeder -s LogSeeder</info>
<info>migration seed:run -e development -v</info>

EOT;
    }

    public function init()
    {
        $this->addOption('e|environment?', 'The target environment');
        $this->addOption('s|seed+', 'What is the name of the seeder?');
    }

    /**
     * Run database seeders.
     *
     * @return void
     */
    protected function execute()
    {
        $this->bootstrap();

        $output = $this->getOutput();

        $seedSet = $this->getOption('seed');
        $environment = $this->getOption('environment');

        if (null === $environment) {
            $environment = $this->getConfig()->getDefaultEnvironment();
            $output->writeln('<comment>warning</comment> no environment specified, defaulting to: ' . $environment);
        } else {
            $output->writeln('<info>using environment</info> ' . $environment);
        }

        $envOptions = $this->getConfig()->getEnvironment($environment);
        if (isset($envOptions['adapter'])) {
            $output->writeln('<info>using adapter</info> ' . $envOptions['adapter']);
        }

        if (isset($envOptions['wrapper'])) {
            $output->writeln('<info>using wrapper</info> ' . $envOptions['wrapper']);
        }

        if (isset($envOptions['name'])) {
            $output->writeln('<info>using database</info> ' . $envOptions['name']);
        } else {
            $output->writeln('<error>Could not determine database name! Please specify a database name in your config file.</error>');

            return;
        }

        if (isset($envOptions['table_prefix'])) {
            $output->writeln('<info>using table prefix</info> ' . $envOptions['table_prefix']);
        }
        if (isset($envOptions['table_suffix'])) {
            $output->writeln('<info>using table suffix</info> ' . $envOptions['table_suffix']);
        }

        $start = microtime(true);

        if (empty($seedSet)) {
            // run all the seed(ers)
            $this->getManager()->seed($environment);
        } else {
            // run seed(ers) specified in a comma-separated list of classes
            foreach ($seedSet as $seed) {
                $this->getManager()->seed($environment, trim($seed));
            }
        }

        $end = microtime(true);

        $output->writeln('');
        $output->writeln('<comment>All Done. Took ' . sprintf('%.4fs', $end - $start) . '</comment>');
    }
}


text:
package com.blurengine.blur.framework.metadata.auto;

import com.google.common.base.Preconditions;

import com.blurengine.blur.framework.metadata.MetadataHolder;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.annotation.Nonnull;

public abstract class AbstractAutoMetadataCreator<HOLDER extends MetadataHolder> {

    private Set<Class<Object>> classes;
    private Map<Class<Object>, MetadataCreator<Object, HOLDER>> creators;

    public AbstractAutoMetadataCreator() {
        this(new HashSet<>(), new HashMap<>());
    }

    protected AbstractAutoMetadataCreator(Set<Class<Object>> classes,
                                          Map<Class<Object>, MetadataCreator<Object, HOLDER>> creators) {
        this.classes = classes;
        this.creators = creators;
    }

    public List<Object> initialize(@Nonnull HOLDER holder) {
        ArrayList<Object> instances = new ArrayList<>();
        for (Class<?> metadataClazz : getClasses()) {
            instances.add(instantiateClass(metadataClazz, holder));
        }
        // Supplier data instances
        for (MetadataCreator<?, HOLDER> creator : creators.values()) {
            instances.add(creator.create(holder));
        }
        return instances;
    }

    @Nonnull
    protected abstract Object instantiateClass(@Nonnull Class<?> clazz, @Nonnull HOLDER holder);

    @Nonnull
    public Set<Class<Object>> getClasses() {
        return Collections.unmodifiableSet(classes);
    }

    @Nonnull
    public Map<Class<Object>, MetadataCreator<Object, HOLDER>> getCreators() {
        return Collections.unmodifiableMap(creators);
    }

    public <T> void registerClass(@Nonnull Class<T> clazz) {
        Preconditions.checkNotNull(clazz, "clazz cannot be null.");
        Preconditions.checkArgument(!this.creators.containsKey(clazz),
            "%s already registered (with creator)", clazz);
        Preconditions.checkArgument(!this.classes.contains(clazz),
            "%s already registered (without creator)", clazz);
        this.classes.add((Class<Object>) clazz);
    }

    public <T> void registerClass(@Nonnull Class<T> clazz, @Nonnull MetadataCreator<T, HOLDER> creator) {
        Preconditions.checkNotNull(clazz, "clazz cannot be null.");
        Preconditions.checkNotNull(creator, "creator cannot be null.");

        Preconditions.checkArgument(!this.creators.containsKey(clazz),
            "%s already registered (with creator)", clazz);
        Preconditions.checkArgument(!this.classes.contains(clazz),
            "%s already registered (without creator)", clazz);
        this.creators.put((Class) clazz, (MetadataCreator) creator);
    }

    public <T> boolean unregisterClass(@Nonnull Class<T> clazz) {
        Preconditions.checkNotNull(clazz, "clazz cannot be null.");
        if (this.classes.remove(clazz)) {
            return true;
        } else if (this.creators.remove(clazz) != null) {
            return true;
        }
        return false;
    }
}


text:
Config.fs is not in version control. Add it manually.

``` csharp
module Config

let LocalDb = @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=C:\SRC\GITHUB\CUBESENSORS-IOT-AZURE\SAMPLE_DATA\CUBE_DB.MDF;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"
let Azure = @""

let Users = [("foo", "bar"); ("bill", "temple")]
```

## SQL type provider
https://msdn.microsoft.com/en-us/library/hh361033.aspx

## From nuget to Paket
http://fsprojects.github.io/Paket/getting-started.html

https://fsprojects.github.io/Paket/paket-convert-from-nuget.html

```sh
# get paket.exe
.paket\paket.bootstrapper.exe
# install dependencies
.paket\paket.exe install
```

## Example requests

Use HTTPie

```sh
pip install httpie
```

```sh
# List all sensors
http 127.0.0.1:8083/api/v1/sensor
# Get all data for sensor
http 127.0.0.1:8083/api/v1/sensor/000D4F0004E764C3
# Get all data for sensor from last 60 min
http 127.0.0.1:8083/api/v1/sensor/000D4F0004E764C3/60
# Get all value points (time, value) from X min
http 127.0.0.1:8083/api/v1/temperature/000D4F0004E764C3/1440
http 127.0.0.1:8083/api/v1/noise/000D4F0004E764C3/30
# Get average temperature from last day
http 127.0.0.1:8083/api/v1/temperature/avg/000D4F0004E764C3/1440
# Get last update time
http 127.0.0.1:8083/api/v1/last -a foo:bar
```


text:
layout: page
title: "Talks"
description: "On se croise #IRL ?"
header-img: "/img/mic.png"
credit: Julien Pauli
---

J'ai commencé en 2014 à participer à des conférences Web en tant qu'orateur.

Je le fais pour le moment de façon assez occasionnelle, mais c'est quelque chose que j'aime car ce sont d'excellentes opportunités d'apprendre et de rencontrer des gens remarquables.

## 🗓 Les confs à venir

### PHP Tour 2018 - Montpellier
### [Merci de laisser ce code dans l'état dans lequel vous aimeriez le trouver](https://event.afup.org/phptourmontpellier2018/programme/#2474)

> Il existe un dicton célèbre dans le monde de la programmation informatique : "Code toujours comme si la personne qui va maintenir ton code est un violent psychopathe qui sais où tu habites." Même si je ne suis pas vraiment d'accord avec l'idée d'avoir peur des gens avec qui l'on travaille, il est de notre devoir de développeur·se de faire en sorte que la maintenance du code que l'on écrit se fasse dans les meilleures conditions possibles. Avec un zeste de psychologie comportementale, nous verrons quelles sont les bonnes pratiques qui peuvent être mises en place pour faire du code un endroit où l'on aime revenir.

## 🎥 Previously on "le skwi en conférence"

Parmi les talks que j'ai présenté, il n'y en a pour le moment qu'un seul qui ait été filmé.

### Egoless programming - Tu n'es pas ton code
Présentation du concept d'Egoless Programming introduit par Jerry Weinberg, avec un focus sur les 10 commandments qu'il propose.

Slides - @ BlendWebMix - Oct. 2015


text:
using System;
using System.ComponentModel;
using System.IO;
using NUnit.Framework;
using ProtoBuf;
using System.Runtime.Serialization;
using ProtoBuf.Meta;

namespace Examples.DesignIdeas
{
    /// <summary>
    /// would like to be able to specify custom values for enums;
    /// implementation note: some kind of map: Dictionary<TValue, long>?
    /// note: how to handle -ves? (ArgumentOutOfRangeException?)
    /// note: how to handle flags? (NotSupportedException? at least for now?
    ///             could later use a bitmap sweep?)
    /// </summary>
    [ProtoContract(Name="blah")]
    enum SomeEnum
    {
        [ProtoEnum(Name="FOO")]
        ChangeName = 3,

        [ProtoEnum(Value = 19)]
        ChangeValue = 5,

        [ProtoEnum(Name="BAR", Value=92)]
        ChangeBoth = 7,

        LeaveAlone = 22,

        Default = 2
    }
    [ProtoContract]
    class EnumFoo
    {
        public EnumFoo() { Bar = SomeEnum.Default; }
        [ProtoMember(1), DefaultValue(SomeEnum.Default)]
        public SomeEnum Bar { get; set; }
    }

    [ProtoContract]
    class EnumNullableFoo
    {
        public EnumNullableFoo() { Bar = SomeEnum.Default; }
        [ProtoMember(1), DefaultValue(SomeEnum.Default)]
        public SomeEnum? Bar { get; set; }
    }

    enum NegEnum
    {
        A = -1, B = 0, C = 1
    }
    [ProtoContract]
    class NegEnumType
    {
        [ProtoMember(1)]
        public NegEnum Value { get; set; }
    }
    public enum HasConflictingKeys
    {
        [ProtoEnum(Value = 1)]
        Foo = 0,
        [ProtoEnum(Value = 2)]
        Bar = 0
    }
    public enum HasConflictingValues
    {
        [ProtoEnum(Value=2)]
        Foo = 0,
        [ProtoEnum(Value = 2)]
        Bar = 1
    }
    [ProtoContract]
    class TypeDuffKeys
    {
        [ProtoMember(1)]
        public HasConflictingKeys Value {get;set;}
    }
    [ProtoContract]
    class TypeDuffValues
    {
        [ProtoMember(1)]
        public HasConflictingValues Value {get;set;}
    }

    [ProtoContract]
    class NonNullValues
    {
        [ProtoMember(1), DefaultValue(SomeEnum.Default)]
        SomeEnum Foo { get; set; }
        [ProtoMember(2)]
        bool Bar { get; set; }
    }
    [ProtoContract]
    class NullValues
    {
        [ProtoMember(1), DefaultValue(SomeEnum.Default)]
        SomeEnum? Foo { get; set; }
        [ProtoMember(2)]
        bool? Bar { get; set; }
    }

    [TestFixture]
    public class EnumTests
    {

        [Test]
        public void EnumGeneration()
        {

            string proto = Serializer.GetProto<EnumFoo>();

            Assert.AreEqual(@"package Examples.DesignIdeas;

message EnumFoo {
   optional blah Bar = 1 [default = Default];
}
enum blah {
   Default = 2;
   FOO = 3;
   ChangeValue = 19;
   LeaveAlone = 22;
   BAR = 92;
}
", proto);
        }

        [Test]
        public void TestNonNullValues()
        {
            var model = TypeModel.Create();
            model.UseImplicitZeroDefaults = false;

            string proto = model.GetSchema(typeof (NonNullValues));

            Assert.AreEqual(@"package Examples.DesignIdeas;

message NonNullValues {
   optional blah Foo = 1 [default = Default];
   optional bool Bar = 2;
}
enum blah {
   Default = 2;
   FOO = 3;
   ChangeValue = 19;
   LeaveAlone = 22;
   BAR = 92;
}
", proto);
        }

        [Test]
        public void TestNullValues()
        {

            string proto = Serializer.GetProto<NullValues>();

            Assert.AreEqual(@"package Examples.DesignIdeas;

message NullValues {
   optional blah Foo = 1 [default = Default];
   optional bool Bar = 2;
}
enum blah {
   Default = 2;
   FOO = 3;
   ChangeValue = 19;
   LeaveAlone = 22;
   BAR = 92;
}
", proto);
        }

        [Test, ExpectedException(typeof(ProtoException))]
        public void TestConflictingKeys()
        {
            Serializer.Serialize(Stream.Null, new TypeDuffKeys { Value = HasConflictingKeys.Foo });
        }

        [Test, ExpectedException(typeof(ProtoException))]
        public void TestConflictingValues()
        {
            Serializer.Serialize(Stream.Null, new TypeDuffValues { Value = HasConflictingValues.Foo });
        }

        [Test]
        public void TestEnumNameValueMapped()
        {
            CheckValue(SomeEnum.ChangeBoth, 0x08, 92);
        }

        [Test]
        public void TestFlagsEnum()
        {
            var orig = new TypeWithFlags { Foo = TypeWithFlags.FlagsEnum.A | TypeWithFlags.FlagsEnum.B };
            var clone = Serializer.DeepClone(orig);
            Assert.AreEqual(orig.Foo, clone.Foo);
        }

        [ProtoContract]
        class TypeWithFlags
        {
            [Flags]
            public enum FlagsEnum
            {
                None = 0, A = 1, B = 2, C = 4
            }
            [ProtoMember(1)]
            public FlagsEnum Foo { get; set; }
        }

        [Test]
        public void TestNulalbleEnumNameValueMapped()
        {
            var orig = new EnumNullableFoo { Bar = SomeEnum.ChangeBoth };
            var clone = Serializer.DeepClone(orig);
            Assert.AreEqual(orig.Bar, clone.Bar);
        }
        [Test]
        public void TestEnumNameMapped() {
            CheckValue(SomeEnum.ChangeName, 0x08, 03);
        }
        [Test]
        public void TestEnumValueMapped() {
            CheckValue(SomeEnum.ChangeValue, 0x08, 19);
        }
        [Test]
        public void TestEnumNoMap() {
            CheckValue(SomeEnum.LeaveAlone, 0x08, 22);
        }

        static void CheckValue(SomeEnum val, params byte[] expected)
        {
            EnumFoo foo = new EnumFoo { Bar = val };
            using (MemoryStream ms = new MemoryStream())
            {
                Serializer.Serialize(ms, foo);
                ms.Position = 0;
                byte[] buffer = ms.ToArray();
                Assert.IsTrue(Program.ArraysEqual(buffer, expected), "Byte mismatch");

                EnumFoo clone = Serializer.Deserialize<EnumFoo>(ms);
                Assert.AreEqual(val, clone.Bar);
            }
        }

        [Test]
        public void TestNegEnum()
        {
            TestNegEnum(NegEnum.A);
            TestNegEnum(NegEnum.B);
            TestNegEnum(NegEnum.C);
        }
        [Test, ExpectedException(typeof(ProtoException))]
        public void TestNegEnumnotDefinedNeg()
        {
            TestNegEnum((NegEnum)(-2));
        }
        [Test, ExpectedException(typeof(ProtoException))]
        public void TestNegEnumnotDefinedPos()
        {
            TestNegEnum((NegEnum) 2);
        }
        [Test]
        public void ShouldBeAbleToSerializeExactDuplicatedEnumValues()
        {
            var obj = new HasDuplicatedEnumProp { Value = NastDuplicates.B };
            var clone = Serializer.DeepClone(obj);
            Assert.AreEqual(NastDuplicates.A, clone.Value);
            Assert.AreEqual(NastDuplicates.B, clone.Value);
        }
        [ProtoContract]
        class HasDuplicatedEnumProp
        {
            [ProtoMember(1)]
            public NastDuplicates Value { get; set; }
        }
        enum NastDuplicates
        {
            None = 0,
            A = 1,
            B = 1
        }

        private static void TestNegEnum(NegEnum value)
        {
            NegEnumType obj = new NegEnumType { Value = value },
                clone = Serializer.DeepClone(obj);
            Assert.AreEqual(obj.Value, clone.Value, value.ToString());
        }

        [ProtoContract]
        enum EnumMarkedContract : ushort
        {
            None = 0, A, B, C, D
        }
        enum EnumNoContract : ushort
        {
            None = 0, A, B, C, D
        }

        [Test]
        public void RoundTripTopLevelContract()
        {
            EnumMarkedContract value = EnumMarkedContract.C;
            Assert.IsTrue(Program.CheckBytes(value, 8, 3));
            Assert.AreEqual(value, Serializer.DeepClone(value));
        }

        [Test]
        public void RoundTripTopLevelNullableContract()
        {
            EnumMarkedContract? value = EnumMarkedContract.C;
            Assert.IsTrue(Program.CheckBytes(value, 8, 3));
            Assert.AreEqual(value, Serializer.DeepClone(value));
        }
        [Test]
        public void RoundTripTopLevelNullableContractNull()
        {
            EnumMarkedContract? value = null;
            Assert.AreEqual(value, Serializer.DeepClone(value));
        }
        [Test]
        public void RoundTripTopLevelNoContract()
        {
            EnumNoContract value = EnumNoContract.C;
            Assert.IsTrue(Program.CheckBytes(value, 8, 3));
            Assert.AreEqual(value, Serializer.DeepClone(value));
        }

        [Test]
        public void RoundTripTopLevelNullableNoContract()
        {
            EnumNoContract? value = EnumNoContract.C;
            Assert.IsTrue(Program.CheckBytes(value, 8, 3));
            Assert.AreEqual(value, Serializer.DeepClone(value));
        }
        [Test]
        public void RoundTripTopLevelNullableNoContractNull()
        {
            EnumNoContract? value = null;
            Assert.AreEqual(value, Serializer.DeepClone(value));
        }

    }
}


text:
@font-face {
    font-family: 'leaf';
    src:
        url('/style/icomoon/fonts/leaf.ttf?aot8cm') format('truetype'),
        url('/style/icomoon/fonts/leaf.woff?aot8cm') format('woff'),
        url('/style/icomoon/fonts/leaf.svg?aot8cm#leaf') format('svg');
    font-weight: normal;
    font-style: normal;
}

.icon {
    /* use !important to prevent issues with browser extensions that change fonts */
    font-family: 'leaf' !important;
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;

    /* Better Font Rendering =========== */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.icon-bag:before {
    content: "\e904";
}
.icon-checkmark:before {
    content: "\e906";
}
.icon-x:before {
    content: "\e907";
}
.icon-shopping-cart:before {
    content: "\e900";
}
.icon-chevron-thin-right:before {
    content: "\e901";
}
.icon-chevron-thin-left:before {
    content: "\e902";
}
.icon-spinner:before {
    content: "\e908";
}
.icon-facebook:before {
    content: "\e903";
}
.icon-leaf:before {
    content: "\e909";
}
.icon-search:before {
    content: "\e905";
}
.icon-bin:before {
    content: "\e90a";
}


text:
'use strict';

const common = require('../common');
if (!common.isLinux)
  common.skip('Test is linux specific.');

const path = require('path');
const fs = require('fs');
const assert = require('assert');

common.refreshTmpDir();
const filename = '\uD83D\uDC04';
const root = Buffer.from(`${common.tmpDir}${path.sep}`);
const filebuff = Buffer.from(filename, 'ucs2');
const fullpath = Buffer.concat([root, filebuff]);

try {
  fs.closeSync(fs.openSync(fullpath, 'w+'));
} catch (e) {
  if (e.code === 'EINVAL')
    common.skip('test requires filesystem that supports UCS2');
  throw e;
}

fs.readdir(common.tmpDir, 'ucs2', common.mustCall((err, list) => {
  assert.ifError(err);
  assert.strictEqual(1, list.length);
  const fn = list[0];
  assert.deepStrictEqual(filebuff, Buffer.from(fn, 'ucs2'));
  assert.strictEqual(fn, filename);
}));


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

namespace GraphQL\Tests\Server;

use GraphQL\Executor\ExecutionResult;
use GraphQL\Server\Helper;
use Nyholm\Psr7\Response;
use Nyholm\Psr7\Stream;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\ResponseInterface;

use function Safe\json_encode;

final class PsrResponseTest extends TestCase
{
    public function testConvertsResultToPsrResponse(): void
    {
        $result = new ExecutionResult(['key' => 'value']);
        $stream = Stream::create();
        $psrResponse = new Response();

        $response = (new Helper())->toPsrResponse($result, $psrResponse, $stream);

        self::assertInstanceOf(ResponseInterface::class, $response);
        self::assertSame(json_encode($result), (string) $response->getBody());
        self::assertSame(['Content-Type' => ['application/json']], $response->getHeaders());
    }
}


text:
package mil.nga.giat.geowave.examples.ingest.bulk;

import java.io.IOException;
import java.util.List;

import mil.nga.giat.geowave.adapter.vector.FeatureDataAdapter;
import mil.nga.giat.geowave.core.geotime.GeometryUtils;
import mil.nga.giat.geowave.core.geotime.ingest.SpatialDimensionalityTypeProvider;
import mil.nga.giat.geowave.core.store.adapter.WritableDataAdapter;
import mil.nga.giat.geowave.core.store.data.VisibilityWriter;
import mil.nga.giat.geowave.core.store.data.visibility.UnconstrainedVisibilityHandler;
import mil.nga.giat.geowave.core.store.data.visibility.UniformVisibilityWriter;
import mil.nga.giat.geowave.core.store.index.PrimaryIndex;
import mil.nga.giat.geowave.datastore.accumulo.util.AccumuloKeyValuePair;
import mil.nga.giat.geowave.datastore.accumulo.util.AccumuloKeyValuePairGenerator;

import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.geotools.feature.simple.SimpleFeatureBuilder;
import org.opengis.feature.simple.SimpleFeature;

import com.vividsolutions.jts.geom.Coordinate;

public class SimpleFeatureToAccumuloKeyValueMapper extends
		Mapper<LongWritable, Text, Key, Value>
{

	private final WritableDataAdapter<SimpleFeature> adapter = new FeatureDataAdapter(
			GeonamesSimpleFeatureType.getInstance());
	private final PrimaryIndex index = new SpatialDimensionalityTypeProvider().createPrimaryIndex();
	private final VisibilityWriter<SimpleFeature> visibilityWriter = new UniformVisibilityWriter<SimpleFeature>(
			new UnconstrainedVisibilityHandler<SimpleFeature, Object>());
	private final AccumuloKeyValuePairGenerator<SimpleFeature> generator = new AccumuloKeyValuePairGenerator<SimpleFeature>(
			adapter,
			index,
			visibilityWriter);
	private SimpleFeature simpleFeature;
	private List<AccumuloKeyValuePair> keyValuePairs;
	private final SimpleFeatureBuilder builder = new SimpleFeatureBuilder(
			GeonamesSimpleFeatureType.getInstance());
	private String[] geonamesEntryTokens;
	private String geonameId;
	private double longitude;
	private double latitude;
	private String location;

	@Override
	protected void map(
			final LongWritable key,
			final Text value,
			final Context context )
			throws IOException,
			InterruptedException {

		simpleFeature = parseGeonamesValue(value);

		// build Geowave-formatted Accumulo [Key,Value] pairs
		keyValuePairs = generator.constructKeyValuePairs(
				adapter.getAdapterId().getBytes(),
				simpleFeature);

		// output each [Key,Value] pair to shuffle-and-sort phase where we rely
		// on MapReduce to sort by Key
		for (final AccumuloKeyValuePair accumuloKeyValuePair : keyValuePairs) {
			context.write(
					accumuloKeyValuePair.getKey(),
					accumuloKeyValuePair.getValue());
		}
	}

	private SimpleFeature parseGeonamesValue(
			final Text value ) {

		geonamesEntryTokens = value.toString().split(
				"\\t"); // Exported Geonames entries are tab-delimited

		geonameId = geonamesEntryTokens[0];
		location = geonamesEntryTokens[1];
		latitude = Double.parseDouble(geonamesEntryTokens[4]);
		longitude = Double.parseDouble(geonamesEntryTokens[5]);

		return buildSimpleFeature(
				geonameId,
				longitude,
				latitude,
				location);
	}

	private SimpleFeature buildSimpleFeature(
			final String featureId,
			final double longitude,
			final double latitude,
			final String location ) {

		builder.set(
				"geometry",
				GeometryUtils.GEOMETRY_FACTORY.createPoint(new Coordinate(
						longitude,
						latitude)));
		builder.set(
				"Latitude",
				latitude);
		builder.set(
				"Longitude",
				longitude);
		builder.set(
				"Location",
				location);

		return builder.buildFeature(featureId);
	}

}


text:
<?php

namespace Devhelp\DatatablesBundle\Tests\Fixtures\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity(repositoryClass="Devhelp\DatatablesBundle\Tests\Fixtures\Repository\TestRepository")
 *
 */
class Test
{

}


text:
package org.parboiled.matchers;

import org.parboiled.MatcherContext;
import org.parboiled.matchervisitors.MatcherVisitor;
import org.parboiled.support.Chars;

import static org.parboiled.common.Preconditions.checkArgNotNull;
import static org.parboiled.common.StringUtils.escape;

/**
 * A {@link Matcher} matching a single given character.
 */
public class CharMatcher extends AbstractMatcher {
    public final char character;

    public CharMatcher(char character) {
        super(getLabel(character));
        this.character = character;
    }

    private static String getLabel(char c) {
        switch (c) {
            case Chars.DEL_ERROR:
            case Chars.INS_ERROR:
            case Chars.RESYNC:
            case Chars.RESYNC_START:
            case Chars.RESYNC_END:
            case Chars.RESYNC_EOI:
            case Chars.INDENT:
            case Chars.DEDENT:
            case Chars.EOI:
                return escape(c);
            default:
                return '\'' + escape(c) + '\'';
        }
    }

    public boolean match(MatcherContext context) {
        if (context.getCurrentChar() != character) return false;
        context.advanceIndex(1);
        context.createNode();
        return true;
    }

    public <R> R accept(MatcherVisitor<R> visitor) {
        checkArgNotNull(visitor, "visitor");
        return visitor.visit(this);
    }

}


text:
"""
    l_system
"""
from __future__ import absolute_import, division, print_function
import logging

from OpenGL import GL

from mcedit2.rendering.scenegraph.vertex_array import VertexNode
from mcedit2.rendering.selection import SelectionBoxNode
from mcedit2.rendering.vertexarraybuffer import VertexArrayBuffer
from mcedit2.util import bresenham
from mceditlib.selection import BoundingBox

log = logging.getLogger(__name__)

"""
An L-system is a way of generating graphics and geometric structures through code. It is also
a way of thinking about algorithmic generation.

This is a very simple L-system that only renders a triangle with fixed coordinates:

    class Triangle(Symbol):
        def replace():
            p1 = (0, 0, 20)
            p2 = (10, 0, -10)
            p3 = (-10, 0, -10)
            return [Line(p1, p2, blocktype="stone"),
                    Line(p2, p3, blocktype="stone"),
                    Line(p3, p1, blocktype="stone")]

    initial_system = [Triangle()]
    # use initial_system in an LSystemPlugin, etc...

At the core, an L-system is made of one type of object, a Symbol, and two functions: a `replace`
function and a `render` function. The `replace` function's job is to add increasing amounts of
detail to the system by replacing a symbol with its components, and the `render` function is for
transforming the final result from a list of Symbols into a form suitable for rendering. In our
case, we have two kinds of `render` functions - one for producing OpenGL graphics to show on
screen, and one for producing Minecraft blocks to either show on screen or write to the world file.

An L-system as a whole is a simple list of Symbols. The initial state of the system is a list
containing a single Symbol (called the "axiom" in the literature). The system is evolved to the
next state by calling `replace` on each symbol in the list, and replacing it with the result of
the replace function. Thus, the system is evolved by calling `replace` repeatedly, over a given
number of iterations, or until no further symbols can be replaced.

A Symbol is an object that contains any number of parameters, and implements either the `replace`
function, the `render` function, or both.

The `replace` function returns a list of new Symbols to replace this symbol in the system's list.
Because Symbols are allowed to have parameters, the replace function can return different lists of
new Symbols depending on the current Symbol's parameters. If the Symbol does not implement replace,
it will remain in the system as-is during further iterations. *

The `renderBlocks` function returns a list of `setBlock` tuples: `(x, y, z, blockType)`.
(in the future, `renderBlocks` may be changed to take the currently edited world as an argument
so it can directly edit the world.) *

The `renderSceneNodes` function returns a list of `scenegraph.Node` objects to be rendered in an
OpenGL viewport. *

If a Symbol implements both `replace` and `render` functions, it is said to be recursive. This
means a system containing this symbol can be evolved for any number of iterations and will not
ever "halt" with a list of non-replaceable symbols.

To implement your own L-system, start by creating a Symbol subclass for your initial symbol.
Implement `replace` on this symbol to return a list of symbols that will replace this symbol
in the first iteration. You may create additional Symbol subclasses for the symbols that will
replace the initial symbol. Optionally, implement `renderBlocks` and possibly `renderSceneNodes` on
any symbols that can be rendered as the final output of the system.

For generating Minecraft objects, it is useful for each Symbol to represent a region of 3D space,
and for each `replace` function to subdivide this symbol into smaller regions represented by
other Symbols. A `Geometric` symbol class is provided for this purpose that acts as an
axis-aligned bounding box. `Geometric` also implements `renderSceneNodes` to help visualize the
evolution of a system.

A small collection of predefined symbols that implement both `render` functions are provided:
Line, Fill, (TODO: more symbols), and others. You can return these from your Symbol's `replace` to
render the final output of a system. These symbols usually have points or boxes as parameters, plus
a `blocktype` parameter. They can save you the trouble of implementing any `render` functions.

* `replace` and `render` may be implemented as generators using the `yield` statement instead of
directly returning a `list`.
"""

def applyReplacements(symbol_list):
    """
    Apply the rules associated with each symbol to the symbols in
     `symbol_list`. Symbols with no defined rule are returned as-is.

    The elements of `symbol_list` must be subclasses of Symbol.

    Returns a tuple of (`replaced`, `new_symbol_list`) where `replaced` is
    True if any symbols had triggered a replacement rule, and
    `new_symbol_list` is the new list after applying all replacement rules.
    If `replaced` is False, `new_symbol_list` should be identical to
    `symbol_list`

    :param symbol_list:
    :type symbol_list: list[Symbol]
    :return:
    :rtype: (bool, list[Symbol])
    """
    replaced = False
    new_list = []
    for symbol in symbol_list:
        if hasattr(symbol, 'replace'):
            replaced = True
            new_symbols = symbol.replace()
            new_list.extend(new_symbols)
        else:
            new_list.append(symbol)

    return replaced, new_list

def applyReplacementsIterated(symbol_list, repeats):
    """
    Repeatedly apply replacement rules to `symbol_list` up to `repeats` times or until no replacements are applied.

    This is a generator function. For each iteration, yields the iteration count and the intermediate list as a tuple.

    :param symbol_list:
    :type symbol_list: list[Symbol]
    :param repeats:
    :type repeats: int
    :return:
    :rtype: list[Symbol]
    """
    for i in range(repeats):
        replaced, symbol_list = applyReplacements(symbol_list)
        if not replaced:
            break

        yield i, symbol_list

def renderBlocks(symbol_list):
    rendering = []
    for symbol in symbol_list:
        rendering.extend(symbol.renderBlocks())

    return rendering

def renderSceneNodes(symbol_list):
    rendering = []
    for symbol in symbol_list:
        rendering.extend(symbol.renderSceneNodes())

    return rendering

class Symbol(object):
    def __init__(self, **kw):
        self.parameters = kw

    def __getattr__(self, key):
        return self.parameters[key]

    def renderBlocks(self):
        """
        Implement this function to render this symbol as a list of Minecraft block
        placement commands, in the form of (x, y, z, blockType) tuples. Return an empty
        list if there is nothing to render.

        In the future this will probably be extended to allow rendering Entities and TileEntities,
        although this may require passing in the level to render into in order to create item stacks
        with the correct id format.
        """

        return []

    def renderSceneNodes(self):
        """
        Implement this function to render this symbol as an OpenGL scene node. Typically only
        one Node is required. Return an empty list if there is nothing to render.
        """
        return []

    def __repr__(self):
        return "%s(%s)" % (self.__class__.__name__, self.parameters)

# --- Predefined symbols ---

class Geometric(Symbol, BoundingBox):
    """
    A symbol that can represent a region of 3D space as an axis-aligned
    bounding box.

    Inherits from mceditlib's BoundingBox and provides all derived
    properties such as center, volume, maximum, positions, the chunk
    coordinates [min,max][cx,cy,cz] and so on.

    Parameters:
    minx
    miny
    minz
    width
    height
    length
    """

    def __init__(self, box=None, **kw):
        Symbol.__init__(self, **kw)
        if box is None:
            origin = kw['minx'], kw['miny'], kw['minz']
            size = kw['width'], kw['height'], kw['length']
        else:
            origin = box.origin
            size = box.size

        BoundingBox.__init__(self, origin, size)

    def renderSceneNodes(self):
        node = SelectionBoxNode()  # xxx BoundingBoxNode
        node.selectionBox = self
        node.filled = False
        node.color = 1.0, 1.0, 1.0, 0.7

        return [node]

class Fill(Geometric):
    """
    Fills a 3D box with a chosen blocktype.

    Parameters:

    blocktype

    + parameters inherited from Geometric
    """

    def __init__(self, box=None, blocktype=None, **kw):
        super(Fill, self).__init__(box, **kw)
        if blocktype:
            self.parameters["blocktype"] = blocktype

    def renderBlocks(self):
        return [(x, y, z, self.blocktype) for x, y, z in self.positions]

class Line(Symbol):
    """
    Draws a line between the chosen points with a chosen blocktype.

    Parameters:

    blocktype: BlockType | str | int | (int, int)
    p1: Vector
    p2: Vector

    """

    def __init__(self, p1, p2, **kw):
        kw.setdefault("glColor", (255, 64, 64, 128))
        super(Line, self).__init__(**kw)
        self.p1 = p1
        self.p2 = p2

    def renderBlocks(self):
        for x, y, z in bresenham.bresenham(self.p1, self.p2):
            yield x, y, z, self.blocktype

    def renderSceneNodes(self):
        vertexArray = VertexArrayBuffer(2, GL.GL_LINES, False, False)
        vertexArray.vertex[:] = [self.p1, self.p2]
        vertexArray.vertex[:] += 0.5  # draw using box centers
        vertexArray.rgba[:] = self.glColor

        node = VertexNode([vertexArray])  # xxx LineNode

        return [node]

"""

From Wikipedia:
[An L-system or Lindenmayer system is a parallel rewriting system and
a type of formal grammar. An L-system consists of an alphabet of symbols
that can be used to make strings, a collection of production rules that
expand each symbol into some larger string of symbols, an initial
"axiom" string from which to begin construction, and a mechanism for
translating the generated strings into geometric structures.]

Briefly, an L-system allows you to start with a root symbol (the
"axiom"), and then define rules for replacing that symbol with a number
of sub-symbols. The rules may be applied repeatedly to add more
symbols and more depth to the symbol list. The final element list is then
translated into a form that can be displayed on-screen.

The Wiki page describes translating the symbols into Turtle Graphics commands
from LOGO. Other forms such as OpenGL rendering commands or 2D painting
commands from DirectDraw/QuickDraw/Cocoa2D are also possible, but typically
the replacement rules must be designed with the output in mind, such as
by using a parametric grammar as described further down the page.

The original use of L-systems was to model organic growth, by using a
set of replacement rules that results in symbols that can be replaced
further. The rules are typically applied for a fixed number of
iterations. For our purpose of modeling deliberate constructions it is
more useful to have non-recursive replacement rules that can be run
indefinitely because they will terminate when all of the elements have
no replacements available.

The resulting tree of elements is then rendered into geometric points.

This file defines a variant of the L-system meant for creating geometric
structures in 3D space. The alphabet of symbols is extended to include
"parametrized" symbols, where a single symbol can take many forms according
to parameters such as length, width, radius, etcetera. The production rules
are also extended to consider the parameters of a symbol when formulating its
replacements.

The final step of translating the symbols into geometric structures will
result in a list of coordinates and blocktypes, suitable for passing to
the `setBlock` function of a Minecraft world or world editor.

Alternately, the symbols can be rendered as OpenGL scene nodes instead of
Minecraft blocks. This is usually much faster and is suitable for returning
preview nodes from a Generate Tool plugin.

Several default symbols are available for primitives such as lines and blocks.
These provide both Minecraft block renderers and OpenGL scene node renderers.
The block renderers will use only a single block type. For primitives filled with
e.g. patterns of blocks, subclass them and override render()

It may be possible to add different rendering outputs such as SVG or HTML.
This is as simple as adding another render function to each symbol type, and
calling that function on each symbol in the list. (See the renderBlocks and
renderSceneNodes functions - they are really nothing more than `flatmap(f, symbol_list)`)
"""


text:
module Magento
  # http://www.magentocommerce.com/wiki/doc/webservices-api/api/catalog_product
  # 100  Requested store view not found.
  # 101  Product not exists.
  # 102  Invalid data given. Details in error message.
  # 103  Product not deleted. Details in error message.
  class Product < Base
    # catalog_product.list
    # Retrieve products list by filters
    #
    # Return: array
    #
    # Arguments:
    #
    # array filters - array of filters by attributes (optional)
    # mixed storeView - store view ID or code (optional)
    def list(*args)
      results = commit("list", *args)
      Array(results).map do |result|
        self.class.new(connection, result)
      end
    end

    # catalog_product.create
    # Create new product and return product id
    #
    # Return: int
    #
    # Arguments:
    #
    # string type - product type
    # int set - product attribute set ID
    # string sku - product SKU
    # array productData - array of attributes values
    def create(*args)
      id = commit("create", *args)
      record = info(id)
      record
    end

    # catalog_product.info
    # Retrieve product
    #
    # Return: array
    #
    # Arguments:
    #
    # mixed product - product ID or Sku
    # mixed storeView - store view ID or code (optional)
    # array attributes - list of attributes that will be loaded (optional)
    def info(*args)
      self.class.new(connection, commit("info", *args))
    end

    # catalog_product.update
    # Update product
    #
    # Return: boolean
    #
    # Arguments:
    #
    # mixed product - product ID or Sku
    # array productData - array of attributes values
    # mixed storeView - store view ID or code (optional)
    def update(*args)
      commit("update", *args)
    end

    # catalog_product.delete
    # Delete product
    #
    # Return: boolean
    #
    # Arguments:
    #
    # mixed product - product ID or Sku
    def delete(*args)
      commit("delete", *args)
    end

    # catalog_product.currentStore
    # Set/Get current store view
    #
    # Return: int
    #
    # Arguments:
    #
    # mixed storeView - store view ID or code (optional)
    def current_store(*args)
      commit("currentStore", *args)
    end

    def list_of_additional_attributes(*args)
      commit("listOfAdditionalAttributes", *args)
    end

    # catalog_product.setSpecialPrice
    # Update product special price
    #
    # Return: boolean
    #
    # Arguments:
    #
    # mixed product - product ID or Sku
    # float specialPrice - special price (optional)
    # string fromDate - from date (optional)
    # string toDate - to date (optional)
    # mixed storeView - store view ID or code (optional)
    def set_special_price(*args)
      commit('setSpecialPrice', *args)
    end

    # catalog_product.getSpecialPrice
    # Get product special price data
    #
    # Return: array
    #
    # Arguments:
    #
    # mixed product - product ID or Sku
    # mixed storeView - store view ID or code (optional)
    def get_special_price(*args)
      commit('getSpecialPrice', *args)
    end

    def find_by_id_or_sku(id)
      find_by_id(id)
    end

    def find_by_id(id)
      info(id)
    end

    def find(find_type, options = {})
      filters = {}
      options.each_pair { |k, v| filters[k] = {:eq => v} }
      results = list(filters)
      if find_type == :first
        results.first
      else
        results
      end
    end

    def all
      list
    end
  end
end


text:
using System;
using UIKit;
using Toggl.Ross.Views;

namespace Toggl.Ross.Theme
{
    public static partial class Style
    {
        public static class NavTimer
        {
            public static void DurationButton (UIButton v)
            {
                v.Font = UIFont.FromName ("HelveticaNeue-Thin", 32f);
                v.LineBreakMode = UILineBreakMode.Clip;
                v.SetTitleColor (Color.Black, UIControlState.Normal);
                v.SetTitleColor (Color.Gray, UIControlState.Highlighted);
            }

            public static void StartButton (UIButton v)
            {
                v.Font = UIFont.FromName ("HelveticaNeue", 16f);
                v.SetBackgroundImage (Image.CircleStart, UIControlState.Normal);
                v.SetBackgroundImage (Image.CircleStartPressed, UIControlState.Highlighted);
                v.SetTitleColor (Color.White, UIControlState.Normal);
                v.SetTitleColor (Color.White, UIControlState.Highlighted);
                v.SetTitle ("NavTimerStart".Tr (), UIControlState.Normal);
                // TODO: Remove this scale workaround
                v.Transform = CoreGraphics.CGAffineTransform.MakeScale (0.7f, 0.7f);
            }

            public static void StopButton (UIButton v)
            {
                v.Font = UIFont.FromName ("HelveticaNeue-Light", 16f);
                v.SetBackgroundImage (Image.CircleStop, UIControlState.Normal);
                v.SetBackgroundImage (Image.CircleStopPressed, UIControlState.Highlighted);
                v.SetTitleColor (Color.Red, UIControlState.Normal);
                v.SetTitleColor (Color.White, UIControlState.Highlighted);
                v.SetTitle ("NavTimerStop".Tr (), UIControlState.Normal);
                // TODO: Remove this scale workaround
                v.Transform = CoreGraphics.CGAffineTransform.MakeScale (0.7f, 0.7f);
            }
        }
    }
}


text:
/*
 * A File Manager singleton, manages source files
 *
 * @type FileManager
 */
var FileManager = new function() {
    this.folder = new Folder("Files");
    this.currentFile = null;
    this.currentFolder = this.folder;
    this.fileDisplays = [];
    this.editor = null;
    this.startFunc = "start();";

    /*
     * Add a file to the current folder
     *
     * @param {File} file   The file object to add
     * @returns {undefined}
     */
    this.addFile = function(file) {
        this.currentFolder.addFile(file);

        // Display the new file
        this.setCurrentFile(file);
        this.updateDisplay();
    };

    /*
     * Add a subfolder to the current folder
     *
     * @param {Folder} folder   The Folder object to add
     * @returns {undefined}
     */
    this.addFolder = function(folder) {
        this.currentFolder.addFolder(folder);

        // Open the new folder
        this.currentFolder = folder;
        this.currentFile = null;
        this.updateDisplay();
    };

    /*
     * Remove a file from the manager.  if no file is provided,
     * remove the currently selected file.
     *
     * @param {File} file   the File object to remove
     * @returns {undefined}
     */
    this.removeFile = function(file) {
        file = file || this.currentFile;

        // Remove the current file from its parent
        if (file) {
            file.parent.removeFile(file);

            // Empty the file editor
            this.currentFile = null;
        }

        this.updateDisplay();
    };

    /*
     * Remove a folder from the manager.  if no folder is provided,
     * remove the currently selected folder.
     *
     * @param {Folder} folder   the Folder object to remove
     * @returns {undefined}
     */
    this.removeFolder = function(folder) {
        folder = folder || this.currentFolder;

        // Remove the folder from its parent
        if (folder && folder !== this.folder) {
            folder.parent.removeFolder(folder);

            // open the parent folder
            this.currentFolder = folder.parent;
        }

        this.updateDisplay();
    };

    /*
     * Remove all files and folders from this project
     *
     * @returns {undefined}
     */
    this.empty = function() {
        this.rootFolder = new Folder("Files");
        this.folder = this.rootFolder;
        this.currentFolder = this.rootFolder;
        this.setCurrentFile(null);
    };

    /*
     * Make a file the currently selected file
     *
     * @param {File} file   the File object to select
     * @returns {undefined}
     */
    this.setCurrentFile = function(file) {
        this.currentFile = file;
    };

    /*
     * Make a folder the currently selected folder
     *
     * @param {Folder} folder   the Folder object to select
     * @returns {undefined}
     */
    this.setCurrentFolder = function(folder) {
        this.currentFolder = folder;
    };

    /*
     * Get a reference to the currently selected folder
     *
     * @returns {@var;folder.parent|@this;.currentFolder.parent|Folder}
     */
    this.getCurrentFolder = function() {
        return this.currentFolder;
    };

    /*
     * Set the function call to make to run the code.
     *
     * @param {String} func   the function call to make to run the code
     * @returns {undefined}
     */
    this.setStartFunction = function(func) {
        this.startFunc = func;
    };

    /*
     * Retrieve the function call to make in order to run the code.
     *
     * @returns {String}   the function call to make to run the code
     */
    this.getStartFunction = function() {
        return this.startFunc;
    };

    /*
     * Retrieve the current file
     *
     * @returns {FileManager.currentFile|File}
     */
    this.getFile = function() {
        return this.currentFile;
    };

    /*
     * Get the contents of a file based on its file name.
     *
     * @param {File} file   the file object to examine
     * @returns {String}
     */
    this.getFileContents = function(file) {
        return file.contents;
    };

    /*
     * Get the contents of all .js files concatenated together
     *
     * @returns {String}
     */
    this.getAllJSFileContents = function(folder) {
        let contents = "";

        let currFolder = folder || this.folder;

        for (let i = 0; i < currFolder.getNumFiles(); i++) {
            contents += currFolder.getFile(i).contents;
            contents += '\n';
        }

        for (let i = 0; i < currFolder.getNumFolders(); i++) {
            let folder = currFolder.getFolder(i);

            if ('Test' !== folder.getName()) {
                contents += this.getAllJSFileContents(currFolder.getFolder(i));
            }
        }

        return contents;
    };

    /*
     * Get a reference to the root folder
     */

    this.getRootFolder = function() {
        return this.folder;
    };

    /*
     * Get the test case folder
     *
     * @returns {Folder} the Test folder, or null
     */
    this.getTestFolder = function() {
        for (let i = 0; i < this.folder.getNumFolders(); i++) {
            let folder = this.folder.getFolder(i);
            if (folder.name === 'Test') {
                return folder;
            }
        }
        return null;
    };

    /*
     * Replace the contents of a file in the manager, if no file is
     * provided, updates the currently selected file
     */
    this.updateFile = function(contents, file) {
        file = file || this.currentFile;

        if (file !== null) {
            file.contents = contents;
            file.changed = true;
        }
    };

    /*
     * Rename a file in the file manager.  If no file is provided, rename the
     * current file.
     */
    this.renameFile = function(newName, file) {
        file = file || this.currentFile;

        if (file !== null) {
            file.name = newName;
        }

        this.updateDisplay();
    };

    /*
     * Rename a folder in the file manager.  If no folder is provided, rename the
     * current folder.
     */
    this.renameFolder = function(newName, folder) {
        folder = folder || this.currentFolder;

        if (folder !== null) {
            folder.name = newName;
        }

        this.updateDisplay();
    };

    /*
     * Add a DOM element which will hold a list of files in the manager
     */
    this.addFileDisplay = function(el) {
        this.fileDisplays.push($(el));

        this.updateDisplay();
    };

    /*
     * Set the editor that will display and edit the currently selected file
     */
    this.setEditor = function(ed) {
        this.editor = ed;
    };

    /*
     * Update the file list and the editor to display the names of all files and
     * folders in the manager, and the contents of the currently selected file,
     * respectively
     */
    this.updateDisplay = function() {
        // If an editor has been assigned, load the contents of the current file
        // into the editor.
        if (this.editor !== null) {
            if (this.currentFile !== null) {
                this.editor.setReadOnly(false);
                this.editor.setValue(this.currentFile.contents, 1);
            }
            else {
                this.editor.setValue("");
                this.editor.setReadOnly(true);
            }
        }

        // If a fileDisplay has been assigned, add a tree of folders and files
        // to the display
        this.fileDisplays.forEach(function(element){
            // Clear any contents of the parent element
            $(element).empty();

            // Create a list to hold the tree view
            var list = document.createElement('ul');
            $(list).addClass('list-root');
            $(element).append(list);

            // Add the root folder and its contents to the display
            FileManager.displayFolder(list, FileManager.folder);
        });
    };

    /*
     * Add the contents of a folder to a fileDisplay
     */
    this.displayFolder = function(element, folder) {
        // add a list item for this folder
        var folderEl = document.createElement("li");
        $(folderEl).addClass('folder');
        $(element).append(folderEl);

        // Add a span to contain the folder's name and icon
        var container = document.createElement('span');
        $(folderEl).append(container);

        // Add the folder icon
        var icon = document.createElement('span');
        $(icon).addClass('glyphicon');
        // If the folder is selected, show it as open, otherwise, show it as closed
        if (folder === FileManager.currentFolder) {
            $(icon).addClass('glyphicon-folder-open');
        }
        else {
            $(icon).addClass('glyphicon-folder-close');
        }

        $(container).append(icon);

        // Space between the folder icon and name
        $(container).append('  ');

        // Show the name of the folder
        var title = document.createElement("label");
        $(title).addClass('listfolder');
        $(title).text(folder.getName());
        $(container).append(title);

        // Add a click handler to open the folder if its name/icon are clicked
        $(container).click(function() {
            FileManager.setCurrentFolder(folder);
            FileManager.setCurrentFile(null);
            FileManager.updateDisplay();
        });

        // Add a list to contain the folder's contents
        var ul = document.createElement('ul');
        $(ul).addClass('nav')
             .addClass('nav-list')
             .addClass('tree');
        $(folderEl).append(ul);

        // If this folder is open, add any files to the list of this folder's
        //  contents
        if (FileManager.currentFolder === folder) {
            folder.files.forEach(function(file) {
                FileManager.displayFile(ul, file);
            });
        }
        // Add any subfolders to this folder's contents
        folder.folders.forEach(function(subfolder) {
            FileManager.displayFolder(ul, subfolder);
        });
    };

    // Add a file to a folder in the fileDisplay
    this.displayFile = function(element, file) {
        // Add a list item for the file
        var item = document.createElement('li');
        $(element).append(item);

        // Create a label to hold the filename
        var title = document.createElement('label');

        // Add an icon for the file
        var icon = document.createElement('span');
        $(icon).addClass('glyphicon');
        $(icon).addClass('glyphicon-file');

        $(title).append(icon);
        $(title).append(' ');

        // Add the filename
        $(title).append(file.name);
        $(title).addClass('listFile');

        // If the file is open, highlight its name
        if (file === FileManager.currentFile) {
            $(title).addClass('active');
        }
        $(item).append(title);

        // Add a click handler to open a file when its name or icon are clicked
        $(title).click(function() {
            $('.file-List').find('label').removeClass('active');
            FileManager.setCurrentFile(file);
            $(this).addClass('active');

            FileManager.updateDisplay();
        });
    };

    /*
     * Download all of the files from a Gist, chosen by id
     */
    this.loadFromGist = function(gist, errorhandler) {
        // Download the files from the gist asynchronously
        $.ajax({
            url: 'https://api.github.com/gists/' + gist,
            type: 'get',
            dataType: 'json',
            cache: true,
            success: handleGist,
            async: true,
            error: errorhandler
        });

        /*
         * When a gist is received
         */
        function handleGist(data) {
            // Get rid of any other files/folders
            FileManager.empty();

            // Extract each of the files in the gist
            Object.keys(data.files).map(function(key){
                var gistFile = new SourceFile(key, data.files[key].content);

                // add the file to the file manager
                FileManager.addFile(gistFile);
            });

            FileManager.updateDisplay();
        }
    };
};

/*
 * A simple class that will hold a single source file and its filename
 */
function SourceFile(name, content) {
    if (name) {
        this.name = name;
    }
    else {
        this.name = "";
    }
    if (content) {
        this.contents = content;
    }
    else {
        this.contents = "";
    }

    this.parent = null;
}

/*
 * A class that represents a folder full of files / a package
 */
function Folder(name, parent) {
    // Establish the name of this folder
    if (name) {
        this.name = name;
    }
    else {
        this.name = "New Folder";
    }

    // Link to the parent of this folder
    this.parent = null;
    if (parent) {
        this.parent = parent;
    }

    // Lists of file and subfolders contained in this folder
    this.files = [];
    this.folders = [];

    /*
     * Set the name of this folder
     */
    this.setName = function(newName) {
        this.name = newName;
    };

    /*
     * Retrieve the name of this folder
     */
    this.getName = function() {
        return this.name;
    };

    /*
     * Set this folder's parent folder
     */
    this.setParent = function(parent) {
        this.parent = parent;
    };

    /*
     * Get this folder's parent folder
     */
    this.getParent = function() {
        return this.parent;
    };

    /*
     * Add a file to this folder
     */
    this.addFile = function(file) {
        file.parent = this;
        this.files.push(file);

        // Sort the list of files
        this.files.sort(function(a,b){return (b.name<a.name) ? 1 : -1; });

        return file;
    };

    /*
     * Add a subfolder to this folder
     */
    this.addFolder = function(folder) {
        this.folders.push(folder);
        folder.parent = this;

        // Sort the list of folders
        this.folders.sort(function(a,b){return (b.name<a.name) ? 1 : -1; });

        return folder;
    };

    /*
     * Get the number of files stored in this folder
     */
    this.getNumFiles = function () {
        return this.files.length;
    };

    /*
     * Retrieve a file from the manager by its index
     */
    this.getFile = function(num) {
        if (num === undefined | num === null) {
            return this.currentFile;
        }
        return this.files[num];
    };

    /*
     * Retrieve the number of subfolders in this folder
     */
    this.getNumFolders = function() {
        return this.folders.length;
    };

    /*
     * retrieve a subfolder based on its index
     */
    this.getFolder = function(num) {
        return this.folders[num];
    };

    /*
     * Retrieve a reference to a subfolder by name
     */
    this.findFolder = function(folderName) {
        var found = null;
        this.folders.forEach(function(folder){
            if (folder.getName() === folderName) {
                found = folder;
                return;
            }
        });
        return found;
    };

    /*
     * Remove the current file
     */
    this.removeFile = function(file) {
        var parent = file.parent;

        if (parent !== null) {
            for (var i = 0; i < parent.files.length; i++) {
                if (parent.files[i] === file) {
                    parent.files.splice(i, 1);
                    break;
                }
            }
        }
    };

    /*
     * Remove the current folder
     */
    this.removeFolder = function(folder) {
        var parent = folder.parent;

        if (parent !== null) {
            for (var i = 0; i < parent.folders.length; i++) {
                if (parent.folders[i] === folder) {
                    parent.folders.splice(i, 1);
                    break;
                }
            }
        }
    };

    /*
     * remove all files and sub folders from this folder
     */
    this.empty = function() {
        this.files = [];
        this.folders = [];
    };
}


text:
namespace OpenProtocolInterpreter.MultiSpindle
{
    /// <summary>
    /// Represents a Spindle Status entity
    /// </summary>
    public class SpindleStatus
    {
        public int SpindleNumber { get; set; }
        public int ChannelId { get; set; }
        public bool SyncOverallStatus { get; set; }
    }
}


text:
const mongoose = require('mongoose');
const mongoosePaginate = require('mongoose-paginate-v2');
const idPlugin = require('mongoose-id');

const launchpadSchema = new mongoose.Schema({
  name: {
    type: String,
    default: null,
  },
  full_name: {
    type: String,
    default: null,
  },
  status: {
    type: String,
    enum: ['active', 'inactive', 'unknown', 'retired', 'lost', 'under construction'],
    required: true,
  },
  locality: {
    type: String,
    default: null,
  },
  region: {
    type: String,
    default: null,
  },
  timezone: {
    type: String,
    default: null,
  },
  latitude: {
    type: Number,
    default: null,
  },
  longitude: {
    type: Number,
    default: null,
  },
  launch_attempts: {
    type: Number,
    default: 0,
  },
  launch_successes: {
    type: Number,
    default: 0,
  },
  rockets: [{
    type: mongoose.ObjectId,
    ref: 'Rocket',
  }],
  launches: [{
    type: mongoose.ObjectId,
    ref: 'Launch',
  }],
  details: {
    type: String,
    default: null,
  },
}, { autoCreate: true });

launchpadSchema.plugin(mongoosePaginate);
launchpadSchema.plugin(idPlugin);

const Launchpad = mongoose.model('Launchpad', launchpadSchema);

module.exports = Launchpad;


text:
from django.core.management.base import CommandError, BaseCommand

from devilry.apps.core.models import Subject, Period
from devilry.devilry_account.models import PermissionGroup

class Command(BaseCommand):
    help = 'Clear period admins (removes the syncsystem permission group ' \
           'for the period).'

    def add_arguments(self, parser):
        parser.add_argument(
            'subject_short_name',
            help='Short name of the subject that contains the period you '
                 'wish to add an admin to.')
        parser.add_argument(
            'period_short_name',
            help='Short name of the period you wish to add an admin to.')

    def handle(self, *args, **options):
        subject_short_name = options['subject_short_name']
        period_short_name = options['period_short_name']

        try:
            subject = Subject.objects.get(short_name=subject_short_name)
        except Subject.DoesNotExist:
            raise CommandError('Invalid subject_short_name.')

        try:
            period = Period.objects.get(short_name=period_short_name, parentnode=subject)
        except Period.DoesNotExist:
            raise CommandError('Invalid period_short_name.')
        try:
            permissiongroup = PermissionGroup.objects.get_syncsystem_permissiongroup(
                grouptype=PermissionGroup.GROUPTYPE_PERIODADMIN,
                basenode=period)
        except PermissionGroup.DoesNotExist:
            self.stdout.write('WARNING: No sync-system permission group exists '
                              'for this period, so there is no admins to clear.')
            return
        else:
            permissiongroup.delete()


text:
  #include "../x86/x86internal_p.h"
  #include "../x86/x86instdb_p.h"
#endif // ASMJIT_BUILD_X86

#ifdef ASMJIT_BUILD_ARM
  #include "../arm/arminternal_p.h"
  #include "../arm/arminstdb.h"
#endif // ASMJIT_BUILD_ARM

ASMJIT_BEGIN_NAMESPACE

// ============================================================================
// [asmjit::BaseEmitter - Construction / Destruction]
// ============================================================================

BaseEmitter::BaseEmitter(uint32_t emitterType) noexcept
  : _emitterType(uint8_t(emitterType)),
    _emitterFlags(0),
    _validationFlags(0),
    _validationOptions(0),
    _encodingOptions(0),
    _forcedInstOptions(BaseInst::kOptionReserved),
    _privateData(0),
    _code(nullptr),
    _logger(nullptr),
    _errorHandler(nullptr),
    _environment(),
    _gpRegInfo(),
    _instOptions(0),
    _extraReg(),
    _inlineComment(nullptr) {}

BaseEmitter::~BaseEmitter() noexcept {
  if (_code) {
    _addEmitterFlags(kFlagDestroyed);
    _code->detach(this);
  }
}

// ============================================================================
// [asmjit::BaseEmitter - Finalize]
// ============================================================================

Error BaseEmitter::finalize() {
  // Does nothing by default, overridden by `BaseBuilder` and `BaseCompiler`.
  return kErrorOk;
}

// ============================================================================
// [asmjit::BaseEmitter - Internals]
// ============================================================================

static constexpr uint32_t kEmitterPreservedFlags =
    BaseEmitter::kFlagOwnLogger |
    BaseEmitter::kFlagOwnErrorHandler ;

static ASMJIT_NOINLINE void BaseEmitter_updateForcedOptions(BaseEmitter* self) noexcept {
  bool hasLogger = self->_logger != nullptr;
  bool hasValidationOptions;

  if (self->emitterType() == BaseEmitter::kTypeAssembler)
    hasValidationOptions = self->hasValidationOption(BaseEmitter::kValidationOptionAssembler);
  else
    hasValidationOptions = self->hasValidationOption(BaseEmitter::kValidationOptionIntermediate);

  self->_forcedInstOptions &= ~BaseInst::kOptionReserved;
  if (hasLogger || hasValidationOptions)
    self->_forcedInstOptions |= BaseInst::kOptionReserved;
}

// ============================================================================
// [asmjit::BaseEmitter - Validation Options]
// ============================================================================

void BaseEmitter::addValidationOptions(uint32_t options) noexcept {
  _validationOptions = uint8_t(_validationOptions | options);
  BaseEmitter_updateForcedOptions(this);
}

void BaseEmitter::clearValidationOptions(uint32_t options) noexcept {
  _validationOptions = uint8_t(_validationOptions | options);
  BaseEmitter_updateForcedOptions(this);
}

// ============================================================================
// [asmjit::BaseEmitter - Logging]
// ============================================================================

void BaseEmitter::setLogger(Logger* logger) noexcept {
#ifndef ASMJIT_NO_LOGGING
  if (logger) {
    _logger = logger;
    _addEmitterFlags(kFlagOwnLogger);
  }
  else {
    _logger = nullptr;
    _clearEmitterFlags(kFlagOwnLogger);
    if (_code)
      _logger = _code->logger();
  }
  BaseEmitter_updateForcedOptions(this);
#else
  DebugUtils::unused(logger);
#endif
}

// ============================================================================
// [asmjit::BaseEmitter - Error Handling]
// ============================================================================

void BaseEmitter::setErrorHandler(ErrorHandler* errorHandler) noexcept {
  if (errorHandler) {
    _errorHandler = errorHandler;
    _addEmitterFlags(kFlagOwnErrorHandler);
  }
  else {
    _errorHandler = nullptr;
    _clearEmitterFlags(kFlagOwnErrorHandler);
    if (_code)
      _errorHandler = _code->errorHandler();
  }
}

Error BaseEmitter::reportError(Error err, const char* message) {
  ErrorHandler* eh = _errorHandler;
  if (eh) {
    if (!message)
      message = DebugUtils::errorAsString(err);
    eh->handleError(err, message, this);
  }
  return err;
}

// ============================================================================
// [asmjit::BaseEmitter - Labels]
// ============================================================================

Label BaseEmitter::labelByName(const char* name, size_t nameSize, uint32_t parentId) noexcept {
  return Label(_code ? _code->labelIdByName(name, nameSize, parentId) : uint32_t(Globals::kInvalidId));
}

bool BaseEmitter::isLabelValid(uint32_t labelId) const noexcept {
  return _code && labelId < _code->labelCount();
}

// ============================================================================
// [asmjit::BaseEmitter - Emit (Low-Level)]
// ============================================================================

using EmitterUtils::noExt;

Error BaseEmitter::_emitI(uint32_t instId) {
  return _emit(instId, noExt[0], noExt[1], noExt[2], noExt);
}

Error BaseEmitter::_emitI(uint32_t instId, const Operand_& o0) {
  return _emit(instId, o0, noExt[1], noExt[2], noExt);
}

Error BaseEmitter::_emitI(uint32_t instId, const Operand_& o0, const Operand_& o1) {
  return _emit(instId, o0, o1, noExt[2], noExt);
}

Error BaseEmitter::_emitI(uint32_t instId, const Operand_& o0, const Operand_& o1, const Operand_& o2) {
  return _emit(instId, o0, o1, o2, noExt);
}

Error BaseEmitter::_emitI(uint32_t instId, const Operand_& o0, const Operand_& o1, const Operand_& o2, const Operand_& o3) {
  Operand_ opExt[3] = { o3 };
  return _emit(instId, o0, o1, o2, opExt);
}

Error BaseEmitter::_emitI(uint32_t instId, const Operand_& o0, const Operand_& o1, const Operand_& o2, const Operand_& o3, const Operand_& o4) {
  Operand_ opExt[3] = { o3, o4 };
  return _emit(instId, o0, o1, o2, opExt);
}

Error BaseEmitter::_emitI(uint32_t instId, const Operand_& o0, const Operand_& o1, const Operand_& o2, const Operand_& o3, const Operand_& o4, const Operand_& o5) {
  Operand_ opExt[3] = { o3, o4, o5 };
  return _emit(instId, o0, o1, o2, opExt);
}

Error BaseEmitter::_emitOpArray(uint32_t instId, const Operand_* operands, size_t opCount) {
  const Operand_* op = operands;

  Operand_ opExt[3];

  switch (opCount) {
    case 0:
      return _emit(instId, noExt[0], noExt[1], noExt[2], noExt);

    case 1:
      return _emit(instId, op[0], noExt[1], noExt[2], noExt);

    case 2:
      return _emit(instId, op[0], op[1], noExt[2], noExt);

    case 3:
      return _emit(instId, op[0], op[1], op[2], noExt);

    case 4:
      opExt[0] = op[3];
      opExt[1].reset();
      opExt[2].reset();
      return _emit(instId, op[0], op[1], op[2], opExt);

    case 5:
      opExt[0] = op[3];
      opExt[1] = op[4];
      opExt[2].reset();
      return _emit(instId, op[0], op[1], op[2], opExt);

    case 6:
      return _emit(instId, op[0], op[1], op[2], op + 3);

    default:
      return DebugUtils::errored(kErrorInvalidArgument);
  }
}

// ============================================================================
// [asmjit::BaseEmitter - Emit (High-Level)]
// ============================================================================

ASMJIT_FAVOR_SIZE Error BaseEmitter::emitProlog(const FuncFrame& frame) {
  if (ASMJIT_UNLIKELY(!_code))
    return DebugUtils::errored(kErrorNotInitialized);

#ifdef ASMJIT_BUILD_X86
  if (environment().isFamilyX86())
    return x86::X86Internal::emitProlog(as<x86::Emitter>(), frame);
#endif

#ifdef ASMJIT_BUILD_ARM
  if (environment().isFamilyARM())
    return arm::ArmInternal::emitProlog(as<arm::Emitter>(), frame);
#endif

  return DebugUtils::errored(kErrorInvalidArch);
}

ASMJIT_FAVOR_SIZE Error BaseEmitter::emitEpilog(const FuncFrame& frame) {
  if (ASMJIT_UNLIKELY(!_code))
    return DebugUtils::errored(kErrorNotInitialized);

#ifdef ASMJIT_BUILD_X86
  if (environment().isFamilyX86())
    return x86::X86Internal::emitEpilog(as<x86::Emitter>(), frame);
#endif

#ifdef ASMJIT_BUILD_ARM
  if (environment().isFamilyARM())
    return arm::ArmInternal::emitEpilog(as<arm::Emitter>(), frame);
#endif

  return DebugUtils::errored(kErrorInvalidArch);
}

ASMJIT_FAVOR_SIZE Error BaseEmitter::emitArgsAssignment(const FuncFrame& frame, const FuncArgsAssignment& args) {
  if (ASMJIT_UNLIKELY(!_code))
    return DebugUtils::errored(kErrorNotInitialized);

#ifdef ASMJIT_BUILD_X86
  if (environment().isFamilyX86())
    return x86::X86Internal::emitArgsAssignment(as<x86::Emitter>(), frame, args);
#endif

#ifdef ASMJIT_BUILD_ARM
  if (environment().isFamilyARM())
    return arm::ArmInternal::emitArgsAssignment(as<arm::Emitter>(), frame, args);
#endif

  return DebugUtils::errored(kErrorInvalidArch);
}

// ============================================================================
// [asmjit::BaseEmitter - Comment]
// ============================================================================

Error BaseEmitter::commentf(const char* fmt, ...) {
  if (ASMJIT_UNLIKELY(!_code))
    return DebugUtils::errored(kErrorNotInitialized);

#ifndef ASMJIT_NO_LOGGING
  va_list ap;
  va_start(ap, fmt);
  Error err = commentv(fmt, ap);
  va_end(ap);
  return err;
#else
  DebugUtils::unused(fmt);
  return kErrorOk;
#endif
}

Error BaseEmitter::commentv(const char* fmt, va_list ap) {
  if (ASMJIT_UNLIKELY(!_code))
    return DebugUtils::errored(kErrorNotInitialized);

#ifndef ASMJIT_NO_LOGGING
  StringTmp<1024> sb;
  Error err = sb.appendVFormat(fmt, ap);

  if (ASMJIT_UNLIKELY(err))
    return err;

  return comment(sb.data(), sb.size());
#else
  DebugUtils::unused(fmt, ap);
  return kErrorOk;
#endif
}

// ============================================================================
// [asmjit::BaseEmitter - Events]
// ============================================================================

Error BaseEmitter::onAttach(CodeHolder* code) noexcept {
  _code = code;
  _environment = code->environment();

  onSettingsUpdated();
  return kErrorOk;
}

Error BaseEmitter::onDetach(CodeHolder* code) noexcept {
  DebugUtils::unused(code);

  _clearEmitterFlags(~kEmitterPreservedFlags);
  _forcedInstOptions = BaseInst::kOptionReserved;
  _privateData = 0;

  if (!hasOwnLogger())
    _logger = nullptr;

  if (!hasOwnErrorHandler())
    _errorHandler = nullptr;

  _environment.reset();
  _gpRegInfo.reset();

  _instOptions = 0;
  _extraReg.reset();
  _inlineComment = nullptr;

  return kErrorOk;
}

void BaseEmitter::onSettingsUpdated() noexcept {
  // Only called when attached to CodeHolder by CodeHolder.
  ASMJIT_ASSERT(_code != nullptr);

  if (!hasOwnLogger())
    _logger = _code->logger();

  if (!hasOwnErrorHandler())
    _errorHandler = _code->errorHandler();

  BaseEmitter_updateForcedOptions(this);
}

ASMJIT_END_NAMESPACE


text:
<?php

namespace Eva\EvaOAuth\Exception;

/**
 * Class VerifyException
 * @package Eva\EvaOAuth\Exception
 */
class VerifyException extends \InvalidArgumentException implements ExceptionInterface
{
}


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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>21</version>
    <relativePath />
  </parent>

  <groupId>org.apache.drat</groupId>
  <artifactId>dms</artifactId>
  <name>Apache DRAT</name>
  <packaging>pom</packaging>
  <description>The Apache Distributed Release Auditing Tool (DRAT).</description>
  <version>1.1-SNAPSHOT</version>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <oodt.version>1.9</oodt.version>
    <junit.version>4.12</junit.version>
  </properties>

  <repositories>
    <repository>
      <id>maven2</id>
      <name>Java Sun Maven2 Repository</name>
      <url>https://download.java.net/maven/2</url>
      <layout>default</layout>
    </repository>
    <repository>
      <id>apache.snapshots</id>
      <name>Apache Snapshots</name>
      <url>https://repository.apache.org/snapshots/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
    </repository>
  </repositories>

  <build>
    <defaultGoal>clean install</defaultGoal>
    <sourceDirectory>${basedir}/src/main/java</sourceDirectory>
    <testSourceDirectory>${basedir}/src/test</testSourceDirectory>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <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>
            <index>true</index>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.6</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.17</version>
        <configuration>
          <includes>
            <include>**/*Test*.java</include>
          </includes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9</version>
        <configuration>
          <outputEncoding>UTF-8</outputEncoding>
          <charset>UTF-8</charset>
          <docencoding>UTF-8</docencoding>
          <encoding>UTF-8</encoding>
	  <source>8</source>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <phase>package</phase>
            <goals>
              <goal>javadoc</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <modules>
    <module>rat</module>
    <module>extensions</module>
    <module>resmgr</module>
    <module>pcs</module>
    <module>filemgr</module>
    <module>workflow</module>
    <module>crawler</module>
    <module>pge</module>
    <module>solr</module>
    <module>webapps</module>
    <module>proteus</module>
    <module>distribution</module>
  </modules>

  <scm>
    <connection>scm:git:git@github.com:apache/drat.git</connection>
    <developerConnection>scm:git:git@github.com:apache/drat.git</developerConnection>
    <url>http://github.com/apache/drat</url>
    <tag>HEAD</tag>
  </scm>

</project>


text:
package pl.touk.nussknacker.engine.deployment

import io.circe.generic.extras.semiauto.{deriveUnwrappedDecoder, deriveUnwrappedEncoder}
import io.circe.{Decoder, Encoder}

//id generated by Nussknacker - vide ExternalDeploymentId for id generated by e.g. Flink
final case class DeploymentId(value: String) extends AnyVal

object DeploymentId {
  implicit val encoder: Encoder[DeploymentId] = deriveUnwrappedEncoder
  implicit val decoder: Decoder[DeploymentId] = deriveUnwrappedDecoder
}


text:
namespace cppgc {
namespace internal {

class V8_EXPORT_PRIVATE LivenessBrokerFactory {
 public:
  static LivenessBroker Create();
};

}  // namespace internal
}  // namespace cppgc

#endif  // V8_HEAP_CPPGC_LIVENESS_BROKER_H_