text:
<?php

// In this part we will register all bundles we need

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
	    	new Blogger\BlogBundle\BloggerBlogBundle(),
	   	 	new Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(),
	    	new Symfony\Bundle\DoctrineMigrationsBundle\DoctrineMigrationsBundle(),
        	new Ornicar\GravatarBundle\OrnicarGravatarBundle(),
        	new Avalanche\Bundle\ImagineBundle\AvalancheImagineBundle(),
            new Mistakes\MistakesBundle\MistakesBundle(),
            new Mistakes\MistakesTestBundle\MistakesTestBundle(),
        	new SaadTazi\GChartBundle\SaadTaziGChartBundle(),
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
            $bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
        }

        return $bundles;
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
    }
}


text:
layout: default
---

{% include menu-dropdown.html  %}

		{% if page.image.feature %}

				{% if page.image.credit %}{% include image-credit.html %}{% endif %}

		{% endif %}
		{% include breadcrumbs.html %}

{{ page.title }}

				{{ content }}

					{% if page.categories %}{% include page-author.html %}{% endif %}
					{% if page.share != false %}{% include share-this.html %}{% endif %}
					{% include page-meta.html %}

					  {% if page.previous.url %}
					    « {{page.previous.title}}
					  {% endif %}
					  {% if page.next.url %}
					    {{page.next.title}} »
					  {% endif %}

				{% assign hasSimilar = '' %}
				{% for post in site.related_posts %}
				    {% assign postHasSimilar = false %}
				    {% for tag in post.tags %}
					{% for thisTag in page.tags %}
					    {% if postHasSimilar == false and hasSimilar.size < 6 and post.title != page.title and tag == thisTag %}
						{% if hasSimilar.size == 0 %}

Related Post

						{% endif %}

						    {{ post.title }}
						    {% if post.series %}
							(Series: {{ post.series }})
						    {% endif %}

						{% capture hasSimilar %}{{ hasSimilar }}*{% endcapture %}
						{% assign postHasSimilar = true %}
					    {% endif %}
					{% endfor %}
				    {% endfor %}
				{% endfor %}
				{% if hasSimilar.size > 0 %}

				{% endif %}

					{% if page.comments == true %}{% include comments.html %}{% endif %}

		{% if page.ads == true %}
{% include advertising.html %}
{% endif %}

redpajama_set_name: RedPajamaGithub


text:
/**
 * @file html-track-element-list.js
 */

import * as browser from '../utils/browser.js';
import document from 'global/document';

class HtmlTrackElementList {
  constructor(trackElements = []) {
    let list = this;

    if (browser.IS_IE8) {
      list = document.createElement('custom');

      for (let prop in HtmlTrackElementList.prototype) {
        if (prop !== 'constructor') {
          list[prop] = HtmlTrackElementList.prototype[prop];
        }
      }
    }

    list.trackElements_ = [];

    Object.defineProperty(list, 'length', {
      get() {
        return this.trackElements_.length;
      }
    });

    for (let i = 0, length = trackElements.length; i < length; i++) {
      list.addTrackElement_(trackElements[i]);
    }

    if (browser.IS_IE8) {
      return list;
    }
  }

  addTrackElement_(trackElement) {
    this.trackElements_.push(trackElement);
  }

  getTrackElementByTrack_(track) {
    let trackElement_;

    for (let i = 0, length = this.trackElements_.length; i < length; i++) {
      if (track === this.trackElements_[i].track) {
        trackElement_ = this.trackElements_[i];

        break;
      }
    }

    return trackElement_;
  }

  removeTrackElement_(trackElement) {
    for (let i = 0, length = this.trackElements_.length; i < length; i++) {
      if (trackElement === this.trackElements_[i]) {
        this.trackElements_.splice(i, 1);

        break;
      }
    }
  }
}

export default HtmlTrackElementList;


text:
package com.locus.game.network;

import com.locus.game.sprites.entities.Ship;

/**
 * Created by Divya Mamgai on 10/3/2016.
 * Player
 */

public class Player {

    public Ship.Property property;
    public boolean isReady;

    Player() {

    }

    Player(Ship.Property property, boolean isReady) {
        this.property = property;
        this.isReady = isReady;
    }

}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using TestLibrary;

namespace NativeCallingManaged
{
    class NativeCallingManaged
    {
        static int Main(string[] args)
        {
            // Disable running on Windows 7 until IJW activation work is complete.
            if(Environment.OSVersion.Platform != PlatformID.Win32NT || TestLibrary.Utilities.IsWindows7)
            {
                return 100;
            }

            bool success = true;
            // Load a fake mscoree.dll to avoid starting desktop
            LoadLibraryEx(Path.Combine(Environment.CurrentDirectory, "mscoree.dll"), IntPtr.Zero, 0);

            TestFramework.BeginScenario("Calling from managed to native IJW code");

            // Building with a reference to the IJW dll is difficult, so load via reflection instead
            TestFramework.BeginTestCase("Load IJW dll via reflection");
            Assembly ijwNativeDll = Assembly.Load("IjwNativeCallingManagedDll");
            TestFramework.EndTestCase();

            TestFramework.BeginTestCase("Call native method returning int");
            Type testType = ijwNativeDll.GetType("TestClass");
            object testInstance = Activator.CreateInstance(testType);
            MethodInfo testMethod = testType.GetMethod("ManagedEntryPoint");
            int result = (int)testMethod.Invoke(testInstance, null);
            if(result != 100)
            {
                TestFramework.LogError("IJW", "Incorrect result returned: " + result);
                success = false;
            }
            TestFramework.EndTestCase();

            TestFramework.BeginTestCase("Ensure .NET Framework was not loaded");
            IntPtr clrHandle = GetModuleHandle("mscoreei.dll");
            if (clrHandle != IntPtr.Zero)
            {
                TestFramework.LogError("IJW", ".NET Framework loaded by IJw module load");
                success = false;
            }
            TestFramework.EndTestCase();

            return success ? 100 : 99;
        }

        [DllImport("kernel32.dll")]
        static extern IntPtr LoadLibraryEx(string lpFileName, IntPtr hReservedNull, int dwFlags);

        [DllImport("kernel32.dll")]
        static extern IntPtr GetModuleHandle(string lpModuleName);
    }
}


text:
//
//  PUMValidations.h
//  PayUmoney_SampleApp
//
//  Created by Vipin Aggarwal on 15/11/16.
//  Copyright © 2016 PayUmoney. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface PUMValidations : NSObject

/*!
 * This method checks the if received object is a string which can be consumed by PayUmoney sdk
 */
+ (BOOL)isValidString:(id)content;

@end


text:
import {HTMLBox, HTMLBoxView} from "models/layouts/html_box"
import {ColumnDataSource} from "models/sources/column_data_source"
import * as p from "core/properties"

declare namespace vis {
  class Graph3d {
    constructor(el: HTMLElement, data: object, OPTIONS: object)
    setData(data: vis.DataSet): void
  }

  class DataSet {
    add(data: unknown): void
  }
}

// This defines some default options for the Graph3d feature of vis.js
// See: http://visjs.org/graph3d_examples.html for more details. This
// JS object should match the Python default value.
const OPTIONS = {
  width: '600px',
  height: '600px',
  style: 'surface',
  showPerspective: true,
  showGrid: true,
  keepAspectRatio: true,
  verticalRatio: 1.0,
  legendLabel: 'stuff',
  cameraPosition: {
    horizontal: -0.35,
    vertical: 0.22,
    distance: 1.8,
  },
}

// To create custom model extensions that will render on to the HTML canvas or
// into the DOM, we must create a View subclass for the model. In this case we
// will subclass from the existing BokehJS ``HTMLBoxView``, corresponding to our.
export class Surface3dView extends HTMLBoxView {
  model: Surface3d

  private _graph: vis.Graph3d

  render(): void {
    super.render()
    // Create a new Graph3s using the vis.js API. This assumes the vis.js has
    // already been loaded (e.g. in a custom app template). In the future Bokeh
    // models will be able to specify and load external scripts automatically.
    //
    // Views create <div> elements by default, accessible as @el. Many
    // Bokeh views ignore this default <div>, and instead do things like draw
    // to the HTML canvas. In this case though, we use the <div> to attach a
    // Graph3d to the DOM.
    this._graph = new vis.Graph3d(this.el, this.get_data(), this.model.options)
  }

  connect_signals(): void {
    super.connect_signals()
    // Set listener so that when the Bokeh data source has a change
    // event, we can process the new data
    this.connect(this.model.data_source.change, () => this._graph.setData(this.get_data()))
  }

  // This is the callback executed when the Bokeh data has an change (e.g. when
  // the server updates the data). It's basic function is simply to adapt the
  // Bokeh data source to the vis.js DataSet format
  get_data(): vis.DataSet {
    const data = new vis.DataSet()
    const source = this.model.data_source
    for (let i = 0; i < source.get_length()!; i++) {
      data.add({
        x: source.data[this.model.x][i],
        y: source.data[this.model.y][i],
        z: source.data[this.model.z][i],
      })
    }
    return data
  }
}

// We must also create a corresponding JavaScript model subclass to
// correspond to the python Bokeh model subclass. In this case, since we want
// an element that can position itself in the DOM according to a Bokeh layout,
// we subclass from ``HTMLBox``

export namespace Surface3d {
  export type Attrs = p.AttrsOf<Props>

  export type Props = HTMLBox.Props & {
    x: p.Property<string>
    y: p.Property<string>
    z: p.Property<string>
    data_source: p.Property<ColumnDataSource>
    options: p.Property<{[key: string]: unknown}>
  }
}

export interface Surface3d extends Surface3d.Attrs {}

export class Surface3d extends HTMLBox {
  properties: Surface3d.Props

  constructor(attrs?: Partial<Surface3d.Attrs>) {
    super(attrs)
  }

  // The ``__name__`` class attribute should generally match exactly the name
  // of the corresponding Python class. Note that if using TypeScript, this
  // will be automatically filled in during compilation, so except in some
  // special cases, this shouldn't be generally included manually, to avoid
  // typos, which would prohibit serialization/deserialization of this model.
  static __name__ = "Surface3d"

