text:
<?php

// Set the path of Bootstrap to be the root of the project.
//Yii::setPathOfAlias('bootstrap', realpath(dirname(__FILE__).'/../../../'));

$config = array(
	'basePath'=>realpath(dirname(__FILE__).'/..'),
	'name'=>'Lixen Application',

	'preload'=>array(
		'bootstrap',
		'log',
	),

	'import'=>array(
		'application.models.*',
		'application.components.*',
        	'application.modules.user.models.*',
        	'application.modules.user.components.*',
	),

	'modules'=>array(
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'pass',
			'ipFilters'=>false,
			'generatorPaths'=>array('bootstrap.gii'),
		),
            'user'=>array(
                # encrypting method (php hash function)
                'hash' => 'md5',
                # send activation email
                'sendActivationMail' => true,
                # allow access for non-activated users
                'loginNotActiv' => false,
                # activate user on registration (only sendActivationMail = false)
                'activeAfterRegister' => false,
                # automatically login from registration
                'autoLogin' => true,
                # registration path
                'registrationUrl' => array('/user/registration'),
                # recovery password path
                'recoveryUrl' => array('/user/recovery'),
                # login form path
                'loginUrl' => array('/user/login'),
                # page after login
                'returnUrl' => array('/user/profile'),
                # page after logout
                'returnLogoutUrl' => array('/user/login'),
            ),

	),

	'components'=>array(
		'bootstrap'=>array(
			'class'=>'ext.bootstrap.components.Bootstrap',
			'responsiveCss'=>true,
		),
        	'user'=>array(
            	// enable cookie-based authentication
            		'class' => 'WebUser',
            		'allowAutoLogin'=>true,
            		'loginUrl' => array('/user/login'),
        	),
		'db'=>array(
			'connectionString' => 'pgsql:host=localhost;dbname=lixen',
			'emulatePrepare' => true,
			'username' => 'admin',
			'password' => '',
			'charset' => 'utf8',
			'tablePrefix' => 'tbl_',
		),
		'errorHandler'=>array(
			'errorAction'=>'site/error',
		),
		'fb'=>array(
			'class'=>'ext.facebook.components.FacebookConnect',
			'appID'=>'106265262835735',
			'appNamespace'=>'yii-bootstrap',
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
			),
		),
		'urlManager'=>array(
			'showScriptName'=>false,
			'urlFormat'=>'path',
			'urlSuffix'=>'.html',
			'rules'=>array(
				'index'=>'site/index',
				'setup'=>'site/setup',
			),
		),
	),

	// Application-level parameters
	'params'=>array(
		'appTitle'=>'Yii-Bootstrap - Bringing together the Yii PHP framework and Twitter\'s Bootstrap',
		'appDescription'=>'Yii-Bootstrap is an extension for Yii that provides a wide range of server-side widgets that allow you to easily use Bootstrap with Yii.',
	),
);

return file_exists(dirname(__FILE__).'/local.php')
		? CMap::mergeArray($config, require('local.php'))
		: $config;


text:
<?php
/* @var $this AppellationsController */
/* @var $model Appellations */
/* @var $form CActiveForm */
?>

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'appellations-form',
        'focus'=>'input[type="text"]:first',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

Fields with * are required.

    <?php echo $form->errorSummary($model); ?>

        <?php echo $form->labelEx($model,'country'); ?>
        <?php echo $form->textField($model,'country',array('size'=>45,'maxlength'=>45)); ?>
        <?php echo $form->error($model,'country'); ?>

        <?php
            echo $form->labelEx($model,'region_id');
            $region_list = CHtml::listData(Regions::model()->findAll(array('order'=>'country ASC, region_name ASC')), 'id', 'countryRegion');
            echo $form->dropDownList($model, 'id', $region_list, array('empty'=>'(Select an Region)'));
            echo $form->error($model,'region_id');
        ?>

        <?php echo $form->labelEx($model,'appellation'); ?>
        <?php echo $form->textField($model,'appellation',array('size'=>45,'maxlength'=>45)); ?>
        <?php echo $form->error($model,'appellation'); ?>

        <?php echo $form->labelEx($model,'common_flg'); ?>
        <?php echo $form->textField($model,'common_flg',array('size'=>1,'maxlength'=>1)); ?>
        <?php echo $form->error($model,'common_flg'); ?>

        <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>

<?php $this->endWidget(); ?>

redpajama_set_name: RedPajamaGithub


text:
Plotter class
#############

.. automodule:: pymeasure.display.plotter
    :members:
    :show-inheritance:


text:
class CreateFoods < ActiveRecord::Migration
  def self.up
    create_table :foods do |t|
      t.string :name
      t.string :notes

      t.timestamps
    end
  end

  def self.down
    drop_table :foods
  end
end


text:
@implementation MTZPerspectiveView

#pragma mark - Initialization

- (instancetype)initWithFrame:(CGRect)frame
{
	self = [super initWithFrame:frame];
	if ( self ) {
		[self __MTZPerspectiveView_setUp];
	}
	return self;
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super initWithCoder:aDecoder];
	if ( self ) {
		[self __MTZPerspectiveView_setUp];
	}
	return self;
}

- (instancetype)init
{
	self = [super init];
	if ( self ) {
		[self __MTZPerspectiveView_setUp];
	}
	return self;
}

- (void)__MTZPerspectiveView_setUp
{
	// Default perspective type
	[self setPerspectiveType:MTZPerspectiveTypeDefault];
}

CATransform3D makeSkew(CGFloat x, CGFloat y)
{
	CATransform3D transform = CATransform3DIdentity;
	transform.m34 = 1.0f / 2000;
	return CATransform3DRotate(transform, 60.0f * M_PI / 180.0f, x, y, 0);
}

- (void)setPerspectiveType:(MTZPerspectiveViewType)perspectiveType
{
	_perspectiveType = perspectiveType;

	// Clear out motion effects.
	self.motionEffects = nil;

	// Determine multiplier, or exit early.
	int multiplier = 0;
	if ( _perspectiveType == MTZPerspectiveTypeUser )  {
#ifdef SHOULD_RASTERIZE
		self.layer.shouldRasterize = YES;
#endif
		multiplier = -1;
	} else if ( _perspectiveType == MTZPerspectiveTypeDevice ) {
#ifdef SHOULD_RASTERIZE
		self.layer.shouldRasterize = YES;
#endif
		multiplier = 1;
	} else {
#ifdef SHOULD_RASTERIZE
		self.layer.shouldRasterize = NO;
#endif
		return;
	}

	// Horizontal motion
	UIInterpolatingMotionEffect *horizontal = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"layer.transform" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];
	horizontal.minimumRelativeValue = [NSValue valueWithCATransform3D:makeSkew(0,  1 * multiplier)];
	horizontal.maximumRelativeValue = [NSValue valueWithCATransform3D:makeSkew(0, -1 * multiplier)];
	[self addMotionEffect:horizontal];

	// Vertical motion
	UIInterpolatingMotionEffect *vertical = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"layer.transform" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];
	vertical.minimumRelativeValue = [NSValue valueWithCATransform3D:makeSkew(-1 * multiplier, 0)];
	vertical.maximumRelativeValue = [NSValue valueWithCATransform3D:makeSkew( 1 * multiplier, 0)];
	[self addMotionEffect:vertical];
}

@end


text:
tizen-sdk-query
===============

