text:
#ifndef __COCOS2D_H__
#define __COCOS2D_H__

// 0x00 HI ME LO
// 00   03 02 00
#define COCOS2D_VERSION 0x00030200

//
// all cocos2d include files
//
#include "base/ccConfig.h"

// base
#include "base/CCRef.h"
#include "base/CCRefPtr.h"
#include "base/CCVector.h"
#include "base/CCMap.h"
#include "base/CCAutoreleasePool.h"
#include "base/CCNS.h"
#include "base/CCData.h"
#include "base/CCValue.h"
#include "base/ccConfig.h"
#include "base/ccMacros.h"
#include "base/ccTypes.h"
#include "base/CCConfiguration.h"
#include "base/CCDirector.h"
#include "base/CCScheduler.h"
#include "base/base64.h"
#include "base/ZipUtils.h"
#include "base/CCProfiling.h"
#include "base/CCConsole.h"
#include "base/ccUTF8.h"
#include "base/CCUserDefault.h"
#include "base/CCIMEDelegate.h"
#include "base/CCIMEDispatcher.h"
#include "base/ccUtils.h"

// EventDispatcher
#include "base/CCEventType.h"
#include "base/CCEventDispatcher.h"
#include "base/CCEventListenerTouch.h"
#include "base/CCEventTouch.h"
#include "base/CCEventListenerKeyboard.h"
#include "base/CCEventKeyboard.h"
#include "base/CCEventListenerMouse.h"
#include "base/CCEventMouse.h"
#include "base/CCEventAcceleration.h"
#include "base/CCEventListenerAcceleration.h"
#include "base/CCEventCustom.h"
#include "base/CCEventListenerCustom.h"
#include "base/CCEventFocus.h"
#include "base/CCEventListenerFocus.h"

// math
#include "math/CCAffineTransform.h"
#include "math/CCGeometry.h"
#include "math/Vec2.h"
#include "math/Vec3.h"
#include "math/Vec4.h"
#include "math/Mat4.h"
#include "math/Quaternion.h"
#include "math/MathUtil.h"
#include "math/CCVertex.h"

// actions
#include "2d/CCAction.h"
#include "2d/CCActionInterval.h"
#include "2d/CCActionCamera.h"
#include "2d/CCActionManager.h"
#include "2d/CCActionEase.h"
#include "2d/CCActionPageTurn3D.h"
#include "2d/CCActionGrid.h"
#include "2d/CCActionProgressTimer.h"
#include "2d/CCActionGrid3D.h"
#include "2d/CCActionTiledGrid.h"
#include "2d/CCActionInstant.h"
#include "2d/CCActionTween.h"
#include "2d/CCActionCatmullRom.h"
#include "2d/CCTweenFunction.h"

// 2d nodes
#include "2d/CCNode.h"
#include "2d/CCAtlasNode.h"
#include "2d/CCDrawingPrimitives.h"
#include "2d/CCDrawNode.h"
#include "2d/CCLabelAtlas.h"
#include "2d/CCLabelTTF.h"
#include "2d/CCLabelBMFont.h"
#include "2d/CCLabel.h"
#include "2d/CCFontFNT.h"
#include "2d/CCLayer.h"
#include "2d/CCScene.h"
#include "2d/CCTransition.h"
#include "2d/CCTransitionPageTurn.h"
#include "2d/CCTransitionProgress.h"
#include "2d/CCMenu.h"
#include "2d/CCMenuItem.h"
#include "2d/CCClippingNode.h"
#include "2d/CCMotionStreak.h"
#include "2d/CCProgressTimer.h"
#include "2d/CCRenderTexture.h"
#include "2d/CCNodeGrid.h"
#include "2d/CCParticleBatchNode.h"
#include "2d/CCParticleSystem.h"
#include "2d/CCParticleExamples.h"
#include "2d/CCParticleSystemQuad.h"

// 2d utils
#include "2d/CCGrabber.h"
#include "2d/CCGrid.h"

// include
#include "base/CCProtocols.h"

// renderer
#include "renderer/CCCustomCommand.h"
#include "renderer/CCGroupCommand.h"
#include "renderer/CCQuadCommand.h"
#include "renderer/CCRenderCommand.h"
#include "renderer/CCRenderCommandPool.h"
#include "renderer/CCRenderer.h"
#include "renderer/CCGLProgram.h"
#include "renderer/CCGLProgramCache.h"
#include "renderer/CCGLProgramState.h"
#include "renderer/ccGLStateCache.h"
#include "renderer/ccShaders.h"
#include "renderer/CCTexture2D.h"
#include "renderer/CCTextureCache.h"

// physics
#include "physics/CCPhysicsBody.h"
#include "physics/CCPhysicsContact.h"
#include "physics/CCPhysicsShape.h"
#include "physics/CCPhysicsJoint.h"
#include "physics/CCPhysicsWorld.h"

// platform
#include "platform/CCDevice.h"
#include "platform/CCCommon.h"
#include "platform/CCFileUtils.h"
#include "platform/CCImage.h"
#include "platform/CCSAXParser.h"
#include "platform/CCThread.h"
#include "base/CCPlatformConfig.h"
#include "base/CCPlatformMacros.h"

#if (CC_TARGET_PLATFORM == CC_PLATFORM_QT5)
  #ifdef USE_GLFW
    #include "platform/qt/glfw/CCApplication.h"
    #include "platform/qt/glfw/CCGLView.h"
    #include "platform/qt/glfw/CCGL.h"
    #include "platform/qt/glfw/CCStdC.h"
    #include "platform/qt/glfw/UIMessageAdapter.h"
  #else /* USE_GLFW */
    #include "platform/qt/CCApplication.h"
    #include "platform/qt/CCGLView.h"
    #include "platform/qt/CCGL.h"
    #include "platform/qt/CCStdC.h"
  #endif /* USE_GLFW */
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_QT5

#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
    #include "platform/ios/CCApplication.h"
    #include "platform/ios/CCGLView.h"
    #include "platform/ios/CCGL.h"
    #include "platform/ios/CCStdC.h"
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_IOS

#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
    #include "platform/android/CCApplication.h"
    #include "platform/android/CCGLView.h"
    #include "platform/android/CCGL.h"
    #include "platform/android/CCStdC.h"
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID

#if (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY)
    #include "platform/blackberry/CCApplication.h"
    #include "platform/blackberry/CCGLView.h"
    #include "platform/blackberry/CCGL.h"
    #include "platform/blackberry/CCStdC.h"
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY

#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
    #include "platform/win32/CCApplication.h"
    #include "platform/desktop/CCGLView.h"
    #include "platform/win32/CCGL.h"
    #include "platform/win32/CCStdC.h"
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32

#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
    #include "platform/mac/CCApplication.h"
    #include "platform/desktop/CCGLView.h"
    #include "platform/mac/CCGL.h"
    #include "platform/mac/CCStdC.h"
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC

#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
    #include "platform/linux/CCApplication.h"
    #include "platform/desktop/CCGLView.h"
    #include "platform/linux/CCGL.h"
    #include "platform/linux/CCStdC.h"
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX

#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
	#include "platform/winrt/CCApplication.h"
	#include "platform/winrt/CCGLView.h"
	#include "platform/winrt/CCGL.h"
	#include "platform/winrt/CCStdC.h"
	#include "platform/winrt/CCPrecompiledShaders.h"
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WINRT

#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
	#include "platform/winrt/CCApplication.h"
	#include "platform/wp8/CCGLView.h"
	#include "platform/winrt/CCGL.h"
	#include "platform/winrt/CCStdC.h"
	#include "platform/winrt/CCPrecompiledShaders.h"
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WP8

// script_support
#include "base/CCScriptSupport.h"

// sprite_nodes
#include "2d/CCAnimation.h"
#include "2d/CCAnimationCache.h"
#include "2d/CCSprite.h"
#include "2d/CCSpriteBatchNode.h"
#include "2d/CCSpriteFrame.h"
#include "2d/CCSpriteFrameCache.h"

// text_input_node
#include "2d/CCTextFieldTTF.h"

// textures
#include "renderer/CCTextureAtlas.h"

// tilemap_parallax_nodes
#include "2d/CCParallaxNode.h"
#include "2d/CCTMXLayer.h"
#include "2d/CCTMXObjectGroup.h"
#include "2d/CCTMXTiledMap.h"
#include "2d/CCTMXXMLParser.h"
#include "2d/CCTileMapAtlas.h"
#include "2d/CCFastTMXTiledMap.h"
#include "2d/CCFastTMXLayer.h"

// component
#include "2d/CCComponent.h"
#include "2d/CCComponentContainer.h"

//3d
#include "3d/CCSprite3D.h"
#include "3d/CCMesh.h"
#include "3d/CCMeshSkin.h"
#include "3d/CCAnimate3D.h"
#include "3d/CCAnimation3D.h"
#include "3d/CCSprite3DMaterial.h"

// Audio
#include "audio/include/SimpleAudioEngine.h"

// Deprecated include
#include "deprecated/CCDictionary.h"
#include "deprecated/CCArray.h"
#include "deprecated/CCSet.h"
#include "deprecated/CCInteger.h"
#include "deprecated/CCFloat.h"
#include "deprecated/CCDouble.h"
#include "deprecated/CCBool.h"
#include "deprecated/CCString.h"
#include "deprecated/CCNotificationCenter.h"
// CCDeprecated.h must be included at the end
#include "deprecated/CCDeprecated.h"

NS_CC_BEGIN

CC_DLL const char* cocos2dVersion();

NS_CC_END

#endif // __COCOS2D_H__


text:
@interface BDPhotoCameraViewController : UIViewController

@end

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace DataSift\WebDriver;

/**
 * Exception thrown when we attempt to interact with a collection that
 * does not exist.
 *
 * I haven't actually seen this exception occur, so I'm not entirely
 * certain what a collection is.
 *
 * @category Libraries
 * @package  WebDriver
 * @license  http://www.apache.org/licenses/LICENSE-2.0
 * @link     http://www.datasift.com
 * @link     http://facebook.com
 */