  static init_Surface3d(): void {
    // This is usually boilerplate. In some cases there may not be a view.
    this.prototype.default_view = Surface3dView

    // The @define block adds corresponding "properties" to the JS model. These
    // should basically line up 1-1 with the Python model class. Most property
    // types have counterparts, e.g. ``bokeh.core.properties.String`` will be
    // ``p.String`` in the JS implementatin. Where the JS type system is not yet
    // as rich, you can use ``p.Any`` as a "wildcard" property type.
    this.define<Surface3d.Props>({
      x:           [ p.String           ],
      y:           [ p.String           ],
      z:           [ p.String           ],
      data_source: [ p.Instance         ],
      options:     [ p.Any,     OPTIONS ],
    })
  }
}


text:
<?php

namespace Backendweb\GeneratorBundle\Manipulator;

use Sensio\Bundle\GeneratorBundle\Manipulator\Manipulator;
use Symfony\Component\Yaml\Parser;
use Symfony\Component\Yaml\Dumper;

/**
 * Changes the PHP code of a YAML services configuration file.
 */
class ServiceConfigurationManipulator extends Manipulator
{
    private $file;

    /**
     * Constructor.
     *
     * @param string $file The YAML configuration file path
     * @param string $forceOverwrite
     */
    public function __construct($file, $forceOverwrite = false)
    {
        $this->file = $file;
        $this->forceOverwrite = $forceOverwrite;
        $this->parser = new Parser();
        $this->dumper = new Dumper();
    }

    /**
     * Adds a service at the bottom of the existing ones.
     *
     * @var string $service The FQCN of the service to add
     * @var string $name The name of the service to add
     * @var array $arguments The arguments to pass to the service constructor
     *
     * @throws \RuntimeException If this process fails for any reason
     */
    public function addService(string $service, string $name, array $arguments = [], array $factory = null)
    {
        // if the config.yml file doesn't exist, don't even try.
        if (!file_exists($this->file)) {
            throw new \RuntimeException(sprintf('The target config file %s does not exist', $this->file));
        }

        $serviceConfig = $this->parser->parse(file_get_contents($this->file));

        if (!is_array($serviceConfig)) {
            $serviceConfig = [];
        }

        if (!isset($serviceConfig['services'])) {
            $serviceConfig['services'] = [];
        }

        if ($this->forceOverwrite === false && $this->hasService($serviceConfig, $name)) {
            throw new \RuntimeException(sprintf('A service with the name %s is already defined', $name));
        }

        $serviceConfig['services'][$name] = $this->generateServiceConfig($service, $arguments, $factory);

        $newContents = $this->dumper->dump($serviceConfig, 5);

        if (false === file_put_contents($this->file, $newContents)) {
            throw new \RuntimeException(sprintf('Could not write file %s ', $this->file));
        }
    }

    /**
     * @param array $serviceConfig
     * @param string $name
     * @return bool
     */
    private function hasService(array $serviceConfig, string $name): bool
    {
        foreach (array_keys($serviceConfig['services']) as $key) {
            if ($key === $name) {
                return true;
            }
        }

        return false;
    }

    /**
     * @param string $service
     * @param array $arguments
     * @param array $factory
     * @return array
     */
    private function generateServiceConfig(string $service, array $arguments, array $factory = null): array
    {
        $config = [
            'class' => $service,
        ];

        if (count($arguments) > 0) {
            $config['arguments'] = $arguments;
        }

        if ($factory !== null) {
            $config['factory'] = $factory;
        }

        return $config;
    }

}


text:
layout:     graph
title:      "Termik Santraller Ağı"
description: "Termik santral projelerini üstlenen/finansman sağlayan şirketler ve bu şirketlerin diğer yatırımları"
graph_url:  "https://graphcommons.com/graphs/5d293d74-f1bd-46fe-b673-a597fcd0b21d"
date:       2015-09-10 12:00:00
author:     "Mülksüzleştirme Ağları"
header-img: "img/graphs/termik-santraller-agi-mulksuzlestirme-graphcommons.jpg"
---


text:
using System;

namespace TehPers.FishingOverhaul.Api.Events
{
    /// <summary>
    /// Event data for when an item (either a fish or trash) is caught while fishing.
    /// </summary>
    public class CaughtItemEventArgs : EventArgs
    {
        /// <summary>
        /// The catch info.
        /// </summary>
        public CatchInfo Catch { get; }

        /// <summary>
        /// Initializes a new instance of the <see cref="CaughtItemEventArgs"/> class.
        /// </summary>
        /// <param name="catch">The catch info.</param>
        /// <exception cref="ArgumentNullException">An argument was null.</exception>
        public CaughtItemEventArgs(CatchInfo @catch)
        {
            this.Catch = @catch ?? throw new ArgumentNullException(nameof(@catch));
        }
    }
}


text:
/*-------------------------------------------------------------------------
 *
 * cdbpullup.h
 *    definitions for cdbpullup.c utilities
 *
 *
 *-------------------------------------------------------------------------
 */

#ifndef CDBPULLUP_H
#define CDBPULLUP_H

#include "nodes/relation.h"     /* PathKeyItem, Relids */

struct Plan;                    /* #include "nodes/plannodes.h" */

/*
 * cdbpullup_colIdx
 *
 * Given a [potentially] projecting Plan operator and a vector
 * of attribute numbers in the plan's single subplan, create a
 * vector of attribute numbers in the plan's targetlist.
 *
 * Parameters:
 *      plan -> the Plan node
 *      subplan -> the Plan node's subplan
 *      numCols = number of colIdx array elements
 *      subplanColIdx (IN) -> array [0..numCols-1] of AttrNumber, designating
 *          entries in the targetlist of the Plan operator's subplan.
 *     *pProjectedColIdx (OUT) -> array [0..n-1] of AttrNumber, palloc'd
 *          by this function, where n is the function's return value; or
 *          NULL when n == 0.
 *
 * Returns the number of leading subplanColIdx entries for which matching
 * Var nodes were found in the plan's targetlist.
 */
int
cdbpullup_colIdx(struct Plan   *plan,
                 struct Plan   *subplan,
                 int            numCols,
                 AttrNumber    *subplanColIdx,
                 AttrNumber   **pProjectedColIdx);

/*
 * cdbpullup_expr
 *
 * Suppose there is a Plan node 'P' whose projection is defined by
 * a targetlist 'TL', and which has subplan 'S'.  Given TL and an
 * expr 'X0' whose Var nodes reference the result columns of S, this
 * function returns a new expr 'X1' that is a copy of X0 with Var nodes
 * adjusted to reference the columns of S after their passage through P.
 *
 * Parameters:
 *      expr -> X0, the expr in terms of the subplan S's targetlist
 *      targetlist -> TL (a List of TargetEntry), the plan P's targetlist
 *              (or can be a List of Expr)
 *      newvarlist -> an optional List of Expr which may contain Var nodes
 *              referencing the result of the projection.  The Var nodes in
 *              the new expr are copied from ones in this list if possible,
 *              to get their varnoold and varoattno settings.
 *      newvarno = varno to be used in new Var nodes
 *
 * When calling this function on an expr which has NOT yet been transformed
 * by set_plan_references(), newvarno should be the RTE index assigned to
 * the result of the projection.
 *
 * When calling this function on an expr which HAS been transformed by
 * set_plan_references(), newvarno should usually be OUTER; or 0 if the
 * expr is to be used in the targetlist of an Agg or Group node.
 *
 * At present this function doesn't support pull-up from a subquery into a
 * containing query: there is no provision for adjusting the varlevelsup
 * field in Var nodes for outer references.  This could be added if needed.
 *
 * Returns X1, the expr recast in terms of the given targetlist; or
 * NULL if X0 references a column of S that is not projected in TL.
 */
Expr *
cdbpullup_expr(Expr *expr, List *targetlist, List *newvarlist, Index newvarno);

/*
 * cdbpullup_exprHasSubplanRef
 *
 * Returns true if the expr's first Var is a reference to an item in the
 * targetlist of the associated Plan node's subplan.  If so, it can be
 * assumed that the Plan node and associated exprs have been processed
 * by set_plan_references(), and its Var nodes are in executor format.
 *
 * Returns false otherwise, which implies no conclusion about whether or
 * not set_plan_references() has been done.
 *
 * Note that a Var node that belongs to a Scan operator and refers to the
 * Scan's source relation or index, doesn't have its varno changed by
 * set_plan_references() to OUTER/INNER/0.  Think twice about using this
 * unless you know that the expr comes from an upper Plan node.
 */
bool
cdbpullup_exprHasSubplanRef(Expr *expr);

/*
 * cdbpullup_findPathKeyItemInTargetList
 *
 * Searches the equivalence class 'pathkey' for a PathKeyItem that
 * uses no rels outside the 'relids' set, and either is a member of
 * 'targetlist', or uses no Vars that are not in 'targetlist'.
 *
 * If found, returns the chosen PathKeyItem and sets the output variables.
 * - If the item's Vars (if any) are in targetlist, but the item itself is not:
 *      *ptargetindex = 0
 * - Else if the targetlist is a List of TargetEntry nodes:
 *      *ptargetindex gets the matching TargetEntry's resno (which is the
 *          1-based position of the TargetEntry in the targetlist); or 0.
 * - Else if the targetlist is a plain List of Expr without TargetEntry nodes:
 *      *ptargetindex gets the 1-based position of the matching entry in the
 *          targetlist, or 0 if the expr is not in the targetlist.
 *
 * Otherwise returns NULL and sets *ptargetindex = 0.
 *
 * 'pathkey' is a List of PathKeyItem.
 * 'relids' is the set of relids that may occur in the targetlist exprs.
 * 'targetlist' is a List of TargetEntry or merely a List of Expr.
 *
 * NB: We ignore the presence or absence of a RelabelType node atop either
 * expr in determining whether a PathKeyItem expr matches a targetlist expr.
 *
 * (A RelabelType node might have been placed atop a PathKeyItem's expr to
 * match its type to the sortop's input operand type, when the types are
 * binary compatible but not identical... such as VARCHAR and TEXT.  The
 * RelabelType node merely documents the representational equivalence but
 * does not affect the semantics.  A RelabelType node might also be found
 * atop an argument of a function or operator, but generally not atop a
 * targetlist expr.)
 */
PathKeyItem *
cdbpullup_findPathKeyItemInTargetList(List         *pathkey,
                                      Relids        relids,
                                      List         *targetlist,
                                      AttrNumber   *ptargetindex);  // OUT (optional)