[![Build Status](https://travis-ci.org/kalyazin/tizen-sdk-query.svg?branch=master)](https://travis-ci.org/kalyazin/tizen-sdk-query)

Utilities for querying Tizen SDK packages
- tsq belongs  - list what package file belongs to
- tsq depends  - show depending packages
- tsq info     - show package information
- tsq depgraph - show package's install dependencies
- tsq files    - list all files installed by package
- tsq pkglist  - list all packages
- tsq grep     - grep filename in packages
- tsq tree     - show package dependency tree

You need to have [Tizen SDK 2.2.1](https://developer.tizen.org/downloads/tizen-sdk) installed to use the utilities.
For test run use FAKE_SDK env variable pointing to ./tests/fixtures.


text:
import lejos.nxt.*;
import lejos.util.Timer;
import lejos.util.TimerListener;

public class LCDInfo implements TimerListener {
	private static final int LCD_REFRESH = 100;
	private Odometer odo;
	private Timer lcdTimer;

	public LCDInfo(Odometer odo) {
		this.odo = odo;
		this.lcdTimer = new Timer(LCD_REFRESH, this);
		// start the timer
		lcdTimer.start();
	}

	public void timedOut() {
		Odometer.Position pos = odo.getPosition();
		LCD.clear();
		LCD.drawString("X: " + (float) pos.x, 0, 0);
		LCD.drawString("Y: " + (float) pos.y, 0, 1);
		LCD.drawString("H: " + (int) Math.toDegrees(pos.theta), 0, 2);
		// Allow for exit anytime in case of a problem
		if (Button.ESCAPE.isDown()) {
			System.exit(0);
		}
	}
}


text:
@(field: Field, args: (Symbol,Any)*)(implicit handler: b3.B3FieldConstructor, messages: Messages)
@b3.inputWrapped("text", field, args:_*) { input =>

		@input

}


text:
/**
 * @fileoverview Configuration applied when a user configuration extends from
 * eslint:recommended.
 * @author Nicholas C. Zakas
 */

"use strict";

const builtInRules = require("../lib/built-in-rules-index");

module.exports = {
    rules: Object.assign({}, ...Object.keys(builtInRules).map(ruleId => ({
        [ruleId]: builtInRules[ruleId].meta.docs.recommended ? "error" : "off"
    })))
};


text:
layout: feature
title: 'VerbForm'
shortdef: 'form of verb or deverbative'
udver: '2'
---

  Values:
  Conv
  Vnoun

Even though the name of the feature seems to suggest that it is used
exclusively with [verbs](u-pos/VERB), it is not the case (see converb).

### `Conv`: converb

In Beja, converbs are formed using an affix on the verbal stem.
We add the VerbForm feature on the affix tag [SCONJ](pos/SCONJ).

#### Examples
- _ʃʔag -aː_ "carry on shoulder"

### `Vnoun`: verbal noun

Verbal nouns other than infinitives. Also formed using an affix on the verbal stem.
We add the VerbForm feature on the affix tag [SCONJ](pos/SCONJ).

#### Examples
- _tʔi -it_ " "


text:
var ContactUsService = function() {

    this.initialize = function() {
        // No Initialization required
        var deferred = $.Deferred();

        if(typeof url == "undefined") {
          this.url = "http://whatsmywage.org/api/v1";
        } else {
          this.url = url;
        }

        deferred.resolve();
        return deferred.promise();
    }

    this.submitContactUs = function(contactInfo) {
      var deferred = $.Deferred();

      $.ajax(this.url + "/contact_us", {
        method: "POST",
        contentType: "application/json; charset=utf-8",
        data: JSON.stringify(contactInfo),
        dataType: "json",
        processData: false,
        success: function(data) {
          deferred.resolve();
        },
        error: function(reply, status, errorThrown) {
          deferred.reject(reply, status, errorThrown)
        }
      });

      return deferred.promise();
    }
}


text:
exe = '"../../Release/FeatureExtraction.exe"';

output = './output_features_vid/';

if(~exist(output, 'file'))
    mkdir(output)
end

in_files = dir('../../videos/2015-10-15-15-14.avi');
% some parameters
verbose = true;

command = exe;
% Remove for a speedup
command = cat(2, command, ' -verbose ');

% add all videos to single argument list (so as not to load the model anew
% for every video)
for i=1:numel(in_files)

    inputFile = ['../../videos/', in_files(i).name];
    [~, name, ~] = fileparts(inputFile);

    % where to output tracking results
    outputFile_gaze = [output name '_gaze.txt'];

    if(~exist([output name], 'file'))
        mkdir([output name]);
    end

    command = cat(2, command, ['-fx 700 -fy 700 -f "' inputFile '" -ogaze "' outputFile_gaze '"']);

end

dos(command);

%% Demonstrating reading the output files
filename = [output name];

% Read gaze (x,y,z) for one eye and (x,y,z) for another
gaze  = dlmread([filename, '_gaze.txt'], ',', 1, 0);

% This indicates which frames were succesfully tracked
valid_frames = gaze(:,4);

% only picking left, right and up down views for visualisation
gaze = gaze(:,[5,6,7,8,9,10]);
gaze = (gaze(:,[1,2,3]) + gaze(:,[4,5,6]))/2;
gaze(:,1) = smooth(gaze(:,1));
gaze(:,2) = smooth(gaze(:,2));
gaze(:,3) = smooth(gaze(:,3));

plot(gaze(:,1), 'DisplayName', 'Left - right');
hold on;
plot(gaze(:,2), 'DisplayName', 'Up - down');
xlabel('Frame') % x-axis label
ylabel('Gaze vector size') % y-axis label
legend('show');
hold off;


text:
import os

from paddle.distributed.fleet import launch
from paddle.distributed.fleet.launch_utils import run_with_coverage

if __name__ == "__main__":
    if os.environ.get("WITH_COVERAGE", "OFF") == "ON":
        run_with_coverage(True)
    launch.launch()


text:
<?php

namespace Deliveries\PizzaBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class TestType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('email')

        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Deliveries\PizzaBundle\Entity\Test'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'deliveries_pizzabundle_test';
    }
}


text:
"""Tests for the WLED sensor platform."""
from datetime import datetime
from unittest.mock import patch

import pytest

from homeassistant.components.sensor import (
    DEVICE_CLASS_CURRENT,
    DOMAIN as SENSOR_DOMAIN,
)
from homeassistant.components.wled.const import (
    ATTR_LED_COUNT,
    ATTR_MAX_POWER,
    CURRENT_MA,
    DOMAIN,
)
from homeassistant.const import (
    ATTR_DEVICE_CLASS,
    ATTR_ICON,
    ATTR_UNIT_OF_MEASUREMENT,
    DATA_BYTES,
    PERCENTAGE,
    SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from homeassistant.util import dt as dt_util

from tests.components.wled import init_integration
from tests.test_util.aiohttp import AiohttpClientMocker

async def test_sensors(
    hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
) -> None:
    """Test the creation and values of the WLED sensors."""

    entry = await init_integration(hass, aioclient_mock, skip_setup=True)
    registry = er.async_get(hass)

    # Pre-create registry entries for disabled by default sensors
    registry.async_get_or_create(
        SENSOR_DOMAIN,
        DOMAIN,
        "aabbccddeeff_uptime",
        suggested_object_id="wled_rgb_light_uptime",
        disabled_by=None,
    )

    registry.async_get_or_create(
        SENSOR_DOMAIN,
        DOMAIN,
        "aabbccddeeff_free_heap",
        suggested_object_id="wled_rgb_light_free_memory",
        disabled_by=None,
    )

    registry.async_get_or_create(
        SENSOR_DOMAIN,
        DOMAIN,
        "aabbccddeeff_wifi_signal",
        suggested_object_id="wled_rgb_light_wifi_signal",
        disabled_by=None,
    )

    registry.async_get_or_create(
        SENSOR_DOMAIN,
        DOMAIN,
        "aabbccddeeff_wifi_rssi",
        suggested_object_id="wled_rgb_light_wifi_rssi",
        disabled_by=None,
    )

    registry.async_get_or_create(
        SENSOR_DOMAIN,
        DOMAIN,
        "aabbccddeeff_wifi_channel",
        suggested_object_id="wled_rgb_light_wifi_channel",
        disabled_by=None,
    )

    registry.async_get_or_create(
        SENSOR_DOMAIN,
        DOMAIN,
        "aabbccddeeff_wifi_bssid",
        suggested_object_id="wled_rgb_light_wifi_bssid",
        disabled_by=None,
    )

    # Setup
    test_time = datetime(2019, 11, 11, 9, 10, 32, tzinfo=dt_util.UTC)
    with patch("homeassistant.components.wled.sensor.utcnow", return_value=test_time):
        await hass.config_entries.async_setup(entry.entry_id)
        await hass.async_block_till_done()

    state = hass.states.get("sensor.wled_rgb_light_estimated_current")
    assert state
    assert state.attributes.get(ATTR_ICON) == "mdi:power"
    assert state.attributes.get(ATTR_LED_COUNT) == 30
    assert state.attributes.get(ATTR_MAX_POWER) == 850
    assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == CURRENT_MA
    assert state.attributes.get(ATTR_DEVICE_CLASS) == DEVICE_CLASS_CURRENT
    assert state.state == "470"

    entry = registry.async_get("sensor.wled_rgb_light_estimated_current")
    assert entry
    assert entry.unique_id == "aabbccddeeff_estimated_current"

    state = hass.states.get("sensor.wled_rgb_light_uptime")
    assert state
    assert state.attributes.get(ATTR_ICON) == "mdi:clock-outline"
    assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is None
    assert state.state == "2019-11-11T09:10:00+00:00"

    entry = registry.async_get("sensor.wled_rgb_light_uptime")
    assert entry
    assert entry.unique_id == "aabbccddeeff_uptime"

    state = hass.states.get("sensor.wled_rgb_light_free_memory")
    assert state
    assert state.attributes.get(ATTR_ICON) == "mdi:memory"
    assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == DATA_BYTES
    assert state.state == "14600"

    entry = registry.async_get("sensor.wled_rgb_light_free_memory")
    assert entry
    assert entry.unique_id == "aabbccddeeff_free_heap"

    state = hass.states.get("sensor.wled_rgb_light_wifi_signal")
    assert state
    assert state.attributes.get(ATTR_ICON) == "mdi:wifi"
    assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == PERCENTAGE
    assert state.state == "76"

    entry = registry.async_get("sensor.wled_rgb_light_wifi_signal")
    assert entry
    assert entry.unique_id == "aabbccddeeff_wifi_signal"

    state = hass.states.get("sensor.wled_rgb_light_wifi_rssi")
    assert state
    assert state.attributes.get(ATTR_ICON) == "mdi:wifi"
    assert (
        state.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
        == SIGNAL_STRENGTH_DECIBELS_MILLIWATT
    )
    assert state.state == "-62"

    entry = registry.async_get("sensor.wled_rgb_light_wifi_rssi")
    assert entry
    assert entry.unique_id == "aabbccddeeff_wifi_rssi"

    state = hass.states.get("sensor.wled_rgb_light_wifi_channel")
    assert state
    assert state.attributes.get(ATTR_ICON) == "mdi:wifi"
    assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is None
    assert state.state == "11"

    entry = registry.async_get("sensor.wled_rgb_light_wifi_channel")
    assert entry
    assert entry.unique_id == "aabbccddeeff_wifi_channel"

    state = hass.states.get("sensor.wled_rgb_light_wifi_bssid")
    assert state
    assert state.attributes.get(ATTR_ICON) == "mdi:wifi"
    assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is None
    assert state.state == "AA:AA:AA:AA:AA:BB"

    entry = registry.async_get("sensor.wled_rgb_light_wifi_bssid")
    assert entry
    assert entry.unique_id == "aabbccddeeff_wifi_bssid"

@pytest.mark.parametrize(
    "entity_id",
    (
        "sensor.wled_rgb_light_uptime",
        "sensor.wled_rgb_light_free_memory",
        "sensor.wled_rgb_light_wi_fi_signal",
        "sensor.wled_rgb_light_wi_fi_rssi",
        "sensor.wled_rgb_light_wi_fi_channel",
        "sensor.wled_rgb_light_wi_fi_bssid",
    ),
)
async def test_disabled_by_default_sensors(
    hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, entity_id: str
) -> None:
    """Test the disabled by default WLED sensors."""
    await init_integration(hass, aioclient_mock)
    registry = er.async_get(hass)

    state = hass.states.get(entity_id)
    assert state is None

    entry = registry.async_get(entity_id)
    assert entry
    assert entry.disabled
    assert entry.disabled_by == "integration"


text:
<?php

namespace Heming\Gabriel\RD\App\Model\Entity;

/**
 * The entity used by DataMapper
 * @author Gabriel Heming <gabriel.heming@hotmail.com>
 **/
abstract class Entity {

    private $id;

    /**
     * define the id for DomainObject
     * @param mixed $id
     **/
    public function setId($id) {
        $this->id = $id;
    }

    /**
     * retrieve the id
     * @return mixed
     **/
    public function getId() {
        return $this->id;
    }
}


text:
package main

var (
	// Version information of current build
	Version string
)

func VersionString() string {
	if Version != "" {
		return Version
	}
	return "unknown"
}


text:
package bammerbom.ultimatecore.sponge.modules.blockprotection.api;

public class BlockprotectionPermissions {

}


text:
<!DOCTYPE root [
<!ELEMENT root (elem)>
<!ELEMENT elem (#PCDATA)>
<!ATTLIST elem id ID #IMPLIED>
<!ENTITY target SYSTEM "dtds/737840.ent">
]>

<root>
  ⌖
</root>


text:
package com.vmware.vim25;

/**
 * @author Steve Jin (http://www.doublecloud.org)
 * @version 5.1
 */

@SuppressWarnings("all")
public class EightHostLimitViolated extends VmConfigFault {
}


text:
import os.path
import sys
import getopt
import cgi

import cfgdef
import cfghtml
import cfgh
import cfgc

def addConfigEntry(entries, entrySection, entryDefine, entryLabel, entryType, entryValue):
    "Add an entry to the configuration values"
    for section in entries:
        if section[0] == entrySection:
            section.append([entryDefine, entryLabel, entryType, entryValue])
            return
    entries.append([entrySection])
    addConfigEntry(entries, entrySection, entryDefine, entryLabel, entryType, entryValue)

def makePathRelativeTo(baseFile, filePath):
    "Rebase filePath relative to the path of baseFile"
    if os.path.isabs(filePath):
        return filePath
    basePath = os.path.dirname(os.path.abspath(baseFile))
    return os.path.normpath(os.path.join(basePath, filePath))

def readConfig(inFile):
    "Read the configuration file"
    configFile = open(inFile, 'r')
    entries = []
    customConfig = {}
    customConfigString = readALine(configFile)
    for customConfigPair in customConfigString.split('|'):
        customConfigKey, customConfigValue = customConfigPair.split('=')
        customConfig[customConfigKey] = customConfigValue
    while True:
        entrySection = readALine(configFile)
        entryDefine = readALine(configFile)
        entryLabel = readALine(configFile)
        entryType = readALine(configFile)
        entryValue = readALine(configFile)
        if entryValue is None:
            break
        addConfigEntry(entries, entrySection, entryDefine, entryLabel, entryType, entryValue)
    configFile.close()
    customConfig['ENTRIES'] = entries
    # File path are relative to config script
    for testEntry in ['OUTCFILE', 'OUTHFILE', 'OUTHTMLFILE', 'HEADER', 'FOOTER']:
        if testEntry in customConfig:
            customConfig[testEntry] = makePathRelativeTo(inFile, customConfig[testEntry])
    return customConfig

def printUsage():
    "Display a usage message on the output"
    print 'Usage:'
    print '  make-cfg.py -i <input file> [-t <header>] [-b <footer>] [-c <C output>] [-x <C header output>] [-o <HTML output>]'

def parseParams(argv):
    "Parse input parameters"
    cliConfig = {}
    try:
        opts, args = getopt.getopt(argv,"hi:t:b:c:x:o:",["ifile=","cfile=","hfile=","ofile=","top=","bottom="])
    except getopt.GetoptError:
        printUsage()
        sys.exit(1)
    for opt, arg in opts:
        if opt in ("-i", "--ifile"):
            cliConfig['INFILE'] = arg
        elif opt in ("-t", "--top"):
            cliConfig['HEADER'] = arg
        elif opt in ("-b", "--bottom"):
            cliConfig['FOOTER'] = arg
        elif opt in ("-c", "--cfile"):
            cliConfig['OUTCFILE'] = arg
        elif opt in ("-x", "--hfile"):
            cliConfig['OUTHFILE'] = arg
        elif opt in ("-o", "--ofile"):
            cliConfig['OUTHTMLFILE'] = arg
        else:
            printUsage()
            sys.exit(1)
    if 'INFILE' not in cliConfig:
        print 'Input file is mandatory!'
        sys.exit(1)
    return cliConfig

def openFiles(fileNames):
    "Open all files returned by parseParams()"
    inputFileName, outputCFileName, outputHFileName, outputHTMLFileName, inputHeaderFileName, inputFooterFileName = fileNames
    if inputFileName == '--':
        inFile = sys.stdin
    else:
        inFile = open(inputFileName, 'r')
    outCFile = open(outputCFileName, 'w')
    outHFile = open(outputHFileName, 'w')
    outHTMLFile = open(outputHTMLFileName, 'w')
    return inFile, outCFile, outHFile, outHTMLFile, inputHeaderFileName, inputFooterFileName

def closeFiles(inFile, outCFile, outHFile, outHTMLFile):
    "Close files opened by openFiles()"
    inFile.close()
    outCFile.close()
    outHFile.close()
    outHTMLFile.close()

def readALine(inFile):
    "Read a line from a file (ignoring empty lines and lines starting with a #"
    while True:
        line = inFile.readline()
        if line == '':
            return None
        if line[0] == '#':
            continue
        result = line.strip()
        if result == '':
            continue
        return result

def pumpFile(sourceName, destination):
    "Read every line of source into destination"
    if sourceName == '':
        return
    source = open(sourceName, "r")
    pumpFileFromDescriptor(source, destination)
    source.close()

def pumpFileFromDescriptor(source, destination):
    "Copy the content from one file to another"
    if source is None:
        return
    while True:
        readLine = source.readline()
        if readLine == '':
            return
        destination.write(readLine)

def sanitizeConfig(config):
    if 'APPNAME' not in config:
        config['APPNAME'] = 'Watchface'
    if 'OUTCFILE' not in config:
        config['OUTCFILE'] = 'config.c'
    if 'OUTHFILE' not in config:
        config['OUTHFILE'] = 'config.h'
    if 'OUTHTMLFILE' not in config:
        config['OUTHTMLFILE'] = 'config.htm'
    if 'HEADER' not in config:
        config['HEADER'] = None
    if 'FOOTER' not in config:
        config['FOOTER'] = None
    if 'APPMESSAGE' not in config:
        config['APPMESSAGE'] = True
    else:
        config['APPMESSAGE'] = config['APPMESSAGE'] == 'true'

def main(argv):
    "Application entry point"
    cliConfig = parseParams(argv)
    configFileConfig = readConfig(cliConfig['INFILE'])
    # Merge config file and cli config
    appConfig = configFileConfig.copy()
    appConfig.update(cliConfig)
    sanitizeConfig(appConfig)
    defines = cfgdef.readDefines(appConfig['ENTRIES'])
    # Generate outputs
    cfghtml.generateHTML(appConfig, defines)
    cfgh.generateCHeader(appConfig, defines)
    cfgc.generateCSource(appConfig, defines)
    # JS Ids
    firstKey = True
    result = ''
    for key in defines['CONFIG']:
        if firstKey:
            firstKey = False
            result = '"%(key)s": %(value)s' % { 'key': key, 'value': defines['CONFIG'][key] }
        else:
            result += ',\n"%(key)s": %(value)s' % { 'key': key, 'value': defines['CONFIG'][key] }
    return result

if __name__ == '__main__':
    print main(sys.argv[1:])


text:
import {AssetBase} from "@awayjs/core";

import {AttributesView} from "./AttributesView";

export class AttributesBuffer extends AssetBase
{
	public static assetType:string = "[assets AttributesBuffer]";

	private _count:number = 0;
	private _newCount:number = 0;
	private _stride:number = 0;
	private _newStride:number = 0;

	private _buffer:ArrayBuffer;
	private _bufferView:Uint8Array;
	private _contentDirty:boolean;
	private _lengthDirty:boolean;
	private _viewVOs:Array<ViewVO> = new Array<ViewVO>();

	/**
	 * @returns {string}
	 */
	public get assetType():string
	{
		return AttributesBuffer.assetType;
	}

	public get stride():number
	{
		if (this._lengthDirty)
			this._updateLength();

		return this._stride;
	}

	public set stride(value:number)
	{
		if (this._newStride == value)
			return;

		this._newStride = value;

		this.resize();
	}

	public get count():number
	{
		return this._newCount;
	}
	public set count(value:number)
	{
		if (this._newCount == value)
			return;

		this._newCount = value;

		this.resize();
	}

	public get buffer():ArrayBuffer
	{
		if (this._lengthDirty)
			this._updateLength();

		this._contentDirty = false;

		return this._buffer;
	}

	public get bufferView():Uint8Array
	{
		if (this._lengthDirty)
			this._updateLength();

		this._contentDirty = false;

		return this._bufferView;
	}

	public set bufferView(value:Uint8Array)
	{
		this._bufferView = value;
		this._buffer = this._bufferView.buffer;
	}

	public get length():number
	{
		return this._count*this.stride;
	}

	/**
	 *
	 */
	constructor(stride:number = 0, count:number = 0)
	{
		super();

		this._stride = this._newStride = stride;
		this._count = this._newCount = count;

		this._buffer = new ArrayBuffer(this._stride*this._count);
		this._bufferView = new Uint8Array(this._buffer, 0, this._buffer.byteLength);
	}

	/**
	 *
	 */
	public invalidate():void
	{
		if (this._contentDirty)
			return;

		super.invalidate();

		this._contentDirty = true;
	}

	/**
	 *
	 * @private
	 */
	public resize():void
	{
		if (this._lengthDirty)
			return;

		this.clear();

		this._lengthDirty = true;

		//dispose buffer if stride is 0
		if (!this._newStride) {
			this._buffer = null;
			this._bufferView = null;
		}
	}

	public cloneBufferView():AttributesBuffer
	{
		var attributesBuffer:AttributesBuffer = new AttributesBuffer(this._stride, this._count);

		attributesBuffer.bufferView.set(this.bufferView);

		return attributesBuffer;
	}

	public clone():AttributesBuffer
	{
		var attributesBuffer:AttributesBuffer = new AttributesBuffer(this._stride, this._count);

		attributesBuffer.bufferView.set(this.bufferView);

		var len:number = this._viewVOs.length;
		for (var i:number = 0; i < len; i++)
			this._viewVOs[i].view._internalClone(attributesBuffer);

		return attributesBuffer;
	}

	public getView(index:number):AttributesView
	{
		if (index < this._viewVOs.length)
			return this._viewVOs[index].view;

		return null;
	}

	public _setAttributes(viewIndex:number, arrayBufferView:ArrayBufferView, offset:number = 0):void
	{
		var array:Uint8Array = (arrayBufferView instanceof Uint8Array)? <Uint8Array> arrayBufferView : new Uint8Array(arrayBufferView.buffer);

		var viewVO:ViewVO = this._viewVOs[viewIndex];
		var vLength:number = viewVO.length;
		var vOffset:number = viewVO.offset;
		var vCount:number = array.length/vLength;

		//make sure there is enough space in the buffer
		if (this.count < vCount + offset)
			this.count = vCount + offset;

		if (this._lengthDirty)
			this._updateLength();

		//fast path for separate buffers
		if (this._viewVOs.length == 1) {
			this._bufferView.set(array);
		} else {
			for (var i:number = 0; i < vCount; i++)
				this._bufferView.set(array.subarray(i*vLength, (i+1)*vLength), (i+offset)*this._stride + vOffset);
		}

		this.invalidate();
	}

	public _addView(view:AttributesView):void
	{
		var viewVO:ViewVO = new ViewVO(view);
		var len:number = this._viewVOs.length;

		viewVO.offset = len? this._viewVOs[len - 1].offset + this._viewVOs[len - 1].length : 0;

		this._viewVOs.push(viewVO);

		if (this._newStride < viewVO.offset + viewVO.length) {
			this._newStride = viewVO.offset + viewVO.length;
			this.resize();
		}

		view._index = len;
	}

	public _removeView(view:AttributesView):void
	{
		var viewIndex:number = view._index;
		var viewVO:ViewVO = this._viewVOs.splice(viewIndex, 1)[0];
		var len:number = this._viewVOs.length;

		viewVO.dispose();

		for (var i:number = viewIndex; i < len; i++) {
			viewVO = this._viewVOs[i];
			viewVO.offset = i? this._viewVOs[i - 1].offset + this._viewVOs[i - 1].length : 0;
			viewVO.view._index = i;
		}

		this._newStride = len? this._viewVOs[len - 1].offset + this._viewVOs[len - 1].length : 0;

		this.resize();
	}

	public _getOffset(viewIndex:number):number
	{
		return this._viewVOs[viewIndex].offset;
	}

	public _updateLength():void
	{
		this._lengthDirty = false;

		var i:number;
		var j:number;
		var len:number = this._viewVOs.length;

		var newLength:number = this._newStride*this._newCount;

		if (!this._buffer || this._buffer.byteLength != newLength) {
			var newBuffer:ArrayBuffer = new ArrayBuffer(newLength);
			var newView:Uint8Array = new Uint8Array(newBuffer, 0, newBuffer.byteLength);
			var viewVO:ViewVO;
			var vLength:number;
			var vOffset:number;
			var vOldOffset:number;

			if (this._buffer) {
				if (this._stride != this._newStride) {
					for (i = 0; i < len; i++) {
						viewVO = this._viewVOs[i];
						vLength = viewVO.length;
						vOffset = viewVO.offset;
						vOldOffset = viewVO.oldOffset;
						for (j = 0; j < this._count; j++)
							if (vOldOffset != null)
								newView.set(new Uint8Array(this._buffer, j*this._stride + vOldOffset, vLength), j*this._newStride + vOffset);

						viewVO.oldOffset = viewVO.offset;
					}

					this._stride = this._newStride;
				} else {
					newView.set(new Uint8Array(this._buffer, 0, Math.min(newLength, this._buffer.byteLength))); //TODO: bypass quantisation of bytearray on instantiation
				}
			}

			this._buffer = newBuffer;
			this._bufferView = newView;
		}
		this._count=this._newCount;
	}
}

class ViewVO
{
	public view:AttributesView;

	public length;

	public offset;

	public oldOffset;

	constructor(view:AttributesView)
	{
		this.view = view;
		this.length = view.size*view.dimensions;
	}

	public dispose():void
	{
		this.view = null;
	}

	public clone():ViewVO
	{
		return new ViewVO(this.view);
	}
}

import {AssetEvent, AbstractionBase} from "@awayjs/core";

import {IIndexBuffer} from "../base/IIndexBuffer";
import {IVertexBuffer} from "../base/IVertexBuffer";
import {ContextGLDrawMode} from "../base/ContextGLDrawMode";
import {Stage} from "../Stage";

/**
 *
 * @class away.pool._Stage_AttributesBuffer
 */
export class _Stage_AttributesBuffer extends AbstractionBase
{
    public _indexBuffer:IIndexBuffer;

    public _vertexBuffer:IVertexBuffer;

    public _stage:Stage;

    public _attributesBuffer:AttributesBuffer;

    public _mipmap:boolean;

    public _invalid:boolean;

    constructor(attributesBuffer:AttributesBuffer, stage:Stage)
    {
        super(attributesBuffer, stage);

        this._stage = stage;

        this._attributesBuffer = attributesBuffer;
    }

    /**
     *
     */
    public onClear(event:AssetEvent):void
    {
        super.onClear(event);

        this._attributesBuffer = null;

        if (this._indexBuffer) {
            this._indexBuffer.dispose();
            this._indexBuffer = null;
        }

        if (this._vertexBuffer) {
            this._vertexBuffer.dispose();
            this._vertexBuffer = null;
        }
    }

    public activate(index:number, size:number, dimensions:number, offset:number, unsigned:boolean = false):void
    {
        this._stage.setVertexBuffer(index, this._getVertexBuffer(), size, dimensions, offset, unsigned);
    }

    public draw(mode:ContextGLDrawMode, firstIndex:number, numIndices:number):void
    {
        this._stage.context.drawIndices(mode, this._getIndexBuffer(), firstIndex, numIndices);
    }

    public _getIndexBuffer():IIndexBuffer
    {
        if (!this._indexBuffer) {
            this._invalid = true;
            this._indexBuffer = this._stage.context.createIndexBuffer(this._attributesBuffer.count*this._attributesBuffer.stride/2); //hardcoded assuming UintArray
        }

        if (this._invalid) {
            this._invalid = false;
            this._indexBuffer.uploadFromByteArray(this._attributesBuffer.buffer, 0, this._attributesBuffer.length);
        }

        return this._indexBuffer;
    }

    public _getVertexBuffer():IVertexBuffer
    {
        if (!this._vertexBuffer) {
            this._invalid = true;
            this._vertexBuffer = this._stage.context.createVertexBuffer(this._attributesBuffer.count, this._attributesBuffer.stride);
        }

        if (this._invalid) {
            this._invalid = false;
            this._vertexBuffer.uploadFromByteArray(this._attributesBuffer.buffer, 0, this._attributesBuffer.count);
        }

        return this._vertexBuffer;
    }
}

Stage.registerAbstraction(_Stage_AttributesBuffer, AttributesBuffer);


text:
<?php

// myBundleictBundle:career:new.html.twig
return array (
);


text:
import {Component, Inject, ElementRef} from '@angular/core';

import {SlideCommon} from '../../slideCommon/slideCommon';
import {Editor} from '../../../editor/editor';
import {EditorTab} from '../../../editorTab/editorTab';

import {HOST_SLIDE_CONTAINER_CLASS} from '../../../../services/constants';

@Component({
	selector:'NgCompare2',
	templateUrl:'src/components/slides/preamble/ngCompare2/ngCompare2.html',
	styleUrls: ['src/components/slides/preamble/ngCompare2/ngCompare2.css'],
	directives: [Editor, EditorTab]
})
export class NgCompare2 extends SlideCommon{
	constructor(elt: ElementRef, @Inject(HOST_SLIDE_CONTAINER_CLASS) hostClass: string) {
		super(elt, hostClass);
	}
}


text:
<title>GGCs database - What's new</title>

<?php include 'inte2.php'?>

What's new...

List of recent upgrades and modifications in the
GGC database.

Show only the ten latest upgrades

<?php

include 'conn.php';

// Performing SQL query
$query = "SELECT * FROM whatsnewtab ORDER BY timemod DESC";
$result = mysql_query($query) or die("Query failed");

// Printing results in HTML

// headers

print "
\n";
print "\t
\n";
print "\t\tDate	\n";
print "\t\tTopic	\n";
print "\t\tCategory	\n";
print "\t
\n";

// print of data

while ($line = mysql_fetch_array($result)) {
     print "\t\t$line[3]	\n";
     print "\t\t$line[1]	\n";
     print "\t\t$line[4]	\n";

     print "\t
\n";
 }
 print "
\n";

// Closing connection

mysql_close($link);

?>

<?php include 'coda.html' ?>


text:
// <copyright file="ITestExecutionProvider.cs" company="Automate The Planet Ltd.">
// Copyright 2021 Automate The Planet Ltd.
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
// <author>Anton Angelov</author>
// <site>http://automatetheplanet.com/</site>
using System.Reflection;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace ObserverDesignPatternIObservableIObserver
{
    public interface ITestExecutionProvider
    {
        void PreTestInit(TestContext context, MemberInfo memberInfo);

        void PostTestInit(TestContext context, MemberInfo memberInfo);

        void PreTestCleanup(TestContext context, MemberInfo memberInfo);

        void PostTestCleanup(TestContext context, MemberInfo memberInfo);

        void TestInstantiated(MemberInfo memberInfo);
    }
}


text:
package org.wso2.carbon.registry.core.jdbc.handlers.builtin;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.registry.core.Resource;
import org.wso2.carbon.registry.core.exceptions.RegistryException;
import org.wso2.carbon.registry.core.jdbc.handlers.Handler;
import org.wso2.carbon.registry.core.jdbc.handlers.RequestContext;
import org.wso2.carbon.registry.core.session.CurrentSession;
import org.wso2.carbon.registry.core.utils.RegistryUtils;

/**
 * Handler managing adding and fetching SQL Queries.
 */
public class SQLQueryHandler extends Handler {

    private static final Log log = LogFactory.getLog(SQLQueryHandler.class);
    private ThreadLocal<Boolean> inExecution =
            new ThreadLocal<Boolean>() {
                protected Boolean initialValue() {
                    return false;
                }
            };

    private Boolean isInExecution() {
        return inExecution.get();
    }

    private void setInExecution(Boolean input) {
        inExecution.set(input);
    }

    public Resource get(RequestContext requestContext) throws RegistryException {
        if(isInExecution()){
            return super.get(requestContext);
        } else {
            setInExecution(true);
        }

        try {
            String queryPath = requestContext.getResourcePath().getPath();
            Resource resource = requestContext.getRegistry().get(queryPath);
            Object content = resource.getContent();
            if (content instanceof byte[]) {
                resource.setContent(RegistryUtils.decodeBytes((byte[]) content));
            }
            // else:
            // This case should not happen. If execution comes here
            // there must be something wrong when retrieving the content.
            // Note that this is tested for in SQLQueryProcessor

            requestContext.setProcessingComplete(true);
            return resource;
        }finally {
            setInExecution(false);
        }
    }

    public void put(RequestContext requestContext) throws RegistryException {
        if(isInExecution()){
            super.put(requestContext);
            return;
        } else {
            setInExecution(true);
        }

        try{
            // only admin users (admin user and users in admin role) are allowed to add sql queries.
            if (!RegistryUtils.hasAdminAuthorizations(
                    CurrentSession.getUser(), CurrentSession.getUserRealm())) {
                String msg = "User " + CurrentSession.getUser() +
                        " does not have necessary authorizations to add or modify queries.";
                log.error(msg);
                throw new RegistryException(msg);
            }

            Resource resource = requestContext.getResource();

            Object content = resource.getContent();
            if (content instanceof String) {
                String textContent = (String) content;
                resource.setContent(RegistryUtils.encodeString(textContent));
            }

            String queryPath = requestContext.getResourcePath().getPath();
            requestContext.getRegistry().put(queryPath, resource);
            requestContext.setProcessingComplete(true);
        } finally {
            setInExecution(false);
        }
    }
}


text:
<?php

/* GeekhubGestbookBundle:Default:edit.html.twig */
class __TwigTemplate_6acd7f23f8be2c56c0ffc9572639460f extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = $this->env->loadTemplate("GeekhubGestbookBundle::layout.html.twig");

        $this->blocks = array(
            'body' => array($this, 'block_body'),
        );
    }

    protected function doGetParent(array $context)
    {
        return "GeekhubGestbookBundle::layout.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 3
    public function block_body($context, array $blocks = array())
    {
        // line 4
        echo "    <form action=\"";
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("geekhub_gestbook_change", array("id" => $this->getAttribute($this->getContext($context, "record"), "id"))), "html", null, true);
        echo "\" method=\"POST\" ";
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getContext($context, "form"), 'enctype');
        echo ">
        ";
        // line 5
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getContext($context, "form"), 'widget');
        echo "
        <input type=\"submit\">
    </form>

    ";
    }

    public function getTemplateName()
    {
        return "GeekhubGestbookBundle:Default:edit.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  36 => 5,  29 => 4,  26 => 3,);
    }
}