class E4xx_NoSuchCollectionWebDriverError extends Exxx_WebDriverException
{
	public function __construct($msg) {
		parent::__construct(400, $msg, $msg);
	}
}


text:
<?php

namespace Oro\Bundle\SidebarBundle\Tests\Unit\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;

use Oro\Bundle\SidebarBundle\DependencyInjection\OroSidebarExtension;
use Oro\Bundle\SidebarBundle\Tests\Unit\Fixtures;

use Oro\Component\Config\CumulativeResourceManager;

class OroSidebarExtensionTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @dataProvider loadDataProvider
     */
    public function testLoad(array $configs, array $expectedThemeSettings)
    {
        $bundle1 = new Fixtures\FooBundle\FooBundle();
        $bundle2 = new Fixtures\BarBundle\BarBundle();

        CumulativeResourceManager::getInstance()
            ->clear()
            ->setBundles([$bundle1->getName() => get_class($bundle1), $bundle2->getName() => get_class($bundle2)]);

        $extension = new OroSidebarExtension();

        $container = new ContainerBuilder();

        $extension->load($configs, $container);

        $this->assertEquals(
            $expectedThemeSettings,
            $container->getParameter(OroSidebarExtension::WIDGETS_SETTINGS_PARAMETER)
        );

        $this->assertNotNull($container->getDefinition('oro_sidebar.widget_definition.registry'));
        $this->assertNotNull($container->getDefinition('oro_sidebar.twig.extension'));
    }

    public function loadDataProvider()
    {
        return array(
            'basic' => array(
                'configs' => array(
                    array()
                ),
                'expectedThemeSettings' => array(
                    'foo' => array(
                        'title' => 'Foo',
                        'icon' => 'foo.ico',
                        'iconClass' => null,
                        'module' => 'widget/foo',
                        'placement' => 'left',
                        'settings' => array('test' => 'Hello')
                    ),
                    'bar' => array(
                        'title' => 'Bar',
                        'icon' => null,
                        'iconClass' => 'test',
                        'module' => 'widget/bar',
                        'placement' => 'both',
                        'settings' => null
                    )
                ),
            ),
            'override' => array(
                'configs' => array(
                    array(
                        'sidebar_widgets' => array(
                            'foo' => array(
                                'title' => 'Foo Extended',
                                'settings' => array('test2' => 'Rewritten'),
                                'icon' => null,
                                'iconClass' => 'test2'
                            )
                        )
                    )
                ),
                'expectedThemeSettings' => array(
                    'foo' => array(
                        'title' => 'Foo Extended',
                        'icon' => null,
                        'iconClass' => 'test2',
                        'module' => 'widget/foo',
                        'placement' => 'left',
                        'settings' => array('test2' => 'Rewritten')

                    ),
                    'bar' => array(
                        'title' => 'Bar',
                        'icon' => null,
                        'iconClass' => 'test',
                        'module' => 'widget/bar',
                        'placement' => 'both',
                        'settings' => null
                    )
                ),
            )
        );
    }
}


text:
package com.jjc.mailshop.biz;

import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * 基类  API
 */
public class BaseApi {
    private Retrofit retrofit = null;
    private OkHttpClient client = null;
    public static final String AUTHORIZATION = "Authorization";
    private static final long connectTimeoutMills = 10 * 1000L;
    private static final long readTimeoutMills = 10 * 1000L;

    private static BaseApi instance;

    private BaseApi() {

    }

    public static synchronized BaseApi getInstance() {
        if (instance == null)
            instance = new BaseApi();
        return instance;
    }
    /***
     * 外部传递url
     *
     * @param service 服务
     * @param baseUrl url
     * @param <S> 泛型
     * @return 泛型
     */
    public static <S> S get(Class<S> service, String baseUrl) {
        return getInstance().getRetrofit( baseUrl).create(service);
    }

    /**
     * 传递url
     *
     * @param baseUrl
     * @return
     */
    public Retrofit getRetrofit(String baseUrl) {
        if (retrofit == null) {
            Retrofit.Builder builder = new Retrofit.Builder()
                    .baseUrl(baseUrl)
                    .client(getClient())
                    .addConverterFactory(GsonConverterFactory.create());
            builder.addCallAdapterFactory(RxJavaCallAdapterFactory.create());
            retrofit = builder.build();
        }
        return retrofit;
    }

    public OkHttpClient getClient() {
        if (client == null) {
            OkHttpClient.Builder builder = new OkHttpClient.Builder();
            builder.connectTimeout(connectTimeoutMills, TimeUnit.MILLISECONDS);
            builder.readTimeout(readTimeoutMills, TimeUnit.MILLISECONDS);

            client = builder.build();
        }
        return client;
    }

}


text:
.. _sphx_glr_auto_examples_plot_sotus.py:

=============================
Plotting State of the Union Addresses from 1989-2017
=============================

To plot text, simply pass the text data to the plot function.  Here, we are
ploting each SOTU address fit to a topic model, and then reduced to visualize.
By default, hypertools transforms the text data using a model fit to a selected
set of wikipedia pages.

.. image:: /auto_examples/images/sphx_glr_plot_sotus_001.png
    :align: center

.. code-block:: python

    # Code source: Andrew Heusser
    # License: MIT

    # load hypertools
    import hypertools as hyp

    # load the data
    geo = hyp.load('sotus')

    # plot it
    geo.plot()

**Total running time of the script:** ( 0 minutes  0.193 seconds)

.. only :: html

 .. container:: sphx-glr-footer

  .. container:: sphx-glr-download

     :download:`Download Python source code: plot_sotus.py <plot_sotus.py>`

  .. container:: sphx-glr-download

     :download:`Download Jupyter notebook: plot_sotus.ipynb <plot_sotus.ipynb>`

.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_


text:
<bill session="115" type="h" number="3294" updated="2017-09-11T02:55:05Z">
  <state datetime="2017-07-19">REFERRED</state>
  <status>
    <introduced datetime="2017-07-19"/>
  </status>
  <introduced datetime="2017-07-19"/>
  <titles>
    <title type="short" as="introduced">HUBZone Unification and Business Stability Act of 2017</title>
    <title type="short" as="introduced">HUBZone Unification and Business Stability Act of 2017</title>
    <title type="official" as="introduced">To amend the Small Business Act to clarify the definitions relating to HUBZones, and for other purposes.</title>
    <title type="display">HUBZone Unification and Business Stability Act of 2017</title>
  </titles>
  <sponsor bioguide_id="V000081"/>
  <cosponsors>
    <cosponsor bioguide_id="C000266" joined="2017-07-19"/>
  </cosponsors>
  <actions>
    <action datetime="2017-07-19">
      <text>Introduced in House</text>
    </action>
    <action datetime="2017-07-19" state="REFERRED">
      <text>Referred to the House Committee on Small Business.</text>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="HSSM" name="House Small Business" activity="Referral"/>
  </committees>
  <relatedbills/>
  <subjects>
    <term name="Commerce"/>
  </subjects>
  <amendments/>
  <committee-reports/>
</bill>


text:
package org.obridge.util.jdbc;

/**
 * Created by fkarsany on 2015.03.23..
 */
public class JdbcTemplateException extends RuntimeException {
    public JdbcTemplateException(Throwable cause) {
        super(cause);
    }