/*
 * cdbpullup_findSubplanRefInTargetList
 *
 * Given a targetlist, returns ptr to first TargetEntry whose expr is a
 * Var node having the specified varattno, and having its varno in executor
 * format (varno is OUTER, INNER, or 0) as set by set_plan_references().
 * Returns NULL if no such TargetEntry is found.
 */
TargetEntry *
cdbpullup_findSubplanRefInTargetList(AttrNumber varattno, List *targetlist);

/*
 * cdbpullup_isExprCoveredByTargetlist
 *
 * Returns true if 'expr' is in 'targetlist', or if 'expr' contains no
 * Var node of the current query level that is not in 'targetlist'.
 *
 * If 'expr' is a List, returns false if the above condition is false for
 * some member of the list.
 *
 * 'targetlist' is a List of TargetEntry.
 *
 * NB:  A Var in the expr is considered as matching a Var in the targetlist
 * without regard for whether or not there is a RelabelType node atop the
 * targetlist Var.
 *
 * See also: cdbpullup_missing_var_walker
 */
bool
cdbpullup_isExprCoveredByTargetlist(Expr *expr, List *targetlist);

/*
 * cdbpullup_makeVar
 *
 * Returns a new Var node with given 'varno' and 'varattno', and varlevelsup=0.
 *
 * The caller must provide an 'oldexpr' from which we obtain the vartype and
 * vartypmod for the new Var node.  If 'oldexpr' is a Var node, all fields are
 * copied except for varno, varattno and varlevelsup.
 *
 * The parameter modifyOld determines if varnoold and varoattno are modified or
 * not. Rule of thumb is to use modifyOld = false if called before setrefs.
 *
 * Copying an existing Var node preserves its varnoold and varoattno fields,
 * which are used by EXPLAIN to display the table and column name.
 * Also these fields are tested by equal(), so they may need to be set
 * correctly for successful lookups by list_member(), tlist_member(),
 * make_canonical_pathkey(), etc.
 */
Expr *
cdbpullup_make_expr(Index varno, AttrNumber varattno, Expr *oldexpr, bool modifyOld);

/*
 * cdbpullup_missingVarWalker
 *
 * Returns true if some Var in expr is not in targetlist.
 * 'targetlist' is either a List of TargetEntry, or a plain List of Expr.
 *
 * NB:  A Var in the expr is considered as matching a Var in the targetlist
 * without regard for whether or not there is a RelabelType node atop the
 * targetlist Var.
 *
 * See also: cdbpullup_isExprCoveredByTargetlist
 */
bool
cdbpullup_missingVarWalker(Node *node, void *targetlist);

/*
 * cdbpullup_targetentry
 *
 * Given a TargetEntry from a subplan's targetlist, this function returns a
 * new TargetEntry that can be used to pull the result value up into the
 * parent plan's projection.
 *
 * Parameters:
 *      subplan_targetentry is an item in the targetlist of the subplan S.
 *      newresno is the attribute number of the new TargetEntry (its
 *          position in P's targetlist).
 *      newvarno should be OUTER; except it should be 0 if P is an Agg or
 *          Group node.  It is ignored if useExecutorVarFormat is false.
 *      useExecutorVarFormat must be true if called after optimization,
 *          when set_plan_references() has been called and Var nodes have
 *          been adjusted to refer to items in the subplan's targetlist.
 *          It must be false before the end of optimization, when Var
 *          nodes are still in parser format, referring to RTE items.
 */
TargetEntry *
cdbpullup_targetentry(TargetEntry  *subplan_targetentry,
                      AttrNumber    newresno,
                      Index         newvarno,
                      bool          useExecutorVarFormat);

/*
 * cdbpullup_targetlist
 *
 * Return a targetlist that can be attached to a parent plan yielding
 * the same projection as the given subplan.
 */
List *
cdbpullup_targetlist(struct Plan *subplan, bool useExecutorVarFormat);

#endif   /* CDBPULLUP_H */


text:
package org.killbill.billing.plugin.adyen.client.model;

public enum RecurringType {
    ONECLICK,
    RECURRING
}


text:
<?php

/**
 * A ModelAdmin interface that allows management of {@link SentEmail} records
 * as well as {@link PermamailTemplate} objects
 *
 * @author Uncle Cheese <unclecheese@leftandmain.com>
 * @package  silverstripe-permamail
 */
class PermamailAdmin extends ModelAdmin {

	private static $menu_title = 'Email';

	private static $managed_models = array (
		'SentEmail' => array (
			'title' => 'Outbound Emails'
		),
		'PermamailTemplate' => array (
			'title' => 'Email Templates'
		)
	);

	private static $url_segment = 'email';
}


text:
<meta charset="UTF-8">
<title>A - test</title>

test / A

A

class A

Constructors

<init>

A()

<meta charset="UTF-8">
<title>B - test</title>

test / B

B

class B

Constructors

<init>

B()

<meta charset="UTF-8">
<title>C - test</title>

test / C

C

class C

Constructors

<init>

C()

<meta charset="UTF-8">
<title>acceptFunctionTypeWithNamedArguments - test</title>

test / acceptFunctionTypeWithNamedArguments

acceptFunctionTypeWithNamedArguments

fun acceptFunctionTypeWithNamedArguments(f: (bb: B, aa: A) -> C): Unit

<meta charset="UTF-8">
<title>f - test</title>

test / f

f

val f: (a: A, b: B) -> C


text:
@interface OFHttpBasicCredential : OFResource< NSCoding >
{
	@package
	NSString* userId;
	NSString* email;
	NSString* cryptedPassword;
	NSString* salt;
	BOOL rememberToken;
	NSString* rememberTokenExpiresAt;
	NSString* createdAt;
	NSString* updatedAt;
	BOOL verified;
	NSString* lastLoginAt;
}

- (id)initWithCoder:(NSCoder *)aDecoder;
- (void)encodeWithCoder:(NSCoder *)aCoder;

+ (OFResourceDataMap*)getDataMap;
+ (NSString*)getResourceName;
+ (NSString*)getResourceDiscoveredNotification;

@property (nonatomic, readonly, retain) NSString* userId;
@property (nonatomic, readonly, retain) NSString* email;
@property (nonatomic, readonly, retain)	NSString* cryptedPassword;
@property (nonatomic, readonly, retain) NSString* salt;
@property (nonatomic)	BOOL rememberToken;
@property (nonatomic)	BOOL verified;
@property (nonatomic, readonly, retain) NSString* rememberTokenExpiresAt;
@property (nonatomic, readonly, retain) NSString* createdAt;
@property (nonatomic, readonly, retain) NSString* updatedAt;
@property (nonatomic, readonly, retain) NSString* lastLoginAt;

@end


text:
set -euo pipefail
trap "echo 'error: Script failed: see failed command above'" ERR

# prune files that don't need when using the node modules(like test or example code)

readyToDeleteFiles=(license* LICENSE* .npmignore .travis.yml AUTHORS .gitignore)

for file in ${readyToDeleteFiles[@]}; do
  find . -name "$file" -delete
done

readyToDeleteDirs=(test tests example examples)

for dir in ${readyToDeleteDirs[@]}; do
  find . -name "$dir" -type d | xargs -I{} rm -rf {}
done


text:
--
-- PostgreSQL database dump
--

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

SET search_path = dis, pg_catalog;

--
-- Name: one_result(text, text); Type: FUNCTION; Schema: dis; Owner: postgres
--

CREATE OR REPLACE FUNCTION one_result(call text, message text DEFAULT ''::text) RETURNS score
    LANGUAGE plpgsql
    AS $$
/*  Function:     dis.one_result(call text, message text DEFAULT '')
    Description:  Test if the provided query returns one result
    Affects:      nothing, unless the query performs an action
    Arguments:    call (text): query to execute
                  message (text): Mesage to include (optional)
    Returns:      dis.score
*/
DECLARE
    _count      integer;
    _score      dis.score;
BEGIN
    _count := dis._count(call);
    _score := dis.assert(
        _count = 1,
        message,
        ARRAY[
            ('call: ' || call),
            ('have: ' || COALESCE(_count || ' results', 'failed to execute')),
            ('want: one result')
        ]
    );
    RETURN _score;
END;
$$;

ALTER FUNCTION dis.one_result(call text, message text) OWNER TO postgres;

--
-- Name: FUNCTION one_result(call text, message text); Type: COMMENT; Schema: dis; Owner: postgres
--

COMMENT ON FUNCTION one_result(call text, message text) IS 'Test if the provided query returns one result (2012-04-14)';

--
-- PostgreSQL database dump complete
--


text: CREATE TABLE tbl LIKE tbl2;


text:
package org.glamey.training.designmodel.observable;

import java.util.Vector;

/**
 * @author zhouyang.zhou. 2017.08.29.15.
 */
public class Observable {

  private final Vector<Observer> observers = new Vector<>();

  public void addObserver(Observer observer) {
    this.observers.add(observer);
  }

  public void removeObserver(Observer observer) {
    this.observers.remove(observer);
  }

  public void notifyAllObservers() {
    for (Observer observer : observers) {
      observer.change(this);
    }
  }
}


text:
package com.sturdyhelmetgames.dodgethecars.events;

import java.util.EventObject;

/**
 * An event to be dispatched to an external application.
 *
 * @author Antti
 *
 */
public class SwarmEvent extends EventObject {

	private static final long serialVersionUID = 7145766592451775967L;

	/**
	 * Event type for opening leaderboard.
	 */
	public static final int EVENT_TYPE_OPEN_LEADERBOARD = 0;
	/**
	 * Event type for updating leaderboard.
	 */
	public static final int EVENT_TYPE_UPDATE_LEADERBOARD = 1;

	/**
	 * Event type.
	 *
	 * @see {@link #EVENT_TYPE_OPEN_LEADERBOARD}
	 *      {@link #EVENT_TYPE_UPDATE_LEADERBOARD}
	 */
	public int type;
	/**
	 * Event value e.g. leaderboard score. Should depend on {@link #type}.
	 */
	public Object eventValue;