text:
using UnityEditor;
using UnityEngine;

namespace Com.LuisPedroFonseca.ProCamera2D
{
	[CustomEditor(typeof(ProCamera2DTriggerZoom))]
	[CanEditMultipleObjects]
    public class ProCamera2DTriggerZoomEditor : Editor
    {
        MonoScript _script;
        GUIContent _tooltip;

        void OnEnable()
        {
            ProCamera2DEditorHelper.AssignProCamera2D(target as BasePC2D);

            _script = MonoScript.FromMonoBehaviour((ProCamera2DTriggerZoom)target);
        }

        public override void OnInspectorGUI()
        {
            var proCamera2DTriggerZoom = (ProCamera2DTriggerZoom)target;

            if(proCamera2DTriggerZoom.ProCamera2D == null)
                EditorGUILayout.HelpBox("ProCamera2D is not set.", MessageType.Error, true);

            serializedObject.Update();

            // Show script link
            GUI.enabled = false;
            _script = EditorGUILayout.ObjectField("Script", _script, typeof(MonoScript), false) as MonoScript;
            GUI.enabled = true;

            // ProCamera2D
            _tooltip = new GUIContent("Pro Camera 2D", "");
            EditorGUILayout.PropertyField(serializedObject.FindProperty("ProCamera2D"), _tooltip);

            // Update interval
            _tooltip = new GUIContent("Update Interval", "Every X seconds detect collision. Smaller frequencies are more precise but also require more processing.");
            EditorGUILayout.PropertyField(serializedObject.FindProperty("UpdateInterval"), _tooltip);

            if (proCamera2DTriggerZoom.UpdateInterval <= 0.01f)
                proCamera2DTriggerZoom.UpdateInterval = 0.01f;

            // Trigger shape
            _tooltip = new GUIContent("Trigger Shape", "");
            EditorGUILayout.PropertyField(serializedObject.FindProperty("TriggerShape"), _tooltip);

            // Set size as multiplier
            _tooltip = new GUIContent("Set Size As Multiplier", "If checked, you set target size of the camera as a zoom multiplier of the initial camera size");
            EditorGUILayout.PropertyField(serializedObject.FindProperty("SetSizeAsMultiplier"), _tooltip);

            // Target zoom
            if(proCamera2DTriggerZoom.SetSizeAsMultiplier)
                _tooltip = new GUIContent("Zoom Multiplier", "The amount of zoom the camera should do when entering this trigger");
            else if(proCamera2DTriggerZoom.ProCamera2D.GameCamera.orthographic)
                _tooltip = new GUIContent("Target Ortho Size", "The target size of the camera when entering this trigger");
            else
                _tooltip = new GUIContent("Target FOV Size", "The target size of the camera when entering this trigger");

            EditorGUILayout.PropertyField(serializedObject.FindProperty("TargetZoom"), _tooltip);

            if (proCamera2DTriggerZoom.TargetZoom <= 0.01f)
                proCamera2DTriggerZoom.TargetZoom = 0.01f;

            // Zoom smoothness
            _tooltip = new GUIContent("Zoom Smoothness", "How smooth should the zoom be?");
            EditorGUILayout.PropertyField(serializedObject.FindProperty("ZoomSmoothness"), _tooltip);

            if (proCamera2DTriggerZoom.ZoomSmoothness < 0f)
                proCamera2DTriggerZoom.ZoomSmoothness = 0f;

            // Exclusive influence percentage
            _tooltip = new GUIContent("Exclusive Influence Percentage", "After entering this area the camera will reach it's max zoom value");
            EditorGUILayout.PropertyField(serializedObject.FindProperty("ExclusiveInfluencePercentage"), _tooltip);

            // Reset size on exit
            EditorGUILayout.BeginHorizontal();
            _tooltip = new GUIContent("Reset Size On Leave", "As the target leaves the trigger area the camera will reset its size to the start value");
            EditorGUILayout.PropertyField(serializedObject.FindProperty("ResetSizeOnExit"), _tooltip);

            if (proCamera2DTriggerZoom.ResetSizeOnExit)
            {
                // Reset size smoothness
                _tooltip = new GUIContent("Smoothness", "How smoothly should the camera resit its size?");
                EditorGUILayout.PropertyField(serializedObject.FindProperty("ResetSizeSmoothness"), _tooltip);
            }
            EditorGUILayout.EndHorizontal();

            // Trigger targets
            EditorGUILayout.BeginHorizontal();
            _tooltip = new GUIContent("Use Targets Mid Point", "If checked, the trigger will use the mid point of all your camera targets");
            EditorGUILayout.PropertyField(serializedObject.FindProperty("UseTargetsMidPoint"), _tooltip);

            if (!proCamera2DTriggerZoom.UseTargetsMidPoint)
            {
                _tooltip = new GUIContent("Trigger Target", "The target to use instead of the mid point of all camera targets");
                EditorGUILayout.PropertyField(serializedObject.FindProperty("TriggerTarget"), _tooltip);
            }
            EditorGUILayout.EndHorizontal();

            serializedObject.ApplyModifiedProperties();
        }
    }
}