    public JdbcTemplateException(String s, Throwable ex) {
        super(s, ex);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<dictionary version="minimum">
  <tag group="0004" element="1130" keyword="FileSetID" vr="CS" vm="1">File-set ID</tag>
</dictionary>


text:
from keystone import utils
from keystone.common import wsgi
from keystone.logic.types.role import Role
import keystone.config as config
from . import get_marker_limit_and_url

class RolesController(wsgi.Controller):
    """Controller for Role related operations"""

    def __init__(self, options):
        self.options = options

    # Not exposed yet.
    @utils.wrap_error
    def create_role(self, req):
        role = utils.get_normalized_request_content(Role, req)
        return utils.send_result(201, req,
            config.SERVICE.create_role(utils.get_auth_token(req), role))

    @utils.wrap_error
    def delete_role(self, req, role_id):
        rval = config.SERVICE.delete_role(utils.get_auth_token(req), role_id)
        return utils.send_result(204, req, rval)

    @utils.wrap_error
    def get_roles(self, req):
        role_name = req.GET["name"] if "name" in req.GET else None
        if role_name:
            tenant = config.SERVICE.get_role_by_name(
                utils.get_auth_token(req), role_name)
            return utils.send_result(200, req, tenant)
        else:
            marker, limit, url = get_marker_limit_and_url(req)
            roles = config.SERVICE.get_roles(
                utils.get_auth_token(req), marker, limit, url)
            return utils.send_result(200, req, roles)

    @utils.wrap_error
    def get_role(self, req, role_id):
        role = config.SERVICE.get_role(utils.get_auth_token(req), role_id)
        return utils.send_result(200, req, role)

    @utils.wrap_error
    def add_role_to_user(self, req, user_id, role_id, tenant_id=None):
        config.SERVICE.add_role_to_user(utils.get_auth_token(req),
            user_id, role_id, tenant_id)
        return utils.send_result(201, None)

    @utils.wrap_error
    def delete_role_from_user(self, req, user_id, role_id, tenant_id=None):
        config.SERVICE.remove_role_from_user(utils.get_auth_token(req),
            user_id, role_id, tenant_id)
        return utils.send_result(204, req, None)

    @utils.wrap_error
    def get_user_roles(self, req, user_id, tenant_id=None):
        marker, limit, url = get_marker_limit_and_url(req)
        roles = config.SERVICE.get_user_roles(
            utils.get_auth_token(req), marker, limit, url, user_id, tenant_id)
        return utils.send_result(200, req, roles)


text:
package com.vmware.vim25;
import lombok.Getter;
import lombok.Setter;

public class PlacementSpec extends DynamicData {
    @Getter @Setter public VirtualMachineMovePriority priority;
    @Getter @Setter public ManagedObjectReference vm;
    @Getter @Setter public VirtualMachineConfigSpec configSpec;
    @Getter @Setter public VirtualMachineRelocateSpec relocateSpec;
    @Getter @Setter public ManagedObjectReference[] hosts;
    @Getter @Setter public ManagedObjectReference[] datastores;
    @Getter @Setter public ManagedObjectReference[] storagePods;
    @Getter @Setter public Boolean disallowPrerequisiteMoves;
    @Getter @Setter public ClusterRuleInfo[] rules;
    @Getter @Setter public String key;
    @Getter @Setter public String placementType;
    @Getter @Setter public VirtualMachineCloneSpec cloneSpec;
    @Getter @Setter public String cloneName;
}


text:
package org.apache.nifi.processors.azure.storage;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;

import com.microsoft.azure.storage.OperationContext;
import org.apache.nifi.annotation.behavior.InputRequirement;
import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
import org.apache.nifi.annotation.behavior.WritesAttribute;
import org.apache.nifi.annotation.behavior.WritesAttributes;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.SeeAlso;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.flowfile.FlowFile;
import org.apache.nifi.processor.ProcessContext;
import org.apache.nifi.processor.ProcessSession;
import org.apache.nifi.processor.exception.ProcessException;
import org.apache.nifi.processor.util.StandardValidators;
import org.apache.nifi.processors.azure.AbstractAzureBlobProcessor;
import org.apache.nifi.processors.azure.storage.utils.AzureStorageUtils;

import com.microsoft.azure.storage.StorageException;
import com.microsoft.azure.storage.blob.BlobProperties;
import com.microsoft.azure.storage.blob.CloudBlob;
import com.microsoft.azure.storage.blob.CloudBlobClient;
import com.microsoft.azure.storage.blob.CloudBlobContainer;

@Tags({ "azure", "microsoft", "cloud", "storage", "blob" })
@SeeAlso({ ListAzureBlobStorage.class, FetchAzureBlobStorage.class, DeleteAzureBlobStorage.class })
@CapabilityDescription("Puts content into an Azure Storage Blob")
@InputRequirement(Requirement.INPUT_REQUIRED)
@WritesAttributes({ @WritesAttribute(attribute = "azure.container", description = "The name of the Azure container"),
        @WritesAttribute(attribute = "azure.blobname", description = "The name of the Azure blob"),
        @WritesAttribute(attribute = "azure.primaryUri", description = "Primary location for blob content"),
        @WritesAttribute(attribute = "azure.etag", description = "Etag for the Azure blob"),
        @WritesAttribute(attribute = "azure.length", description = "Length of the blob"),
        @WritesAttribute(attribute = "azure.timestamp", description = "The timestamp in Azure for the blob")})
public class PutAzureBlobStorage extends AbstractAzureBlobProcessor {

    public static final PropertyDescriptor BLOB_NAME = new PropertyDescriptor.Builder()
            .name("blob")
            .displayName("Blob")
            .description("The filename of the blob")
            .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
            .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
            .required(true)
            .build();

    @Override
    public List<PropertyDescriptor> getSupportedPropertyDescriptors() {
        List<PropertyDescriptor> properties = new ArrayList<>(super.getSupportedPropertyDescriptors());
        properties.remove(BLOB);
        properties.add(BLOB_NAME);
        return properties;
    }

    public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException {
        FlowFile flowFile = session.get();
        if (flowFile == null) {
            return;
        }

        final long startNanos = System.nanoTime();

        String containerName = context.getProperty(AzureStorageUtils.CONTAINER).evaluateAttributeExpressions(flowFile).getValue();

        String blobPath = context.getProperty(BLOB_NAME).evaluateAttributeExpressions(flowFile).getValue();

        AtomicReference<Exception> storedException = new AtomicReference<>();
        try {
            CloudBlobClient blobClient = AzureStorageUtils.createCloudBlobClient(context, getLogger(), flowFile);
            CloudBlobContainer container = blobClient.getContainerReference(containerName);
            container.createIfNotExists();

            CloudBlob blob = container.getBlockBlobReference(blobPath);

            final OperationContext operationContext = new OperationContext();
            AzureStorageUtils.setProxy(operationContext, context);

            final Map<String, String> attributes = new HashMap<>();
            long length = flowFile.getSize();
            session.read(flowFile, rawIn -> {
                InputStream in = rawIn;
                if (!(in instanceof BufferedInputStream)) {
                    // do not double-wrap
                    in = new BufferedInputStream(rawIn);
                }

                try {
                    blob.upload(in, length, null, null, operationContext);
                    BlobProperties properties = blob.getProperties();
                    attributes.put("azure.container", containerName);
                    attributes.put("azure.primaryUri", blob.getSnapshotQualifiedUri().toString());
                    attributes.put("azure.etag", properties.getEtag());
                    attributes.put("azure.length", String.valueOf(length));
                    attributes.put("azure.timestamp", String.valueOf(properties.getLastModified()));
                } catch (StorageException | URISyntaxException e) {
                    storedException.set(e);
                    throw new IOException(e);
                }
            });

            if (!attributes.isEmpty()) {
                flowFile = session.putAllAttributes(flowFile, attributes);
            }
            session.transfer(flowFile, REL_SUCCESS);

            final long transferMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNanos);
            session.getProvenanceReporter().send(flowFile, blob.getSnapshotQualifiedUri().toString(), transferMillis);

        } catch (IllegalArgumentException | URISyntaxException | StorageException | ProcessException e) {
            if (e instanceof ProcessException && storedException.get() == null) {
                throw (ProcessException) e;
            } else {
                Exception failureException = Optional.ofNullable(storedException.get()).orElse(e);
                getLogger().error("Failed to put Azure blob {}", new Object[]{blobPath}, failureException);
                flowFile = session.penalize(flowFile);
                session.transfer(flowFile, REL_FAILURE);
            }
        }

    }
}


text:
package com.google.common.collect;

import static com.google.common.base.Preconditions.checkNotNull;

import java.util.Map;
import java.util.Map.Entry;

/**
 * GWT emulation of {@link ImmutableEnumMap}. The type parameter is not bounded by {@code Enum<E>}
 * to avoid code-size bloat.
 *
 * @author Hayward Chan
 */
final class ImmutableEnumMap<K, V> extends ForwardingImmutableMap<K, V> {
  static <K, V> ImmutableMap<K, V> asImmutable(Map<K, V> map) {
    for (Entry<K, V> entry : checkNotNull(map).entrySet()) {
      checkNotNull(entry.getKey());
      checkNotNull(entry.getValue());
    }
    return new ImmutableEnumMap<K, V>(map);
  }

  private ImmutableEnumMap(Map<? extends K, ? extends V> delegate) {
    super(delegate);
  }
}


text:
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "Something went wrong" %}{% endblock %}

{% block content %}

{% trans "Error 500" %}

{% trans "I regret to inform you, that our trained monkeys made a mistake when processing your request. Our trainers already have been informed of this incident and will try resolve the issue as soon as possible" %}

{% endblock content %}


text:
using System.Linq;
using Avalonia.Controls.Presenters;
using Avalonia.Controls.Templates;
using Avalonia.LogicalTree;
using Avalonia.UnitTests;
using Avalonia.VisualTree;
using Moq;
using Xunit;

namespace Avalonia.Controls.UnitTests.Presenters
{
    /// <summary>
    /// Tests for ContentControls that are hosted in a control template.
    /// </summary>
    public class ContentPresenterTests_InTemplate
    {
        [Fact]
        public void Should_Register_With_Host_When_TemplatedParent_Set()
        {
            var host = new Mock<IContentPresenterHost>();
            var target = new ContentPresenter();

            target.SetValue(Control.TemplatedParentProperty, host.Object);

            host.Verify(x => x.RegisterContentPresenter(target));
        }

        [Fact]
        public void Setting_Content_To_Control_Should_Set_Child()
        {
            var (target, _) = CreateTarget();
            var child = new Border();

            target.Content = child;

            Assert.Equal(child, target.Child);
        }

        [Fact]
        public void Setting_Content_To_Control_Should_Update_Logical_Tree()
        {
            var (target, parent) = CreateTarget();
            var child = new Border();

            target.Content = child;

            Assert.Equal(parent, child.GetLogicalParent());
            Assert.Equal(new[] { child }, parent.GetLogicalChildren());
        }

        [Fact]
        public void Setting_Content_To_Control_Should_Update_Visual_Tree()
        {
            var (target, _) = CreateTarget();
            var child = new Border();

            target.Content = child;

            Assert.Equal(target, child.GetVisualParent());
            Assert.Equal(new[] { child }, target.GetVisualChildren());
        }

        [Fact]
        public void Setting_Content_To_String_Should_Create_TextBlock()
        {
            var (target, _) = CreateTarget();

            target.Content = "Foo";

            Assert.IsType<TextBlock>(target.Child);
            Assert.Equal("Foo", ((TextBlock)target.Child).Text);
        }

        [Fact]
        public void Setting_Content_To_String_Should_Update_Logical_Tree()
        {
            var (target, parent) = CreateTarget();

            target.Content = "Foo";

            var child = target.Child;
            Assert.Equal(parent, child.GetLogicalParent());
            Assert.Equal(new[] { child }, parent.GetLogicalChildren());
        }

        [Fact]
        public void Setting_Content_To_String_Should_Update_Visual_Tree()
        {
            var (target, _) = CreateTarget();

            target.Content = "Foo";

            var child = target.Child;
            Assert.Equal(target, child.GetVisualParent());
            Assert.Equal(new[] { child }, target.GetVisualChildren());
        }

        [Fact]
        public void Clearing_Control_Content_Should_Update_Logical_Tree()
        {
            var (target, _) = CreateTarget();
            var child = new Border();

            target.Content = child;
            target.Content = null;

            Assert.Null(child.GetLogicalParent());
            Assert.Empty(target.GetLogicalChildren());
        }

        [Fact]
        public void Clearing_Control_Content_Should_Update_Visual_Tree()
        {
            var (target, _) = CreateTarget();
            var child = new Border();

            target.Content = child;
            target.Content = null;

            Assert.Null(child.GetVisualParent());
            Assert.Empty(target.GetVisualChildren());
        }