	/**
	 * Constructs a {@link SwarmEvent} with type and value.
	 *
	 * @param source
	 *            Source e.g. object where the {@link SwarmEvent} was created.
	 * @param type
	 *            Event type.
	 * @param eventValue
	 *            Event value e.g. leaderboard score. Should depend on
	 *            {@link #type}.
	 */
	public SwarmEvent(Object source, int type, Object eventValue) {
		super(source);
		this.type = type;
		this.eventValue = eventValue;
	}
}


text:
from pprint import pprint

__all__ = ['TableDefs', 'TableDefsHpS']

class TableDefs(object):
    '''
        formato do self.definition:
        {
            'field': {
                'header': 'Header',
                'style': 'text-align: right;',
                'decimals':
            },
            ...
        }
    '''

    def __init__(self, definition, keys=None, **kwargs):
        '''
            se keys for uma lista de chaves como ['header', 'style'],
            a definition recebida estará no formato
            {
                'field': ['Header', 'text-align: right;'],
                ...
            }
            e deverá ser convertida para o formato do self.definition

            se uma key na lista de chaves iniciar com '+' como ['header', '+style'],
            valor do key será uma chave para um dicionário com esse nome
            passado no kwargs
        '''
        super(TableDefs, self).__init__()
        self.kwargs = kwargs
        self.default_kwargs()

        self.cols_list = []

        definition = self.un_multiple_cols(definition)
        if keys is None:
            self.definition = definition
        else:
            self.definition = self.convert(definition, keys)

    def default_kwargs(self):
        if 'style' in self.kwargs:
            style = {}
            for key in self.kwargs['style']:
                if key == '_':
                    if self.kwargs['style'][key] == 'text-align':
                        style.update({
                            'l': 'text-align: left;',
                            'c': 'text-align: center;',
                            'r': 'text-align: right;',
                        })
                else:
                    style[key] = self.kwargs['style'][key]
            self.kwargs['style'] = style

    def un_multiple_cols(self, definition):
        new_def = {}
        for key in definition:
            for sub_key in key.split():
                new_def[sub_key] = definition[key]
        return new_def

    def convert(self, definition, keys):
        result = {}
        for col in definition:
            def_col = {}
            for i, key in enumerate(keys):
                if i < len(definition[col]):
                    if key.startswith('+'):
                        key = key[1:]
                        def_col[key] = self.kwargs[key][definition[col][i]]
                    else:
                        def_col[key] = definition[col][i]
            result[col] = def_col
        return result

    def cols(self, *cols):
        if cols:
            self.cols_list = cols
        else:
            self.cols_list = self.definition.keys()

    def add(self, pos, *cols):
        if isinstance(pos, int):
            self.cols_list = self.cols_list[:pos] + cols + self.cols_list[pos:]
        else:
            self.cols_list += (pos,) + cols

    def dele(self, key):
        if not self.cols_list:
            self.cols()
        self.cols_list = tuple(
            col
            for col in self.cols_list
            if col != key
        )

    def bitmap_match(self, col, bitmap):
        col_bitmap = self.definition[col].get('flags_bitmap', 0)
        if isinstance(col_bitmap, int) and col_bitmap:
            return (bitmap & col_bitmap)
        return True

    def defs(self, *cols, bitmap=None):
        if len(cols) == 0:
            if len(self.cols_list) == 0:
                cols = self.definition.keys()
            else:
                cols = self.cols_list

        if isinstance(bitmap, int):
            cols = [
                col
                for col in cols
                if self.bitmap_match(col, bitmap)
            ]

        self.headers = []
        self.fields = []
        self.style = {}
        self.decimals = {}
        for idx, col in enumerate(cols, 1):
            if col not in self.definition:
                continue
            self.headers.append(
                self.definition[col].get('header', '') or col.capitalize())
            self.fields.append(col)
            if 'style' in self.definition[col]:
                self.style[idx] = self.definition[col]['style']
            if 'decimals' in self.definition[col]:
                self.decimals[idx] = self.definition[col]['decimals']

    def hfs(self, *cols, bitmap=None, decimals=False):
        self.defs(*cols, bitmap=bitmap)
        result = [self.headers, self.fields, self.style]
        if decimals:
            result.append(self.decimals)
        return tuple(result)

    def hfs_dict(self, *cols, bitmap=None, context=None, sufixo='', decimals=False):
        self.defs(*cols, bitmap=bitmap)
        config = {
            f'{sufixo}headers': self.headers,
            f'{sufixo}fields': self.fields,
            f'{sufixo}style': self.style,
        }
        if decimals:
            config[f'{sufixo}decimals'] = self.decimals
        if context:
            context.update(config)
        else:
            return config

    def hfsd(self, *cols, bitmap=None):
        return self.hfs(*cols, bitmap=bitmap, decimals=True)

    def hfsd_dict(self, *cols, bitmap=None, context=None, sufixo=''):
        return self.hfs_dict(*cols, bitmap=bitmap, context=context, sufixo=sufixo, decimals=True)

class TableDefsH(TableDefs):

    def __init__(self, definition):
        super(TableDefsH, self).__init__(
            definition,
            ['header'],
        )

class TableDefsHpS(TableDefs):

    def __init__(self, definition):
        super(TableDefsHpS, self).__init__(
            definition,
            ['header', '+style'],
            style = {'_': 'text-align'},
        )

class TableDefsHpSD(TableDefs):

    def __init__(self, definition):
        super(TableDefsHpSD, self).__init__(
            definition,
            ['header', '+style', 'decimals'],
            style = {'_': 'text-align'},
        )


text:
package generators

import (
	"bytes"
	"fmt"
	"io"
	"path/filepath"
	"strings"

	"k8s.io/kubernetes/cmd/libs/go2idl/args"
	"k8s.io/kubernetes/cmd/libs/go2idl/generator"
	"k8s.io/kubernetes/cmd/libs/go2idl/namer"
	"k8s.io/kubernetes/cmd/libs/go2idl/types"
	"k8s.io/kubernetes/pkg/util/sets"

	"github.com/golang/glog"
)

// TODO: This is created only to reduce number of changes in a single PR.
// Remove it and use PublicNamer instead.
func conversionNamer() *namer.NameStrategy {
	return &namer.NameStrategy{
		Join: func(pre string, in []string, post string) string {
			return strings.Join(in, "_")
		},
		PrependPackageNames: 1,
	}
}

func defaultFnNamer() *namer.NameStrategy {
	return &namer.NameStrategy{
		Prefix: "SetDefaults_",
		Join: func(pre string, in []string, post string) string {
			return pre + strings.Join(in, "_") + post
		},
	}
}

// NameSystems returns the name system used by the generators in this package.
func NameSystems() namer.NameSystems {
	return namer.NameSystems{
		"public":    conversionNamer(),
		"raw":       namer.NewRawNamer("", nil),
		"defaultfn": defaultFnNamer(),
	}
}

// DefaultNameSystem returns the default name system for ordering the types to be
// processed by the generators in this package.
func DefaultNameSystem() string {
	return "public"
}

var fallbackPackages = []string{
	"k8s.io/kubernetes/pkg/api/unversioned",
	"k8s.io/kubernetes/pkg/apis/extensions",
	"k8s.io/kubernetes/pkg/apis/autoscaling",
	"k8s.io/kubernetes/pkg/apis/batch",
}

func getInternalTypeFor(context *generator.Context, t *types.Type) (*types.Type, bool) {
	internalPackage := filepath.Dir(t.Name.Package)
	if !context.Universe.Package(internalPackage).Has(t.Name.Name) {
		for _, fallbackPackage := range fallbackPackages {
			if fallbackPackage == t.Name.Package || !context.Universe.Package(fallbackPackage).Has(t.Name.Name) {
				continue
			}
			return context.Universe.Package(fallbackPackage).Type(t.Name.Name), true
		}
		return nil, false
	}
	return context.Universe.Package(internalPackage).Type(t.Name.Name), true
}

type conversionType struct {
	inType  *types.Type
	outType *types.Type
}

// All of the types in conversions map are of type "DeclarationOf" with
// the underlying type being "Func".
type conversions map[conversionType]*types.Type

// Returns all already existing conversion functions that we are able to find.
func existingConversionFunctions(context *generator.Context) conversions {
	scopeName := types.Name{Package: conversionPackagePath, Name: "Scope"}
	errorName := types.Name{Package: "", Name: "error"}
	buffer := &bytes.Buffer{}
	sw := generator.NewSnippetWriter(buffer, context, "$", "$")

	preexisting := make(conversions)
	for _, p := range context.Universe {
		for _, f := range p.Functions {
			if f.Underlying == nil || f.Underlying.Kind != types.Func {
				glog.Errorf("Malformed function: %#v", f)
				continue
			}
			if f.Underlying.Signature == nil {
				glog.Errorf("Function without signature: %#v", f)
				continue
			}
			signature := f.Underlying.Signature
			// Check whether the function is conversion function.
			// Note that all of them have signature:
			// func Convert_inType_To_outType(inType, outType, conversion.Scope) error
			if signature.Receiver != nil {
				continue
			}
			if len(signature.Parameters) != 3 || signature.Parameters[2].Name != scopeName {
				continue
			}
			if len(signature.Results) != 1 || signature.Results[0].Name != errorName {
				continue
			}
			inType := signature.Parameters[0]
			outType := signature.Parameters[1]
			if inType.Kind != types.Pointer || outType.Kind != types.Pointer {
				continue
			}
			// Now check if the name satisfies the convention.
			args := argsFromType(inType.Elem, outType.Elem)
			sw.Do("Convert_$.inType|public$_To_$.outType|public$", args)
			if f.Name.Name == buffer.String() {
				key := conversionType{inType.Elem, outType.Elem}
				if v, ok := preexisting[key]; ok && v != nil {
					panic(fmt.Sprintf("duplicate static conversion defined: %#v", key))
				}
				preexisting[key] = f
			}
			buffer.Reset()
		}
	}
	return preexisting
}

// All of the types in conversions map are of type "DeclarationOf" with
// the underlying type being "Func".
type defaulters map[*types.Type]*types.Type