text:
<?php

namespace WideFocus\Magento\ZendHydratorAdapter;

use Magento\Framework\EntityManager\HydratorInterface;
use Zend\Stdlib\Hydrator\Filter\FilterInterface;
use Zend\Stdlib\Hydrator\HydratorInterface as ZendHydratorInterface;
use Zend\Stdlib\Hydrator\NamingStrategy\NamingStrategyInterface;
use Zend\Stdlib\Hydrator\NamingStrategy\UnderscoreNamingStrategy;
use Zend\Stdlib\Hydrator\Strategy\StrategyInterface;
use Zend\Stdlib\Hydrator\StrategyEnabledInterface as StdStrategyEnabledInterface;
use Zend\Hydrator\StrategyEnabledInterface;
use Zend\Stdlib\Hydrator\FilterEnabledInterface as StdFilterEnabledInterface;
use Zend\Hydrator\FilterEnabledInterface;
use Zend\Stdlib\Hydrator\NamingStrategyEnabledInterface as StdNamingStrategyEnabledInterface;
use Zend\Hydrator\NamingStrategyEnabledInterface;

class ZendHydratorAdapter implements HydratorInterface
{
    /**
     * @var ZendHydratorInterface
     */
    private $zendHydrator;

    /**
     * Constructor.
     *
     * @param ZendHydratorInterface        $zendHydrator
     * @param StrategyInterface[]          $strategies
     * @param FilterInterface[]            $filters
     * @param NamingStrategyInterface|null $namingStrategy
     */
    public function __construct(
        ZendHydratorInterface $zendHydrator,
        array $strategies = [],
        array $filters = [],
        NamingStrategyInterface $namingStrategy = null
    ) {
        if ($zendHydrator instanceof NamingStrategyEnabledInterface
            || $zendHydrator instanceof StdNamingStrategyEnabledInterface
        ) {
            $namingStrategy = $namingStrategy ?? new UnderscoreNamingStrategy();
            $strategies     = $this->expandNames($namingStrategy, $strategies);
            $filters        = $this->expandNames($namingStrategy, $filters);

            $zendHydrator->setNamingStrategy($namingStrategy);
        }

        $this->setStrategies($zendHydrator, $strategies);
        $this->setFilters($zendHydrator, $filters);

        $this->zendHydrator = $zendHydrator;
    }