        [Fact]
        public void Control_Content_Should_Not_Be_NameScope()
        {
            var (target, _) = CreateTarget();

            target.Content = new TextBlock();

            Assert.IsType<TextBlock>(target.Child);
            Assert.Null(NameScope.GetNameScope((Control)target.Child));
        }

        [Fact]
        public void DataTemplate_Created_Control_Should_Be_NameScope()
        {
            var (target, _) = CreateTarget();

            target.Content = "Foo";

            Assert.IsType<TextBlock>(target.Child);
            Assert.NotNull(NameScope.GetNameScope((Control)target.Child));
        }

        [Fact]
        public void Assigning_Control_To_Content_Should_Not_Set_DataContext()
        {
            var (target, _) = CreateTarget();
            target.Content = new Border();

            Assert.False(target.IsSet(Control.DataContextProperty));
        }

        [Fact]
        public void Assigning_NonControl_To_Content_Should_Set_DataContext_On_UpdateChild()
        {
            var (target, _) = CreateTarget();
            target.Content = "foo";

            Assert.Equal("foo", target.DataContext);
        }

        [Fact]
        public void Should_Use_ContentTemplate_If_Specified()
        {
            var (target, _) = CreateTarget();

            target.ContentTemplate = new FuncDataTemplate<string>(_ => new Canvas());
            target.Content = "Foo";

            Assert.IsType<Canvas>(target.Child);
        }

        [Fact]
        public void Should_Update_If_ContentTemplate_Changed()
        {
            var (target, _) = CreateTarget();

            target.Content = "Foo";
            Assert.IsType<TextBlock>(target.Child);

            target.ContentTemplate = new FuncDataTemplate<string>(_ => new Canvas());
            Assert.IsType<Canvas>(target.Child);

            target.ContentTemplate = null;
            Assert.IsType<TextBlock>(target.Child);
        }

        [Fact]
        public void Assigning_Control_To_Content_After_NonControl_Should_Clear_DataContext()
        {
            var (target, _) = CreateTarget();

            target.Content = "foo";

            Assert.True(target.IsSet(Control.DataContextProperty));

            target.Content = new Border();

            Assert.False(target.IsSet(Control.DataContextProperty));
        }

        [Fact]
        public void Recycles_DataTemplate()
        {
            var (target, _) = CreateTarget();
            target.DataTemplates.Add(new FuncDataTemplate<string>(_ => new Border(), true));

            target.Content = "foo";

            var control = target.Child;
            Assert.IsType<Border>(control);

            target.Content = "bar";
            Assert.Same(control, target.Child);
        }

        [Fact]
        public void Detects_DataTemplate_Doesnt_Match_And_Doesnt_Recycle()
        {
            var (target, _) = CreateTarget();
            target.DataTemplates.Add(new FuncDataTemplate<string>(x => x == "foo", _ => new Border(), true));

            target.Content = "foo";

            var control = target.Child;
            Assert.IsType<Border>(control);

            target.Content = "bar";
            Assert.IsType<TextBlock>(target.Child);
        }

        [Fact]
        public void Detects_DataTemplate_Doesnt_Support_Recycling()
        {
            var (target, _) = CreateTarget();
            target.DataTemplates.Add(new FuncDataTemplate<string>(_ => new Border(), false));

            target.Content = "foo";

            var control = target.Child;
            Assert.IsType<Border>(control);

            target.Content = "bar";
            Assert.NotSame(control, target.Child);
        }

        [Fact]
        public void Reevaluates_DataTemplates_When_Recycling()
        {
            var (target, _) = CreateTarget();

            target.DataTemplates.Add(new FuncDataTemplate<string>(x => x == "bar", _ => new Canvas(), true));
            target.DataTemplates.Add(new FuncDataTemplate<string>(_ => new Border(), true));

            target.Content = "foo";

            var control = target.Child;
            Assert.IsType<Border>(control);

            target.Content = "bar";
            Assert.IsType<Canvas>(target.Child);
        }

        (ContentPresenter presenter, ContentControl templatedParent) CreateTarget()
        {
            var templatedParent = new ContentControl
            {
                Template = new FuncControlTemplate<ContentControl>(x =>
                    new ContentPresenter
                    {
                        Name = "PART_ContentPresenter",
                    }),
            };
            var root = new TestRoot { Child = templatedParent };

            templatedParent.ApplyTemplate();

            return ((ContentPresenter)templatedParent.Presenter, templatedParent);
        }

        private class TestContentControl : ContentControl
        {
            public IControl Child { get; set; }
        }
    }
}


text:
class CamaleonCms::Site < CamaleonCms::TermTaxonomy
  # attrs: [name, description, slug]
  attr_accessor :site_domain
  include CamaleonCms::SiteDefaultSettings
  default_scope { where(taxonomy: :site).reorder(term_group: :desc) }
  has_many :metas, -> { where(object_class: 'Site') }, :class_name => "CamaleonCms::Meta", foreign_key: :objectid, dependent: :delete_all
  has_many :post_types, :class_name => "CamaleonCms::PostType", foreign_key: :parent_id, dependent: :destroy
  has_many :nav_menus, :class_name => "CamaleonCms::NavMenu", foreign_key: :parent_id, dependent: :destroy, inverse_of: :site
  has_many :nav_menu_items, :class_name => "CamaleonCms::NavMenuItem", foreign_key: :term_group
  has_many :widgets, :class_name => "CamaleonCms::Widget::Main", foreign_key: :parent_id, dependent: :destroy
  has_many :sidebars, :class_name => "CamaleonCms::Widget::Sidebar", foreign_key: :parent_id, dependent: :destroy
  has_many :user_roles_rel, :class_name => "CamaleonCms::UserRole", foreign_key: :parent_id, dependent: :destroy
  has_many :custom_field_groups, :class_name => "CamaleonCms::CustomFieldGroup", foreign_key: :parent_id, dependent: :destroy
  has_many :term_taxonomies, :class_name => "CamaleonCms::TermTaxonomy", foreign_key: :parent_id

  has_many :posts, through: :post_types, :source => :posts
  has_many :plugins, :class_name => "CamaleonCms::Plugin", foreign_key: :parent_id, dependent: :destroy
  has_many :themes, :class_name => "CamaleonCms::Theme", foreign_key: :parent_id, dependent: :destroy

  after_create :default_settings
  after_create :set_default_user_roles
  after_save :update_routes
  before_destroy :destroy_site
  after_destroy :reload_routes
  validates_uniqueness_of :slug, scope: :taxonomy

  # all user roles for this site
  def user_roles
    if PluginRoutes.system_info["users_share_sites"]
      CamaleonCms::Site.main_site.user_roles_rel
    else
      user_roles_rel
    end
  end

  #select full_categories for the site, include all children categories
  def full_categories
    CamaleonCms::Category.where({site_id: self.id})
  end

  # all post_tags for this site
  def post_tags
    CamaleonCms::PostTag.includes(:post_type).where(post_type: self.post_types.pluck(:id))
  end

  # all main categories for this site
  def categories
    CamaleonCms::Category.includes(:post_type_parent).where(post_type_parent: self.post_types.pluck(:id))
  end

  # return all languages configured by the admin
  # if it is empty, then return default locale
  def get_languages
    return @_languages if defined?(@_languages)
    l = get_meta("languages_site", [I18n.default_locale])
    @_languages = l.map { |x| x.to_sym } rescue [I18n.default_locale.to_sym]
  end

  # return current admin language configured for this site
  def get_admin_language
    options[:_admin_theme] || "en"
  end

  # set current admin language for this site
  def set_admin_language(language)
    set_option("_admin_theme", language)
  end

  # return current theme slug configured for this site
  # if theme was not configured, then return system.json defined
  def get_theme_slug
    options[:_theme] || PluginRoutes.system_info["default_template"]
  end

  # return theme model with slug theme_slug for this site
  # theme_slug: (optional) if it is null, this will return current theme for this site
  def get_theme(theme_slug = nil)
    self.themes.where(slug: (theme_slug || get_theme_slug), status: nil).first_or_create!
  end

  # return plugin model with slug plugin_slug
  def get_plugin(plugin_slug)
    self.plugins.where(slug: plugin_slug).first_or_create!
  end

  # assign user to this site
  def assign_user(user)
    user.assign_site(self)
  end

  # items per page to be listed on frontend
  def front_per_page
    get_option("front_per_page", 10)
  end

  # items per page to be listed on admin panel
  def admin_per_page
    get_option("admin_per_page", 10)
  end

  # frontend comments status for new comments on frontend
  def front_comment_status
    get_option("comment_status", "pending")
  end

  # security: user register form show captcha?
  def security_user_register_captcha_enabled?
    get_option('security_captcha_user_register', false) == true
  end

  def need_validate_email?
    get_option('need_validate_email', false) == true
  end

  # return main site
  def self.main_site
    @main_site ||= CamaleonCms::Site.reorder(id: :asc).first
  end

  # check if this site is the main site
  # main site is a site that doesn't have slug
  def main_site?
    self.class.main_site == self
  end
  alias_method :is_default?, :main_site?

  # list all users of current site
  def users
    if PluginRoutes.system_info["users_share_sites"]
      CamaleonCms::User.all
    else
      CamaleonCms::User.where(site_id: self.id)
    end
  end
  alias_method :users_include_admins, :users

  # return upload directory for this site (deprecated for cloud support)
  def upload_directory(inner_directory = nil)
    File.join(Rails.public_path, "/media/#{PluginRoutes.static_system_info["media_slug_folder"] ? self.slug : self.id}", inner_directory.to_s)
  end

  # return the directory name where to upload file for this site
  def upload_directory_name
    "#{PluginRoutes.static_system_info["media_slug_folder"] ? self.slug : self.id}"
  end

  # return an available slug for a new post
  # slug: (String) possible slug value
  # post_id: (integer, optional) current post id
  # sample: ("<!--:es-->features-1<!--:--><!--:en-->caract-1<!--:-->") | ("features")
  # return: (String) available slugs
  def get_valid_post_slug(slug, post_id=nil)
    slugs = slug.translations
    if slugs.present?
      slugs.each do |k, v|
        slugs[k] = get_valid_post_slug(v)
      end
      slugs.to_translate
    else
      res = slug
      (1..9999).each do |i|
        p = self.posts.find_by_slug(res)
        break if !p.present? || (p.present? && p.id == post_id)
        res = "#{slug}-#{i}"
      end
      res
    end
  end

  # check if current site is active or not
  def is_active?
    !self.status.present? || self.status == 'active'
  end

  # check if current site is active or not
  def is_inactive?
    self.status == 'inactive'
  end

  # check if current site is in maintenance or not
  def is_maintenance?
    self.status == 'maintenance'
  end

  # return the anonymous user
  # if the anonymous user not exist, will create one
  def get_anonymous_user
    user = self.users.where(username: 'anonymous').first
    unless user.present?
      pass = "anonymous#{rand(9999)}"
      user = self.users.create({email: 'anonymous_user@local.com', username: 'anonymous', password: pass, password_confirmation: pass, first_name: 'Anonymous'})
    end
    user
  end

  # return the domain for current site
  # sample: mysite.com | sample.mysite.com
  # also, you can define custom domain for this site by: my_site.site_domain = 'my_site.com' # used for sites with different domains to call from console or task
  def get_domain
    @site_domain || (main_site? ? slug : (slug.include?(".") ? slug : "#{slug}.#{Cama::Site.main_site.slug}"))
  end

  private
  # destroy all things before site destroy
  def destroy_site
    unless PluginRoutes.system_info["users_share_sites"]
      CamaleonCms::User.where(site_id: self.id).destroy_all
    end
    FileUtils.rm_rf(File.join(Rails.public_path, "/media/#{upload_directory_name}").to_s) # destroy current media directory
    users.destroy_all unless PluginRoutes.system_info["users_share_sites"] # destroy all users assigned fot this site
  end

  # assign all users to this new site
  # DEPRECATED
  def set_all_users
    return
  end

  # update all routes of the system
  # reload system routes for this site
  def update_routes
    PluginRoutes.reload if self.slug_changed?
  end

  def reload_routes
    PluginRoutes.reload
  end

  def before_validating
    slug = self.slug
    slug = self.name if slug.blank?
    self.name = slug unless self.name.present?
    self.slug = slug.to_s.try(:downcase)
  end