// Returns all already existing defaulting functions that we are able to find.
func existingDefaultingFunctions(context *generator.Context) defaulters {
	buffer := &bytes.Buffer{}
	sw := generator.NewSnippetWriter(buffer, context, "$", "$")

	preexisting := make(defaulters)
	for _, p := range context.Universe {
		for _, f := range p.Functions {
			if f.Underlying == nil || f.Underlying.Kind != types.Func {
				glog.Errorf("Malformed function: %#v", f)
				continue
			}
			if f.Underlying.Signature == nil {
				glog.Errorf("Function without signature: %#v", f)
				continue
			}
			signature := f.Underlying.Signature
			// Check whether the function is conversion function.
			// Note that all of them have signature:
			// func Convert_inType_To_outType(inType, outType, conversion.Scope) error
			if signature.Receiver != nil {
				continue
			}
			if len(signature.Parameters) != 1 {
				continue
			}
			if len(signature.Results) != 0 {
				continue
			}
			inType := signature.Parameters[0]
			if inType.Kind != types.Pointer {
				continue
			}
			// Now check if the name satisfies the convention.
			args := defaultingArgsFromType(inType.Elem)
			sw.Do("$.inType|defaultfn$", args)
			if f.Name.Name == buffer.String() {
				key := inType.Elem
				if v, ok := preexisting[key]; ok && v != nil {
					panic(fmt.Sprintf("duplicate static defaulter defined: %#v", key))
				}
				preexisting[key] = f
			}
			buffer.Reset()
		}
	}
	return preexisting
}

func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages {
	boilerplate, err := arguments.LoadGoBoilerplate()
	if err != nil {
		glog.Fatalf("Failed loading boilerplate: %v", err)
	}

	inputs := sets.NewString(arguments.InputDirs...)
	packages := generator.Packages{}
	header := append([]byte(
		`// +build !ignore_autogenerated

`), boilerplate...)
	header = append(header, []byte(
		`
// This file was autogenerated by conversion-gen. Do not edit it manually!

`)...)

	// Compute all pre-existing conversion functions.
	preexisting := existingConversionFunctions(context)
	preexistingDefaults := existingDefaultingFunctions(context)

	// We are generating conversions only for packages that are explicitly
	// passed as InputDir, and only for those that have a corresponding type
	// (in the directory one above) and can be automatically converted to.
	for _, p := range context.Universe {
		path := p.Path
		if !inputs.Has(path) {
			continue
		}
		// Only generate conversions for package which explicitly requested it
		// byt setting "+genversion=true" in their doc.go file.
		filtered := false
		for _, comment := range p.DocComments {
			comment := strings.Trim(comment, "//")
			if types.ExtractCommentTags("+", comment)["genconversion"] == "true" {
				filtered = true
			}
		}
		if !filtered {
			continue
		}

		convertibleType := false
		for _, t := range p.Types {
			// Check whether this type can be auto-converted to the internal
			// version.
			internalType, exists := getInternalTypeFor(context, t)
			if !exists {
				// There is no corresponding type in the internal package.
				continue
			}
			// We won't be able to convert to private type.
			if namer.IsPrivateGoName(internalType.Name.Name) {
				continue
			}
			// If we can generate conversion in any direction, we should
			// generate this package.
			if isConvertible(t, internalType, preexisting) || isConvertible(internalType, t, preexisting) {
				convertibleType = true
			}
		}

		if convertibleType {
			packages = append(packages,
				&generator.DefaultPackage{
					PackageName: filepath.Base(path),
					PackagePath: path,
					HeaderText:  header,
					GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) {
						generators = []generator.Generator{}
						generators = append(
							generators, NewGenConversion("conversion_generated", path, preexisting, preexistingDefaults))
						return generators
					},
					FilterFunc: func(c *generator.Context, t *types.Type) bool {
						return t.Name.Package == path
					},
				})
		}
	}
	return packages
}

func findMember(t *types.Type, name string) (types.Member, bool) {
	if t.Kind != types.Struct {
		return types.Member{}, false
	}
	for _, member := range t.Members {
		if member.Name == name {
			return member, true
		}
	}
	return types.Member{}, false
}

func isConvertible(in, out *types.Type, preexisting conversions) bool {
	// If there is pre-existing conversion function, return true immediately.
	if _, ok := preexisting[conversionType{in, out}]; ok {
		return true
	}
	return isDirectlyConvertible(in, out, preexisting)
}

func isDirectlyConvertible(in, out *types.Type, preexisting conversions) bool {
	// If one of the types is Alias, resolve it.
	if in.Kind == types.Alias {
		return isConvertible(in.Underlying, out, preexisting)
	}
	if out.Kind == types.Alias {
		return isConvertible(in, out.Underlying, preexisting)
	}

	if in.Kind != out.Kind {
		return false
	}
	switch in.Kind {
	case types.Builtin, types.Struct, types.Map, types.Slice, types.Pointer:
	default:
		// We don't support conversion of other types yet.
		return false
	}
	switch out.Kind {
	case types.Builtin, types.Struct, types.Map, types.Slice, types.Pointer:
	default:
		// We don't support conversion of other types yet.
		return false
	}

	switch in.Kind {
	case types.Builtin:
		if in == out {
			return true
		}
		// TODO: Support more conversion types.
		return types.IsInteger(in) && types.IsInteger(out)
	case types.Struct:
		convertible := true
		for _, inMember := range in.Members {
			// Check if there is an out member with that name.
			outMember, found := findMember(out, inMember.Name)
			if !found {
				// Check if the member doesn't have comment:
				// "+ genconversion=false"
				// comment to ignore this field for conversion.
				// TODO: Switch to SecondClosestCommentLines.
				if types.ExtractCommentTags("+", inMember.CommentLines)["genconversion"] == "false" {
					continue
				}
				return false
			}
			convertible = convertible && isConvertible(inMember.Type, outMember.Type, preexisting)
		}
		return convertible
	case types.Map:
		return isConvertible(in.Key, out.Key, preexisting) && isConvertible(in.Elem, out.Elem, preexisting)
	case types.Slice:
		return isConvertible(in.Elem, out.Elem, preexisting)
	case types.Pointer:
		return isConvertible(in.Elem, out.Elem, preexisting)
	}
	glog.Fatalf("All other types should be filtered before")
	return false
}

const (
	apiPackagePath        = "k8s.io/kubernetes/pkg/api"
	conversionPackagePath = "k8s.io/kubernetes/pkg/conversion"
)

// genConversion produces a file with a autogenerated conversions.
type genConversion struct {
	generator.DefaultGen
	targetPackage string
	preexisting   conversions
	defaulters    defaulters
	imports       namer.ImportTracker
	typesForInit  []conversionType
}

func NewGenConversion(sanitizedName, targetPackage string, preexisting conversions, defaulters defaulters) generator.Generator {
	return &genConversion{
		DefaultGen: generator.DefaultGen{
			OptionalName: sanitizedName,
		},
		targetPackage: targetPackage,
		preexisting:   preexisting,
		defaulters:    defaulters,
		imports:       generator.NewImportTracker(),
		typesForInit:  make([]conversionType, 0),
	}
}

func (g *genConversion) Namers(c *generator.Context) namer.NameSystems {
	// Have the raw namer for this file track what it imports.
	return namer.NameSystems{"raw": namer.NewRawNamer(g.targetPackage, g.imports)}
}

func (g *genConversion) convertibleOnlyWithinPackage(inType, outType *types.Type) bool {
	var t *types.Type
	var other *types.Type
	if inType.Name.Package == g.targetPackage {
		t, other = inType, outType
	} else {
		t, other = outType, inType
	}

	if t.Name.Package != g.targetPackage {
		return false
	}
	if types.ExtractCommentTags("+", t.CommentLines)["genconversion"] == "false" {
		return false
	}
	// TODO: Consider generating functions for other kinds too.
	if t.Kind != types.Struct {
		return false
	}
	// Also, filter out private types.
	if namer.IsPrivateGoName(other.Name.Name) {
		return false
	}
	return true
}

func (g *genConversion) Filter(c *generator.Context, t *types.Type) bool {
	internalType, exists := getInternalTypeFor(c, t)
	if !exists {
		return false
	}
	if !g.convertibleOnlyWithinPackage(t, internalType) {
		return false
	}
	// We explicitly return true if any conversion is possible - this needs
	// to be checked again while generating code for that type.
	convertible := false
	if isConvertible(t, internalType, g.preexisting) {
		g.typesForInit = append(g.typesForInit, conversionType{t, internalType})
		convertible = true
	}
	if isConvertible(internalType, t, g.preexisting) {
		g.typesForInit = append(g.typesForInit, conversionType{internalType, t})
		convertible = true
	}
	return convertible
}

func (g *genConversion) isOtherPackage(pkg string) bool {
	if pkg == g.targetPackage {
		return false
	}
	if strings.HasSuffix(pkg, `"`+g.targetPackage+`"`) {
		return false
	}
	return true
}

func (g *genConversion) Imports(c *generator.Context) (imports []string) {
	var importLines []string
	if g.isOtherPackage(apiPackagePath) {
		importLines = append(importLines, "api \""+apiPackagePath+"\"")
	}
	if g.isOtherPackage(conversionPackagePath) {
		importLines = append(importLines, "conversion \""+conversionPackagePath+"\"")
	}
	for _, singleImport := range g.imports.ImportLines() {
		if g.isOtherPackage(singleImport) {
			importLines = append(importLines, singleImport)
		}
	}
	return importLines
}

func argsFromType(inType, outType *types.Type) interface{} {
	return map[string]interface{}{
		"inType":  inType,
		"outType": outType,
	}
}

func defaultingArgsFromType(inType *types.Type) interface{} {
	return map[string]interface{}{
		"inType": inType,
	}
}
func (g *genConversion) funcNameTmpl(inType, outType *types.Type) string {
	tmpl := "Convert_$.inType|public$_To_$.outType|public$"
	g.imports.AddType(inType)
	g.imports.AddType(outType)
	return tmpl
}

func (g *genConversion) preexists(inType, outType *types.Type) (*types.Type, bool) {
	function, ok := g.preexisting[conversionType{inType, outType}]
	return function, ok
}

func (g *genConversion) Init(c *generator.Context, w io.Writer) error {
	sw := generator.NewSnippetWriter(w, c, "$", "$")
	sw.Do("func init() {\n", nil)
	if g.targetPackage == apiPackagePath {
		sw.Do("if err := Scheme.AddGeneratedConversionFuncs(\n", nil)
	} else {
		sw.Do("if err := api.Scheme.AddGeneratedConversionFuncs(\n", nil)
	}
	for _, conv := range g.typesForInit {
		funcName := g.funcNameTmpl(conv.inType, conv.outType)
		sw.Do(fmt.Sprintf("%s,\n", funcName), argsFromType(conv.inType, conv.outType))
	}
	sw.Do("); err != nil {\n", nil)
	sw.Do("// if one of the conversion functions is malformed, detect it immediately.\n", nil)
	sw.Do("panic(err)\n", nil)
	sw.Do("}\n", nil)
	sw.Do("}\n\n", nil)
	return sw.Error()
}