    /**
     * Extract data from object
     *
     * @param object $entity
     *
     * @return array
     */
    public function extract($entity): array
    {
        return $this->zendHydrator->extract($entity);
    }

    /**
     * Populate entity with data
     *
     * @param object $entity
     * @param array  $data
     *
     * @return object
     */
    public function hydrate($entity, array $data)
    {
        return $this->zendHydrator->hydrate($data, $entity);
    }

    /**
     * Set the strategies if supported.
     *
     * @param ZendHydratorInterface $zendHydrator
     * @param StrategyInterface[]   $strategies
     *
     * @return void
     */
    private function setStrategies(
        ZendHydratorInterface $zendHydrator,
        array $strategies
    ) {
        if ($zendHydrator instanceof StrategyEnabledInterface
            || $zendHydrator instanceof StdStrategyEnabledInterface
        ) {
            foreach ($strategies as $name => $strategy) {
                $zendHydrator->addStrategy($name, $strategy);
            }
        }
    }

    /**
     * Set the filters if supported.
     *
     * @param ZendHydratorInterface $zendHydrator
     * @param FilterInterface[]     $filters
     *
     * @return void
     */
    private function setFilters(
        ZendHydratorInterface $zendHydrator,
        array $filters
    ) {
        if ($zendHydrator instanceof FilterEnabledInterface
            || $zendHydrator instanceof StdFilterEnabledInterface
        ) {
            foreach ($filters as $name => $filter) {
                $zendHydrator->addFilter($name, $filter);
            }
        }
    }