end


text:
Equipment:

            {{item.quantity}} {{item.name}} (<skill hide-rank="true" name="item.skill" rank="getRank(item.skill)" abty="getAbility(item.skill)" minion="isMinion()"></skill>;
            Damage: {{item.damage}}; Critical: {{item.critical}}; Range [{{item.range}}]; Piece {{item.pierce}}; Blast {{item.blast}}; Vicious {{item.vicious}}; Limited Ammo {{item.ammo}}; Auto Fire; Stun setting; ), .

            {{item}}, .

        None.


text:
<?php

// ::modal-delete.html.twig
return array (
);


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <item name="fast_image_size" type="id" />
</resources>


text:
layout: post
title: "Exploring Global Tools in .NET Core"
subtitle: "This post is about Global Tools in .NET Core, Global Tools is new feature in .NET Core. Global Tools helps you to write .NET Core console apps that can be packaged and delivered as NuGet packages. It is similar to npm global tools."
date: 2018-03-17 00:00:00
categories: [.NETCore,GlobalTools]
tags: [.NETCore,GlobalTools]
author: "Anuraj"
---
This post is about Global Tools in .NET Core, Global Tools is new feature in .NET Core. Global Tools helps you to write .NET Core console apps that can be packaged and delivered as NuGet packages. It is similar to npm global tools.

You can install the global tool using `dotnet install` command line. And for un-installing you need to manually delete it from the installation location, in Windows it is `%USERPROFILE%\.dotnet\tools` and in Linux systems `~/.dotnet/tools`.

Here is a sample .net global tool which helps to ascii art. So first you need to create a console application using `dotnet new console -o banner`. Once it is created, you can open the project in VS Code, you need to modify the `csproj` file and include following elements.

{% highlight XML %}
<PropertyGroup>
  <OutputType>Exe</OutputType>
  <TargetFramework>netcoreapp2.1</TargetFramework>
  <ToolCommandName>banner</ToolCommandName>
  <PackAsTool>true</PackAsTool>
</PropertyGroup>
{% endhighlight %}

* PackAsTool - This specifies this is a tool.
* ToolCommandName - Specifies the command name - using this command users can invoke the tool.