func (g *genConversion) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
	sw := generator.NewSnippetWriter(w, c, "$", "$")
	internalType, _ := getInternalTypeFor(c, t)
	if isDirectlyConvertible(t, internalType, g.preexisting) {
		g.generateConversion(t, internalType, sw)
	}
	if isDirectlyConvertible(internalType, t, g.preexisting) {
		g.generateConversion(internalType, t, sw)
	}
	return sw.Error()
}

func (g *genConversion) generateConversion(inType, outType *types.Type, sw *generator.SnippetWriter) {
	funcName := g.funcNameTmpl(inType, outType)
	if g.targetPackage == conversionPackagePath {
		sw.Do(fmt.Sprintf("func auto%s(in *$.inType|raw$, out *$.outType|raw$, s Scope) error {\n", funcName), argsFromType(inType, outType))
	} else {
		sw.Do(fmt.Sprintf("func auto%s(in *$.inType|raw$, out *$.outType|raw$, s conversion.Scope) error {\n", funcName), argsFromType(inType, outType))
	}
	// if no defaulter of form SetDefaults_XXX is defined, do not inline a check for defaulting.
	if function, ok := g.defaulters[inType]; ok {
		sw.Do("$.|raw$(in)\n", function)
	}

	g.generateFor(inType, outType, sw)
	sw.Do("return nil\n", nil)
	sw.Do("}\n\n", nil)

	// If there is no public preexisting Convert method, generate it.
	if _, ok := g.preexists(inType, outType); !ok {
		if g.targetPackage == conversionPackagePath {
			sw.Do(fmt.Sprintf("func %s(in *$.inType|raw$, out *$.outType|raw$, s Scope) error {\n", funcName), argsFromType(inType, outType))
		} else {
			sw.Do(fmt.Sprintf("func %s(in *$.inType|raw$, out *$.outType|raw$, s conversion.Scope) error {\n", funcName), argsFromType(inType, outType))
		}
		sw.Do(fmt.Sprintf("return auto%s(in, out, s)\n", funcName), argsFromType(inType, outType))
		sw.Do("}\n\n", nil)
	}
}

// we use the system of shadowing 'in' and 'out' so that the same code is valid
// at any nesting level. This makes the autogenerator easy to understand, and
// the compiler shouldn't care.
func (g *genConversion) generateFor(inType, outType *types.Type, sw *generator.SnippetWriter) {
	var f func(*types.Type, *types.Type, *generator.SnippetWriter)
	switch inType.Kind {
	case types.Builtin:
		f = g.doBuiltin
	case types.Map:
		f = g.doMap
	case types.Slice:
		f = g.doSlice
	case types.Struct:
		f = g.doStruct
	case types.Pointer:
		f = g.doPointer
	case types.Alias:
		f = g.doAlias
	default:
		f = g.doUnknown
	}
	f(inType, outType, sw)
}

func (g *genConversion) doBuiltin(inType, outType *types.Type, sw *generator.SnippetWriter) {
	if inType == outType {
		sw.Do("*out = *in\n", nil)
	} else {
		sw.Do("*out = $.|raw$(*in)\n", outType)
	}
}

func (g *genConversion) doMap(inType, outType *types.Type, sw *generator.SnippetWriter) {
	sw.Do("*out = make($.|raw$, len(*in))\n", outType)
	if outType.Key.IsAssignable() {
		sw.Do("for key, val := range *in {\n", nil)
		if outType.Elem.IsAssignable() {
			if inType.Key == outType.Key {
				sw.Do("(*out)[key] = ", nil)
			} else {
				sw.Do("(*out)[$.|raw$(key)] = ", outType.Key)
			}
			if inType.Elem == outType.Elem {
				sw.Do("val\n", nil)
			} else {
				sw.Do("$.|raw$(val)\n", outType.Elem)
			}
		} else {
			sw.Do("newVal := new($.|raw$)\n", outType.Elem)
			if function, ok := g.preexists(inType.Elem, outType.Elem); ok {
				sw.Do("if err := $.|raw$(&val, newVal, s); err != nil {\n", function)
			} else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) {
				funcName := g.funcNameTmpl(inType.Elem, outType.Elem)
				sw.Do(fmt.Sprintf("if err := %s(&val, newVal, s); err != nil {\n", funcName), argsFromType(inType.Elem, outType.Elem))
			} else {
				sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil)
				sw.Do("if err := s.Convert(&val, newVal, 0); err != nil {\n", nil)
			}
			sw.Do("return err\n", nil)
			sw.Do("}\n", nil)
			if inType.Key == outType.Key {
				sw.Do("(*out)[key] = *newVal\n", nil)
			} else {
				sw.Do("(*out)[$.|raw$(key)] = *newVal\n", outType.Key)
			}
		}
	} else {
		// TODO: Implement it when necessary.
		sw.Do("for range *in {\n", nil)
		sw.Do("// FIXME: Converting unassignable keys unsupported $.|raw$\n", inType.Key)
	}
	sw.Do("}\n", nil)
}

func (g *genConversion) doSlice(inType, outType *types.Type, sw *generator.SnippetWriter) {
	sw.Do("*out = make($.|raw$, len(*in))\n", outType)
	if inType.Elem == outType.Elem && inType.Elem.Kind == types.Builtin {
		sw.Do("copy(*out, *in)\n", nil)
	} else {
		sw.Do("for i := range *in {\n", nil)
		if outType.Elem.IsAssignable() {
			if inType.Elem == outType.Elem {
				sw.Do("(*out)[i] = (*in)[i]\n", nil)
			} else {
				sw.Do("(*out)[i] = $.|raw$((*in)[i])\n", outType.Elem)
			}
		} else {
			if function, ok := g.preexists(inType.Elem, outType.Elem); ok {
				sw.Do("if err := $.|raw$(&(*in)[i], &(*out)[i], s); err != nil {\n", function)
			} else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) {
				funcName := g.funcNameTmpl(inType.Elem, outType.Elem)
				sw.Do(fmt.Sprintf("if err := %s(&(*in)[i], &(*out)[i], s); err != nil {\n", funcName), argsFromType(inType.Elem, outType.Elem))
			} else {
				sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil)
				sw.Do("if err := s.Convert(&(*in)[i], &(*out)[i], 0); err != nil {\n", nil)
			}
			sw.Do("return err\n", nil)
			sw.Do("}\n", nil)
		}
		sw.Do("}\n", nil)
	}
}

func (g *genConversion) doStruct(inType, outType *types.Type, sw *generator.SnippetWriter) {
	for _, m := range inType.Members {
		outMember, isOutMember := findMember(outType, m.Name)
		if !isOutMember {
			// Since this object wasn't filtered out, this means that
			// this field has "genconversion=false" comment to ignore it.
			continue
		}
		args := map[string]interface{}{
			"inType":  m.Type,
			"outType": outMember.Type,
			"name":    m.Name,
		}
		if function, ok := g.preexists(m.Type, outMember.Type); ok {
			args["function"] = function
			sw.Do("if err := $.function|raw$(&in.$.name$, &out.$.name$, s); err != nil {\n", args)
			sw.Do("return err\n", nil)
			sw.Do("}\n", nil)
			continue
		}
		switch m.Type.Kind {
		case types.Builtin:
			if m.Type == outMember.Type {
				sw.Do("out.$.name$ = in.$.name$\n", args)
			} else {
				sw.Do("out.$.name$ = $.outType|raw$(in.$.name$)\n", args)
			}
		case types.Map, types.Slice, types.Pointer:
			sw.Do("if in.$.name$ != nil {\n", args)
			sw.Do("in, out := &in.$.name$, &out.$.name$\n", args)
			g.generateFor(m.Type, outMember.Type, sw)
			sw.Do("} else {\n", nil)
			sw.Do("out.$.name$ = nil\n", args)
			sw.Do("}\n", nil)
		case types.Struct:
			if g.convertibleOnlyWithinPackage(m.Type, outMember.Type) {
				funcName := g.funcNameTmpl(m.Type, outMember.Type)
				sw.Do(fmt.Sprintf("if err := %s(&in.$.name$, &out.$.name$, s); err != nil {\n", funcName), args)
			} else {
				sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil)
				sw.Do("if err := s.Convert(&in.$.name$, &out.$.name$, 0); err != nil {\n", args)
			}
			sw.Do("return err\n", nil)
			sw.Do("}\n", nil)
		case types.Alias:
			if outMember.Type.IsAssignable() {
				if m.Type == outMember.Type {
					sw.Do("out.$.name$ = in.$.name$\n", args)
				} else {
					sw.Do("out.$.name$ = $.outType|raw$(in.$.name$)\n", args)
				}
			} else {
				if g.convertibleOnlyWithinPackage(m.Type, outMember.Type) {
					funcName := g.funcNameTmpl(m.Type, outMember.Type)
					sw.Do(fmt.Sprintf("if err := %s(&in.$.name$, &out.$.name$, s); err != nil {\n", funcName), args)
				} else {
					sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil)
					sw.Do("if err := s.Convert(&in.$.name$, &out.$.name$, 0); err != nil {\n", args)
				}
				sw.Do("return err\n", nil)
				sw.Do("}\n", nil)
			}
		default:
			if g.convertibleOnlyWithinPackage(m.Type, outMember.Type) {
				funcName := g.funcNameTmpl(m.Type, outMember.Type)
				sw.Do(fmt.Sprintf("if err := %s(&in.$.name$, &out.$.name$, s); err != nil {\n", funcName), args)
			} else {
				sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil)
				sw.Do("if err := s.Convert(&in.$.name$, &out.$.name$, 0); err != nil {\n", args)
			}
			sw.Do("return err\n", nil)
			sw.Do("}\n", nil)
		}
	}
}