    /**
     * Use hydration names and extraction names for strategies and filters.
     *
     * @param NamingStrategyInterface $namingStrategy
     * @param array                   $objects
     *
     * @return array
     *
     * @see https://github.com/zendframework/zend-hydrator/issues/46
     */
    private function expandNames(
        NamingStrategyInterface $namingStrategy,
        array $objects
    ): array {
        $extractionNames = array_map(
            function (string $name) use ($namingStrategy) : string {
                return $namingStrategy->extract($name) ?? $name;
            },
            array_keys($objects)
        );

        $hydrationNames = array_map(
            function (string $name) use ($namingStrategy) : string {
                return $namingStrategy->hydrate($name) ?? $name;
            },
            array_keys($objects)
        );

        return array_combine($extractionNames, array_values($objects))
            + array_combine($hydrationNames, array_values($objects));
    }
}


text:
package main

import (
	"fmt"
	"io"
	"log"
	"net"
	"net/rpc"
	"os"
	"strings"
	"text/template"
	"unicode"
	"unicode/utf8"

	"github.com/ugorji/go/codec"
)

type ErrorTypesDefinitions map[string]map[string]int64
type TypesDefinitions map[string]map[string]int64
type FunctionDefinitions map[string]FunctionDesc

type FunctionDesc struct {
	Parameters []string
	Return     string
}