Next you need to modify the main method and add the logic. I am using [figgle](https://github.com/drewnoakes/figgle) library for the ascii art generation purposes. Here is the code.

{% highlight CSharp %}
class Program
{
    static int Main(string[] args)
    {
        if (args.Length >= 1)
        {
            var text = string.Empty;
            foreach (var arg in args)
            {
                text += $" {arg}";
            }
            Console.WriteLine(FiggleFonts.Standard.Render(text));
            return 0;
        }
        else
        {
            Console.WriteLine("Error : Text option missing. Banner <text>");
            return -1;
        }
    }
}
{% endhighlight %}

Now you can build the tool using `dotnet build` command and test it using `dotnet .\bin\Debug\netcoreapp2.1\Banner.dll Hello World` command. It will print something like this.

![dotnet global tool running]({{ site.url }}/assets/images/2018/03/dotnet_global_tool.png)

Once it is done, you can run `dotnet pack` command to build nuget package. You may see some warnings related to preview versions references, you can ignore them for time being.

![dotnet pack command]({{ site.url }}/assets/images/2018/03/dotnet_pack.png)

Next you need to configure a local nuget repo to verify the tool installation and execution. For this, first create a nuget.config file. And inside this include the folder you created the nuget package. You can create nuget.config file using `dotnet new nugetconfig` command. And add the following code. You need to change the value of the local key.

{% highlight XML %}
<?xml version="1.0" encoding="utf-8"?>
<configuration>
 <packageSources>
    <clear />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="local" value="D:/Anuraj-OSS/nupkgs" />
 </packageSources>
</configuration>
{% endhighlight %}

Next run the `dotnet install tool -g Banner` command to install your tool.

![dotnet install command]({{ site.url }}/assets/images/2018/03/dotnet_install.png)

Once installation is successful, you can run the `banner` command to execute the tool.

![dotnet tool running]({{ site.url }}/assets/images/2018/03/dotnet_tool_running.png)

You can find the source code in [GitHub](https://github.com/anuraj/banner).

Happy Programming :)


text:
/*
 * 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.
 */
package io.trino.plugin.kudu;

import org.testng.annotations.Test;

import java.util.Optional;

import static org.testng.Assert.assertEquals;

public abstract class BaseKuduWithStandardInferSchemaConnectorSmokeTest
        extends BaseKuduConnectorSmokeTest
{
    @Override
    protected Optional<String> getKuduSchemaEmulationPrefix()
    {
        return Optional.of("presto::");
    }

    @Test
    public void testListingOfTableForDefaultSchema()
    {
        // The special $schemas table is created when listing schema names with schema emulation enabled
        // Depending on test ordering, this table may or may not be created when this test runs, so filter it out
        assertEquals(computeActual("SHOW TABLES FROM default LIKE '%$schemas'").getRowCount(), 0);
    }
}


text:
/**
 *    Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior
 *    University
 *
 *    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.
 **/

package org.openflow.protocol;

import org.jboss.netty.buffer.ChannelBuffer;

/**
 * Base class representing ofp_switch_config based messages
 *
 * @author David Erickson (daviderickson@cs.stanford.edu)
 */
public abstract class OFSwitchConfig extends OFMessage {
    public static int MINIMUM_LENGTH = 12;

    public enum OFConfigFlags {
        OFPC_FRAG_NORMAL, OFPC_FRAG_DROP, OFPC_FRAG_REASM, OFPC_FRAG_MASK
    }

    protected short flags;
    protected short missSendLength;

    public OFSwitchConfig() {
        super();
        super.setLengthU(OFSwitchConfig.MINIMUM_LENGTH);
    }

    /**
     * @return the flags
     */
    public short getFlags() {
        return this.flags;
    }

    /**
     * @param flags
     *            the flags to set
     */
    public OFSwitchConfig setFlags(final short flags) {
        this.flags = flags;
        return this;
    }

    /**
     * @return the missSendLength
     */
    public short getMissSendLength() {
        return this.missSendLength;
    }

    /**
     * @param missSendLength
     *            the missSendLength to set
     */
    public OFSwitchConfig setMissSendLength(final short missSendLength) {
        this.missSendLength = missSendLength;
        return this;
    }

    @Override
    public void readFrom(final ChannelBuffer data) {
        super.readFrom(data);
        this.flags = data.readShort();
        this.missSendLength = data.readShort();
    }

    @Override
    public void writeTo(final ChannelBuffer data) {
        super.writeTo(data);
        data.writeShort(this.flags);
        data.writeShort(this.missSendLength);
    }

    @Override
    public int hashCode() {
        final int prime = 331;
        int result = super.hashCode();
        result = prime * result + this.flags;
        result = prime * result + this.missSendLength;
        return result;
    }

    @Override
    public boolean equals(final Object obj) {
        if (this == obj) {
            return true;
        }
        if (!super.equals(obj)) {
            return false;
        }
        if (!(obj instanceof OFSwitchConfig)) {
            return false;
        }
        final OFSwitchConfig other = (OFSwitchConfig) obj;
        if (this.flags != other.flags) {
            return false;
        }
        if (this.missSendLength != other.missSendLength) {
            return false;
        }
        return true;
    }
}


text:
package gcl

import (
	"encoding/json"
	"fmt"
	"net/url"
	"time"

	gce_util "github.com/Stackdriver/heapster/common/gce"
	"github.com/Stackdriver/heapster/events/core"

	"golang.org/x/oauth2"
	"golang.org/x/oauth2/google"
	gcl "google.golang.org/api/logging/v2"
	"k8s.io/klog"
)

const (
	monitoredResourceType = "global"
	logName               = "kubernetes.io/events"
	loggingSeverity       = "NOTICE"
)

type gclSink struct {
	project    string
	gclService *gcl.Service
}

func (sink *gclSink) ExportEvents(eventBatch *core.EventBatch) {
	if len(eventBatch.Events) == 0 {
		klog.V(4).Info("Not events to export")
		return
	}
	klog.V(4).Info("Exporting events")
	entries := make([]*gcl.LogEntry, len(eventBatch.Events))
	for i, event := range eventBatch.Events {
		evtJson, err := json.Marshal(event)
		if err != nil {
			klog.Errorf("Skipping exporting event due to error while marshaling event %v as JSON: %v", event, err)
			continue
		}
		entries[i] = &gcl.LogEntry{
			LogName:     fmt.Sprintf("projects/%s/logs/%s", sink.project, url.QueryEscape(logName)),
			Timestamp:   event.LastTimestamp.Time.UTC().Format(time.RFC3339),
			Severity:    loggingSeverity,
			Resource:    &gcl.MonitoredResource{Type: monitoredResourceType},
			InsertId:    string(event.UID),
			JsonPayload: evtJson,
		}
	}
	req := &gcl.WriteLogEntriesRequest{Entries: entries}
	if _, err := sink.gclService.Entries.Write(req).Do(); err != nil {
		klog.Errorf("Error while exporting events to GCL: %v", err)
	} else {
		klog.V(4).Infof("Successfully exported %d events", len(entries))
	}
}

func (sink *gclSink) Name() string {
	return "GCL Sink"
}

func (sink *gclSink) Stop() {
	// nothing needs to be done.
}

func CreateGCLSink(uri *url.URL) (core.EventSink, error) {
	client, err := google.DefaultClient(oauth2.NoContext, gcl.LoggingWriteScope)
	if err != nil {
		return nil, fmt.Errorf("error creating oauth2 client: %v", err)
	}

	// Create Google Cloud Logging service.
	gclService, err := gcl.New(client)
	if err != nil {
		return nil, fmt.Errorf("error creating GCL service: %v", err)
	}

	// Detect project ID
	projectId, err := gce_util.GetProjectId()
	if err != nil {
		return nil, fmt.Errorf("error getting GCP project ID: %v", err)
	}

	sink := &gclSink{project: projectId, gclService: gclService}
	klog.Info("created GCL sink")
	return sink, nil
}


text:
import { createSlice, createSelector, PayloadAction, Action } from '@reduxjs/toolkit'

import { RootState } from '../store/configureStore'
import type { LoginAction } from './session'
import { AvatarData, SavedAvatarData, Grid, HoodieObject } from '../types/viewer'

// Reducer for viewer-account and state

const accountSlice = createSlice({
  name: 'account',

  initialState: getDefault(),

  reducers: {
    signInStatus: {
      reducer (
        state,
        action: PayloadAction<{ isLoggedIn: boolean, isUnlocked: boolean | null, username: string}>
      ) {
        if (action.payload.isUnlocked != null) {
          state.unlocked = action.payload.isUnlocked
        }
        state.loggedIn = action.payload.isLoggedIn
        state.username = action.payload.username
      },
      prepare (isSignedIn: boolean, isUnlocked: boolean | null, username: string = '') {
        const isLoggedIn = Boolean(isSignedIn)
        return {
          payload: {
            isLoggedIn,
            isUnlocked: isUnlocked,
            username: isLoggedIn ? username : ''
          }
        }
      }
    },

    signOut: getDefault,

    unlocked (state) {
      state.unlocked = true
    },

    displayResetKeys (state, action: PayloadAction<string[]>) {
      state.resetKeys = action.payload
    },

    closeResetKeys (state, action: Action) {
      state.resetKeys = null
    },

    didUpdateUsername (state, action: PayloadAction<{ username: string }>) {
      state.username = action.payload.username
    },

    avatarSaved (state, action: PayloadAction<SavedAvatarData>) {
      state.savedAvatars.push(action.payload)
    },

    avatarsLoaded (state, action: PayloadAction<SavedAvatarData[]>) {
      state.savedAvatars = action.payload
      state.savedAvatarsLoaded = true
    },

    savedAvatarUpdated (state, action: PayloadAction<SavedAvatarData>) {
      const index = state.savedAvatars.findIndex(avatar => avatar._id === action.payload._id)
      if (index >= 0) {
        state.savedAvatars[index] = action.payload
      }
    },

    savedAvatarRemoved (state, action: PayloadAction<SavedAvatarData | HoodieObject>) {
      state.savedAvatars = state.savedAvatars.filter(avatar => avatar._id !== action.payload._id)
    },

    gridAdded (state, action: PayloadAction<Grid>) {
      state.savedGrids.push(action.payload)
    },

    gridsLoaded (state, action: PayloadAction<Grid[]>) {
      state.savedGrids.push(...action.payload)
      state.savedGridsLoaded = true
    },

    savedGridDidChanged (state, action: PayloadAction<Grid>) {
      const index = state.savedGrids.findIndex(grid => {
        return grid._id != null // If grid has an id
          ? grid._id === action.payload._id
          : grid.name === action.payload.name
      })

      state.savedGrids[index] = action.payload
    },

    savedGridRemoved (state, action: PayloadAction<Grid>) {
      state.savedGrids = state.savedGrids.filter(grid => grid._id != null
        ? grid._id !== action.payload._id
        : grid.name !== action.payload.name
      )
    }
  },

  extraReducers: {
    'session/login' (state, action: PayloadAction<LoginAction>) {
      const { save, grid, name, avatarIdentifier, dataSaveId } = action.payload
      if (!save) { // Anonym
        state.anonymAvatarData = {
          grid: grid.name,
          name: name.firstName + ' ' + name.lastName,
          avatarIdentifier,
          dataSaveId
        }
      }
    },

    'session/logout' (state) {
      state.anonymAvatarData = null
    },
    'session/userWasKicked' (state) {
      state.anonymAvatarData = null
    }
  }
})

export default accountSlice.reducer

export const {
  signInStatus,
  signOut,
  unlocked,
  didUpdateUsername,

  displayResetKeys,
  closeResetKeys,

  avatarSaved,
  avatarsLoaded,
  savedAvatarUpdated,
  savedAvatarRemoved,

  gridAdded,
  gridsLoaded,
  savedGridDidChanged,
  savedGridRemoved
} = accountSlice.actions

// Selectors

export const selectIsSignedIn = (state: RootState) => state.account.loggedIn

export const selectIsUnlocked = (state: RootState) => state.account.unlocked

export const selectUserName = (state: RootState) => state.account.username

export const selectSavedAvatars = (state: RootState) => state.account.savedAvatars

export const selectSavedAvatarsAreLoaded = (state: RootState) => state.account.savedAvatarsLoaded

export const selectAnonymAvatarData = (state: RootState) => state.account.anonymAvatarData!

export const selectSavedGrids = (state: RootState) => state.account.savedGrids as Grid[]

export const selectGridsByName = createSelector(
  selectSavedGrids,
  grids => {
    const allGrids: { [key: string]: Grid } = {}
    for (const grid of grids) {
      allGrids[grid.name] = grid
    }
    return allGrids
  }
)

export const selectSavedGridsAreLoaded = (state: RootState) => state.account.savedGridsLoaded

export const selectShowUnlockDialog = createSelector(
  [
    selectIsSignedIn,
    selectIsUnlocked
  ],
  (isSignedIn, isUnlocked) => !isUnlocked && isSignedIn
)

export const selectResetKeys = (state: RootState) => state.account.resetKeys

// Helpers

function getDefault () {
  const defaultData = {
    unlocked: false,
    loggedIn: false,
    username: '',
    resetKeys: ((): string[] | null => null)(),
    savedAvatars: ((): SavedAvatarData[] => [])(),
    savedAvatarsLoaded: false,
    anonymAvatarData: ((): AvatarData | null => null)(),
    savedGrids: ((): Grid[] => [
      {
        _id: 'second_life',
        name: 'Second Life',
        loginURL: 'https://login.agni.lindenlab.com:443/cgi-bin/login.cgi',
        isLLSDLogin: true
      },
      {
        _id: 'second_life_beta',
        name: 'Second Life Beta',
        loginURL: 'https://login.aditi.lindenlab.com/cgi-bin/login.cgi',
        isLLSDLogin: true
      },
      {
        _id: 'os_grid',
        name: 'OS Grid',
        loginURL: 'http://login.osgrid.org/',
        isLLSDLogin: false
      }
    ])(),
    savedGridsLoaded: false
  }
  return defaultData
}

// Types

type SignInPopup = 'resetKeys' | 'Error' | null

export type PopupType = SignInPopup | 'unlock'


text:
<?xml version="1.0" encoding="UTF-8"?>
<element_events xmlns="http://digitalhps.org/creationEvents-model"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://digitalhps.org/creationEvents-model qstore4s-schema.xsd">
	<relation_event>
		<id />
		<creator>creator1</creator>
		<creation_date>2002-05-30T09:00:00</creation_date>
		<creation_place>berlin</creation_place>
		<source_reference>test_source_reference</source_reference>
		<interpretation_creator>test_interpretation_creator</interpretation_creator>
		<relation_creator>test_relation_creator</relation_creator>
		<relation>
			<id></id>
			<creator>creator1</creator>
			<creation_date>2002-05-30T09:00:00</creation_date>
			<creation_place>berlin</creation_place>
			<subject>
				<appellation_event>
					<id></id>
					<creator>creator1</creator>
					<creation_date>2002-05-30T09:00:00</creation_date>
					<creation_place>berlin</creation_place>
					<source_reference>test_source_reference</source_reference>
					<term>
						<id></id>
						<creator>creator1</creator>
						<creation_date>2002-05-30T09:00:00</creation_date>
						<creation_place>berlin</creation_place>
						<source_reference>test_source_reference</source_reference>
						<interpretation>URI1</interpretation>
						<normalized_representation>URI2</normalized_representation>
						<printed_representation>
							<id></id>
							<creator>creator1</creator>
							<creation_date>2002-05-30T09:00:00</creation_date>
							<creation_place>berlin</creation_place>
							<source_reference>test_source_reference</source_reference>
							<term_part>
								<id></id>
								<creator>creator1</creator>
								<creation_date>2002-05-30T09:00:00</creation_date>
								<creation_place>berlin</creation_place>
								<source_reference>test_source_reference</source_reference>
								<position>120</position>
								<expression>Exp1</expression>
								<normalization>URI1</normalization>
								<formatted_pointer />
								<format />
							</term_part>
							<term_part>
								<id></id>
								<creator>creator1</creator>
								<creation_date>2002-05-30T09:00:00</creation_date>
								<creation_place>berlin</creation_place>
								<source_reference>test_source_reference</source_reference>
								<position>120</position>
								<expression>Exp1</expression>
								<normalization>URI1</normalization>
								<formatted_pointer />
								<format />
							</term_part>
							<term_part>
								<id></id>
								<creator>creator1</creator>
								<creation_date>2002-05-30T09:00:00</creation_date>
								<creation_place>berlin</creation_place>
								<source_reference>test_source_reference</source_reference>
								<position>120</position>
								<expression>Exp1</expression>
								<normalization>URI1</normalization>
								<formatted_pointer />
								<format />
							</term_part>
						</printed_representation>
						<certain>true</certain>
						<referenced_terms />
					</term>
				</appellation_event>
			</subject>
			<object>
				<appellation_event>
					<id />
					<creator>creator1</creator>
					<creation_date>2002-05-30T09:00:00</creation_date>
					<creation_place>berlin</creation_place>
					<source_reference>test_source_reference</source_reference>
					<interpretation_creator>test_interpretation_creator
					</interpretation_creator>
					<term>
						<id />
						<creator>creator1</creator>
						<creation_date>2002-05-30T09:00:00</creation_date>
						<creation_place>berlin</creation_place>
						<source_reference>test_source_reference</source_reference>
						<normalized_representation>URI2</normalized_representation>
						<printed_representation>
							<id />
							<creator>creator1</creator>
							<creation_date>2002-05-30T09:00:00</creation_date>
							<creation_place>berlin</creation_place>
							<source_reference>test_source_reference</source_reference>
							<term_part>
								<id />
								<creator>creator1</creator>
								<creation_date>2002-05-30T09:00:00</creation_date>
								<creation_place>berlin</creation_place>
								<source_reference>test_source_reference</source_reference>
								<position>120</position>
								<expression>Exp1</expression>
								<normalization>URI1</normalization>
								<formatted_pointer />
								<format />
							</term_part>
							<term_part>
								<id />
								<creator>creator1</creator>
								<creation_date>2002-05-30T09:00:00</creation_date>
								<creation_place>berlin</creation_place>
								<source_reference>test_source_reference</source_reference>
								<position>120</position>
								<expression>Exp1</expression>
								<normalization>URI1</normalization>
								<formatted_pointer />
								<format />
							</term_part>
							<term_part>
								<id />
								<creator>creator1</creator>
								<creation_date>2002-05-30T09:00:00</creation_date>
								<creation_place>berlin</creation_place>
								<source_reference>test_source_reference</source_reference>
								<position>140</position>
								<expression>Exp1</expression>
								<normalization>URI1</normalization>
								<formatted_pointer />
								<format />
							</term_part>
						</printed_representation>
						<certain>true</certain>
						<referenced_terms />
					</term>
				</appellation_event>
			</object>
			<predicate>
				<appellation_event>
					<id />
					<creator>creator1</creator>
					<creation_date>2002-05-30T09:00:00</creation_date>
					<creation_place>berlin</creation_place>
					<source_reference>test_source_reference</source_reference>
					<interpretation_creator>test_interpretation_creator
					</interpretation_creator>

					<term>
						<id />
						<creator>creator1</creator>
						<creation_date>2002-05-30T09:00:00</creation_date>
						<creation_place>berlin</creation_place>
						<source_reference>test_source_reference</source_reference>
						<interpretation>URI1</interpretation>
						<normalized_representation>URI2</normalized_representation>
						<printed_representation>
							<id />
							<creator>creator1</creator>
							<creation_date>2002-05-30T09:00:00</creation_date>
							<creation_place>berlin</creation_place>
							<source_reference>test_source_reference</source_reference>
							<id />
							<creator>creator1</creator>
							<creation_date>2002-05-30T09:00:00</creation_date>
							<creation_place>berlin</creation_place>
							<source_reference>test_source_reference</source_reference>
							<term_part>
								<id />
								<creator>creator1</creator>
								<creation_date>2002-05-30T09:00:00</creation_date>
								<creation_place>berlin</creation_place>
								<source_reference>test_source_reference</source_reference>
								<position>120</position>
								<expression>Exp1</expression>
								<normalization>URI1</normalization>
								<formatted_pointer />
								<format />
							</term_part>
						</printed_representation>
						<certain>true</certain>
						<referenced_terms />
					</term>
				</appellation_event>
			</predicate>
		</relation>
	</relation_event>
</element_events>


text:
<?xml version="1.0" encoding="UTF-8" ?>
<module>
	<name>blocklanguages</name>
	<displayName><![CDATA[Language block]]></displayName>
	<version><![CDATA[1.3]]></version>
	<description><![CDATA[Adds a block allowing customers to select a language for your store's content.]]></description>
	<author><![CDATA[PrestaShop]]></author>
	<tab><![CDATA[front_office_features]]></tab>
	<is_configurable>0</is_configurable>
	<need_instance>0</need_instance>
	<limited_countries></limited_countries>
</module>


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ValidationResult_1 = require("./ValidationResult");
var ValidationResultType_1 = require("./ValidationResultType");
var ExcludedRule = /** @class */ (function () {
    function ExcludedRule() {
        var values = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            values[_i] = arguments[_i];
        }
        this._values = values;
    }
    ExcludedRule.prototype.validate = function (path, schema, value, results) {
        if (!this._values)
            return;
        var name = path || "value";
        var found = false;
        for (var i = 0; i < this._values.length && !found; i++) {
            var thisValue = this._values[i];
            if (thisValue && thisValue == value) {
                found = true;
            }
        }
        if (found) {
            results.push(new ValidationResult_1.ValidationResult(path, ValidationResultType_1.ValidationResultType.Error, "VALUE_INCLUDED", name + " must not be one of " + this._values, this._values, null));
        }
    };
    return ExcludedRule;
}());
exports.ExcludedRule = ExcludedRule;
//# sourceMappingURL=ExcludedRule.js.map


text:
from . import append_feature_flag

class features:

    @classmethod
    def init_once(cls, env):
        env.AppendUnique(CCFLAGS = ['-TP', '/Z7', '/W3' ,'/GR', '/MDd', '/Zc:forScope', '/Zc:wchar_t', '/wd4675', '/EHs'])
        env.AppendUnique(LINKFLAGS = ['/subsystem:console'])

    @staticmethod
    def architecture(env, arch):
        if arch:
            flag = {'x86' :    '/MACHINE:X86',
                    'x86_64' : '/MACHINE:X64',}.get(arch)
            if flag:
                append_feature_flag(env, LINKFLAGS = flag)

    @staticmethod
    def optimize(env, optimize):
        #if not optimize or optimize == "no":
        #    append_feature_flag(env, CCFLAGS = "-O0 -fno-inline")
        #elif optimize == "speed":
        #    append_feature_flag(env, CCFLAGS = "-O3 -finline-functions -Wno-inline")
        #elif optimize == "space":
        #    append_feature_flag(env, CCFLAGS = "-Os")
        #else:
            append_feature_flag(env, CCFLAGS = "")

    @staticmethod
    def profile(env, profile):
        #if profile:
        #    append_feature_flag(env, CCFLAGS = "-pg", LINKFLAGS = "-pg")
        #else:
            append_feature_flag(env, CCFLAGS = "", LINKFLAGS = "")

    @staticmethod
    def threading(env, threading):
        #if threading == "multi":
        #    append_feature_flag(env, CCFLAGS = "/MT")
        #else:
        #    append_feature_flag(env, CCFLAGS = "", LINKFLAGS = "")
        pass

    @staticmethod
    def debug(env, debug):
        #if debug:
        #    append_feature_flag(env, CCFLAGS = "-g", CPPDEFINES = [])
        #else:
            append_feature_flag(env, CCFLAGS = "", CPPDEFINES = "NDEBUG")


text:
	Warmod Project
	Dev(s): x[N]ir, Hajt
	File: modules/core/setup.lua
	Description: Mix setup
--]]---------------------------------------------------------------------------

