text:
'------------------------------------------------------------------------------
' <generado automáticamente>
'     Este código fue generado por una herramienta.
'
'     Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
'     se vuelve a generar el código.
' </generado automáticamente>
'------------------------------------------------------------------------------

Option Strict On
Option Explicit On

Partial Public Class VentanaRegistroFactura

    '''
    '''Control form1.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents form1 As Global.System.Web.UI.HtmlControls.HtmlForm

    '''
    '''Control lblOrden.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents lblOrden As Global.System.Web.UI.WebControls.Label

    '''
    '''Control lblMonto.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents lblMonto As Global.System.Web.UI.WebControls.Label

    '''
    '''Control lblArea.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents lblArea As Global.System.Web.UI.WebControls.Label

    '''
    '''Control rcbTipoDocumento.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents rcbTipoDocumento As Global.Telerik.Web.UI.RadComboBox

    '''
    '''Control rfvNumero2.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents rfvNumero2 As Global.System.Web.UI.WebControls.RequiredFieldValidator

    '''
    '''Control txtSerie.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents txtSerie As Global.System.Web.UI.WebControls.TextBox

    '''
    '''Control rfvNumero0.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents rfvNumero0 As Global.System.Web.UI.WebControls.RequiredFieldValidator

    '''
    '''Control txtNumero.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents txtNumero As Global.System.Web.UI.WebControls.TextBox

    '''
    '''Control rfvNumero.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents rfvNumero As Global.System.Web.UI.WebControls.RequiredFieldValidator

    '''
    '''Control txtMonto.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents txtMonto As Global.System.Web.UI.WebControls.TextBox

    '''
    '''Control rfvNumero3.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents rfvNumero3 As Global.System.Web.UI.WebControls.RequiredFieldValidator

    '''
    '''Control rdpFecha.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents rdpFecha As Global.Telerik.Web.UI.RadDatePicker

    '''
    '''Control rfvNumero1.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents rfvNumero1 As Global.System.Web.UI.WebControls.RequiredFieldValidator

    '''
    '''Control rdpFechaRecepcion.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents rdpFechaRecepcion As Global.Telerik.Web.UI.RadDatePicker

    '''
    '''Control rfvNumero4.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents rfvNumero4 As Global.System.Web.UI.WebControls.RequiredFieldValidator

    '''
    '''Control btnGuardar.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents btnGuardar As Global.System.Web.UI.WebControls.Button

    '''
    '''Control gvDetalle.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents gvDetalle As Global.System.Web.UI.WebControls.GridView

    '''
    '''Control odsOcxFactura.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents odsOcxFactura As Global.System.Web.UI.WebControls.ObjectDataSource

    '''
    '''Control odsTipoDocumento.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents odsTipoDocumento As Global.System.Web.UI.WebControls.ObjectDataSource

    '''
    '''Control RadScriptManager1.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RadScriptManager1 As Global.Telerik.Web.UI.RadScriptManager

    '''
    '''Control RadAjaxManager1.
    '''
    '''<remarks>
    '''Campo generado automáticamente.
    '''Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
    '''</remarks>
    Protected WithEvents RadAjaxManager1 As Global.Telerik.Web.UI.RadAjaxManager
End Class


text:
layout: post
date: 2015-11-16
title: "Nicole Spose Collection COLET EDITH COAB15257IV 2015 2015 Sleeveless Chapel Train Ballgown"
category: Nicole Spose
tags: [Nicole Spose,Ballgown,Illusion,Chapel Train,Sleeveless,2015]
---
### Nicole Spose Collection COLET EDITH COAB15257IV 2015
Just **$329.99**
### 2015  Sleeveless Chapel Train Ballgown

BRANDS	Nicole Spose

Silhouette	Ballgown

Neckline	Illusion

Hemline/Train	Chapel Train

Sleeve	Sleeveless

Years	2015

Buy it: [https://www.readybrides.com/en/nicole-spose/3730-nicole-spose-coab15257iv.html](https://www.readybrides.com/en/nicole-spose/3730-nicole-spose-coab15257iv.html)

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="#f00"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="adasdada"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"/>

</android.support.constraint.ConstraintLayout>


text:
package io.permazen.util;

import com.google.common.base.Preconditions;

import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.regex.Matcher;

/**
 * Used to report difference(s) between two hierarchical structures.
 *
 * <p>
 * Each individual difference is a {@link String} (map key) and has optional further detail contained in another
 * {@link Diffs} instance (map value, or null for none). Keys must not be null.
 */
@SuppressWarnings("serial")
public class Diffs extends LinkedHashMap<String, Diffs> {

    /**
     * Default constructor.
     */
    public Diffs() {
    }

    /**
     * Copy constructor. Performs a shallow copy.
     *
     * @param other instance to copy
     */
    public Diffs(Diffs other) {
        super(other);
    }

    /**
     * Add a difference without any sub-differences.
     *
     * @param description description of the difference
     * @throws IllegalArgumentException if {@code description} is null
     */
    public void add(String description) {
        this.add(description, null);
    }

    /**
     * Add a difference with optional sub-differences.
     *
     * @param description description of the difference
     * @param diffs sub-differences, or null for none
     * @throws IllegalArgumentException if {@code description} is null
     */
    public void add(String description, Diffs diffs) {
        Preconditions.checkArgument(description != null, "null description");
        this.put(description, diffs);
    }

    /**
     * Format this instance as a {@link String}.
     */
    @Override
    public String toString() {
        if (this.isEmpty())
            return "no differences";
        final StringBuilder buf = new StringBuilder();
        this.format(buf, 0);
        return buf.toString().trim();
    }

    private void format(StringBuilder buf, int depth) {
        final String indent = this.getIndent(depth);
        for (Map.Entry<String, Diffs> entry : this.entrySet()) {
            final String description = entry.getKey();
            buf.append(String.format("%s%s%n", indent,
              description.trim().replaceAll("(\\r?\\n)", "$1" + Matcher.quoteReplacement(indent))));
            final Diffs child = entry.getValue();
            if (child != null)
                child.format(buf, depth + 1);
        }
    }

    private String getIndent(int depth) {
        final char[] indent = new char[depth * 2];
        Arrays.fill(indent, ' ');
        return new String(indent) + "-> ";
    }
}


text:
import platform
from django.utils.functional import SimpleLazyObject
from shared_schema_tenants.settings import get_setting
from shared_schema_tenants.models import Tenant
from shared_schema_tenants.utils import import_from_string

if platform.python_version_tuple()[0] == '2':
    import thread as threading
else:
    import threading

def get_tenant(request):
    if not hasattr(request, '_cached_tenant'):
        tenant_retrievers = get_setting('TENANT_RETRIEVERS')

        for tenant_retriever in tenant_retrievers:
            tenant = import_from_string(tenant_retriever)(request)
            if tenant:
                request._cached_tenant = tenant
                break

        if not getattr(request, '_cached_tenant', False):
            lazy_tenant = TenantMiddleware.get_current_tenant()
            if not lazy_tenant:
                return None

            lazy_tenant._setup()
            request._cached_tenant = lazy_tenant._wrapped

        elif get_setting('ADD_TENANT_TO_SESSION'):
            try:
                request.session['tenant_slug'] = request._cached_tenant.slug
            except AttributeError:
                pass

    return request._cached_tenant

class TenantMiddleware(object):
    _threadmap = {}

    def __init__(self, get_response):
        self.get_response = get_response
        # One-time configuration and initialization.

    @classmethod
    def get_current_tenant(cls):
        try:
            return cls._threadmap[threading.get_ident()]
        except KeyError:
            return None

    @classmethod
    def set_tenant(cls, tenant_slug):
        cls._threadmap[threading.get_ident()] = SimpleLazyObject(
            lambda: Tenant.objects.filter(slug=tenant_slug).first())

    @classmethod
    def clear_tenant(cls):
        del cls._threadmap[threading.get_ident()]

    def process_request(self, request):
        request.tenant = SimpleLazyObject(lambda: get_tenant(request))
        self._threadmap[threading.get_ident()] = request.tenant

        return request

    def process_exception(self, request, exception):
        try:
            del self._threadmap[threading.get_ident()]
        except KeyError:
            pass

    def process_response(self, request, response):
        try:
            del self._threadmap[threading.get_ident()]
        except KeyError:
            pass
        return response

    def __call__(self, request):
        # Code to be executed for each request before
        # the view (and later middleware) are called.
        request = self.process_request(request)
        response = self.get_response(request)
        return self.process_response(request, response)


text:
#ifndef QXTWEBCGISERVICE_P_H
#define QXTWEBCGISERVICE_P_H

#include "qxtwebcgiservice.h"
#include <QString>
#include <QHash>
#include <QPair>
#include <QTimer>
#include <QSignalMapper>

#ifndef QXT_DOXYGEN_RUN
QT_FORWARD_DECLARE_CLASS(QProcess)
class QxtWebContent;

struct QxtCgiRequestInfo
{
    QxtCgiRequestInfo();
    QxtCgiRequestInfo(QxtWebRequestEvent* req);
    int sessionID, requestID;
    QHash<QString, QString> headers;
    bool eventSent, terminateSent;
    QTimer* timeout;
};

class QxtWebCgiServicePrivate : public QObject, public QxtPrivate<QxtWebCgiService>
{
    Q_OBJECT
public:
    QXT_DECLARE_PUBLIC(QxtWebCgiService)

    QHash<QProcess*, QxtCgiRequestInfo> requests;
    QHash<QxtWebContent*, QProcess*> processes;
    QString binary;
    int timeout;
    bool timeoutOverride;
    QSignalMapper timeoutMapper;

public Q_SLOTS:
    void browserReadyRead(QObject* o_content = 0);
    void processReadyRead();
    void processFinished();
    void terminateProcess(QObject* o_process);
};
#endif // QXT_DOXYGEN_RUN

#endif // QXTWEBSERVICEDIRECTORY_P_H


text:
package com.tle.web.controls.universal.handlers;

import com.tle.common.URLUtils;
import com.tle.common.filesystem.handle.FileHandle;
import com.tle.common.filesystem.handle.StagingFile;
import com.tle.common.i18n.CurrentLocale;
import com.tle.common.inplaceeditor.InPlaceEditorServerBackend;
import com.tle.core.guice.Bind;
import com.tle.core.institution.InstitutionService;
import com.tle.core.services.FileSystemService;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import javax.inject.Inject;
import javax.inject.Singleton;

/** @author Aaron */
@Bind
@Singleton
public class FileHandlerInplaceEditorBackend implements InPlaceEditorServerBackend {
  @Inject private FileSystemService fileSystemService;
  @Inject private InstitutionService institutionService;

  @Override
  public String getDownloadUrl(
      String wizardStagingId, int itemVersion, String stagingId, String filename) {
    // if the file doesn't exist in staging then copy it across
    // NOTE: this is completely different staging to the Wizard staging
    // (which has hijacked the itemUuid parameter)
    final FileHandle stagingFile = new StagingFile(stagingId);
    if (!fileSystemService.fileExists(stagingFile, filename)) {
      fileSystemService.copy(new StagingFile(wizardStagingId), filename, stagingFile, filename);
    }
    return institutionService.institutionalise(
        "file/" + stagingId + "/$/" + URLUtils.urlEncode(filename, false));
  }

  @Override
  public void write(String stagingId, String filename, boolean append, byte[] upload) {
    try {
      final FileHandle stagingFile = new StagingFile(stagingId);
      fileSystemService.write(stagingFile, filename, new ByteArrayInputStream(upload), append);
    } catch (IOException ex) {
      throw new RuntimeException(
          CurrentLocale.get(
              "com.tle.web.wizard.controls.universal.handlers.file.inplacebackend.error.write",
              filename),
          ex);
    }
  }
}


text:
import Ticket  from 'models/ticket';
import gridify from 'utils/gridify';

/**
 * The 'gridify' utility snaps positions to an imaginary grid based on the
 * ticket width and height.
 */
describe('utils/gridify', () => {
	it('should not affect coordinates already in grid', () => {
		let zeroed = gridify({ x: 0, y: 0 });

		zeroed.x.should.equal(0);
		zeroed.y.should.equal(0);

		let gridified = gridify({ x: Ticket.Width, y: Ticket.Height });

		gridified.x.should.equal(Ticket.Width);
		gridified.y.should.equal(Ticket.Height);
	});

	it('should snap coordinates towards the closest grid position', () => {
		let position = gridify({
			// Calculate the x value to be less than half of the ticket width.
			x: Ticket.Width - ( (Ticket.Width / 2) + 1 ),
			y: Ticket.Height - 1
		});

		position.x.should.equal(0);
		position.y.should.equal(Ticket.Height);
	})
});


text:
var config = require('../config')
if(!config.tasks.js) return

var path            = require('path')
var pathToUrl       = require('./pathToUrl')
var webpack         = require('webpack')
var webpackManifest = require('./webpackManifest')

module.exports = function(env) {
  var jsSrc = path.resolve(config.root.src, config.tasks.js.src)
  var jsDest = path.resolve(config.root.dest, config.tasks.js.dest)
  var publicPath = pathToUrl(config.tasks.js.dest, '/')

  var extensions = config.tasks.js.extensions.map(function(extension) {
    return '.' + extension
  })

  var rev = config.tasks.production.rev && env === 'production'
  var filenamePattern = rev ? '[name]-[hash].js' : '[name].js'

  var webpackConfig = {
    externals: {
      // require("jquery") is external and available
      //  on the global var jQuery
      "jquery": "jQuery"
    },
    context: jsSrc,
    plugins: [
      // Make $ reference jQuery
      new webpack.ProvidePlugin({
        $: "jquery",
        jQuery: "jquery",
        "window.jQuery": "jquery"
      }),
    ],
    resolve: {
      root: [
        jsSrc,
        path.join(__dirname, "..", "gulp", "node_modules")
      ],
      extensions: [''].concat(extensions)
    },
    module: {
      loaders: [
        {
          test: /\.js$/,
          loader: 'babel-loader',
          exclude: /(node_modules|bower_components)/,
          query: config.tasks.js.babel
        },
        { test: /\.js$/, loader: "imports-loader" },
        { test: /\.coffee$/, loader: "coffee-loader" },
        { test: /\.(coffee\.md|litcoffee)$/, loader: "coffee-loader?literate" }
      ]
    }
  }

  if(env === 'development') {
    webpackConfig.devtool = 'inline-source-map'

    // Create new entries object with webpack-hot-middleware added
    for (var key in config.tasks.js.entries) {
      var entry = config.tasks.js.entries[key]
      config.tasks.js.entries[key] = ['webpack-hot-middleware/client?&reload=true'].concat(entry)
    }

    webpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin())
  }

  if(env !== 'test') {
    // Karma doesn't need entry points or output settings
    webpackConfig.entry = config.tasks.js.entries

    webpackConfig.output= {
      path: path.normalize(jsDest),
      filename: filenamePattern,
      publicPath: publicPath
    }

    if(config.tasks.js.extractSharedJs) {
      // Factor out common dependencies into a shared.js
      webpackConfig.plugins.push(
        new webpack.optimize.CommonsChunkPlugin({
          name: 'shared',
          filename: filenamePattern,
        })
      )
    }
  }

  if(env === 'production') {
    if(rev) {
      webpackConfig.plugins.push(new webpackManifest(publicPath, config.root.dest))
    }
    webpackConfig.plugins.push(
      new webpack.DefinePlugin({
        'process.env': {
          'NODE_ENV': JSON.stringify('production')
        }
      }),
      new webpack.optimize.DedupePlugin(),
      new webpack.optimize.UglifyJsPlugin({
        output: {
          comments: false
        },
        compress: {
          drop_console: true
        },
      }),
      new webpack.NoErrorsPlugin()
    )
  }

  return webpackConfig
}


text:
.. tli documentation master file, created by
   sphinx-quickstart on Sun Nov 25 14:17:06 2012.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to tli's documentation!
===============================

This package contains functions to calculate improvement coefficients
for observables in the Schrödinger functional scheme. The code may be
obtained from `github
<https://github.com/dhesse/tree-level-improve>`_, either via ``ssh`` or http:

.. code-block:: shell

  git clone git@github.com:dhesse/tree-level-improve.git  # OR
  git clone https://github.com/dhesse/tree-level-improve.git

or downloaded as a `.zip archive
<https://github.com/dhesse/tree-level-improve/archive/master.zip>`_.

.. contents::

.. automodule:: tli
  :members:

.. automodule:: observables
  :members: fX, fA, fP, kv, fAstat, f1, f1stat

.. automodule:: propagator
  :members:

.. automodule:: dirac
  :members:

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
#ifndef COM_SANDFLOW_SMPTE_REGXML_DEFINITIONS_SETTYPEDEFINITION_H
#define COM_SANDFLOW_SMPTE_REGXML_DEFINITIONS_SETTYPEDEFINITION_H

#include "Definition.h"
#include "DefinitionVisitor.h"
#include <com/sandflow/smpte/util/AUID.h>
#include <vector>

namespace rxml {

	struct SetTypeDefinition : public Definition {

		virtual void accept(DefinitionVisitor &visitor) const {
			visitor.visit(*this);
		}

		AUID elementType;

	};
}

#endif


text:
/**
 * @fileoverview Generating Kiwifroot Javascript that resolves instance tokens
 * @author rani_sputnik@hotmail.com
 * @author benjamin.p.harding@gmail.com
 */
'use strict';

goog.provide('Blockly.Kiwifroot.instances');

goog.require('Blockly.Kiwifroot');

Blockly.Kiwifroot['kiwi_instance_self'] = function(block) {
	var code = 'this.owner';
  	return [code, Blockly.Kiwifroot.ORDER_ATOMIC];
};

Blockly.Kiwifroot['kiwi_instance_select'] = function(block) {
  var dropdown_id = block.getFieldValue('ID');
  var code = 'this.state.getChildByID("' + dropdown_id + '")';

  return [code, Blockly.Kiwifroot.ORDER_ATOMIC];
};

Blockly.Kiwifroot['kiwi_instance_set'] = function(block) {
	var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || '(null)';
	var prop = block.getFieldValue('PROP');
	var val = Blockly.Kiwifroot.valueToCode(block, 'VALUE', Blockly.Kiwifroot.ORDER_ASSIGNMENT);

  var code = errorCheck( this.workspace, ('!' + inst ), '`Set Instance` block could not find a Instance.' );

  code += inst + '.' + prop + ' = (' + val + ')';

  if( prop === 'rotation' ) {
    code += ' * Kiwi.Utils.GameMath.DEG_TO_RAD';
  }

  code += ';\n';

	return code;
};

Blockly.Kiwifroot['kiwi_instance_get'] = function(block) {
	var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || 'this.owner';
	var prop = block.getFieldValue('PROP');

  inst = errorCheckConditional( this.workspace, 'NotNull', inst, '!%1', 'this.owner', "No Instance could be found for a `get transform of instance` block.");
	var code = inst + '.' + prop;

  //Add error check here...

  if( prop === 'rotation' ) {
    code = '(' + inst + '.' + prop + ' * Kiwi.Utils.GameMath.RAD_TO_DEG)';
  }

	return [code, Blockly.Kiwifroot.ORDER_ATOMIC];
};

Blockly.Kiwifroot['kiwi_instance_get_visible'] = function(block) {
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || 'this.owner';
  var code = errorCheckConditional( this.workspace, 'NotNull', inst, '!%1', 'this.owner', "No Instance could be found for a `get visibility of instance` block.") + '.visible';
  return [code, Blockly.Kiwifroot.ORDER_ATOMIC];
};

Blockly.Kiwifroot['kiwi_instance_set_visible'] = function(block) {
  var value_vis = Blockly.Kiwifroot.valueToCode(block, 'VISIBLE', Blockly.Kiwifroot.ORDER_ATOMIC);
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || '(null)';
  var code = errorCheck( this.workspace, ('!' + inst ), '`Set Instance Visibility` block could not find a Instance.' );
  code += inst + '.visible = ' + value_vis + ';\n';
  return code;
};

Blockly.Kiwifroot['kiwi_instance_death'] = function(block) {
  var value_inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || '(null)';
  var code = errorCheck( this.workspace, ('!' + value_inst ), '`Destroy Instance` block could not find a Instance.' );
  code += value_inst + '.exists = false;\n';
  return code;
};

Blockly.Kiwifroot['kiwi_instance_tag_management'] = function(block) {
  var value_tag = Blockly.Kiwifroot.valueToCode(block, 'TAG', Blockly.Kiwifroot.ORDER_ATOMIC) || null;
  var value_instance = Blockly.Kiwifroot.valueToCode(block, 'INSTANCE', Blockly.Kiwifroot.ORDER_ATOMIC) || '(null)';
  var dropdown_type = block.getFieldValue('TYPE');

  var code = errorCheck( this.workspace, ('!' + value_instance ), '`Add/Remove Tag from Instance` block could not find a Instance.' );
  code += value_instance + '.' + dropdown_type + '(' + value_tag + ');\n';
  return code;
};

Blockly.Kiwifroot['kiwi_instance_has_tags'] = function(block) {
  var value_instance = Blockly.Kiwifroot.valueToCode(block, 'INSTANCE', Blockly.Kiwifroot.ORDER_ATOMIC) || 'this.owner';
  var value_tag = Blockly.Kiwifroot.valueToCode(block, 'TAG', Blockly.Kiwifroot.ORDER_ATOMIC) || null;

  var code = errorCheckConditional( this.workspace, 'NotNull', value_instance, '!%1', 'this.owner', "No Instance could be found for a `instance has tag` block.") + '.hasTag(' + value_tag + ')';
  return [code, Blockly.Kiwifroot.ORDER_ATOMIC];
};

Blockly.Kiwifroot['kiwi_instance_get_by_tag'] = function(block) {
  var value_tag = Blockly.Kiwifroot.valueToCode(block, 'TAG', Blockly.Kiwifroot.ORDER_ATOMIC) || null;
  var dropdown_type = block.getFieldValue('TYPE');

  var code  = 'this.state.' + dropdown_type + '(' + value_tag + ')';
  return [code, Blockly.Kiwifroot.ORDER_ATOMIC];
};

Blockly.Kiwifroot['kiwi_instance_get_all_by_tag'] = function(block) {
  var value_tag = Blockly.Kiwifroot.valueToCode(block, 'TAG', Blockly.Kiwifroot.ORDER_ATOMIC) || null;

  var code = 'this.state.getChildrenByTag(' + value_tag + ')';
  return [code, Blockly.Kiwifroot.ORDER_ATOMIC];
};

Blockly.Kiwifroot['kiwi_instance_move'] = function(block) {
  var value_inst_one = Blockly.Kiwifroot.valueToCode(block, 'INST_ONE', Blockly.Kiwifroot.ORDER_ATOMIC) || null;
  var value_inst_two = Blockly.Kiwifroot.valueToCode(block, 'INST_TWO', Blockly.Kiwifroot.ORDER_ATOMIC) || null;
  var dropdown_method = block.getFieldValue('METHOD');

  var code = errorCheck( this.workspace, ('!' + value_inst_one + '|| !' + value_inst_two ), '`Depth` block could not find a Instance.' );
  code += 'this.state.' + dropdown_method + '(' + value_inst_one + ', ' + value_inst_two + ');\n';
  return code;
};

Blockly.Kiwifroot['kiwi_instance_execute'] = function(block) {
  // Print statement.
  var argument0 = Blockly.Kiwifroot.valueToCode(block, 'TEXT',
      Blockly.Kiwifroot.ORDER_NONE) || '\'\'';
  //AHHH AHHH RUN AWAY
  var code  = 'eval('+argument0+');\n';

  return code;
};

Blockly.Kiwifroot['kiwi_instance_properties_set'] = function(block) {
  var value_prop_name = Blockly.Kiwifroot.valueToCode(block, 'PROP_NAME', Blockly.Kiwifroot.ORDER_ATOMIC) || '(null)';
  var value_value = Blockly.Kiwifroot.valueToCode(block, 'VALUE', Blockly.Kiwifroot.ORDER_ATOMIC) || "''";
  var value_inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || '(null)';

  var code = errorCheck( this.workspace, ('!' + value_inst ), '`Set Key` block could not find a Instance.' );
  code += value_inst + '.properties.set(' + value_prop_name + ',' + value_value + ');\n';

  return code;
};

Blockly.Kiwifroot['kiwi_instance_properties_get'] = function(block) {
  var value_prop_name = Blockly.Kiwifroot.valueToCode(block, 'PROP_NAME', Blockly.Kiwifroot.ORDER_ATOMIC) || '(null)';
  var value_inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || 'this.owner';

  var code = errorCheckConditional( this.workspace, 'NotNull', value_inst, '!%1', 'this.owner', "No Instance could be found for a `get key on instance` block.") + '.properties.get(' + value_prop_name + ')';
  return [code, Blockly.Kiwifroot.ORDER_ATOMIC];
};

// 22/10/2015

Blockly.Kiwifroot['kiwi_instance_set_position'] = function(block) {
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || '(null)';
  var prop = block.getFieldValue('PROP');
  var val = Blockly.Kiwifroot.valueToCode(block, 'VALUE', Blockly.Kiwifroot.ORDER_ASSIGNMENT) || 0;

  var code = errorCheck( this.workspace, ('!' + inst ), '`Set Instance Position` block could not find a Instance.' );
  code += inst + '.' + prop + ' = ' + val;
  code += ';\n';
  return code;
};
Blockly.Kiwifroot[ 'kiwi_instance_set_position_from_location' ] = function( block ) {
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || '(null)';
  var val = Blockly.Kiwifroot.valueToCode(block, 'VALUE', Blockly.Kiwifroot.ORDER_ASSIGNMENT) || 0;

  var code = errorCheck( this.workspace, ('!' + inst ), '`Set Instance Position` block could not find a Instance.' );
  code += inst + '.x' + ' = ' + val + ".x";
  code += ';\n';
  code += inst + '.y' + ' = ' + val + ".y";
  code += ';\n';

  return code;
};
Blockly.Kiwifroot['kiwi_instance_set_dimensions'] = function(block) {
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || '(null)';
  var prop = block.getFieldValue('PROP');
  var val = Blockly.Kiwifroot.valueToCode(block, 'VALUE', Blockly.Kiwifroot.ORDER_ASSIGNMENT) || 0;

  var code = errorCheck( this.workspace, ('!' + inst ), '`Set Instance Dimensions` block could not find a Instance.' );
  code += inst + '.' + prop + ' = ' + val;
  code += ';\n';
  return code;
};
Blockly.Kiwifroot['kiwi_instance_set_rotation'] = function(block) {
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || '(null)';
  var val = Blockly.Kiwifroot.valueToCode(block, 'VALUE', Blockly.Kiwifroot.ORDER_ASSIGNMENT) || 0;

  var code = errorCheck( this.workspace, ('!' + inst ), '`Set Instance Rotation` block could not find a Instance.' );
  code += inst + '.rotation = (' + val + ') * Kiwi.Utils.GameMath.DEG_TO_RAD';
  code += ';\n';
  return code;
};
Blockly.Kiwifroot['kiwi_instance_set_scale'] = function(block) {
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || '(null)';
  var prop = block.getFieldValue('PROP');
  var val = Blockly.Kiwifroot.valueToCode(block, 'VALUE', Blockly.Kiwifroot.ORDER_ASSIGNMENT) || 0;

  var code = errorCheck( this.workspace, ('!' + inst ), '`Set Instance Scale` block could not find a Instance.' );
  code += inst + '.' + prop + ' = ' + val;
  code += ';\n';
  return code;
};
Blockly.Kiwifroot['kiwi_instance_set_alpha'] = function(block) {
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || '(null)';
  var val = Blockly.Kiwifroot.valueToCode(block, 'VALUE', Blockly.Kiwifroot.ORDER_ASSIGNMENT) || 0;

  var code = errorCheck( this.workspace, ('!' + inst ), '`Set Instance Alpha` block could not find a Instance.' );
  code += inst + '.alpha = ' + val;
  code += ';\n';
  return code;
};
Blockly.Kiwifroot['kiwi_instance_set_anchor_point'] = function(block) {
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || '(null)';
  var prop = block.getFieldValue('PROP');
  var val = Blockly.Kiwifroot.valueToCode(block, 'VALUE', Blockly.Kiwifroot.ORDER_ASSIGNMENT) || 0;

  var code = errorCheck( this.workspace, ('!' + inst ), '`Set Instance Anchor` block could not find a Instance.' );
  code += inst + '.' + prop + ' = ' + val;
  code += ';\n';
  return code;
};

// Snap anchor point to instance centroid.
Blockly.Kiwifroot[ "kiwi_instance_center_anchor_point" ] = function( block ) {
  var code = "",
    inst = Blockly.Kiwifroot.valueToCode(
      block, "INST", Blockly.Kiwifroot.ORDER_ATOMIC );

  code += errorCheck(
    this.workspace,
    ( "!" + inst ),
    "`Center Anchor` block could not find an Instance." );
  code += inst + ".anchorPointX = " + inst + ".width / 2;\n";
  code += inst + ".anchorPointY = " + inst + ".height / 2;\n";

  return code;
};

Blockly.Kiwifroot['kiwi_instance_get_position'] = function(block) {
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || 'this.owner';
  var prop = block.getFieldValue('PROP');
  var code = errorCheckConditional( this.workspace, 'NotNull', inst, '!%1', 'this.owner', "No Instance could be found for a `get position of instance` block.") + '.' + prop;
  return [code, Blockly.Kiwifroot.ORDER_ATOMIC];
};

Blockly.Kiwifroot['kiwi_instance_get_location_from_position'] = function(block) {
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || 'this.owner';
  var code =
    "{ x: " +
    errorCheckConditional( this.workspace, 'NotNull', inst, '!%1', 'this.owner', "No Instance could be found for a `get position of instance` block.") +
    ".x, y: " + inst + ".y }";
  return [code, Blockly.Kiwifroot.ORDER_ATOMIC];
};

Blockly.Kiwifroot['kiwi_instance_get_dimensions'] = function(block) {
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || 'this.owner';
  var prop = block.getFieldValue('PROP');
  var mode = block.getFieldValue('MODE');
  var code = errorCheckConditional( this.workspace, 'NotNull', inst, '!%1', 'this.owner', "No Instance could be found for a `get width/height of instance` block.") + '.' + prop;
  if ( mode === "actual" ) {
    code += " * " + inst + "." + ( prop === "width" ? "scaleX" : "scaleY" );
  }

  return [code, Blockly.Kiwifroot.ORDER_ATOMIC];
};
Blockly.Kiwifroot['kiwi_instance_get_rotation'] = function(block) {
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || 'this.owner';
  var code = '(' + errorCheckConditional( this.workspace, 'NotNull', inst, '!%1', 'this.owner', "No Instance could be found for a `get rotation of instance` block.") + '.rotation * Kiwi.Utils.GameMath.RAD_TO_DEG)';

  return [code, Blockly.Kiwifroot.ORDER_ATOMIC];
};
Blockly.Kiwifroot['kiwi_instance_get_scale'] = function(block) {
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || 'this.owner';
  var prop = block.getFieldValue('PROP');
  var code = errorCheckConditional( this.workspace, 'NotNull', inst, '!%1', 'this.owner', "No Instance could be found for a `get scale of instance` block.") + '.' + prop;

  return [code, Blockly.Kiwifroot.ORDER_ATOMIC];
};
Blockly.Kiwifroot['kiwi_instance_get_alpha'] = function(block) {
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || 'this.owner';
  var code = errorCheckConditional( this.workspace, 'NotNull', inst, '!%1', 'this.owner', "No Instance could be found for a `get alpha of instance` block.") + '.alpha';

  return [code, Blockly.Kiwifroot.ORDER_ATOMIC];
};
Blockly.Kiwifroot['kiwi_instance_get_anchor_point'] = function(block) {
  var inst = Blockly.Kiwifroot.valueToCode(block, 'INST', Blockly.Kiwifroot.ORDER_ATOMIC) || 'this.owner';
  var prop = block.getFieldValue('PROP');
  var code = errorCheckConditional( this.workspace, 'NotNull', inst, '!%1', 'this.owner', "No Instance could be found for a `get anchor point of instance` block.") + '.' + prop;

  return [code, Blockly.Kiwifroot.ORDER_ATOMIC];
};


text:
package query

import (
	"bytes"
	"fmt"
	"strconv"

	"github.com/saracen/kubeql/query/ast"
	"github.com/saracen/kubeql/query/lexer"
)

type SelectStatement struct {
	Fields    []string
	Namespace string
	Resource  string
}

type Parser struct {
	s     *lexer.Scanner
	input string
}

func NewStringParser(input string) *Parser {
	in := bytes.NewBufferString(input)

	return &Parser{s: lexer.NewScanner(in), input: input}
}

func (p *Parser) Parse() (stmt *ast.SelectStatement, err error) {
	defer func() {
		if r := recover(); r != nil {
			err = fmt.Errorf("%v", r)
		}
	}()

	statement := p.s.Peek()

	switch statement {
	case lexer.Select:
		p.match(lexer.Select)
		query := p.SelectStatement()
		p.match(lexer.EOF)

		return query, nil

	default:
		return nil, fmt.Errorf("Expected SELECT")
	}
}

func (p *Parser) error(str string, offset int) {
	panic(fmt.Sprintf("%v (offset: %v) (%v <)", str, offset, strconv.Quote(p.input[:offset])))
}

func (p *Parser) match(token lexer.TokenType) string {
	t, offset, text := p.s.Scan()
	if t != token {
		p.error("unexpected token", offset)
	}

	return text
}

func (p *Parser) SelectStatement() *ast.SelectStatement {
	selectStatement := &ast.SelectStatement{}

	selectStatement.SelectClause = p.SelectClause()
	selectStatement.FromClause = p.FromClause()

	if p.s.Peek() == lexer.Where {
		selectStatement.WhereClause = p.WhereClause()
	}

	return selectStatement
}

func (p *Parser) Subselect() *ast.Subselect {
	p.match(lexer.Select)

	return &ast.Subselect{Select: p.SelectStatement()}
}

func (p *Parser) SelectClause() *ast.SelectClause {
	expressions := []*ast.SelectExpression{
		p.SelectExpression(),
	}

	for p.s.Peek() == lexer.Comma {
		p.match(lexer.Comma)
		expressions = append(expressions, p.SelectExpression())
	}

	return &ast.SelectClause{Expressions: expressions}
}

func (p *Parser) FromClause() *ast.FromClause {
	p.match(lexer.From)

	from := &ast.FromClause{}

	if p.s.Peek() == lexer.OpenParenthesis {
		from.Subselects = []*ast.FromSubselect{p.FromSubselect()}
	} else {
		from.Resources = []*ast.FromResource{p.FromResource()}
	}

	for p.s.Peek() == lexer.Comma {
		p.match(lexer.Comma)

		if p.s.Peek() == lexer.OpenParenthesis {
			from.Subselects = append(from.Subselects, p.FromSubselect())
		} else {
			from.Resources = append(from.Resources, p.FromResource())
		}
	}

	return from
}

func (p *Parser) FromSubselect() *ast.FromSubselect {
	p.match(lexer.OpenParenthesis)
	p.match(lexer.Select)
	s := p.SelectStatement()
	p.match(lexer.CloseParenthesis)

	return &ast.FromSubselect{
		Select: s,
		Alias:  p.AsAlias("", false, true),
	}
}

func (p *Parser) FromResource() *ast.FromResource {
	resource := &ast.FromResource{Version: "v1"}
	resource.Kind = p.match(lexer.Ident)

	if p.s.Peek() == lexer.Divide {
		p.match(lexer.Divide)
		resource.Version = p.match(lexer.Ident)
		resource.Group = resource.Kind
		p.match(lexer.Divide)
		resource.Kind = p.match(lexer.Ident)
	}

	if p.s.Peek() == lexer.Namespace {
		p.match(lexer.Namespace)
		resource.Namespace = p.match(lexer.Ident)
	}

	resource.Alias = p.AsAlias(resource.Kind, false, false)

	return resource
}

func (p *Parser) WhereClause() *ast.WhereClause {
	where := &ast.WhereClause{}

	p.match(lexer.Where)
	where.Condition = p.Expression(1)

	return where
}

func (p *Parser) SelectExpression() *ast.SelectExpression {
	selectExpr := &ast.SelectExpression{}

	selectExpr.Condition = p.Expression(1)
	selectExpr.Alias = p.AsAlias("", true, false)

	return selectExpr
}

func (p *Parser) PathExpression() *ast.PathExpression {
	var fields []string
	for p.s.Peek() == lexer.Arrow {
		p.match(lexer.Arrow)

		switch p.s.Peek() {
		case lexer.Ident:
			fields = append(fields, p.match(lexer.Ident))
		case lexer.String:
			fields = append(fields, p.match(lexer.String))
		case lexer.Integer:
			fields = append(fields, p.match(lexer.Integer))
		}
	}

	return &ast.PathExpression{
		Fields: fields,
	}
}

func (p *Parser) AsAlias(def string, allowString, required bool) string {
	if p.s.Peek() == lexer.As {
		p.match(lexer.As)
	}

	token := p.s.Peek()
	switch true {
	case allowString && token == lexer.String:
		return p.match(lexer.String)

	case token == lexer.Ident || required:
		return p.match(lexer.Ident)
	}

	return def
}

func (p *Parser) Expression(precedence int) ast.Expr {
	lhs := p.UnaryExpression()

	for {
		op := ast.Operator(p.s.Peek())
		if op.IsOperator() && op.Precedence() >= precedence {
			p.match(lexer.TokenType(op))
		} else {
			break
		}

		rhs := p.Expression(op.Precedence())
		lhs = &ast.BinaryExpr{Op: op, LHS: lhs, RHS: rhs}
	}

	return lhs
}

func (p *Parser) UnaryExpression() ast.Expr {
	token := p.s.Peek()

	switch token {
	case lexer.OpenParenthesis:
		p.match(lexer.OpenParenthesis)

		if p.s.Peek() == lexer.Select {
			subselect := p.Subselect()
			p.match(lexer.CloseParenthesis)

			return subselect
		}

		paren := &ast.ParenExpr{Expr: p.Expression(1)}
		p.match(lexer.CloseParenthesis)

		if p.s.Peek() == lexer.Arrow {
			paren.PathExpr = p.PathExpression()
		}

		return paren

	case lexer.String:
		return &ast.String{Val: p.match(lexer.String)}

	case lexer.Integer:
		num, _ := strconv.Atoi(p.match(lexer.Integer))
		return &ast.Integer{Val: num}

	case lexer.Float:
		num, _ := strconv.ParseFloat(p.match(lexer.Float), 64)
		return &ast.Float{Val: num}

	case lexer.True:
		p.match(lexer.True)
		return &ast.Boolean{Val: true}

	case lexer.False:
		p.match(lexer.False)
		return &ast.Boolean{Val: false}

	case lexer.Ident:
		name := p.match(lexer.Ident)
		ref := &ast.Reference{Name: name}
		if p.s.Peek() == lexer.Arrow {
			ref.PathExpr = p.PathExpression()
		}

		return ref

	case lexer.JsonPath:
		p.match(lexer.JsonPath)
		p.match(lexer.OpenParenthesis)
		expr := p.Expression(1)
		p.match(lexer.Comma)
		path := p.match(lexer.String)
		p.match(lexer.CloseParenthesis)

		jsonpath := &ast.JsonPath{Expr: expr, Path: path}
		if p.s.Peek() == lexer.Arrow {
			jsonpath.PathExpr = p.PathExpression()
		}

		return jsonpath

	case lexer.Jq:
		p.match(lexer.Jq)
		p.match(lexer.OpenParenthesis)
		expr := p.Expression(1)
		p.match(lexer.Comma)
		path := p.match(lexer.String)
		p.match(lexer.CloseParenthesis)

		jq := &ast.JQ{Expr: expr, Path: path}
		if p.s.Peek() == lexer.Arrow {
			jq.PathExpr = p.PathExpression()
		}

		return jq

	default:
		_, offset, _ := p.s.Scan()
		p.error("unexpected token in expression", offset)
	}

	return nil
}


text:
import { InputRef } from "palette"
import { createContext, Ref, useRef } from "react"

export const SearchContext = createContext<{
  inputRef: Ref<InputRef>
  queryRef: Ref<string>
}>(null as any)

export function useSearchProviderValues(query: string) {
  const inputRef = useRef<InputRef>(null)
  const queryRef = useRef(query)
  queryRef.current = query

  return {
    inputRef,
    queryRef,
  }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Statistics of dep in UD_Western_Sierra_Puebla_Nahuatl-ITML</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

Treebank Statistics: UD_Western_Sierra_Puebla_Nahuatl-ITML: Relations: dep

This relation is universal.

4 nodes (0%) are attached to their parents as dep.

3 instances of dep (75%) are left-to-right (parent precedes child).
Average distance between parent and child is 2.

The following 3 pairs of parts of speech are connected with dep: <tt>NOUN</tt>-<tt>NOUN</tt> (2; 50% instances), <tt>VERB</tt>-<tt>ADP</tt> (1; 25% instances), <tt>VERB</tt>-<tt>NOUN</tt> (1; 25% instances).

# visual-style 20	bgColor:blue
# visual-style 20	fgColor:white
# visual-style 18	bgColor:blue
# visual-style 18	fgColor:white
# visual-style 18 20 dep	color:blue
1	Ninkej	nin	DET	_	_	2	det	2:det	NormalizedForm=ninkeh|NormalizedLemma=nin
2	conhas	concha	NOUN	_	Typo=Yes	4	nsubj	4:nsubj	NormalizedForm=conhas|NormalizedLemma=koncha
3	achtoj	achtoj	ADV	_	_	4	advmod	4:advmod	NormalizedForm=achtoh|NormalizedLemma=achtoh
4	ikkuiliyaj	kuiliya	VERB	_	_	0	root	0:root	NormalizedForm=ikkwiliyah|NormalizedLemma=kwiliya
5	nipankakauyo	pankakauyo	NOUN	_	_	4	obj	4:obj	NormalizedForm=nipankakauyo|NormalizedLemma=pankakauyo
6	wan	wan	CCONJ	_	_	7	cc	7:cc	NormalizedForm=wan|NormalizedLemma=wan
7	kijchikij	ijchiki	VERB	_	_	5	conj	5:conj	NormalizedForm=kihchikih|NormalizedLemma=ihchiki
8	para	para	SCONJ	_	_	10	mark	10:mark	NormalizedForm=para|NormalizedLemma=para
9	ma	ma	AUX	_	_	10	aux	10:aux	NormalizedForm=ma|NormalizedLemma=ma
10	xitlatsiwi	_	VERB	_	_	7	advcl	7:advcl	NormalizedForm=xitlatsiwi|NormalizedLemma=_
11	,	,	PUNCT	_	_	12	punct	12:punct	NormalizedForm=,|NormalizedLemma=,
12	iktitikij	titiki	VERB	_	_	7	conj	7:conj	NormalizedForm=iktitikih|NormalizedLemma=titiki
13	tzokotzitzin	tzotzokotzin	ADV	_	Degree=Dim	12	advmod	12:advmod	NormalizedForm=tsokotsitsin|NormalizedLemma=tsotsokotsin
14	wan	wan	CCONJ	_	_	15	cc	15:cc	NormalizedForm=wan|NormalizedLemma=wan
15	kinchiwaj	chiwa	VERB	_	Number[obj]=Plur|Number[subj]=Plur|Person[obj]=3|Person[subj]=3|Subcat=Tran|Tense=Pres	12	conj	12:conj	NormalizedForm=kinchiwah|NormalizedLemma=chiwa
16	xochitzitzin	xochitl	NOUN	_	Degree=Dim|Number=Plur	15	obj	15:obj	SpaceAfter=No|NormalizedForm=xochitsitsin|NormalizedLemma=xochitl
17	,	,	PUNCT	_	_	18	punct	18:punct	NormalizedForm=,|NormalizedLemma=,
18	xiwitzitzin	xiwitl	NOUN	_	Degree=Dim|Number=Plur	16	conj	16:conj	NormalizedForm=xiwitsitsin|NormalizedLemma=xiwitl
19	tlajkoyan	_	NOUN	_	_	18	dep	18:dep	NormalizedForm=tlahkoyan|NormalizedLemma=_
20	tlaltitikten	tlaltitik	NOUN	_	_	18	dep	18:dep	SpaceAfter=No|NormalizedForm=tlaltitikten|NormalizedLemma=tlaltitik
21	,	,	PUNCT	_	_	22	punct	22:punct	NormalizedForm=,|NormalizedLemma=,
22	pajaritos	pájaro	NOUN	_	_	16	conj	16:conj	SpaceAfter=No|NormalizedForm=pajaritos|NormalizedLemma=páharo
23	,	,	PUNCT	_	_	24	punct	24:punct	NormalizedForm=,|NormalizedLemma=,
24	sitlalimej	sitlali	NOUN	_	Number=Plur	16	conj	16:conj	NormalizedForm=sitlalimeh|NormalizedLemma=sitlali
25	wan	wan	CCONJ	_	_	27	cc	27:cc	NormalizedForm=wan|NormalizedLemma=wan
26	oksiki	oksiki	DET	_	_	27	det	27:det	NormalizedForm=oksiki|NormalizedLemma=oksiki
27	tlejmachio	_	NOUN	_	_	24	conj	24:conj	NormalizedForm=tlehmachio|NormalizedLemma=_
28	.	.	PUNCT	_	_	4	punct	4:punct	NormalizedForm=.|NormalizedLemma=.

# visual-style 7	bgColor:blue
# visual-style 7	fgColor:white
# visual-style 10	bgColor:blue
# visual-style 10	fgColor:white
# visual-style 10 7 dep	color:blue
1	Noyiuqui	noyiuqui	ADV	_	_	3	advmod	3:advmod	_
2	o	o	AUX	_	_	3	aux	3:aux	NormalizedForm=o|NormalizedLemma=o
3	quintlasohtlaya	tlasohtla	VERB	_	Aspect=Imp|Number[obj]=Plur|Number[subj]=Sing|Person[obj]=3|Person[subj]=3|Subcat=Tran|Tense=Past	0	root	0:root	NormalizedForm=kintlasohtlaya|NormalizedLemma=tlasohtla
4	niconeuan	conetl	NOUN	_	Number=Plur|Number[psor]=Sing|Person[psor]=3	3	obj	3:obj	SpaceAfter=No
5	,	,	PUNCT	_	_	10	punct	10:punct	NormalizedForm=,|NormalizedLemma=,
6	quemanian	quemanian	ADV	_	_	10	advmod	10:advmod	NormalizedForm=kemanian|NormalizedLemma=kemanian
7	hasta	hasta	ADP	_	Foreign=Yes	10	dep	10:dep	NormalizedForm=hasta|NormalizedLemma=hasta
8	inuan	uan	NOUN	_	_	10	obl	10:obl	NormalizedForm=inwan|NormalizedLemma=wan
9	o	o	AUX	_	_	10	aux	10:aux	NormalizedForm=o|NormalizedLemma=o
10	tlahmatia	tlahmati	VERB	_	_	3	parataxis	3:parataxis	_
11	.	.	PUNCT	_	_	3	punct	3:punct	NormalizedForm=.|NormalizedLemma=.

# visual-style 16	bgColor:blue
# visual-style 16	fgColor:white
# visual-style 14	bgColor:blue
# visual-style 14	fgColor:white
# visual-style 14 16 dep	color:blue
1	Uan	uan	CCONJ	_	_	8	cc	8:cc	NormalizedForm=wan|NormalizedLemma=wan
2	ohcon	ohcon	ADV	_	_	8	advmod	8:advmod	NormalizedForm=ohkon|NormalizedLemma=ohkon
3	Dios	dios	PROPN	_	_	8	nsubj	8:nsubj	NormalizedForm=dios|NormalizedLemma=dios
4	uan	uan	CCONJ	_	_	6	cc	6:cc	NormalizedForm=wan|NormalizedLemma=wan
5	in	in	DET	_	_	6	det	6:det	NormalizedForm=in|NormalizedLemma=in
6	temaman	mama	NOUN	_	_	3	conj	3:conj	_
7	o	o	AUX	_	_	8	aux	8:aux	NormalizedForm=o|NormalizedLemma=o
8	pacqueh	pacqui	VERB	_	Aspect=Perf|Number[subj]=Plur|Person[subj]=3|Subcat=Intr|Tense=Past	0	root	0:root	_
9	,	,	PUNCT	_	_	12	punct	12:punct	NormalizedForm=,|NormalizedLemma=,
10	porque	porque	SCONJ	_	_	12	mark	12:mark	NormalizedForm=porque|NormalizedLemma=porque
11	o	o	AUX	_	_	12	aux	12:aux	NormalizedForm=o|NormalizedLemma=o
12	cmatqueh	_	VERB	_	Aspect=Perf|Number[obj]=Sing|Number[subj]=Plur|Person[obj]=3|Person[subj]=3|Subcat=Tran|Tense=Past	8	advcl	8:advcl	_
13	o	o	AUX	_	_	14	aux	14:aux	NormalizedForm=o|NormalizedLemma=o
14	ctlatiquitihqueh	tiquiti	VERB	_	_	12	ccomp	12:ccomp	_
15	in	in	DET	_	_	16	det	16:det	NormalizedForm=in|NormalizedLemma=in
16	tlaol	tlaol	NOUN	_	_	14	dep	14:dep	NormalizedForm=tlaol|NormalizedLemma=tlaol
17	cuachicauac	cuachicauac	ADJ	_	_	16	amod	16:amod	SpaceAfter=No
18	.	.	PUNCT	_	_	8	punct	8:punct	NormalizedForm=.|NormalizedLemma=.

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
package com.apssouza.auth;

import java.util.HashMap;
import java.util.Map;
import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.security.oauth2.provider.token.TokenEnhancer;

/**
 *
 * @author apssouza
 */
public class CustomTokenEnhancer implements TokenEnhancer {

    @Override
    public OAuth2AccessToken enhance(
            OAuth2AccessToken accessToken,
            OAuth2Authentication authentication
    ) {
        Map<String, Object> additionalInfo = new HashMap<>();
        additionalInfo.put("name", authentication.getName());
        ((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(additionalInfo);
        return accessToken;
    }

}


text:
/*eslint-disable*/
import React from 'react'
import TestUtils from 'react/lib/ReactTestUtils'
import expect from 'expect'
import ReactGithubStars from '../ReactGithubStars'

describe('ReactGithubStars component', () => {
  //
  const component = TestUtils.renderIntoDocument(<ReactGithubStars username="torvalds" defaultColor={true} displayBorder={true} />)
  it('renders into document', () => {
    expect(component).toExist()
  })
  it('has main rgs class', () => {
    const hasClass = TestUtils.findRenderedDOMComponentWithClass(component, 'rgs')
    expect(hasClass).toExist()
  })
  it('should add rgsShow class on loading complete', function () {
    component.setState({ loading: false })
    const hasClass = TestUtils.findRenderedDOMComponentWithClass(component, 'rgsShow')
    expect(hasClass).toExist()
  })
})


text:
from telemetry.core import android_action_runner
from telemetry.core import platform
from telemetry.internal.app import android_app
from telemetry.internal.backends import android_app_backend

class AndroidPlatform(platform.Platform):

  def __init__(self, platform_backend):
    super(AndroidPlatform, self).__init__(platform_backend)
    self._android_action_runner = android_action_runner.AndroidActionRunner(
        platform_backend)

  def Initialize(self):
    self._platform_backend.Initialize()

  @property
  def android_action_runner(self):
    return self._android_action_runner

  @property
  def system_ui(self):
    """Returns an AppUi object to interact with Android's system UI.

    See devil.android.app_ui for the documentation of the API provided.
    """
    return self._platform_backend.GetSystemUi()

  def IsSvelte(self):
    return self._platform_backend.IsSvelte()

  def LaunchAndroidApplication(self,
                               start_intent,
                               is_app_ready_predicate=None,
                               app_has_webviews=True):
    """Launches an Android application given the intent.

    Args:
      start_intent: The intent to use to start the app.
      is_app_ready_predicate: A predicate function to determine
          whether the app is ready. This is a function that takes an
          AndroidApp instance and return a boolean. When it is not passed in,
          the app is ready when the intent to launch it is completed.
      app_has_webviews: A boolean indicating whether the app is expected to
          contain any WebViews. If True, the app will be launched with
          appropriate webview flags, and the GetWebViews method of the returned
          object may be used to access them.

    Returns:
      A reference to the android_app launched.
    """
    self._platform_backend.DismissCrashDialogIfNeeded()
    app_backend = android_app_backend.AndroidAppBackend(
        self._platform_backend, start_intent, is_app_ready_predicate,
        app_has_webviews)
    return android_app.AndroidApp(app_backend, self._platform_backend)


text:
import template from './datatable.html';
import controller from './datatable.controller';
import './datatable.styl';

// DataTables
import 'datatables.net/js/jquery.dataTables.js';
import 'datatables.net-bs/css/dataTables.bootstrap.css';

let datatableComponent = {
  restrict: 'E',
  bindings: {
    columns: '<',
    rows: '<'
  },
  template,
  controller: ['$timeout', controller]
};

export default datatableComponent;


text:
package com.github.simpleliving40.boardgame.service;

import com.github.simpleliving40.boardgame.domain.BoardGame;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.xml.sax.SAXException;

import java.io.IOException;

/**
 * This class is used to import from XML file (downloaded from BGG) to the BoardGame database.
 */
@Service
public class BoardGameImportService {
    private static final Logger log = LoggerFactory.getLogger(BoardGameImportService.class);

    BggParser parser;

    public BoardGameImportService(){
        parser = new BggParser();
    }

    public BoardGame parse(String filename) throws IOException, SAXException {
        return parser.parse(filename);
    }
}


text:
@interface AppCommunicate : NSObject
{
}

+ (id)appCommunicateDataForAppIDForiOS7Plus:(id)arg1;
+ (id)appCommunicateDataForAppID:(id)arg1;
+ (_Bool)setAppCommunicateDataForiOS7Plus:(id)arg1 forAppID:(id)arg2;
+ (_Bool)setAppCommunicateData:(id)arg1 forAppID:(id)arg2;
+ (id)fileDataForAppID:(id)arg1;
+ (_Bool)setFileData:(id)arg1 forAppID:(id)arg2;
+ (_Bool)setPropertyListForiOS7Plus:(id)arg1 forAppID:(id)arg2;
+ (_Bool)setPropertyList:(id)arg1 forAppID:(id)arg2;
+ (id)propertyListForAppIDForiOS7Plus:(id)arg1;
+ (id)propertyListForAppID:(id)arg1;
+ (id)propertyListForAllAppForiOS7Plus;
+ (id)propertyListForAllApp;
+ (id)getFilePasteboard;
+ (id)getDataPasteboardForiOS7Plus;
+ (id)getDataPasteboard;
+ (id)getFilePasteboardName;
+ (id)getDataPasteboardName;
- (id)init;

@end


text:
package com.thrift.zk.soa.thrift.server;

import com.thrift.zk.soa.thrift.route.RouteEnum;
import com.thrift.zk.soa.utils.Constant;

import java.util.concurrent.ExecutorService;

/**
 * Author: xiajun
 * Date: 2016-10-22
 * Time: 12:46:00
 */
public class ServerConfig {
    private int port = 9090;//服务端口
    private int selectorThreads = 4;//thrift selector的线程数
    private int workerThreads = 500;//thrift 工作线程数
    private int maxReadBufferBytes = 1024000;//thrift 读取buffer大小
    private int acceptQueueSizePerThread = 100;//thrift 客户端连接请求的存放队列
    private String host = null;//服务绑定的IP地址
    private int clientTimeout = 1000;//thrift服务端读超时时间
    private String dns;//服务程序在zookeeper中的节点
    private String zkAddress;//zookeeper集群地址
    private int zkSessionTimeout = 3000;//zookeeper session超时
    private int zkConnTimeout = 3000;//zookeeper 连接超时
    private ExecutorService workerThreadPool;//thrift处理请求的线程池
    private boolean useZk = true;//是否使用zookeeper
    private String cluster = Constant.DEFAULT_CLUSTER;//默认队列
    private int weight;//服务器权重
    private RouteEnum route;
    private Constant.Protocol protocol = Constant.Protocol.TCOMPACTPROTOCOL;//thrift 使用的压缩协议

    public int getPort() {
        return port;
    }

    /**
     * 设置服务器端口号
     *
     * @param port 端口号
     * @return ServerConfig
     */
    public ServerConfig setPort(int port) {
        this.port = port;
        return this;
    }

    public int getSelectorThreads() {
        return selectorThreads;
    }

    /**
     * 设置thrift selector线程数量。根据实际情况设置,
     * 设置标准:服务响应时间偏大类型的运用可以将该值设大,相反请设小该值
     * 默认值:4
     *
     * @param selectorThreads select选择器个数
     * @return ServerConfig
     */
    public ServerConfig setSelectorThreads(int selectorThreads) {
        this.selectorThreads = selectorThreads;
        return this;
    }

    public int getWorkerThreads() {
        return workerThreads;
    }

    /**
     * 该参数为thrift最大工作线程数。工作线程是调用服务实现类的载体
     * 设置标准:参考 setSelectorThreads,两者相通
     * 默认值:500
     *
     * @param workerThreads 工作线程数
     * @return ServerConfig
     */
    public ServerConfig setWorkerThreads(int workerThreads) {
        this.workerThreads = workerThreads;
        return this;
    }

    public int getMaxReadBufferBytes() {
        return maxReadBufferBytes;
    }

    /**
     * 设置thrift server和client通信时一次最大能读的字节数。
     * 默认值:1M,除非有特殊需求,否则请不要增大该值
     *
     * @param maxReadBufferBytes 通讯包大小
     * @return ServerConfig
     */
    public ServerConfig setMaxReadBufferBytes(int maxReadBufferBytes) {
        this.maxReadBufferBytes = maxReadBufferBytes;
        return this;
    }

    public int getAcceptQueueSizePerThread() {
        return acceptQueueSizePerThread;
    }

    /**
     * 设置每个SelectorThread线程处理客户端请求时的队列大小。
     * 默认值:100 一般情况一下不需要重设该值
     *
     * @param acceptQueueSizePerThread 队列大小
     * @return ServerConfig
     */
    public ServerConfig setAcceptQueueSizePerThread(int acceptQueueSizePerThread) {
        this.acceptQueueSizePerThread = acceptQueueSizePerThread;
        return this;
    }

    public String getHost() {
        return host;
    }

    /**
     * 设置thrift服务绑定的IP。
     * 默认值:程序会绑定到0.0.0.0上
     *
     * @param host IP地址
     * @return ServerConfig
     */
    public ServerConfig setHost(String host) {
        this.host = host;
        return this;
    }

    public int getClientTimeout() {
        return clientTimeout;
    }

    /**
     * 设置thrift 服务端socket读取客户端数据时的超时。读超时
     * 默认值:1000ms
     *
     * @param clientTimeout 读取超时时间,毫秒值
     * @return ServerConfig
     */
    public ServerConfig setClientTimeout(int clientTimeout) {
        this.clientTimeout = clientTimeout;
        return this;
    }

    public String getDns() {
        return dns;
    }

    /**
     * 设置thrift服务在zookeeper上的注册地址。每个不同服务应该使用不同dns,
     * 如果设置 setUseZk(false),该值可不设置
     *
     * @param dns zk节点
     * @return ServerConfig
     */
    public ServerConfig setDns(String dns) {
        this.dns = dns;
        return this;
    }

    public String getZkAddress() {
        return zkAddress;
    }

    /**
     * zookeeper集群地址。
     * 格式:ip:port,ip:port
     *
     * @param zkAddress zk服务地址
     * @return ServerConfig
     */
    public ServerConfig setZkAddress(String zkAddress) {
        this.zkAddress = zkAddress;
        return this;
    }

    public ExecutorService getWorkerThreadPool() {
        return workerThreadPool;
    }

    /**
     * 设置thrift 服务工作线程使用的线程池。
     * 如果设置了该值,那么setWorkerThreads()的设置将无效
     *
     * @param workerThreadPool 线程池对象
     * @return ServerConfig
     */
    public ServerConfig setWorkerThreadPool(ExecutorService workerThreadPool) {
        this.workerThreadPool = workerThreadPool;
        return this;
    }

    public boolean isUseZk() {
        return useZk;
    }

    /**
     * 设置是否使用zookeeper对thrift服务进行管理。
     * true表示使用zookeeper,当为false时 意味着这个服务是个单机或者叫本地服务
     *
     * @param useZk 是否使用zk管理
     * @return ServerConfig
     */
    public ServerConfig setUseZk(boolean useZk) {
        this.useZk = useZk;
        return this;
    }

    public String getCluster() {
        return cluster;
    }

    /**
     * 集群名称 暂时无实际用途
     *
     * @param cluster 集群名称
     * @return ServerConfig
     */
    public ServerConfig setCluster(String cluster) {
        this.cluster = cluster;
        return this;
    }

    public Constant.Protocol getProtocol() {
        return protocol;
    }

    /**
     * 设置thrift 服务端使用的通信压缩模式。
     * 默认值:TCompactProtocol
     *
     * @param protocol 通讯协议
     * @return ServerConfig
     */
    public ServerConfig setProtocol(Constant.Protocol protocol) {
        this.protocol = protocol;
        return this;
    }

    public int getZkSessionTimeout() {
        return zkSessionTimeout;
    }

    /**
     * 设置zookeeper 会话超时时间。
     * 数值越小服务宕机后越早被发现,但越容易出现对网络闪断的误判
     * @param zkSessionTimeout 会话超时时间
     * @return ServerConfig
     */
    public ServerConfig setZkSessionTimeout(int zkSessionTimeout) {
        this.zkSessionTimeout = zkSessionTimeout;
        return this;
    }

    public int getZkConnTimeout() {
        return zkConnTimeout;
    }

    /**
     * 设置zookeeper连接超时时间。
     *
     * @param zkConnTimeout 连接超时,毫秒
     * @return ServerConfig
     */
    public ServerConfig setZkConnTimeout(int zkConnTimeout) {
        this.zkConnTimeout = zkConnTimeout;
        return this;
    }

    public int getWeight() {
        return weight;
    }

    /**
     * 服务器权重。
     * 权重越大需要处理的请求越多
     *
     * @param weight 权重
     */
    public ServerConfig setWeight(int weight) {
        this.weight = weight;
        return this;
    }

    public RouteEnum getRoute() {
        return route;
    }

    /**
     * 设置路由方式。
     * default: RouteEnum.RANDOM
     * @param route 路由方式
     * @return ServerConfig
     */
    public ServerConfig setRoute(RouteEnum route) {
        this.route = route;
        return this;
    }
}


text:
package jp.fieldnotes.hatunatu.dao.dataset.states;

import jp.fieldnotes.hatunatu.dao.dataset.RowState;

/**
 * {@link RowState}を管理するインターフェースです。
 */
public interface RowStates {

    /**
     * 変更がないとき用の {@link RowState}です。
     *
     * @see UnchangedState
     */
    RowState UNCHANGED = new UnchangedState();

    /**
     * 新規作成用の {@link RowState}です。
     *
     * @see CreatedState
     */
    RowState CREATED = new CreatedState();

    /**
     * 更新用の {@link RowState}です。
     *
     * @see ModifiedState
     */
    RowState MODIFIED = new ModifiedState();

    /**
     * 削除用の {@link RowState}です。
     *
     * @see RemovedState
     */
    RowState REMOVED = new RemovedState();
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Syll. fung. (Abellini) 4: 266 (1886)

#### Original name
Torula arbuscula Corda, 1838

### Remarks
null


text:
<?php

namespace Hyn\MultiTenant\Models;

use Carbon\Carbon;
use Hyn\MultiTenant\Abstracts\Models\SystemModel;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\SoftDeletes;
use Laracasts\Presenter\PresentableTrait;

/**
 * @property string     $name
 * @property string     $email
 * @property string     $customer_no
 * @property bool    $administrator
 * @property int    $reseller_id
 * @property int    $referer_id
 * @property Tenant     $referer
 * @property Tenant     $reseller
 * @property Collection $refered
 * @property Collection $reselled
 * @property Collection $hostnames
 * @property Collection $websites
 * @property Carbon     $created_at
 * @property Carbon     $updated_at
 * @property Carbon     $deleted_at
 */
class Tenant extends SystemModel
{
    use PresentableTrait, SoftDeletes;

    /**
     * @var string
     */
    protected $presenter = 'Hyn\MultiTenant\Presenters\TenantPresenter';

    protected $fillable = ['name', 'email', 'customer_no'];

    /**
     * All hostnames of this tenant.
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function hostnames()
    {
        return $this->hasMany(Hostname::class);
    }

    /**
     * All websites of this tenant.
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function websites()
    {
        return $this->hasMany(Website::class);
    }

    /**
     * The reseller of this tenant.
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function reseller()
    {
        return $this->belongsTo(self::class);
    }

    /**
     * The referer of this tenant.
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function referer()
    {
        return $this->belongsTo(self::class);
    }

    /**
     * Those who have been reselled by this tenant.
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function reselled()
    {
        return $this->hasMany(self::class, 'reseller_id');
    }

    /**
     * Those that have been refered by this tenant.
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function refered()
    {
        return $this->hasMany(self::class, 'referer_id');
    }
}


text:
#include "sshtunneloutconnection.h"
#include "sshtunnelout.h"
#include "sshclient.h"

Q_LOGGING_CATEGORY(logsshtunneloutconnection, "ssh.tunnelout.connection")
Q_LOGGING_CATEGORY(logsshtunneloutconnectiontransfer, "ssh.tunnelout.connection.transfer")

#define DEBUGCH qCDebug(logsshtunneloutconnection) << m_name
#define DEBUGTX qCDebug(logsshtunneloutconnectiontransfer) << m_name

#define SOCKET_WRITE_ERROR (-1001)

SshTunnelOutConnection::SshTunnelOutConnection(const QString &name, SshClient *client)
    : SshChannel(name, client)
    , m_connector(client, name)
{
    QObject::connect(this, &SshTunnelOutConnection::sendEvent, this, &SshTunnelOutConnection::_eventLoop, Qt::QueuedConnection);
    QObject::connect(&m_connector, &SshTunnelDataConnector::sendEvent, this, &SshTunnelOutConnection::sendEvent);
    DEBUGCH << "Create SshTunnelOutConnection (constructor)";
    emit sendEvent();
}

void SshTunnelOutConnection::configure(QTcpServer *server, quint16 remotePort, QString target)
{
    m_server = server;
    m_port = remotePort;
    m_target = target;
}

SshTunnelOutConnection::~SshTunnelOutConnection()
{
    DEBUGCH << "Free SshTunnelOutConnection (destructor)";
    delete m_sock;
}

void SshTunnelOutConnection::close()
{
    DEBUGCH << "Close SshTunnelOutConnection asked";
    if(channelState() != ChannelState::Error)
    {
        setChannelState(ChannelState::Close);
    }
    emit sendEvent();
}

void SshTunnelOutConnection::sshDataReceived()
{
    m_connector.sshDataReceived();
    emit sendEvent();
}

void SshTunnelOutConnection::flushTx()
{
    m_connector.flushTx();
}

void SshTunnelOutConnection::_eventLoop()
{
    switch(channelState())
    {
        case Openning:
        {
            if ( ! m_sshClient->takeChannelCreationMutex(this) )
            {
                return;
            }
            m_sshChannel = libssh2_channel_direct_tcpip(m_sshClient->session(), qPrintable(m_target), m_port);
            m_sshClient->releaseChannelCreationMutex(this);
            if (m_sshChannel == nullptr)
            {
                char *emsg;
                int size;
                int ret = libssh2_session_last_error(m_sshClient->session(), &emsg, &size, 0);
                if(ret == LIBSSH2_ERROR_EAGAIN)
                {
                    return;
                }
                if(!m_error)
                {
                    qCDebug(logsshtunneloutconnection) << "Refuse client socket connection on " << m_server->serverPort() << QString(emsg);
                    m_error = true;
                    m_sock = m_server->nextPendingConnection();
                    if(m_sock)
                    {
                        m_sock->close();
                    }
                    m_server->close();
                }
                setChannelState(ChannelState::Error);
                qCWarning(logsshtunneloutconnection) << "Channel session open failed";
                return;
            }
            DEBUGCH << "Channel session opened";
            setChannelState(ChannelState::Exec);
        }

        FALLTHROUGH; case Exec:
        {
            m_sock = m_server->nextPendingConnection();
            if(!m_sock)
            {
                m_server->close();
                setChannelState(ChannelState::Error);
                qCWarning(logsshtunneloutconnection) << "Fail to get client socket";
                setChannelState(ChannelState::Close);
                return;
            }

            QObject::connect(m_sock, &QObject::destroyed, [this](){ DEBUGCH << "Client Socket destroyed";});
            m_name = QString(m_name + ":%1").arg(m_sock->localPort());
            DEBUGCH << "createConnection: " << m_sock << m_sock->localPort();
            m_connector.setChannel(m_sshChannel);
            m_connector.setSock(m_sock);
            setChannelState(ChannelState::Ready);
            /* OK, next step */
        }

        FALLTHROUGH; case Ready:
        {
            if(!m_connector.process())
            {
                setChannelState(ChannelState::Close);
            }
            return;
        }

        case Close:
        {
            DEBUGCH << "closeChannel";
            m_connector.close();
            setChannelState(ChannelState::WaitClose);
        }

        FALLTHROUGH; case WaitClose:
        {
            DEBUGCH << "Wait close channel";
            if(m_connector.isClosed())
            {
                setChannelState(ChannelState::Freeing);
            }
            else
            {
                m_connector.process();
                return;
            }
        }

        FALLTHROUGH; case Freeing:
        {
            DEBUGCH << "free Channel";

            int ret = libssh2_channel_free(m_sshChannel);
            if(ret == LIBSSH2_ERROR_EAGAIN)
            {
                return;
            }
            if(ret < 0)
            {
                if(!m_error)
                {
                    m_error = true;
                    qCWarning(logsshtunneloutconnection) << "Failed to free channel: " << sshErrorToString(ret);
                }
            }

            if(m_error)
            {
                setChannelState(ChannelState::Error);
            }
            else
            {
                setChannelState(ChannelState::Free);
            }
            m_sshChannel = nullptr;
            QObject::disconnect(m_sshClient, &SshClient::sshDataReceived, this, &SshTunnelOutConnection::sshDataReceived);
            return;
        }

        case Free:
        {
            qCDebug(logsshtunneloutconnection) << "Channel" << m_name << "is free";
            return;
        }

        case Error:
        {
            qCDebug(logsshtunneloutconnection) << "Channel" << m_name << "is in error state";
            setChannelState(Free);
            return;
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Secret Santa 2014/Xmas</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="msapplication-config" content="none"/>
    <link rel="stylesheet" href="../static/css/bootstrap.css">

            <form method="post" class="form-horizontal" name="mainForm" >

Lyrics ID

                    <input class="form-control" id="lyrics_id" maxlength="None" name="lyrics_id" step="1" type="number" value="134">

Translation ID

                    <input class="form-control" id="translated_lyrics_id" maxlength="None" name="translated_lyrics_id" step="1" type="number" value="">

YouTube ID

                    <input class="form-control" id="youtube_id" maxlength="12" name="youtube_id" type="text" value="">

Lyricist

                    <input class="form-control" id="lyricist" maxlength="64" name="lyricist" type="text" value="?">

Musician

                    <input class="form-control" id="musician" maxlength="64" name="musician" type="text" value="?">

Original Lyrics

                    <textarea class="form-control" id="original_lyrics" maxlength="None" name="original_lyrics">Απ' τη συνοικία τα λεωφορεία
γέμισαν φανέλες κι αναμμένα μάτια
Σμάρι οι οικοδόμοι μπρος στη δημαρχία
στις γωνιές η νύχτα γίνεται κομμάτια

Κόκκινη πόλη μες στ' αγιάζι
Βάλε τα ρούχα τα παλιά
Άρχισε να γλυκοχαράζει
στα λασπωμένα σου γιαπιά

Απ' τη συνοικία μέχρι το λιμάνι
πάνω στους σκυμμένους ώμους του εργάτη
αίμα και τσιμέντο γίνονται χαρμάνι
χτίζεται η ζωή μας, θάνατο γεμάτη

Κόκκινη πόλη μες στ' αγιάζι
Βάλε τα ρούχα τα παλιά
Άρχισε να γλυκοχαράζει
στα λασπωμένα σου γιαπιά</textarea>

Transcribed Lyrics

                    <textarea class="form-control" id="transcribed_lyrics" maxlength="None" name="transcribed_lyrics">Ap' ti synoikia ta leoforeia
gemisan faneles ki anammena matia
Smari oi oikodomoi bros sti dimarchia
stis gonies i nychta ginetai kommatia

Kokkini poli mes st' agiazi
Vale ta roucha ta palia
Archise na glykocharazei
sta laspomena sou giapia

Ap' ti synoikia mechri to limani
pano stous skymmenous omous tou ergati
aima kai tsimento ginontai charmani
chtizetai i zoi mas, thanato gemati

Kokkini poli mes st' agiazi
Vale ta roucha ta palia
Archise na glykocharazei
sta laspomena sou giapia</textarea>

Translated Lyrics

                    <textarea class="form-control" id="translated_lyrics" maxlength="None" name="translated_lyrics"></textarea>

                            <input type="submit" class="form-control btn btn-success" value="Save"/>

            </form>


text:
include YARD::Templates::Helpers::HtmlHelper

def init
  super

  # Additional javascript that power the additional menus, collapsing, etc.
  asset "js/cucumber.js", file("js/cucumber.js",true)

  serialize_object_type :feature

  serialize_object_type :tag

  # Generates the requirements splash page with the 'requirements' template
  serialize(YARD::CodeObjects::Cucumber::CUCUMBER_NAMESPACE)

  # Generates a page for step definitions and step transforms with the 'steptransformers' template
  serialize(YARD::CodeObjects::Cucumber::CUCUMBER_STEPTRANSFORM_NAMESPACE)

  # Generates the tags page with the 'featuretags' template
  serialize(YARD::CodeObjects::Cucumber::CUCUMBER_TAG_NAMESPACE)

  serialize_feature_directories
end

#
# The top-level feature directories. This is affected by the directories that YARD is told to parse.
# All other features in sub-directories are contained under each of these top-level directories.
#
# @example Generating one feature directory
#
#     `yardoc 'example/**/*'`
#
# @example Generating two feature directories
#
#     `yardoc 'example/**/*' 'example2/**/*'`
#
# @return the feature directories at the root of the Cucumber Namespace.
#
def root_feature_directories
  @root_feature_directories ||= YARD::CodeObjects::Cucumber::CUCUMBER_NAMESPACE.children.find_all {|child| child.is_a?(YARD::CodeObjects::Cucumber::FeatureDirectory)}
end

#
# Generate pages for the objects if there are objects of this type contained
# within the Registry.
#
def serialize_object_type(type)
  objects = Registry.all(type.to_sym)
  Array(objects).each {|object| serialize(object) }
end

#
# Generates pages for the feature directories found. Starting with all root-level feature
# directories and then recursively finding all child feature directories.
#
def serialize_feature_directories
  serialize_feature_directories_recursively(root_feature_directories)
  root_feature_directories.each {|directory| serialize(directory) }
end

#
# Generate a page for each Feature Directory. This is called recursively to
# ensure that all feature directories contained as children are rendered to
# pages.
#
def serialize_feature_directories_recursively(namespaces)
  namespaces.each do |namespace|
    Templates::Engine.with_serializer(namespace, options[:serializer]) do
      options[:object] = namespace
      T('layout').run(options)
    end
    serialize_feature_directories_recursively(namespace.children.find_all {|child| child.is_a?(YARD::CodeObjects::Cucumber::FeatureDirectory)})
  end
end

# Generate feature list
# @note this method is called automatically by YARD based on the menus defined in the layout
def generate_feature_list
  features = Registry.all(:feature)
  features_ordered_by_name = features.sort {|x,y| x.value.to_s <=> y.value.to_s }
  generate_full_list features_ordered_by_name, :features
end

# Count scenarios for features
def record_feature_scenarios(features)
  count_with_examples = 0
  features.each do |f|
    count_with_examples += f.total_scenarios
  end
  return count_with_examples
end

# Count scenarios for tags
def record_tagged_scenarios(tags)
  scenario_count = 0
  count_with_examples = 0
  tags.each do |t|
    scenario_count += t.all_scenarios.size
    count_with_examples += t.total_scenarios
  end
end

# Generate tag list
# @note this method is called automatically by YARD based on the menus defined in the layout
def generate_tag_list
  tags = Registry.all(:tag)
  tags_ordered_by_use = Array(tags).sort {|x,y| y.total_scenarios <=> x.total_scenarios }

  record_tagged_scenarios(tags)

  generate_full_list tags_ordered_by_use, :tags
end

# Generate a step definition list
# @note this menu is not automatically added until yard configuration has this menu added
# See the layout template method that loads the menus
def generate_stepdefinition_list
  generate_full_list YARD::Registry.all(:stepdefinition), :stepdefinitions,
    :list_title => "Step Definitions List"
end

# Generate a step list
# @note this menu is not automatically added until yard configuration has this menu added
# See the layout template method that loads the menus
def generate_step_list
  generate_full_list YARD::Registry.all(:step), :steps
end

# Generate feature list
# @note this menu is not automatically added until yard configuration has this menu added
# See the layout template method that loads the menus
def generate_featuredirectories_list
  directories_ordered_by_name = root_feature_directories.sort {|x,y| x.value.to_s <=> y.value.to_s }
  generate_full_list directories_ordered_by_name, :featuredirectories,
    :list_title => "Features by Directory",
    :list_filename => "featuredirectories_list.html"
end

# Helpler method to generate a full_list page of the specified objects with the
# specified type.
def generate_full_list(objects,type,options = {})
  defaults = { :list_title => "#{type.to_s.capitalize} List",
    :css_class => "class",
    :list_filename => "#{type.to_s.gsub(/s$/,'')}_list.html" }

  options = defaults.merge(options)

  @items = objects
  @list_type = type
  @list_title = options[:list_title]
  @list_class = options[:css_class]
  asset options[:list_filename], erb(:full_list)
end

#
# @note This method overrides YARD's default template class_list method.
#
# The existing YARD 'Class List' search field contains all the YARD namespace objects.
# We, however, do not want the Cucumber Namespace YARD Object (which holds the features,
# tags, etc.) as it is a meta-object.
#
# This method removes the namespace from the root node, generates the class list,
# and then adds it back into the root node.
#
def class_list(root = Registry.root, tree = TreeContext.new)
  return super unless root == Registry.root

  cucumber_namespace = YARD::CodeObjects::Cucumber::CUCUMBER_NAMESPACE
  root.instance_eval { children.delete cucumber_namespace }
  out = super(root)
  root.instance_eval { children.push cucumber_namespace }
  out
end

#
# Generate a link to the 'All Features' in the features_list.html
#
# When there are no feature directories or multiple top-level feature directories
# then we want to link to the 'Requirements' page
#
# When there are is just one feature directory then we want to link to that directory
#
def all_features_link
  features = Registry.all(:feature)
  count_with_examples = record_feature_scenarios(features)
  if root_feature_directories.length == 0 || root_feature_directories.length > 1
    linkify YARD::CodeObjects::Cucumber::CUCUMBER_NAMESPACE, "All Features (#{count_with_examples})"
  else
    linkify root_feature_directories.first, "All Features (#{count_with_examples})"
  end
end

#
# This method is used to generate a feature directory. This template may call
# this method as well to generate any child feature directories as well.
#
# @param directory [FeatureDirectory] this is the FeatureDirectory to display
# @param padding [Fixnum] this is the pixel value to ident as we want to keep
#    pushing in the padding to show the parent relationship
# @param row [String] 'odd' or 'even' to correctly color the row
#
def directory_node(directory,padding,row)
  @directory = directory
  @padding = padding
  @row = row
  erb(:directories)
end


text:
class AppCore;

class Settings
{
public:

	Settings(AppCore& core);

	void applySettings(GuiLite::SettingsForm^ form);
	void showSettingsForm();

private:

	AppCore& core;
};


text:
echo off
%load seed.mat
rand('seed',0);
echo on
% This script shows how to use the ga. You should see the demos for
% more information as well. gademo1, gademo2, gademo3
global bounds

% Crossover Operators
xFns = 'arithXover heuristicXover simpleXover';
xOpts = [2 0; 2 3; 2 0];

% Mutation Operators
mFns = 'boundaryMutation multiNonUnifMutation nonUnifMutation unifMutation';
mOpts = [4 0 0;6 10 3;4 10 3;4 0 0];

% Termination Operators
termFns = 'maxGenTerm';
termOps = [10];

% Selection Function
selectFn = 'normGeomSelect';
selectOps = [0.06];

% Evaluation Function takes two options
% prob to use gradient, prob to perform Lamarkian evolution
evalFn = 'gaZBGradEval';
evalOps = [1.00 1.00];

% Bounds on the variables
bounds = [-3 12.1; 4.1 5.8];

% GA Options [epsilon float/binar display]
gaOpts=[1e-6 1 1];

% Generate an intialize population of size 80
startPop = initializega(80,bounds,evalFn,evalOps,[1e-6 1]);
evalOps = [1.00 0.00]; % 1 - Peform learning 0-Do not update

% Lets run the GA using Baldwinian Evolution

[x endPop bestPop trace]=ga(bounds,evalFn,evalOps,startPop,gaOpts,...
    termFns,termOps,selectFn,selectOps,xFns,xOpts,mFns,mOpts);

% x is the best solution found
x
pause

% endPop is the ending population
endPop
pause

% bestPop is the best solution tracked over generations
bestPop
pause

% trace is a trace of the best value and average value of generations
trace
pause

% Plot the best over time
clf
plot(trace(:,1),trace(:,2));
pause

% Add the average to the graph
hold on
plot(trace(:,1),trace(:,3));
pause

% Lets run the GA using Lamarkian Evolution
evalOps = [1.00 1.00];

[x endPop bestPop trace]=ga(bounds,evalFn,evalOps,startPop,gaOpts,...
    termFns,termOps,selectFn,selectOps,xFns,xOpts,mFns,mOpts);

% x is the best solution found
x
pause

% endPop is the ending population
endPop
pause

% bestPop is the best solution tracked over generations
bestPop
pause

% trace is a trace of the best value and average value of generations
trace
pause

% Plot the best over time
clf
plot(trace(:,1),trace(:,2));
pause

% Add the average to the graph
hold on
plot(trace(:,1),trace(:,3));
pause


text:
=[G/AgtForm/00/ID/Entity/0.md]

Signer.=[G/U/Who/geraldine_graber.md]

Signer.Title=Manager

Adr.=[G/U/Place/US/MA/Middlesex/Cambridge/Broadway/1/Geo]

Name.Full=Gerry's Grapes, LLC

Entity.a=a Massachusetts LLC

Adr.Type=business

Contact.Name.Ms=Ms. Graber

Claim.Response.Delay=two business days from the date of the Claim

PageName=U/id/gerrys_grapes_llc


text:
/*
 * Copyright (C) 2004-2011
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package com.sun.xml.internal.rngom.nc;

import javax.xml.namespace.QName;

public final class NsNameClass extends NameClass {

  private final String namespaceUri;

  public NsNameClass(String namespaceUri) {
    this.namespaceUri = namespaceUri;
  }

  public boolean contains(QName name) {
    return this.namespaceUri.equals(name.getNamespaceURI());
  }

  public int containsSpecificity(QName name) {
    return contains(name) ? SPECIFICITY_NS_NAME : SPECIFICITY_NONE;
  }

  @Override
  public int hashCode() {
    return namespaceUri.hashCode();
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == null || !(obj instanceof NsNameClass))
      return false;
    return namespaceUri.equals(((NsNameClass)obj).namespaceUri);
  }

  public <V> V accept(NameClassVisitor<V> visitor) {
    return visitor.visitNsName(namespaceUri);
  }

  public boolean isOpen() {
    return true;
  }
}


text:
    From <input type="date" ng-model="dateRangeHuman.min">

    To <input type="date" ng-model="dateRangeHuman.max">


text:
"""A modeling strategy estimates reach surfaces using Halo instances."""

from typing import Dict
from typing import Type

from wfa_planning_evaluation_framework.models.reach_curve import ReachCurve
from wfa_planning_evaluation_framework.models.reach_surface import ReachSurface
from wfa_planning_evaluation_framework.simulator.halo_simulator import HaloSimulator
from wfa_planning_evaluation_framework.simulator.privacy_tracker import PrivacyBudget
from wfa_planning_evaluation_framework.simulator.system_parameters import (
    SystemParameters,
)
from wfa_planning_evaluation_framework.simulator.privacy_tracker import (
    PrivacyBudget,
)

class ModelingStrategy:
    # TODO: Add args for pricing model when these are introduced.
    def __init__(
        self,
        single_pub_model: Type[ReachCurve],
        single_pub_model_kwargs: Dict,
        multi_pub_model: Type[ReachSurface],
        multi_pub_model_kwargs: Dict,
    ):
        """Initializes a modeling strategy object."""
        self._single_pub_model = single_pub_model
        self._single_pub_model_kwargs = single_pub_model_kwargs
        self._multi_pub_model = multi_pub_model
        self._multi_pub_model_kwargs = multi_pub_model_kwargs

    def fit(
        self, halo: HaloSimulator, params: SystemParameters, budget: PrivacyBudget
    ) -> ReachSurface:
        """Returns the reach surface using this Halo instance.

        Args:
            halo: A Halo object for simulating the behavior of the Halo system.
            params:  Simulation parameters.
            budget:  A PrivacyBudget object specifying how much privacy budget
              is to be consumed for this operation.
        Returns:
            A differentially private ReachSurface model which can be queried
            for reach and frequency estimates for arbitrary spend allocations.
        """
        raise NotImplementedError()


text:
/*
 * ws.js: Top level include for node-http-proxy websocket helpers
 *
 * (C) 2010 Nodejitsu Inc.
 * MIT LICENCE
 *
 */

var assert = require('assert'),
    https = require('https'),
    async = require('async'),
    io = require('socket.io'),
    ws = require('ws'),
    helpers = require('./index'),
    protocols = helpers.protocols,
    http = require('./http');

//
// ### function createServerPair (options, callback)
// #### @options {Object} Options to create target and proxy server.
// ####    @target {Object} Options for the target server.
// ####    @proxy  {Object} Options for the proxy server.
// #### @callback {function} Continuation to respond to when complete.
//
// Creates http target and proxy servers
//
exports.createServerPair = function (options, callback) {
  async.series([
    //
    // 1. Create the target server
    //
    function createTarget(next) {
      exports.createServer(options.target, next);
    },
    //
    // 2. Create the proxy server
    //
    function createTarget(next) {
      http.createProxyServer(options.proxy, next);
    }
  ], callback);
};

//
// ### function createServer (options, callback)
// #### @options {Object} Options for creating the socket.io or ws server.
// ####    @raw   {boolean} Enables ws.Websocket server.
//
// Creates a socket.io or ws server using the specified `options`.
//
exports.createServer = function (options, callback) {
  return options.raw
    ? exports.createWsServer(options, callback)
    : exports.createSocketIoServer(options, callback);
};

//
// ### function createSocketIoServer (options, callback)
// #### @options {Object} Options for creating the socket.io server
// ####    @port   {number} Port to listen on
// ####    @input  {string} Input to expect from the only socket
// ####    @output {string} Output to send the only socket
//
// Creates a socket.io server on the specified `options.port` which
// will expect `options.input` and then send `options.output`.
//
exports.createSocketIoServer = function (options, callback) {
  var server = protocols.target === 'https'
    ? io.listen(options.port, helpers.https, callback)
    : io.listen(options.port, callback);

  server.sockets.on('connection', function (socket) {
    socket.on('incoming', function (data) {
      assert.equal(data, options.input);
      socket.emit('outgoing', options.output);
    });
  });
};

//
// ### function createWsServer (options, callback)
// #### @options {Object} Options for creating the ws.Server instance
// ####    @port   {number} Port to listen on
// ####    @input  {string} Input to expect from the only socket
// ####    @output {string} Output to send the only socket
//
// Creates a ws.Server instance on the specified `options.port` which
// will expect `options.input` and then send `options.output`.
//
exports.createWsServer = function (options, callback) {
  var server,
      wss;

  if (protocols.target === 'https') {
    server = https.createServer(helpers.https, function (req, res) {
      req.writeHead(200);
      req.end();
    }).listen(options.port, callback);

    wss = new ws.Server({ server: server });
  }
  else {
    wss = new ws.Server({ port: options.port }, callback);
  }

  wss.on('connection', function (socket) {
    socket.on('message', function (data) {
      assert.equal(data, options.input);
      socket.send(options.output);
    });
  });
};