type NvimDefinitions struct {
	Fd FunctionDefinitions
	Td TypesDefinitions
	Ed ErrorTypesDefinitions
}

// TEMPLATE FUNCTIONS
func upperFirst(s string) string {
	if s == "" {
		return ""
	}
	r, n := utf8.DecodeRuneInString(s)
	return string(unicode.ToUpper(r)) + s[n:]
}

func parseMethod(s string) (string, []string) {
	parts := strings.Split(s, "_")
	return parts[0], parts[1:]
}

func methodName(s string) string {
	_, methodNames := parseMethod(s)
	var res string
	for _, name := range methodNames {
		res += upperFirst(name)
	}
	return res
}

func structName(s string) string {
	method, _ := parseMethod(s)
	return upperFirst(method)
}

var types = map[string]string{
	"String":              "[]byte",
	"ArrayOf(String)":     "[]string",
	"ArrayOf(Integer, 2)": "[]int",
	"Integer":             "int",
	"Boolean":             "bool",
	"Object":              "interface{}",
	"Buffer":              "BufferIdentifier",
	"ArrayOf(Buffer)":     "[]BufferIdentifier",
	"Window":              "WindowIdentifier",
	"ArrayOf(Window)":     "[]WindowIdentifier",
	"Tabpage":             "TabpageIdentifier",
	"ArrayOf(Tabpage)":    "[]TabpageIdentifier",
	"void":                "nil",
	"Array":               "[]interface{}",          // vim_get_api_info
	"Dictionary":          "map[string]interface{}", // vim_get_color_map
}

var returnTypes = map[string]string{
	"Buffer":  "Buffer",
	"Window":  "Window",
	"Tabpage": "Tabpage",
}

// getType tries to parse t and return
// it corresponding go type else //TODO return err
func getType(s string) string {
	t, ok := types[s]
	if !ok {
		log.Fatalf("Could not find type for %v", s)
	}
	return t
}

func getReturnType(s string) string {
	t, ok := returnTypes[s]
	if !ok {
		log.Fatalf("Could not find struct for %s", s)
	}
	return t
}

func parseParameters(p []string, named bool) string {
	ret := ""
	if named {
		for k, v := range p {
			ret += fmt.Sprintf("v%d %s", k, getType(v))
			if k != len(p)-1 {
				ret += ", "
			}
		}
	} else {
		for k, _ := range p {
			ret += fmt.Sprintf("v%d", k)
			if k != len(p)-1 {
				ret += ", "
			}
		}
	}
	return ret
}

func parseType(r string) string {
	return getType(r)
}

func parseStruct(r string) string {
	// t := getType(r)
	return getReturnType(r)
}

func isStruct(s string) bool {
	_, ok := returnTypes[s]
	return ok
}

// END TEMPLATE FUNCTIONS

func main() {
	socket := "/var/folders/x6/h18jf2xj10bgb1_jlf_fy0rr0000gn/T/nvimaGKXbS/0"

	conn, err := net.Dial("unix", socket)
	if err != nil {
		log.Fatal("fail to connect to server: ", err)
		return
	}

	// no extensions needed for now
	var h codec.MsgpackHandle
	h.RawToString = true
	h.WriteExt = true

	rpcCodec := codec.MsgpackSpecRpc.ClientCodec(conn, &h)
	client := rpc.NewClientWithCodec(rpcCodec)

	bapi := struct {
		Id          uint64 // what it's the id for?
		Definitions map[interface{}]interface{}
	}{
		0,
		nil,
	}
	args := codec.MsgpackSpecRpcMultiArgs{}
	err = client.Call("vim_get_api_info", args, &bapi)
	if err != nil {
		log.Fatal("rpc send cmd: ", err)
	}
	var api NvimDefinitions

	for cat, mapv := range bapi.Definitions {
		switch cat {
		case "functions":
			api.Fd = FunctionDecode(mapv)
		case "types":
			api.Td = TypeDecode(mapv)
		case "error_types":
			api.Ed = ErrorTypeDecode(mapv)
		default:
			fmt.Printf("%s {{}}\n", cat)
		}
	}
	// fmt.Println("=========================")
	// fmt.Printf("api: {{\n")
	// spew.Dump(api)
	// fmt.Printf("}}\n")
	// fmt.Println("=========================")

	funcMap := template.FuncMap{
		"uppercase":       upperFirst,
		"methodName":      methodName,
		"structName":      structName,
		"parseParameters": parseParameters,
		"parseType":       parseType,
		"parseStruct":     parseStruct,
		"isStruct":        isStruct,
	}
	t := template.Must(template.New("main").Funcs(funcMap).ParseGlob("gen/tpl/*.gotexttmpl"))
	if err != nil {
		log.Fatalf("tpl error: %+v", err)
	}
	var out io.Writer
	// out = os.Stdout
	out, err = os.OpenFile("api.go", os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0644)
	if err != nil {
		log.Fatalf("Could not generate gen_api.go file\n%#+v\n", err)
	}
	err = t.ExecuteTemplate(out, "main.gotexttmpl", api)
	if err != nil {
		log.Fatalf("Could not execute template:\n%+#v\n", err)
	}
}