-- Whether or not mix has started
warmod.started             = false

-- Team change access
warmod.teams_locked        = false

-- Script team change falg
warmod.forced_switch       = false

-- Whether or not the knife round is enabled
warmod.knife_round_enabled = true

-- Current amount of mix errors
warmod.errors              = 0

-- Match Rounds
warmod.mr                  = 15

-- Players per team
warmod.team_size           = 5

-- Total amount of players for a mix
warmod.total_players       = warmod.team_size * 2

-- Knife winner ID
warmod.knife_winner        = 0

-- Team selector ID
warmod.team_selector       = 0

-- Current team Organization
warmod.team_organization   = 1

-- Veto players IDs
warmod.veto_player_1       = 0
warmod.veto_player_2       = 0
warmod.veto_winner         = 0
warmod.veto_looser         = 0

-- Captains IDs
warmod.team_a_captain      = 0
warmod.team_b_captain      = 0

-- Team Scores
warmod.team_a_t_score      = 0
warmod.team_a_ct_score     = 0
warmod.team_b_t_score      = 0
warmod.team_b_ct_score     = 0

-- Amount of missing players on each teams
warmod.missing_a_players   = 0
warmod.missing_b_players   = 0

-- Current votes
warmod.map_votes           = {}
warmod.swap_votes          = {}
warmod.stay_votes          = {}
warmod.rr_votes            = {}