func (g *genConversion) doPointer(inType, outType *types.Type, sw *generator.SnippetWriter) {
	sw.Do("*out = new($.Elem|raw$)\n", outType)
	if outType.Elem.IsAssignable() {
		if inType.Elem == outType.Elem {
			sw.Do("**out = **in\n", nil)
		} else {
			sw.Do("**out = $.|raw$(**in)\n", outType.Elem)
		}
	} else {
		if function, ok := g.preexists(inType.Elem, outType.Elem); ok {
			sw.Do("if err := $.|raw$(*in, *out, s); err != nil {\n", function)
		} else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) {
			funcName := g.funcNameTmpl(inType.Elem, outType.Elem)
			sw.Do(fmt.Sprintf("if err := %s(*in, *out, s); err != nil {\n", funcName), argsFromType(inType.Elem, outType.Elem))
		} else {
			sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil)
			sw.Do("if err := s.Convert(*in, *out, 0); err != nil {\n", nil)
		}
		sw.Do("return err\n", nil)
		sw.Do("}\n", nil)
	}
}

func (g *genConversion) doAlias(inType, outType *types.Type, sw *generator.SnippetWriter) {
	// TODO: Add support for aliases.
	g.doUnknown(inType, outType, sw)
}

func (g *genConversion) doUnknown(inType, outType *types.Type, sw *generator.SnippetWriter) {
	sw.Do("// FIXME: Type $.|raw$ is unsupported.\n", inType)
}


text:
<?xml version="1.0" encoding="utf-8"?>
<carbon.widget.LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:gravity="center_vertical"
    android:orientation="horizontal"
    android:padding="@dimen/carbon_padding"
    app:carbon_insetColor="?attr/colorPrimary">

    <carbon.widget.DropDown
        android:id="@+id/day"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_weight="1"
        android:text="1"
        app:carbon_tint="?attr/colorPrimary" />

    <carbon.widget.DropDown
        android:id="@+id/month"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="Jan"
        app:carbon_tint="?attr/colorPrimary" />

    <carbon.widget.DropDown
        android:id="@+id/year"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_weight="1"
        android:text="1987"
        app:carbon_tint="?attr/colorPrimary" />

</carbon.widget.LinearLayout>


text:
<?php

namespace Doctrine\Tests\ODM\PHPCR\Mapping\Model;

use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;

/**
 * A class that uses the repository strategy to generate IDs.
 *
 * @PHPCRODM\Document(referenceable=true)
 */
class ReferenceableMappingObject
{
    /** @PHPCRODM\Id */
    public $id;
}


text:
<?php
namespace ValuSoTest\Command;

use ValuSo\Command\Command;
use ValuSo\Exception\SkippableException;
use ValuSoTest\TestAsset\ClosureService;
use PHPUnit_Framework_TestCase;
use ValuSo\Command\CommandManager;

/**
 * CommandManager test case.
 */
class CommandManagerTest extends PHPUnit_Framework_TestCase
{

    /**
     *
     * @var CommandManager
     */
    private $commandManager;

    /**
     * Prepares the environment before running a test.
     */
    protected function setUp()
    {
        parent::setUp();

        $this->commandManager = new CommandManager();
    }

    /**
     * Cleans up the environment after running a test.
     */
    protected function tearDown()
    {
        // TODO Auto-generated CommandManagerTest::tearDown()
        $this->commandManager = null;

        parent::tearDown();
    }

    public function testAttach()
    {
        $s1 = new ClosureService();
        $listener = $this->commandManager->attach('test', $s1, 1000);

        $this->assertInstanceOf('ValuSo\Command\LazyCallbackHandler', $listener);
        $this->assertSame($s1, $listener->getCallback());
        $this->assertEquals(1000,$listener->getMetadatum('priority'));
    }

    public function testDetach()
    {
        $s1 = new ClosureService();
        $cmd = new Command('test');

        $listener = $this->commandManager->attach('test', $s1, 1000);
        $this->assertFalse($this->commandManager->trigger($cmd)->isEmpty());
        $this->assertTrue($this->commandManager->detach($listener));
        $this->assertTrue($this->commandManager->trigger($cmd)->isEmpty());
    }

    public function testServiceIsExcecuted()
    {
        $s1 = new ClosureService(function(){return 'executed';});
        $this->commandManager->attach('test', $s1);

        $cmd = new Command('test', 'test');
        $responses = $this->commandManager->trigger($cmd);

        $this->assertEquals(
            'executed',
            $responses->last());
    }

    public function testServiceNameIsCaseInsensitiveWhenExecuted()
    {
        $s1 = new ClosureService(function(){return 'executed';});
        $this->commandManager->attach('test', $s1);

        $cmd = new Command('Test');
        $responses = $this->commandManager->trigger($cmd);

        $this->assertEquals(
            'executed',
            $responses->last());
    }

    public function testCorrectServiceIsExcecuted()
    {
        $s1 = new ClosureService(function(){return 'first';});
        $s2 = new ClosureService(function(){return 'second';});
        $this->commandManager->attach('test1', $s1);
        $this->commandManager->attach('test2', $s2);

        $cmd = new Command('test1', 'test');
        $responses = $this->commandManager->trigger($cmd);

        $this->assertEquals(
            'first',
            $responses->first());

        $this->assertEquals(
            'first',
            $responses->last());
    }

    public function testLazyServiceIsExcetuted()
    {
        $this->commandManager->attach('Test.Service', 'testid');
        $this->commandManager->getServiceLoader()->registerService(
                'testid',
                'Test.Service',
                new ClosureService(function($c){return $c->getOperation() == 'run' ? 'executed' : null;}));

        $cmd = new Command('Test.Service', 'run');
        $responses = $this->commandManager->trigger($cmd);

        $this->assertEquals(
            'executed',
            $responses->last());
    }

    public function testMultipleServicesAreExecuted()
    {
        $s1 = new ClosureService(function(){return 'first';});
        $s2 = new ClosureService(function(){return 'last';});
        $this->commandManager->attach('test', $s1);
        $this->commandManager->attach('test', $s2);

        $cmd = new Command('test', 'test');
        $responses = $this->commandManager->trigger($cmd);

        $this->assertEquals(
                'first',
                $responses->first());

        $this->assertEquals(
                'last',
                $responses->last());
    }

    public function testCommandIsPassedToService()
    {
        $s1 = new ClosureService(function($command){return $command;});

        $cmd = new Command('test', 'test');

        $cb = $this->commandManager->attach('test', $s1);
        $responses = $this->commandManager->trigger($cmd);

        $this->assertSame(
            $cmd,
            $responses->first());
    }

    public function testExecutionStopsWhenPropagationIsStopped()
    {
        $s1 = new ClosureService(function($command){$command->stopPropagation(); return 'first';});
        $s2 = new ClosureService(function(){return 'last';});
        $this->commandManager->attach('test', $s1);
        $this->commandManager->attach('test', $s2);

        $cmd = new Command('test', 'test');
        $responses = $this->commandManager->trigger($cmd);

        $this->assertEquals(
                'first',
                $responses->last());

        $this->assertTrue($responses->stopped());
    }

    public function testTriggerContinuesWithSkippableException()
    {
        $s1 = new ClosureService(function(){throw new SkippableException('Skippable');});
        $s2 = new ClosureService(function(){return null;});

        $this->commandManager->attach('test', $s1);
        $this->commandManager->attach('test', $s2);

        $cmd = new Command('test', 'test');
        $responses = $this->commandManager->trigger($cmd);
    }

    /**
     * @expectedException ValuSo\Exception\SkippableException
     */
    public function testTriggerFailsWithSkippableExceptionAndEmptyResponses()
    {
        $s1 = new ClosureService(function(){throw new SkippableException('Skippable');});
        $this->commandManager->attach('test', $s1);

        $cmd = new Command('test', 'test');
        $responses = $this->commandManager->trigger($cmd);
    }

    /**
     * @expectedException \Exception
     */
    public function testTriggerThrowsNonServiceException()
    {
        $s1 = new ClosureService(function(){throw new \Exception('DIE!');});
        $s2 = new ClosureService(function(){return true;});

        $this->commandManager->attach('test', $s1);

        $cmd = new Command('test', 'test');
        $responses = $this->commandManager->trigger($cmd);
    }
}


text:
import React from 'react'

import styles from './styles.scss'

import Api from '../../api'

class Login extends React.Component {
  render() {
    setTimeout(() => { window.location = Api.getOpenIdUrl() }, 750)
    return (

        Redirecting you to Azure login...

    )
  }
}

export default Login


text:
<?php

$username = "";
$password ="";
$hostname = "";
$db = "";

mysql_connect($hostname,$username,$password) or die(mysql_error());
$database = mysql_select_db($db) or die(mysql_error());
?>


text:
"""This file contains a unit test for the EventFilter."""

import unittest

from plaso.lib import event_test
from plaso.lib import eventdata
# pylint: disable=unused-import
from plaso.formatters import winreg

class TestEvent1Formatter(eventdata.EventFormatter):
  """Test event 1 formatter."""
  DATA_TYPE = 'test:event1'
  FORMAT_STRING = u'{text}'

  SOURCE_SHORT = 'FILE'
  SOURCE_LONG = 'Weird Log File'

class WrongEventFormatter(eventdata.EventFormatter):
  """A simple event formatter."""
  DATA_TYPE = 'test:wrong'
  FORMAT_STRING = u'This format string does not match {body}.'

  SOURCE_SHORT = 'FILE'
  SOURCE_LONG = 'Weird Log File'