func FunctionDecode(val interface{}) FunctionDefinitions {
	defs := val.([]interface{})
	fnDef := FunctionDefinitions{}
	for _, v := range defs {
		attrs, ok := v.(map[interface{}]interface{})
		if !ok {
			log.Fatalf("function dec: failed to convert %v %T to string", attrs, attrs)
		}
		// spew.Dump(attrs["name"])
		b := attrs["name"].([]byte)
		name := string(b)

		b = attrs["return_type"].([]byte)
		sreturn := string(b)

		var parameters []string
		par, ok := attrs["parameters"].([]interface{})
		if !ok {
			log.Fatalf("parameters: failed to convert %v %T to string")
		}
		// fmt.Println("printing parameters")
		for _, v := range par {
			val, ok := v.([]interface{})
			if !ok {
				log.Fatalf("parameter value: failed to convert %v %T to string", val, val)
			}
			b := val[0].([]byte)
			parameters = append(parameters, string(b))
		}

		fnDef[name] = FunctionDesc{
			Parameters: parameters,
			Return:     sreturn,
		}
		// spew.Dump(fnDef)
	}
	return fnDef
}

func TypeDecode(val interface{}) TypesDefinitions {
	definitions, ok := val.(map[interface{}]interface{})
	if !ok {
		log.Fatalf("definitions: failed to convert %v %T to string")
	}

	typesDef := TypesDefinitions{}
	for cat, mapv := range definitions {
		name, ok := cat.(string)
		if !ok {
			log.Fatalf("for definitions: failed to convert %v %T to string")
		}
		typesDef[name] = make(map[string]int64)

		members, ok := mapv.(map[interface{}]interface{})
		if !ok {
			log.Fatalf("definitions: failed to convert %v %T to string", members, members)
		}
		for k, v := range members {
			key := string(k.(string))
			val := int64(v.(int64))
			typesDef[name][key] = val
		}
	}
	return typesDef
}

func ErrorTypeDecode(val interface{}) ErrorTypesDefinitions {
	definitions, ok := val.(map[interface{}]interface{})
	if !ok {
		log.Fatalf("definitions: failed to convert %v %T to string")
	}

	errTypes := ErrorTypesDefinitions{}
	for cat, mapv := range definitions {
		name, ok := cat.(string)
		if !ok {
			log.Fatalf("for definitions: failed to convert %v %T to string")
		}
		errTypes[name] = make(map[string]int64)

		members, ok := mapv.(map[interface{}]interface{})
		if !ok {
			log.Fatalf("definitions: failed to convert %v %T to string", members, members)
		}
		for k, v := range members {
			key := string(k.(string))
			val := int64(v.(int64))
			errTypes[name][key] = val
		}
	}
	return errTypes
}


text:
/*
 * Do not modify this file. This file is generated from the monitoring-2010-08-01.normal.json service model.
 */

using System;

using Amazon.Runtime;
using Amazon.Util.Internal;

namespace Amazon.CloudWatch
{
    /// <summary>
    /// Configuration for accessing Amazon CloudWatch service
    /// </summary>
    public partial class AmazonCloudWatchConfig : ClientConfig
    {
        private static readonly string UserAgentString =
            InternalSDKUtils.BuildUserAgentString("3.1.0.2");

        private string _userAgent = UserAgentString;

        /// <summary>
        /// Default constructor
        /// </summary>
        public AmazonCloudWatchConfig()
        {
            this.AuthenticationServiceName = "monitoring";
        }

        /// <summary>
        /// The constant used to lookup in the region hash the endpoint.
        /// </summary>
        public override string RegionEndpointServiceName
        {
            get
            {
                return "monitoring";
            }
        }

        /// <summary>
        /// Gets the ServiceVersion property.
        /// </summary>
        public override string ServiceVersion
        {
            get
            {
                return "2010-08-01";
            }
        }

        /// <summary>
        /// Gets the value of UserAgent property.
        /// </summary>
        public override string UserAgent
        {
            get
            {
                return _userAgent;
            }
        }
    }
}


text:
package com.sylvanaar.idea.Lua.run.kahlua;

import com.intellij.execution.process.ProcessHandler;
import com.intellij.openapi.diagnostic.Logger;

import java.io.OutputStream;

/**
 * Created by IntelliJ IDEA.
 * User: Jon S Akhtar
 * Date: Sep 19, 2010
 * Time: 3:06:41 PM
 */
public class KahluaProcessHandler extends ProcessHandler {
    private static final Logger log = Logger.getInstance("Lua.KahluaProcessHandler");
    public KahluaProcessHandler() {
    }

    @Override
    protected void destroyProcessImpl() {
       log.info("destroyProcessImpl");
    }

    @Override
    protected void detachProcessImpl() {
        log.info("detachProcessImpl");
    }

    @Override
    public boolean detachIsDefault() {
        log.info("detachIsDefault");
        return false;
    }

    @Override
    public OutputStream getProcessInput() {
        log.info("getProcessInput");
        return null;
    }
}


text:
namespace open_spiel {
namespace breakthrough {

inline constexpr int kNumPlayers = 2;
inline constexpr int kBlackPlayerId = 0;
inline constexpr int kWhitePlayerId = 1;
inline constexpr int kCellStates =
    1 + kNumPlayers;  // player 0, player 1, empty.
inline constexpr int kDefaultRows = 8;
inline constexpr int kDefaultColumns = 8;

// State of a cell.
enum class CellState {
  kEmpty,
  kBlack,
  kWhite,
};

class BreakthroughState : public State {
 public:
  explicit BreakthroughState(std::shared_ptr<const Game> game, int rows,
                             int cols);
  Player CurrentPlayer() const override;
  std::string ActionToString(Player player, Action action) const override;
  std::string ToString() const override;
  bool IsTerminal() const override;
  std::vector<double> Returns() const override;
  std::string ObservationString(Player player) const override;
  void ObservationTensor(Player player,
                         absl::Span<float> values) const override;
  std::unique_ptr<State> Clone() const override;
  void UndoAction(Player player, Action action) override;

  bool InBounds(int r, int c) const;
  void SetBoard(int r, int c, CellState cs) { board_[r * cols_ + c] = cs; }
  void SetPieces(int idx, int value) { pieces_[idx] = value; }
  CellState board(int row, int col) const { return board_[row * cols_ + col]; }
  int pieces(int idx) const { return pieces_[idx]; }
  int rows() const { return rows_; }
  int cols() const { return cols_; }
  std::vector<Action> LegalActions() const override;
  std::string Serialize() const override;

 protected:
  void DoApplyAction(Action action) override;

 private:
  int observation_plane(int r, int c) const;

  // Fields sets to bad/invalid values. Use Game::NewInitialState().
  Player cur_player_ = kInvalidPlayer;
  int winner_ = kInvalidPlayer;
  int total_moves_ = -1;
  std::array<int, 2> pieces_;
  int rows_ = -1;
  int cols_ = -1;
  std::vector<CellState> board_;  // for (row,col) we use row*cols_ + col.
};

class BreakthroughGame : public Game {
 public:
  explicit BreakthroughGame(const GameParameters& params);
  int NumDistinctActions() const override;
  std::unique_ptr<State> NewInitialState() const override {
    return std::unique_ptr<State>(
        new BreakthroughState(shared_from_this(), rows_, cols_));
  }
  int NumPlayers() const override { return kNumPlayers; }
  double MinUtility() const override { return -1; }
  double UtilitySum() const override { return 0; }
  double MaxUtility() const override { return 1; }
  std::vector<int> ObservationTensorShape() const override {
    return {kCellStates, rows_, cols_};
  }

  // Each piece must move forward from its current position, so the second last
  // row on the opponent's side is a distance of rows_ - 2 for the front row,
  // and rows_ - 1 for the back row (= 2*rows_ - 3). This can be done for each
  // column, and for both players, and there is one final move to step onto the
  // last winning row. As such, the formula for maximum game length is:
  int MaxGameLength() const override {
    return (2 * (2 * rows_ - 3) * cols_) + 1;
  }

  std::unique_ptr<State> DeserializeState(
      const std::string& str) const override;

 private:
  int rows_ = -1;
  int cols_ = -1;
};

inline std::ostream& operator<<(std::ostream& stream, const CellState& state) {
  switch (state) {
    case CellState::kBlack:
      return stream << "Black";
    case CellState::kWhite:
      return stream << "White";
    case CellState::kEmpty:
      return stream << "Empty";
    default:
      SpielFatalError("Unknown cell state");
  }
}

}  // namespace breakthrough
}  // namespace open_spiel

#endif  // OPEN_SPIEL_GAMES_BREAKTHROUGH_H_