-- Players IDs
warmod.team_a              = {}
warmod.team_b              = {}

-- Leavers IPs
warmod.team_a_leavers      = {}
warmod.team_b_leavers      = {}

-- Subber/Leaver IDs
warmod.sub_players         = {}
warmod.sub_spectators      = {}

-- Teams Names
warmod.team_a_name         = "Team A"
warmod.team_b_name         = "Team B"

-- Current map mode
warmod.map_mode            = warmod.MAP_MODE.CURRENT

-- Current mix state
warmod.state               = warmod.STATES.NONE

-- Resets all mix variables
function warmod.reset_mix_vars()
	warmod.started = false
	warmod.teams_locked = false
	warmod.forced_switch = false
	warmod.ready = {}
	warmod.team_selector = 0
	warmod.knife_winner = 0
	warmod.veto_winner = 0
	warmod.veto_looser = 0
	warmod.veto_player_1 = 0
	warmod.veto_player_2 = 0
	warmod.errors = 0
	warmod.state = warmod.STATES.NONE
	warmod.MENUS["Spectators"].buttons = {}
	warmod.team_a_name = "Team A"
	warmod.team_a_captain = 0
	warmod.team_a = {}
	warmod.team_b_name = "Team B"
	warmod.team_b_captain = 0
	warmod.team_b = {}
	warmod.swap_votes = {}
	warmod.stay_votes = {}
	warmod.team_a_t_score = 0
	warmod.team_a_ct_score = 0
	warmod.team_b_t_score = 0
	warmod.team_b_ct_score = 0
	warmod.missing_a_players = 0
	warmod.missing_b_players = 0
	warmod.sub_players = {}
	warmod.sub_spectators = {}
	warmod.rr_votes       = {}

	local veto_buttons = {}

	for k, _ in pairs(warmod.map_votes) do
		warmod.map_votes[k] = {}
		veto_buttons[#veto_buttons + 1] = {
			label = k, func = warmod.event_veto, args = k
		}
	end

	warmod.MENUS["Veto"].buttons = veto_buttons

	for _, ip in pairs(warmod.team_a_leavers) do
		freetimer("warmod.timer_timeout", "A" .. ip)
	end

	for _, ip in pairs(warmod.team_b_leavers) do
		freetimer("warmod.timer_timeout", "B" .. ip)
	end

	warmod.team_a_leavers = {}
	warmod.team_b_leavers = {}

	warmod.log("Mix", "Variables reset")
end

-- Cancels a mix for the specified reason
function warmod.cancel_mix(reason)
	freetimer("warmod.timer_map_organization")
	freetimer("warmod.timer_check_selection")
	freetimer("warmod.timer_team_organizations")
	freetimer("warmod.timer_check_veto")
	freetimer("warmod.timer_map_vote_results")
	freetimer("warmod.timer_check_side_results")

	warmod.reset_mix_vars()
	warmod.clear_all_texts()
	warmod.update_ready_list()

	msg("\169255255255The mix has been canceled, reason: \169255000000" ..
			reason)
end

-- Adds the specified to the team A
function warmod.add_to_team_a(id)
	warmod.team_a[#warmod.team_a + 1] = id
	warmod.table_remove(warmod.ready, id)
	warmod.log("Mix", "Adding " .. player(id, "name") .. " to team A")
end

-- Adds the specified to the team B
function warmod.add_to_team_b(id)
	warmod.team_b[#warmod.team_b + 1] = id
	warmod.table_remove(warmod.ready, id)
	warmod.log("Mix", "Adding " .. player(id, "name") .. " to team B")
end

-- Returns whether the specified player is playing or not
function warmod.is_playing(id)
	return warmod.table_contains(warmod.team_a, id) or
		warmod.table_contains(warmod.team_b, id)
end

-- Returns the current player team
function warmod.get_team(id)
	if warmod.table_contains(warmod.team_a, id) then
		return "A"
	elseif warmod.table_contains(warmod.team_b, id) then
		return "B"
	end
end

-- Replaces the old captain with a new one
function warmod.new_captain(team, old_captain)
	local players, new_captain

	if team == "A" then
		players = warmod.team_a
	else
		players = warmod.team_b
	end

	-- We have still candidates
	if #players > 1 then
		new_captain = players[math.random(#players)]

		while new_captain == old_captain do
			new_captain = players[math.random(#players)]
		end

		if team == "A" then
			warmod.team_a_captain = new_captain
		else
			warmod.team_b_captain = new_captain
		end

		warmod.sv_msg(player(new_captain, "name") ..
			" has been selected as the new captain of the team " .. team)
	end
end

-- Swaps teamA and teamB data since teamA always starts as TT
-- on the first round.
function warmod.swap_teams_data()
	-- Teams Captains
	local tmp = warmod.team_a_captain
	warmod.team_a_captain = warmod.team_b_captain
	warmod.team_b_captain = tmp
	-- Team players
	tmp = warmod.team_a
	warmod.team_a = warmod.team_b
	warmod.team_b = tmp

	warmod.log("Mix", "Team data has been swapped")
end

-- Post mix process
function warmod.finish_match(result)
	if result == 0 then
		warmod.sv_msg("MIX DRAW !")
	elseif result == 1 then
		warmod.sv_msg(warmod.team_a_name .. " has won the mix !")
	elseif result == 2 then
		warmod.sv_msg(warmod.team_b_name .. " has won the mix !")
	end

	warmod.log_stats()
	warmod.reset_mix_vars()
	warmod.update_ready_list()

	parse("unbanall") -- TODO: remove on stable on stable release
end

-- Forfeit win process
function warmod.forfeit_win(winner)
	if winner == 1 then
		warmod.team_a_t_score = warmod.mr
		warmod.team_a_ct_score = warmod.mr
		warmod.team_b_t_score = 0
		warmod.team_b_ct_score = 0
	else
		warmod.team_b_t_score = warmod.mr
		warmod.team_b_ct_score = warmod.mr
		warmod.team_a_t_score = 0
		warmod.team_a_ct_score = 0
	end

	warmod.finish_match(winner)
end

-- Place subs into the mix
function warmod.place_subs()
	warmod.forced_switch = true -- Allows team change

	-- Through all wanted subs
	for mix_player, spec_target in pairs(warmod.sub_players) do
		-- The spec_target has accepted to sub the mix player
		if warmod.sub_spectators[spec_target] then
			local team = warmod.get_team(mix_player)

			-- Swaps players
			if team == "A" then
				warmod.table_remove(warmod.team_a, mix_player)
				warmod.add_to_team_a(spec_target)

				if warmod.team_a_captain == mix_player then
					warmod.team_a_captain = spec_target
					warmod.sv_msg(player(spec_target, "name") ..
						" is the new captain of " .. warmod.team_a_name)
				end
			else
				warmod.table_remove(warmod.team_b, mix_player)
				warmod.add_to_team_b(spec_target)

				if warmod.team_b_captain == mix_player then
					warmod.team_b_captain = spec_target
					warmod.sv_msg(player(spec_target, "name") ..
						" is the new captain of " .. warmod.team_b_name)
				end
			end

			-- Place player
			if warmod.state < warmod.STATES.SECOND_HALF then
				if team == "A" then
					parse("maket " .. spec_target)
				else
					parse("makect " .. spec_target)
				end
			else
				if team == "A" then
					parse("makect " .. spec_target)
				else
					parse("maket " .. spec_target)
				end
			end

			parse("makespec " .. mix_player)
			parse('setmoney ' .. spec_target .. ' ' .. player(mix_player, "money"))

			-- Swap done
			warmod.sub_players[mix_player] = nil
			warmod.sub_spectators[spec_target] = nil
		end
	end

	warmod.forced_switch = false -- Disable team change
end

-- Returns the current mix state as string
function warmod.get_mix_state()
	local state = warmod.state -- Current mix state

	if state == warmod.STATES.NONE then
		return "NONE"
	elseif state == warmod.STATES.PRE_MAP_VETO then
		return "PRE_MAP_VETO"
	elseif state == warmod.STATES.MAP_VETO then
		return "MAP_VETO"
	elseif state == warmod.STATES.WINNER_VETO then
		return "WINNER_VETO"
	elseif state == warmod.STATES.PRE_CAPTAINS_KNIFE then
		return "PRE_CAPTAINS_KNIFE"
	elseif state == warmod.STATES.CAPTAINS_KNIFE then
		return "CAPTAINS_KNIFE"
	elseif state == warmod.STATES.PRE_TEAM_SELECTION then
		return "PRE_TEAM_SELECTION"
	elseif state == warmod.STATES.TEAM_A_SELECTION then
		return "TEAM_A_SELECTION"
	elseif state == warmod.STATES.TEAM_B_SELECTION then
		return "TEAM_B_SELECTION"
	elseif state == warmod.STATES.PRE_MAP_SELECTION then
		return "PRE_MAP_SELECTION"
	elseif state == warmod.STATES.MAP_SELECTION then
		return "MAP_SELECTION"
	elseif state == warmod.STATES.PRE_KNIFE_ROUND then
		return "PRE_KNIFE_ROUND"
	elseif state == warmod.STATES.KNIFE_ROUND then
		return "KNIFE_ROUND"
	elseif state == warmod.STATES.PRE_FIRST_HALF then
		return "PRE_FIRST_HALF"
	elseif state == warmod.STATES.FIRST_HALF then
		return "FIRST_HALF"
	elseif state == warmod.STATES.PRE_SECOND_HALF then
		return "PRE_SECOND_HALF"
	elseif state == warmod.STATES.SECOND_HALF then
		return "SECOND_HALF"
	end
end


text:
using FluentNHibernate.Mapping;

namespace Grouple.NHibernate
{
  public class GroupleMangaPageMap : SubclassMap<GroupleMangaPage>
  {
    public GroupleMangaPageMap()
    {
      Not.LazyLoad();
      DiscriminatorValue("2634fbff-c408-48cc-a7ea-2c9180032ce0");
    }
  }
}