class EventFormatterUnitTest(unittest.TestCase):
  """The unit test for the event formatter."""

  def setUp(self):
    """Sets up the needed objects used throughout the test."""
    self.event_objects = event_test.GetEventObjects()

  def GetCSVLine(self, event_object):
    """Takes an EventObject and prints out a simple CSV line from it."""
    get_sources = eventdata.EventFormatterManager.GetSourceStrings
    try:
      msg, _ = eventdata.EventFormatterManager.GetMessageStrings(event_object)
      source_short, source_long = get_sources(event_object)
    except KeyError:
      print event_object.GetAttributes()
    return u'{0:d},{1:s},{2:s},{3:s}'.format(
        event_object.timestamp, source_short, source_long, msg)

  def testInitialization(self):
    """Test the initialization."""
    self.assertTrue(TestEvent1Formatter())

  def testAttributes(self):
    """Test if we can read the event attributes correctly."""
    events = {}
    for event_object in self.event_objects:
      events[self.GetCSVLine(event_object)] = True

    self.assertIn((
        u'1334961526929596,REG,UNKNOWN key,[MY AutoRun key] Run: '
        u'c:/Temp/evil.exe'), events)

    self.assertIn(
        (u'1334966206929596,REG,UNKNOWN key,[//HKCU/Secret/EvilEmpire/'
         u'Malicious_key] Value: REGALERT: send all the exes to the other '
         u'world'), events)
    self.assertIn((u'1334940286000000,REG,UNKNOWN key,[//HKCU/Windows'
                   u'/Normal] Value: run all the benign stuff'), events)
    self.assertIn((u'1335781787929596,FILE,Weird Log File,This log line reads '
                   u'ohh so much.'), events)
    self.assertIn((u'1335781787929596,FILE,Weird Log File,Nothing of interest'
                   u' here, move on.'), events)
    self.assertIn((u'1335791207939596,FILE,Weird Log File,Mr. Evil just logged'
                   u' into the machine and got root.'), events)

  def testTextBasedEvent(self):
    """Test a text based event."""
    for event_object in self.event_objects:
      source_short, _ = eventdata.EventFormatterManager.GetSourceStrings(
          event_object)
      if source_short == 'LOG':
        msg, msg_short = eventdata.EventFormatterManager.GetMessageStrings(
            event_object)

        self.assertEquals(msg, (
            u'This is a line by someone not reading the log line properly. And '
            u'since this log line exceeds the accepted 80 chars it will be '
            u'shortened.'))
        self.assertEquals(msg_short, (
            u'This is a line by someone not reading the log line properly. '
            u'And since this l...'))

class ConditionalTestEvent1(event_test.TestEvent1):
  DATA_TYPE = 'test:conditional_event1'

class ConditionalTestEvent1Formatter(eventdata.ConditionalEventFormatter):
  """Test event 1 conditional (event) formatter."""
  DATA_TYPE = 'test:conditional_event1'
  FORMAT_STRING_PIECES = [
      u'Description: {description}',
      u'Comment',
      u'Value: 0x{numeric:02x}',
      u'Optional: {optional}',
      u'Text: {text}']

  SOURCE_SHORT = 'LOG'
  SOURCE_LONG = 'Some Text File.'

class BrokenConditionalEventFormatter(eventdata.ConditionalEventFormatter):
  """A broken conditional event formatter."""
  DATA_TYPE = 'test:broken_conditional'
  FORMAT_STRING_PIECES = [u'{too} {many} formatting placeholders']

  SOURCE_SHORT = 'LOG'
  SOURCE_LONG = 'Some Text File.'

class ConditionalEventFormatterUnitTest(unittest.TestCase):
  """The unit test for the conditional event formatter."""

  def setUp(self):
    """Sets up the needed objects used throughout the test."""
    self.event_object = ConditionalTestEvent1(1335791207939596, {
        'numeric': 12, 'description': 'this is beyond words',
        'text': 'but we\'re still trying to say something about the event'})

  def testInitialization(self):
    """Test the initialization."""
    self.assertTrue(ConditionalTestEvent1Formatter())
    with self.assertRaises(RuntimeError):
      BrokenConditionalEventFormatter()

  def testGetMessages(self):
    """Test get messages."""
    event_formatter = ConditionalTestEvent1Formatter()
    msg, _ = event_formatter.GetMessages(self.event_object)

    expected_msg = (
        u'Description: this is beyond words Comment Value: 0x0c '
        u'Text: but we\'re still trying to say something about the event')
    self.assertEquals(msg, expected_msg)

if __name__ == '__main__':
  unittest.main()


text:
            Daftar Member

                                <input type="checkbox" id="select-all" class="filled-in" v-model="allSelected" @click="selectAll" />

                        Nama
                        NOP
                        Transaksi Terakhir
                        Saldo
                        Tagihan
                        Action

 parseInt(item.tagihan)">
                                <input type="checkbox" class="filled-in" :id="'check-member-' + item.no_objekpajak" v-model="selectedMember" :value="item.no_objekpajak" />

                        {{ item.nama_depan + ' ' + item.nama_belakang }}
                        {{ item.no_objekpajak }}<input type="hidden" name="no_objekpajak" :value="item.no_objekpajak">
                        {{ item.transaksi_terakhir }}
                        Rp. {{ item.saldo }}
                        Rp. {{ item.tagihan }}

                            check

                            add

                            visibility

{{ rowRange }}

skip_previous

chevron_left

{{ link }}

chevron_right

skip_next

loop


text:
package gw.internal.schema.gw.xsd.w3c.xmlschema.anonymous.types.complex;

/***************************************************************************/
/* THIS IS AUTOGENERATED CODE - DO NOT MODIFY OR YOUR CHANGES WILL BE LOST */
/* THIS CODE CAN BE REGENERATED USING 'xsd-codegen'                        */
/***************************************************************************/
public class List extends gw.internal.schema.gw.xsd.w3c.xmlschema.types.complex.Annotated implements gw.internal.xml.IXmlGeneratedClass {

  public static final javax.xml.namespace.QName $ATTRIBUTE_QNAME_Id = new javax.xml.namespace.QName( "", "id", "" );
  public static final javax.xml.namespace.QName $ATTRIBUTE_QNAME_ItemType = new javax.xml.namespace.QName( "", "itemType", "" );
  public static final javax.xml.namespace.QName $ELEMENT_QNAME_Annotation = new javax.xml.namespace.QName( "http://www.w3.org/2001/XMLSchema", "annotation", "xs" );
  public static final javax.xml.namespace.QName $ELEMENT_QNAME_SimpleType = new javax.xml.namespace.QName( "http://www.w3.org/2001/XMLSchema", "simpleType", "xs" );
  public static final gw.util.concurrent.LockingLazyVar<gw.lang.reflect.IType> TYPE = new gw.util.concurrent.LockingLazyVar<gw.lang.reflect.IType>( gw.lang.reflect.TypeSystem.getGlobalLock() ) {
          @Override
          protected gw.lang.reflect.IType init() {
            return gw.lang.reflect.TypeSystem.getByFullName( "gw.xsd.w3c.xmlschema.anonymous.types.complex.List" );
          }
        };
  private static final gw.util.concurrent.LockingLazyVar<java.lang.Object> SCHEMAINFO = new gw.util.concurrent.LockingLazyVar<java.lang.Object>( gw.lang.reflect.TypeSystem.getGlobalLock() ) {
          @Override
          protected java.lang.Object init() {
            gw.lang.reflect.IType type = TYPE.get();
            return getSchemaInfoByType( type );
          }
        };

  public List() {
    super( TYPE.get(), SCHEMAINFO.get() );
  }

  protected List( gw.lang.reflect.IType type, java.lang.Object schemaInfo ) {
    super( type, schemaInfo );
  }

  public gw.internal.schema.gw.xsd.w3c.xmlschema.Annotation Annotation() {
    return (gw.internal.schema.gw.xsd.w3c.xmlschema.Annotation) TYPE.get().getTypeInfo().getProperty( "Annotation" ).getAccessor().getValue( this );
  }

  public void setAnnotation$( gw.internal.schema.gw.xsd.w3c.xmlschema.Annotation param ) {
    TYPE.get().getTypeInfo().getProperty( "Annotation" ).getAccessor().setValue( this, param );
  }

  public java.lang.String Id() {
    return (java.lang.String) TYPE.get().getTypeInfo().getProperty( "Id" ).getAccessor().getValue( this );
  }

  public void setId$( java.lang.String param ) {
    TYPE.get().getTypeInfo().getProperty( "Id" ).getAccessor().setValue( this, param );
  }

  public javax.xml.namespace.QName ItemType() {
    return (javax.xml.namespace.QName) TYPE.get().getTypeInfo().getProperty( "ItemType" ).getAccessor().getValue( this );
  }

  public void setItemType$( javax.xml.namespace.QName param ) {
    TYPE.get().getTypeInfo().getProperty( "ItemType" ).getAccessor().setValue( this, param );
  }

  public gw.internal.schema.gw.xsd.w3c.xmlschema.anonymous.elements.List_SimpleType SimpleType() {
    return (gw.internal.schema.gw.xsd.w3c.xmlschema.anonymous.elements.List_SimpleType) TYPE.get().getTypeInfo().getProperty( "SimpleType" ).getAccessor().getValue( this );
  }

  public void setSimpleType$( gw.internal.schema.gw.xsd.w3c.xmlschema.anonymous.elements.List_SimpleType param ) {
    TYPE.get().getTypeInfo().getProperty( "SimpleType" ).getAccessor().setValue( this, param );
  }

  @SuppressWarnings( {"UnusedDeclaration"} )
  private static final long FINGERPRINT = 2110283714877373226L;

}


text:
module.exports = {
    boss: true,
    curly: true,
    eqeqeq: true,
    eqnull: true,
    expr: true,
    immed: true,
    noarg: true,

    // Never force string to quoting with single or double quotemarks
    quotmark: false,
    smarttabs: true,
    undef: true,
    unused: true,

    sub: true,

    browser: true,
    es5: true,

    // Defining each variables with a `var` statement is more convenient for coding
    onevar: false,

    asi: false,
    lastsemic: false,

    // Report JSHint errors but not fail the task
    // force: true,

    // Declare commonjs env
    globals: {
        require: true,
        module: true,
        exports: true,
        define: true,
        NR: true
    }
}


text:
<?php

namespace FG\ASN1\Universal;

use FG\ASN1\AbstractString;
use FG\ASN1\Identifier;

/**
 * The International Alphabet No.5 (IA5) references the encoding of the ASCII characters.
 *
 * Each character in the data is encoded as 1 byte.
 */
class IA5String extends AbstractString
{
    public function __construct($string)
    {
        parent::__construct($string);
        for ($i = 1; $i < 128; $i++) {
            $this->allowCharacter(chr($i));
        }
    }

    public function getType()
    {
        return Identifier::IA5_STRING;
    }
}


text:
<?php

namespace NewClubsORM;

use NewClubsORM\om\BaseLogQuery;

/**
 * Skeleton subclass for performing query and update operations on the 'log' table.
 *
 *
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 * @package    propel.generator.newclubs
 */
class LogQuery extends BaseLogQuery {

} // LogQuery