text:
from __future__ import absolute_import
from collections import namedtuple
version_info = namedtuple('version_info', ('major', 'minor', 'patch'))

VERSION = version_info(0, 0, 3)

__title__ = 'py_utilities'
__version__ = '{0.major}.{0.minor}.{0.patch}'.format(VERSION)
__author__ = 'Ryan Kanno'
__email__ = 'ryankanno@localkinegrinds.com'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013 Ryan Kanno'

# vim: filetype=python


text:
package chapter2DesignPatternsandPrinciples.chapter2_4UnderstandingDesignPrinciples.chapter4_3DesignPatterns.chapter4_3_3BuilderPattern.Advanced;

public interface QueryBuilder {

	void from(String from);

	void where(String where);

	Query getQuery();

}

redpajama_set_name: RedPajamaGithub


text:
class CommentAuthorizer < ApplicationAuthorizer
  def self.readable_by?(user)
    true
  end

  def self.set_seenable_by?(user)
    true
  end
end


text:
require File.dirname(__FILE__) + '/spec_helper'

describe Connection do
  before do
    @connection = Connection.new(mock('EM', :null_object => true))
    @connection.post_init
    @connection.backend = mock("backend", :ssl? => false)
    @connection.app = proc do |env|
      [200, {}, ['']]
    end
  end

  it "should parse on receive_data" do
    @connection.request.should_receive(:parse).with('GET')
    @connection.receive_data('GET')
  end

  it "should close connection on InvalidRequest error in receive_data" do
    @connection.request.stub!(:parse).and_raise(InvalidRequest)
    @connection.should_receive(:close_connection)
    @connection.receive_data('')
  end

  it "should process when parsing complete" do
    @connection.request.should_receive(:parse).and_return(true)
    @connection.should_receive(:process)
    @connection.receive_data('GET')
  end

  it "should process" do
    @connection.process
  end

  it "should rescue error in process" do
    @connection.app.should_receive(:call).and_raise(StandardError)
    @connection.process
  end

  it "should rescue Timeout error in process" do
    @connection.app.should_receive(:call).and_raise(Timeout::Error.new("timeout error not rescued"))
    @connection.process
  end

  it "should not return HTTP_X_FORWARDED_FOR as remote_address" do
    @connection.request.env['HTTP_X_FORWARDED_FOR'] = '1.2.3.4'
    @connection.stub!(:socket_address).and_return("127.0.0.1")
    @connection.remote_address.should == "127.0.0.1"
  end

  it "should return nil on error retreiving remote_address" do
    @connection.stub!(:get_peername).and_raise(RuntimeError)
    @connection.remote_address.should be_nil
  end

  it "should return nil on nil get_peername" do
    @connection.stub!(:get_peername).and_return(nil)
    @connection.remote_address.should be_nil
  end

  it "should return nil on empty get_peername" do
    @connection.stub!(:get_peername).and_return('')
    @connection.remote_address.should be_nil
  end

  it "should return remote_address" do
    @connection.stub!(:get_peername).and_return(Socket.pack_sockaddr_in(3000, '127.0.0.1'))
    @connection.remote_address.should == '127.0.0.1'
  end

  it "should not be persistent" do
    @connection.should_not be_persistent
  end

  it "should be persistent when response is and allowed" do
    @connection.response.stub!(:persistent?).and_return(true)
    @connection.can_persist!
    @connection.should be_persistent
  end

  it "should not be persistent when response is but not allowed" do
    @connection.response.persistent!
    @connection.should_not be_persistent
  end

  it "should set request env as rack.multithread" do
    EventMachine.should_receive(:defer)

    @connection.threaded = true
    @connection.process

    @connection.request.env["rack.multithread"].should == true
  end

  it "should set as threaded when app.deferred? is true" do
    @connection.app.should_receive(:deferred?).and_return(true)
    @connection.should be_threaded
  end

  it "should not set as threaded when app.deferred? is false" do
    @connection.app.should_receive(:deferred?).and_return(false)
    @connection.should_not be_threaded
  end

  it "should not set as threaded when app do not respond to deferred?" do
    @connection.should_not be_threaded
  end
end


text:
"""
Plot the rats trajectory and a distribution over its locations
"""
import os
import numpy as np
import matplotlib
matplotlib.rcParams.update({'axes.labelsize': 9,
                            'xtick.labelsize' : 9,
                            'ytick.labelsize' : 9,
                            'axes.titlesize' : 11})

import matplotlib.pyplot as plt
from matplotlib.cm import get_cmap

import brewer2mpl
from hips.plotting.layout import *
from hips.distributions.circular_distribution import CircularDistribution

from experiment_helper import load_hipp_data

def make_figure(pos, center, radius, figdir="."):
    """
    Plot the mouses trajectory and a distribution over its locations
    """

    # Plot the locations of this state
    fig = create_figure((4,1.6))

    bmap = brewer2mpl.get_map('Set1', 'qualitative', 3)
    colors = bmap.mpl_colors

    # Plot the rats trajectory
    ax = create_axis_at_location(fig, .1, 0.1, 1.3, 1.3, transparent=True)
    plt.figtext(.05/4., 1.45/1.6, "A")
    remove_plot_labels(ax)

    import matplotlib.patches
    circle = matplotlib.patches.Circle(xy=[0,0],
                                       radius= radius,
                                       linewidth=1,
                                       edgecolor="k",
                                       facecolor="none")
    ax.add_patch(circle)

    # Plot the path in blue
    T = -1
    ax.plot(pos[:T,0]-center[0], pos[:T,1]-center[1], '-k', lw=0.5, color=colors[1])
    ax.set_xlim(-radius, radius)
    ax.set_ylim(-radius, radius)

    ax.set_title('Location Trajectory',
                 fontdict={'size' : 9})

    ax1 = create_axis_at_location(fig, 2., 0.1, 1.3, 1.3, transparent=True, box=False, ticks=False)
    plt.figtext(1.6/4., 1.45/1.6, "B")
    ax1.set_aspect(1)
    cmap = get_cmap('YlOrRd')
    remove_plot_labels(ax1)

    # Plot the empirical location distribution
    cd = CircularDistribution(center/100., radius/100.)
    cd.fit_xy(pos[:,0]/100., pos[:,1]/100.)

    # Update the pdf to be measured in m^{-2}
    A = np.pi*(radius/100.)**2
    cd.pdf *= A

    _, cs = cd.plot(ax=ax1, cmap=cmap, plot_data=False, plot_colorbar=False)

    # Plot a subset of the locations
    inds = np.random.rand(pos.shape[0]) < 0.2
    ax1.scatter(pos[inds,0]/100., pos[inds,1]/100., s=1, marker='.', c='k')

    # Add a colorbar
    ax2 = create_axis_at_location(fig, 3.4, 0.2, 0.1, 1.1)
    cb = fig.colorbar(cs, cax=ax2, ticks=np.arange(0,2.5,step=0.5))

    cb.set_label('$p(\\ell)$ [m${}^{-2}$]',size=9)
    cb.ax.tick_params(labelsize=9)

    ax1.set_title('Empirical Location Distribution',
                 fontdict={'fontsize' : 9})

    plt.savefig(os.path.join(figdir, 'figure4.pdf'))
    plt.savefig(os.path.join(figdir, 'figure4.png'))
    plt.show()

if __name__ == "__main__":
    # Load the data
    dataset = "hipp_2dtrack_a"
    N, S_train, pos_train, S_test, pos_test, center, radius = \
        load_hipp_data(dataname=dataset)

    make_figure(pos_train, center, radius)


text:
layout: default
---

{% include liquid/data %}

{{ page.title }}

      <time class="layout_portfolio__time">{{ page.date | date: "%A, %B %e, %Y" }}</time>

    {{ content }}

  {% if jekyll.environment == 'production' and data.post.disqus.username  and page.comments != false %}

{{ data.post.disqus.title }}

        {% include partials/scripts/disqus_comments.html %}

  {% endif %}


text:
function showFilterSidebar() {
  Sidebar.setView('filter');
}

// Use a "set" filter for a field that is a set of documents uniquely
// identified. For instance `{ labels: ['labelA', 'labelC', 'labelD'] }`.
class SetFilter {
  constructor() {
    this._dep = new Tracker.Dependency();
    this._selectedElements = [];
  }

  isSelected(val) {
    this._dep.depend();
    return this._selectedElements.indexOf(val) > -1;
  }

  add(val) {
    if (this._indexOfVal(val) === -1) {
      this._selectedElements.push(val);
      this._dep.changed();
      showFilterSidebar();
    }
  }

  remove(val) {
    const indexOfVal = this._indexOfVal(val);
    if (this._indexOfVal(val) !== -1) {
      this._selectedElements.splice(indexOfVal, 1);
      this._dep.changed();
    }
  }

  toggle(val) {
    if (this._indexOfVal(val) === -1) {
      this.add(val);
    } else {
      this.remove(val);
    }
  }

  reset() {
    this._selectedElements = [];
    this._dep.changed();
  }

  _indexOfVal(val) {
    return this._selectedElements.indexOf(val);
  }

  _isActive() {
    this._dep.depend();
    return this._selectedElements.length !== 0;
  }

  _getMongoSelector() {
    this._dep.depend();
    return { $in: this._selectedElements };
  }
}

// The global Filter object.
// XXX It would be possible to re-write this object more elegantly, and removing
// the need to provide a list of `_fields`. We also should move methods into the
// object prototype.
Filter = {
  // XXX I would like to rename this field into `labels` to be consistent with
  // the rest of the schema, but we need to set some migrations architecture
  // before changing the schema.
  labelIds: new SetFilter(),
  members: new SetFilter(),
  priceIds: new SetFilter(),

  _fields: ['labelIds', 'members', 'priceIds'],

  // We don't filter cards that have been added after the last filter change. To
  // implement this we keep the id of these cards in this `_exceptions` fields
  // and use a `$or` condition in the mongo selector we return.
  _exceptions: [],
  _exceptionsDep: new Tracker.Dependency(),

  isActive() {
    return _.any(this._fields, (fieldName) => {
      return this[fieldName]._isActive();
    });
  },

  _getMongoSelector() {
    if (!this.isActive())
      return {};

    const filterSelector = {};
    this._fields.forEach((fieldName) => {
      const filter = this[fieldName];
      if (filter._isActive())
        filterSelector[fieldName] = filter._getMongoSelector();
    });

    const exceptionsSelector = {_id: {$in: this._exceptions}};
    this._exceptionsDep.depend();

    return {$or: [filterSelector, exceptionsSelector]};
  },

  mongoSelector(additionalSelector) {
    const filterSelector = this._getMongoSelector();
    if (_.isUndefined(additionalSelector))
      return filterSelector;
    else
      return {$and: [filterSelector, additionalSelector]};
  },

  reset() {
    this._fields.forEach((fieldName) => {
      const filter = this[fieldName];
      filter.reset();
    });
    this.resetExceptions();
  },

  addException(_id) {
    if (this.isActive()) {
      this._exceptions.push(_id);
      this._exceptionsDep.changed();
      Tracker.flush();
    }
  },

  resetExceptions() {
    this._exceptions = [];
    this._exceptionsDep.changed();
  },
};

Blaze.registerHelper('Filter', Filter);


text:
<?php
/**
 * Top Menu Spanish lexicon topic
 *
 * @language es_MX
 * @package modx
 * @subpackage lexicon
 */
$_lang['about'] = 'Acerca de';
$_lang['about_desc'] = 'Más información acerca de MODX Revolution.';
$_lang['access_permissions'] = 'Permisos de Acceso';
$_lang['access_permissions_desc'] = 'Administrar el acceso del grupo de usuarios a recursos y contextos.';
$_lang['api_docs'] = 'Documentación del API';
$_lang['api_docs_desc'] = 'documentación manejada por phpDocumentor del API de Revolution.';
$_lang['components'] = 'Componentes';
$_lang['content_types'] = 'Tipos de Contenido';
$_lang['content_types_desc'] = 'Añadir tipos de contenido para recursos, como .html, .js, etc.';
$_lang['contexts'] = 'Contextos';
$_lang['contexts_desc'] = 'Administrar contextos del sitio y su configuración.';
$_lang['edit_menu'] = 'Acciones';
$_lang['edit_menu_desc'] = 'Administrar Acciones y la estructura del Menú Principal.';
$_lang['eventlog_viewer'] = 'Bitácora de Errores';
$_lang['eventlog_viewer_desc'] = 'Ver el error.log de MODX.';
$_lang['export_site'] = 'Exportar HTML Estático';
$_lang['export_site_desc'] = 'Exportar el sitio actual como páginas estáticas de HTML.';
$_lang['flush_access'] = 'Vaciar Permisos';
$_lang['flush_access_confirm'] = '¿Estás seguro de que quieres vaciar tus permisos de acceso? NOTA: esto no afecta otras sesiones de usuario.';
$_lang['flush_access_desc'] = 'Vaciar todos los permisos y recargar el cache.';
$_lang['flush_sessions'] = 'Vaciar Todas las Sesiones';
$_lang['flush_sessions_confirm'] = '¿Estás seguro de que quieres vaciar todas las sesiones de usuario? Esto destruirá todas las sesiones de usuario actuales y recientes, incluyendo la tuya, forzando a todos a entrar al sistema después de esta acción.';
$_lang['flush_sessions_desc'] = 'Vaciar todas las sesiones y cerrar la sesión de todos los usuarios.';
$_lang['flush_sessions_err'] = 'Ocurrió un error mientras se intentaba vaciar las sesiones de usuario actuales.';
$_lang['flush_sessions_not_supported'] = 'El vaciado de sesiones de usuario no está activado en tu configuración.';
$_lang['form_customization'] = 'Personalización de Formas';
$_lang['form_customization_desc'] = 'Personalizar formas del admin por permisos de seguridad.';
$_lang['forums'] = 'Foros';
$_lang['forums_desc'] = 'Ver los foros oficiales de MODX.';
$_lang['import_resources'] = 'Importar Recursos';
$_lang['import_resources_desc'] = 'Importar un lote de recursos estáticos a este sitio.';
$_lang['import_site'] = 'Importar HTML';
$_lang['import_site_desc'] = 'Importar un lote de archivos HTML a este sitio.';
$_lang['jira'] = 'Bugs';
$_lang['jira_desc'] = 'Ir al bugtracker de MODX para rastrear y archivar bugs.';
$_lang['lexicon_management'] = 'Administración del Léxico';
$_lang['lexicon_management_desc'] = 'Editar cualquiera de los textos de idioma a lo largo del admin de MODX.';
$_lang['logout_desc'] = 'Salir del Admin de MODX.';
$_lang['manage_workspaces'] = 'Administración de Paquetes';
$_lang['manage_workspaces_desc'] = 'Descargar Componentes de Terceros, añadir Proveedores e instalar paquetes.';
$_lang['messages'] = 'Mensajes';
$_lang['messages_desc'] = 'Ve tus mensajes y envía nuevos a usuarios.';
$_lang['namespaces'] = 'Espacios de Nombres';
$_lang['namespaces_desc'] = 'Maneja espacios de nombres que distinguen entre los diferentes componentes añadidos.';
$_lang['new_document'] = 'Documento Nuevo';
$_lang['new_document_desc'] = 'Crear un documento nuevo.';
$_lang['new_resource'] = 'Recurso Nuevo';
$_lang['new_resource_desc'] = 'Crear un recurso nuevo.';
$_lang['new_static_resource'] = 'Recurso Estático Nuevo';
$_lang['new_static_resource_desc'] = 'Crear un recurso estático nuevo basado en un archivo.';
$_lang['new_symlink'] = 'Symlink Nuevo';
$_lang['new_symlink_desc'] = 'Crear un symlink nuevo que apunta a un URL existente sin redireccionar.';
$_lang['new_weblink'] = 'Weblink Nuevo';
$_lang['new_weblink_desc'] = 'Crear un weblink nuevo que apunta a un URL existente y redirecciona.';
$_lang['policy_management'] = 'Políticas de Acceso';
$_lang['policy_management_desc'] = 'Crear y editar políticas para todo el sitio para asegurar procesos.';
$_lang['preview'] = 'Ver';
$_lang['preview_desc'] = 'Carga tu página de inicio en una ventana nueva.';
$_lang['profile'] = 'Perfil';
$_lang['profile_desc'] = 'Actualiza tu perfil personal.';
$_lang['propertysets'] = 'Colecciones de Propiedades';
$_lang['propertysets_desc'] = 'Administra todas las colecciones de propiedades de tu sitio y los elementos a los que están asignados.';
$_lang['refresh_site'] = 'Limpiar Cache';
$_lang['refresh_site_desc'] = 'Limpiar el cache de tu sitio.';
$_lang['remove_locks'] = 'Remover Bloqueos';
$_lang['remove_locks_desc'] = 'Esto removera cualquier bloqueo que haya en cualquier página del admin como resultado de que otros usuarios las hayan editado.';
$_lang['remove_locks_error'] = 'Ocurrió un error mientras se trataba de remover los bloqueos.';
$_lang['reports'] = 'Reportes';
$_lang['resource_groups'] = 'Grupos de Recursos';
$_lang['resource_groups_desc'] = 'Administrar los grupos a los que pertenecen los recursos.';
$_lang['search'] = 'Buscar';
$_lang['search_desc'] = 'Buscar recursos.';
$_lang['security'] = 'Seguridad';
$_lang['site'] = 'Sitio';
$_lang['support'] = 'Soporte';
$_lang['support_desc'] = 'Soporte Futuro';
$_lang['site_schedule'] = 'Calendario del Sitio';
$_lang['site_schedule_desc'] = 'Ver recursos con fechas próximas de publicación o despublicación.';
$_lang['system'] = 'Sistema';
$_lang['system_settings'] = 'Configuración de Sistema';
$_lang['system_settings_desc'] = 'Cambiar o crear configuración de sistema para todo el sitio.';
$_lang['tools'] = 'Herramientas';
$_lang['user'] = 'Usuario';
$_lang['user_management'] = 'Administrar usuarios';
$_lang['user_management_desc'] = 'Añadir, actualizar, y asignar permisos a usuarios.';
$_lang['user_group_management'] = 'Controles de Acceso';
$_lang['user_group_management_desc'] = 'Administrar grupos de usuarios, roles y políticas de acceso.';
$_lang['view_logging'] = 'Acciones del Administrador';
$_lang['view_logging_desc'] = 'Ver la actividad reciente en el administrador.';
$_lang['view_sysinfo'] = 'Información del Sistema';
$_lang['view_sysinfo_desc'] = 'Ver información del servidor, como phpinfo, información de la base de datos MySQL, y más.';
$_lang['wiki'] = 'Wiki';
$_lang['wiki_desc'] = 'Lanza el wiki Confluence de MODX, donde se almacena la documentación de MODX Revolution.';


text:
<?php
/**
 * Created by PhpStorm.
 * User: Stas
 * Date: 17.02.2016
 * Time: 22:31
 */
$picture = 'img/map_marker.png';//TODO path to custom icon
?>

<?= $map->display() ?>


text:
using System;
using System.Collections;
using System.Globalization;

namespace Xceed.Utils.Data
{
  internal sealed class StringDataStore : DataStore
  {
    public StringDataStore( int initialCapacity )
    {
      this.SetCapacity( initialCapacity );
    }

    public override object GetData( int index )
    {
      return m_values[ index ];
    }

    public override void SetData( int index, object data )
    {
      m_values[ index ] = data as string;
    }

    public override int Compare( int xRecordIndex, int yRecordIndex )
    {
      return CultureInfo.CurrentCulture.CompareInfo.Compare(
        m_values[ xRecordIndex ], m_values[ yRecordIndex ], CompareOptions.None );
    }

    public override void SetCapacity( int capacity )
    {
      string[] newValues = new string[ capacity ];

      if( m_values != null )
        Array.Copy( m_values, 0, newValues, 0, System.Math.Min( capacity, m_values.Length ) );

      m_values = newValues;
    }

    private string[] m_values;
  }
}


text:
package com.koch.ambeth.ioc.link;

import java.lang.reflect.Method;

import com.koch.ambeth.ioc.IInitializingBean;
import com.koch.ambeth.ioc.IServiceContext;
import com.koch.ambeth.ioc.config.IBeanConfiguration;
import com.koch.ambeth.log.ILogger;
import com.koch.ambeth.log.LogInstance;
import com.koch.ambeth.util.ParamChecker;
import com.koch.ambeth.util.exception.RuntimeExceptionUtil;

/**
 * Please use LinkContainer instead
 */
@Deprecated
public class LinkContainerOld implements ILinkContainer, IInitializingBean {
	@LogInstance
	private ILogger log;

	protected Object[] arguments;

	protected IBeanConfiguration listenerBean;

	protected Class<?> registryBeanAutowiredType;
	protected String listenerBeanName;
	protected String registryBeanName;
	protected Method addMethod;
	protected Method removeMethod;
	protected IServiceContext beanContext;
	protected Object registry;

	@Override
	public void afterPropertiesSet() throws Throwable {
		ParamChecker.assertTrue(registryBeanAutowiredType != null || registryBeanName != null,
				"either property 'registryBeanAutowiredType' or 'registryBeanName' must be valid");
		ParamChecker.assertTrue(listenerBean != null || listenerBeanName != null,
				"either property 'listenerBean' or 'listenerBeanName' must be valid");
		ParamChecker.assertParamNotNull(addMethod, "addMethod");
		ParamChecker.assertParamNotNull(removeMethod, "removeMethod");
		ParamChecker.assertParamNotNull(arguments, "arguments");
		ParamChecker.assertParamNotNull(beanContext, "beanContext");
	}

	public void setArguments(Object[] arguments) {
		this.arguments = arguments;
	}

	public void setListenerBeanName(String listenerBeanName) {
		this.listenerBeanName = listenerBeanName;
	}

	public void setRegistryBeanName(String registryBeanName) {
		this.registryBeanName = registryBeanName;
	}

	public void setListenerBean(IBeanConfiguration listenerBean) {
		this.listenerBean = listenerBean;
	}

	public void setRegistryBeanAutowiredType(Class<?> registryBeanAutowiredType) {
		this.registryBeanAutowiredType = registryBeanAutowiredType;
	}

	public void setAddMethod(Method addMethod) {
		this.addMethod = addMethod;
	}

	public void setRemoveMethod(Method removeMethod) {
		this.removeMethod = removeMethod;
	}

	public void setBeanContext(IServiceContext beanContext) {
		this.beanContext = beanContext;
	}

	protected Object resolveRegistry() {
		if (registryBeanName != null) {
			Object registry = beanContext.getService(registryBeanName);
			if (registry == null) {
				throw new IllegalStateException(
						"No registry bean with name '" + registryBeanName + "' found to link bean");
			}
			return registry;
		}
		Object registry = beanContext.getService(registryBeanAutowiredType);
		if (registry == null) {
			throw new IllegalStateException("No registry bean with autowired type "
					+ registryBeanAutowiredType.getName() + " found to link bean");
		}
		return registry;
	}

	@Override
	public boolean link() {
		if (registry != null) {
			throw new IllegalStateException();
		}
		registry = resolveRegistry();

		Object listener = null;
		if (listenerBeanName == null) {
			listenerBeanName = listenerBean.getName();
			if (listenerBeanName == null) {
				listener = listenerBean.getInstance();
			}
		}
		if (listenerBeanName != null) {
			listener = beanContext.getService(listenerBeanName);
		}
		ParamChecker.assertParamNotNull(listener, "listener");
		try {
			arguments[0] = listener;
			addMethod.invoke(registry, arguments);
		}
		catch (Throwable e) {
			throw RuntimeExceptionUtil.mask(e, "Attempt failed to register '" + listener + "' to '"
					+ registry + "' with method " + addMethod);
		}
		return true;
	}

	@Override
	public boolean unlink() {
		if (registry == null) {
			// Nothing to do because there was no (successful) call to link() before
			if (log.isDebugEnabled()) {
				log.debug(
						"Unlink has been called without prior linking. If no other exception is visible in the logs then this may be a bug");
			}
			return false;
		}
		Object listener = null;
		try {
			if (listenerBeanName == null) {
				listenerBeanName = listenerBean.getName();
				if (listenerBeanName == null) {
					listener = listenerBean.getInstance();
				}
			}
			if (listenerBeanName != null) {
				listener = beanContext.getService(listenerBeanName);
			}
			ParamChecker.assertParamNotNull(listener, "listener");
			arguments[0] = listener;
			removeMethod.invoke(registry, arguments);
		}
		catch (Throwable e) {
			throw RuntimeExceptionUtil.mask(e, "Attempt failed to unregister '" + listener + "' from '"
					+ registry + "' with method " + removeMethod);
		}
		finally {
			registry = null;
		}
		return true;
	}
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Class org.apache.cassandra.db.compaction.AbstractCompactionTask (apache-cassandra API)</title>
<meta name="date" content="2014-11-05">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.cassandra.db.compaction.AbstractCompactionTask

Packages that use AbstractCompactionTask

Package
Description

org.apache.cassandra.db.compaction

Uses of AbstractCompactionTask in org.apache.cassandra.db.compaction

Subclasses of AbstractCompactionTask in org.apache.cassandra.db.compaction

Modifier and Type
Class and Description

class
CompactionTask

class
LeveledCompactionTask

static class
SSTableSplitter.SplittingCompactionTask

Methods in org.apache.cassandra.db.compaction that return AbstractCompactionTask

Modifier and Type
Method and Description

AbstractCompactionTask
AbstractCompactionStrategy.getCompactionTask(java.util.Collection<SSTableReader> sstables,
                 int gcBefore,
                 long maxSSTableBytes)

AbstractCompactionTask
LeveledCompactionStrategy.getCompactionTask(java.util.Collection<SSTableReader> sstables,
                 int gcBefore,
                 long maxSSTableBytes)

abstract AbstractCompactionTask
AbstractCompactionStrategy.getNextBackgroundTask(int gcBefore)

AbstractCompactionTask
DateTieredCompactionStrategy.getNextBackgroundTask(int gcBefore)

AbstractCompactionTask
LeveledCompactionStrategy.getNextBackgroundTask(int gcBefore)

the only difference between background and maximal in LCS is that maximal is still allowed
 (by explicit user request) even when compaction is disabled.

AbstractCompactionTask
SizeTieredCompactionStrategy.getNextBackgroundTask(int gcBefore)

AbstractCompactionTask
WrappingCompactionStrategy.getNextBackgroundTask(int gcBefore)

abstract AbstractCompactionTask
AbstractCompactionStrategy.getUserDefinedTask(java.util.Collection<SSTableReader> sstables,
                  int gcBefore)

AbstractCompactionTask
DateTieredCompactionStrategy.getUserDefinedTask(java.util.Collection<SSTableReader> sstables,
                  int gcBefore)

AbstractCompactionTask
LeveledCompactionStrategy.getUserDefinedTask(java.util.Collection<SSTableReader> sstables,
                  int gcBefore)

AbstractCompactionTask
SizeTieredCompactionStrategy.getUserDefinedTask(java.util.Collection<SSTableReader> sstables,
                  int gcBefore)

AbstractCompactionTask
WrappingCompactionStrategy.getUserDefinedTask(java.util.Collection<SSTableReader> sstables,
                  int gcBefore)

AbstractCompactionTask
AbstractCompactionTask.setCompactionType(OperationType compactionType)

AbstractCompactionTask
AbstractCompactionTask.setUserDefined(boolean isUserDefined)

Methods in org.apache.cassandra.db.compaction that return types with arguments of type AbstractCompactionTask

Modifier and Type
Method and Description

abstract java.util.Collection<AbstractCompactionTask>
AbstractCompactionStrategy.getMaximalTask(int gcBefore)

java.util.Collection<AbstractCompactionTask>
DateTieredCompactionStrategy.getMaximalTask(int gcBefore)

java.util.Collection<AbstractCompactionTask>
LeveledCompactionStrategy.getMaximalTask(int gcBefore)

java.util.Collection<AbstractCompactionTask>
SizeTieredCompactionStrategy.getMaximalTask(int gcBefore)

java.util.Collection<AbstractCompactionTask>
WrappingCompactionStrategy.getMaximalTask(int gcBefore)

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2014 The Apache Software Foundation


text:
package com.zimbra.qa.selenium.projects.desktop.tests.conversation;

import java.util.*;

import org.testng.annotations.Test;

import com.zimbra.qa.selenium.framework.items.ConversationItem;
import com.zimbra.qa.selenium.framework.ui.*;
import com.zimbra.qa.selenium.framework.util.*;
import com.zimbra.qa.selenium.projects.desktop.core.AjaxCommonTest;

public class DeleteConversation extends AjaxCommonTest {

	@SuppressWarnings("serial")
	public DeleteConversation() {
		logger.info("New "+ DeleteConversation.class.getCanonicalName());

		// All tests start at the login page
		super.startingPage = app.zPageMail;

		// Make sure we are using an account with conversation view
		super.startingAccountPreferences = new HashMap<String , String>() {{
				    put("zimbraPrefGroupMailBy", "conversation");
				    put("zimbraPrefReadingPaneLocation", "bottom");
				}};

	}

	@Test(	description = "Delete a conversation",
			groups = { "smoke" })
	public void DeleteConversation01() throws HarnessException {

		// Create the message data to be sent
		String subject = "subject" + ZimbraSeleniumProperties.getUniqueString();

		ZimbraAccount.AccountA().soapSend(
					"<SendMsgRequest xmlns='urn:zimbraMail'>" +
						"<m>" +
							"<e t='t' a='"+ app.zGetActiveAccount().EmailAddress +"'/>" +
							"<su>"+ subject +"</su>" +
							"<mp ct='text/plain'>" +
								"<content>"+ ZimbraSeleniumProperties.getUniqueString() +"</content>" +
							"</mp>" +
						"</m>" +
					"</SendMsgRequest>");

		// Click Get Mail button
		app.zPageMail.zToolbarPressButton(Button.B_GETMAIL);

		// Select the item
		app.zPageMail.zListItem(Action.A_LEFTCLICK, subject);

		// Click delete
		app.zPageMail.zToolbarPressButton(Button.B_DELETE);

		List<ConversationItem> conversations = app.zPageMail.zListGetConversations();
		ZAssert.assertNotNull(conversations, "Verify the conversation list exists");

		boolean found = false;
		for (ConversationItem c : conversations) {
			logger.info("Subject: looking for "+ subject +" found: "+ c.gSubject);
			if ( subject.equals(c.gSubject) ) {
				found = true;
				break;
			}
		}
		ZAssert.assertFalse(found, "Verify the conversation is no longer in the inbox");

	}

}


text:
<?php

namespace Dataphant\States;

use Dataphant\States\Exceptions\ImmutableException;

/**
 * This state marks a record as locked. Properties can not be changed and the record can not be deleted.
 * Not loaded Attributes can not be loaded afterwards.
 */
class ImmutableState extends PersistedStateBase
{
	public function get($property)
	{
		if( ! $property->isLoadedFor($this->record))
		{
			throw new ImmutableException('Immutable record can not be changed.');
		}

		return $property->getValueFor($this->record);
	}

	public function set($property, $value)
	{
		throw new ImmutableException('Immutable record can not be changed.');
	}

	public function commit()
	{
		return $this;
	}

	public function rollback()
	{
		return $this;
	}

	public function delete()
	{
		throw new ImmutableException('Immutable record can not be deleted.');
	}
}


text:
package com.cmendenhall.tests;

import com.cmendenhall.board.Board;
import com.cmendenhall.board.BoardAnalyzer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import java.util.List;

import static com.cmendenhall.TicTacToeSymbols.*;
import static org.junit.Assert.*;

@RunWith(JUnit4.class)
public class BoardAnalyzerTest extends TicTacToeTest {

    @Test
    public void boardHasHorizontalWin() {
        assertTrue(BoardAnalyzer.hasWin(TicTacToeTestHelper.playerOWins));
    }

    @Test
    public void boardHasVerticalWin() {
        assertTrue(BoardAnalyzer.hasWin(TicTacToeTestHelper.playerXWins));
    }

    @Test
    public void drawBoardDoesNotHaveWin() {
        assertFalse(BoardAnalyzer.hasWin(TicTacToeTestHelper.noWins));
    }

    @Test
    public void boardHasDiagonalWin() {
        assertTrue(BoardAnalyzer.hasWin(TicTacToeTestHelper.diagonal));
    }

    @Test
    public void noWinsOnNewBoard() {
        assertFalse(BoardAnalyzer.hasWin(TicTacToeTestHelper.emptyBoard));
    }

    @Test
    public void emptyBoardIsNotFull() {
        assertFalse(BoardAnalyzer.isFull(TicTacToeTestHelper.emptyBoard));
    }

    @Test
    public void partiallyFullBoardIsNotFull() {
        assertFalse(BoardAnalyzer.isFull(TicTacToeTestHelper.playerONext));
        assertFalse(BoardAnalyzer.isFull(TicTacToeTestHelper.playerXShouldBlock));
    }

    @Test
    public void noWinsIsFull() {
        assertTrue(BoardAnalyzer.isFull(TicTacToeTestHelper.noWins));
    }

    @Test
    public void noWinsHasNoWinner() {
        assertEquals(_, BoardAnalyzer.winnerIs(TicTacToeTestHelper.noWins));
    }

    @Test
    public void playerXWinsWinnerIsX() {
        assertEquals(X, BoardAnalyzer.winnerIs(TicTacToeTestHelper.playerXWins));
    }

    @Test
    public void playerOWinsWinnerIsO() {
        assertEquals(O, BoardAnalyzer.winnerIs(TicTacToeTestHelper.playerOWins));
    }

    @Test
    public void playerXMovesFirst() {
        assertEquals(X, BoardAnalyzer.nextTurn(TicTacToeTestHelper.emptyBoard));
    }

    @Test
    public void playerOMovesNext() {
        assertEquals(O, BoardAnalyzer.nextTurn(TicTacToeTestHelper.playerONext));
    }

    @Test
    public void fullBoardHasNoNextTurn() {
        assertEquals(_, BoardAnalyzer.nextTurn(TicTacToeTestHelper.noWins));
    }

    @Test
    public void emptyBoardSumIsZero() {
        assertEquals(0, BoardAnalyzer.sum(TicTacToeTestHelper.emptyBoard));
    }

    @Test
    public void noWinsBoardSumIsThirteen() {
        assertEquals(13, BoardAnalyzer.sum(TicTacToeTestHelper.noWins));
    }

    @Test
    public void playerXWinsBoardSumIsSeven() {
        assertEquals(7, BoardAnalyzer.sum(TicTacToeTestHelper.playerXWins));
    }

    @Test
    public void emptyBoardIsEmpty() {
        assertTrue(BoardAnalyzer.isEmpty(TicTacToeTestHelper.emptyBoard));
    }

    @Test
    public void turnsPlayedOnEmptyBoardEqualsZero() {
        int played = BoardAnalyzer.turnsPlayed(TicTacToeTestHelper.emptyBoard);
        assertEquals(0, played);
    }

    @Test
    public void turnsPlayedOnBoardWithOneMoveEqualsOne() {
        int played = BoardAnalyzer.turnsPlayed(TicTacToeTestHelper.xInCenter);
        assertEquals(1, played);
    }

    @Test
    public void turnsPlayedOnBoardWithThreeMovesEqualsThree() {
       int played = BoardAnalyzer.turnsPlayed(TicTacToeTestHelper.playerONext);
       assertEquals(3, played);
    }

    @Test
    public void turnsPlayedOnFullBoardEqualsNine() {
       int played = BoardAnalyzer.turnsPlayed(TicTacToeTestHelper.noWins);
       assertEquals(9, played);
    }

    @Test
    public void nextStatesIsEmptyWhenBoardIsFull() {
        List<Board> nextStates = BoardAnalyzer.getNextStates(TicTacToeTestHelper.noWins);
        assertEquals(0, nextStates.size());
    }

    @Test
    public void analyzerDetectsEarlyDraws() {
        assertTrue(BoardAnalyzer.hasDraw(TicTacToeTestHelper.earlyDraw));
    }

    @Test
    public void analyzerDoesNotReturnFalsePositives() {
        assertFalse(BoardAnalyzer.hasDraw(TicTacToeTestHelper.playerXCanWin));
        assertFalse(BoardAnalyzer.hasDraw(TicTacToeTestHelper.playerOCanWin));
    }
}


text:
package org.apache.rave.portal.repository;

import org.apache.rave.model.PageTemplate;
import org.apache.rave.model.PageType;
import org.apache.rave.repository.Repository;

import java.util.List;

/**
 * Provides operations against the backing store for PageTemplate objects
 */
public interface PageTemplateRepository extends Repository<PageTemplate> {

    /**
     * Gets all page templates with the specified page type
     * @param pageType the page type used to filter templates
     * @return a list of all page templates for the type in the repository
     */
    List<PageTemplate> getAll(String pageType);

    /**
     * Gets the default page template for the given type
     * @param pageType teh page type
     * @return a valid page template or null if none exists for the type
     */
    PageTemplate getDefaultPage(String pageType);

}


text:
require "spec_helper"

describe Mongoid::Fields do

  before do
    Product.delete_all
  end

  describe "#\{field}_translations" do

    let(:product) do
      Product.new
    end

    context "when the field is localized" do

      context "when translations exist" do

        before do
          product.description = "test"
          ::I18n.locale = :de
          product.description = "The best"
        end

        after do
          ::I18n.locale = :en
        end

        let(:translations) do
          product.description_translations
        end

        it "returns all the translations" do
          translations.should eq(
            { "en" => "test", "de" => "The best" }
          )
        end
      end

      context "when translations do not exist" do

        context "when no default is provided" do

          it "returns nil" do
            product.description_translations.should be_nil
          end
        end

        context "when a default is provided" do

          it "returns the translations with the default" do
            product.name_translations.should eq(
              { "en" => "no translation" }
            )
          end
        end
      end
    end

    context "when the field is not localized" do

      it "does not respond to the method" do
        product.should_not respond_to(:price_translations)
      end
    end
  end

  describe "#\{field}_translations=" do

    let(:product) do
      Product.new
    end

    context "when the field is localized" do

      let(:translations) do
        { "en" => "test", "de" => "testing" }
      end

      before do
        product.description_translations = translations
      end

      it "sets the raw values of the translations" do
        product.description_translations.should eq(translations)
      end

      context "when saving the new translations" do

        before do
          product.save
        end

        it "persists the changes" do
          product.reload.description_translations.should eq(translations)
        end

        context "when updating the translations" do

          before do
            product.description_translations = { "en" => "overwritten" }
            product.save
          end

          it "persists the changes" do
            product.reload.description_translations.should eq(
              { "en" => "overwritten" }
            )
          end
        end
      end
    end

    context "when the field is not localized" do

      it "does not respond to the method" do
        product.should_not respond_to(:price_translations=)
      end
    end
  end

  describe "#getter" do

    context "when a field is localized" do

      let(:product) do
        Product.new
      end

      context "when no locale is set" do

        before do
          product.description = "The best"
        end

        let(:description) do
          product.description
        end

        it "returns the default locale value" do
          description.should eq("The best")
        end
      end

      context "when a single locale is set" do

        before do
          ::I18n.locale = :de
          product.description = "The best"
        end

        after do
          ::I18n.locale = :en
        end

        let(:description) do
          product.description
        end

        it "returns the set locale value" do
          description.should eq("The best")
        end
      end

      context "when multiple locales are set" do

        before do
          product.description = "Cheap drinks"
          ::I18n.locale = :de
          product.description = "Cheaper drinks"
        end

        after do
          ::I18n.locale = :en
        end

        let(:description) do
          product.description
        end

        it "returns the current locale value" do
          description.should eq("Cheaper drinks")
        end
      end
    end
  end

  describe "#setter=" do

    let(:product) do
      Product.new
    end

    context "when the field is an array" do

      before do
        product.stores = [ "kadewe", "karstadt" ]
        product.save
      end

      context "when setting the value to nil" do

        before do
          product.stores = nil
          product.save
        end

        it "allows the set" do
          product.stores.should be_nil
        end
      end

      context "when setting any of the values to nil" do

        before do
          product.stores = [ "kadewe", nil ]
          product.save
        end

        it "allows the set of nil values" do
          product.stores.should eq([ "kadewe", nil ])
        end

        it "persists the nil values" do
          product.reload.stores.should eq([ "kadewe", nil ])
        end
      end

      context "when reversing the array values" do

        before do
          product.stores = [ "karstadt", "kadewe" ]
          product.save
        end

        it "reverses the values" do
          product.stores.should eq([ "karstadt", "kadewe" ])
        end

        it "persists the changes" do
          product.reload.stores.should eq([ "karstadt", "kadewe" ])
        end
      end
    end

    context "when a field is localized" do

      context "when no locale is set" do

        before do
          product.description = "Cheap drinks"
        end

        let(:description) do
          product.attributes["description"]
        end

        it "sets the value in the default locale" do
          description.should eq({ "en" => "Cheap drinks" })
        end
      end

      context "when a locale is set" do

        before do
          ::I18n.locale = :de
          product.description = "Cheaper drinks"
        end

        after do
          ::I18n.locale = :en
        end

        let(:description) do
          product.attributes["description"]
        end

        it "sets the value in the default locale" do
          description.should eq({ "de" => "Cheaper drinks" })
        end
      end

      context "when having multiple locales" do

        before do
          product.description = "Cheap drinks"
          ::I18n.locale = :de
          product.description = "Cheaper drinks"
        end

        after do
          ::I18n.locale = :en
        end

        let(:description) do
          product.attributes["description"]
        end

        it "sets the value in both locales" do
          description.should eq(
            { "de" => "Cheaper drinks", "en" => "Cheap drinks" }
          )
        end
      end
    end
  end

  context "when a setter accesses a field with a default" do

    let(:person) do
      Person.new(:set_on_map_with_default => "testing")
    end

    it "sets the default value pre process" do
      person.map_with_default.should eq({ "key" => "testing" })
    end
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="CoreNLP-to-HTML.xsl" type="text/xsl"?>
<root>
  <document>
    <sentences>
      <sentence id="1">
        <tokens>
          <token id="1">
            <word>The</word>
            <lemma>the</lemma>
            <CharacterOffsetBegin>0</CharacterOffsetBegin>
            <CharacterOffsetEnd>3</CharacterOffsetEnd>
            <POS>DT</POS>
          </token>
          <token id="2">
            <word>International</word>
            <lemma>International</lemma>
            <CharacterOffsetBegin>4</CharacterOffsetBegin>
            <CharacterOffsetEnd>17</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="3">
            <word>Watch</word>
            <lemma>Watch</lemma>
            <CharacterOffsetBegin>18</CharacterOffsetBegin>
            <CharacterOffsetEnd>23</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="4">
            <word>Company</word>
            <lemma>Company</lemma>
            <CharacterOffsetBegin>24</CharacterOffsetBegin>
            <CharacterOffsetEnd>31</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="5">
            <word>-LRB-</word>
            <lemma>-lrb-</lemma>
            <CharacterOffsetBegin>32</CharacterOffsetBegin>
            <CharacterOffsetEnd>33</CharacterOffsetEnd>
            <POS>-LRB-</POS>
          </token>
          <token id="6">
            <word>IWC</word>
            <lemma>IWC</lemma>
            <CharacterOffsetBegin>33</CharacterOffsetBegin>
            <CharacterOffsetEnd>36</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="7">
            <word>-RRB-</word>
            <lemma>-rrb-</lemma>
            <CharacterOffsetBegin>36</CharacterOffsetBegin>
            <CharacterOffsetEnd>37</CharacterOffsetEnd>
            <POS>-RRB-</POS>
          </token>
          <token id="8">
            <word>is</word>
            <lemma>be</lemma>
            <CharacterOffsetBegin>38</CharacterOffsetBegin>
            <CharacterOffsetEnd>40</CharacterOffsetEnd>
            <POS>VBZ</POS>
          </token>
          <token id="9">
            <word>organizing</word>
            <lemma>organize</lemma>
            <CharacterOffsetBegin>41</CharacterOffsetBegin>
            <CharacterOffsetEnd>51</CharacterOffsetEnd>
            <POS>VBG</POS>
          </token>
          <token id="10">
            <word>an</word>
            <lemma>a</lemma>
            <CharacterOffsetBegin>52</CharacterOffsetBegin>
            <CharacterOffsetEnd>54</CharacterOffsetEnd>
            <POS>DT</POS>
          </token>
          <token id="11">
            <word>on-line</word>
            <lemma>on-line</lemma>
            <CharacterOffsetBegin>55</CharacterOffsetBegin>
            <CharacterOffsetEnd>62</CharacterOffsetEnd>
            <POS>JJ</POS>
          </token>
          <token id="12">
            <word>auction</word>
            <lemma>auction</lemma>
            <CharacterOffsetBegin>63</CharacterOffsetBegin>
            <CharacterOffsetEnd>70</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="13">
            <word>to</word>
            <lemma>to</lemma>
            <CharacterOffsetBegin>71</CharacterOffsetBegin>
            <CharacterOffsetEnd>73</CharacterOffsetEnd>
            <POS>TO</POS>
          </token>
          <token id="14">
            <word>take</word>
            <lemma>take</lemma>
            <CharacterOffsetBegin>74</CharacterOffsetBegin>
            <CharacterOffsetEnd>78</CharacterOffsetEnd>
            <POS>VB</POS>
          </token>
          <token id="15">
            <word>place</word>
            <lemma>place</lemma>
            <CharacterOffsetBegin>79</CharacterOffsetBegin>
            <CharacterOffsetEnd>84</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="16">
            <word>in</word>
            <lemma>in</lemma>
            <CharacterOffsetBegin>85</CharacterOffsetBegin>
            <CharacterOffsetEnd>87</CharacterOffsetEnd>
            <POS>IN</POS>
          </token>
          <token id="17">
            <word>the</word>
            <lemma>the</lemma>
            <CharacterOffsetBegin>88</CharacterOffsetBegin>
            <CharacterOffsetEnd>91</CharacterOffsetEnd>
            <POS>DT</POS>
          </token>
          <token id="18">
            <word>period</word>
            <lemma>period</lemma>
            <CharacterOffsetBegin>92</CharacterOffsetBegin>
            <CharacterOffsetEnd>98</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="19">
            <word>from</word>
            <lemma>from</lemma>
            <CharacterOffsetBegin>99</CharacterOffsetBegin>
            <CharacterOffsetEnd>103</CharacterOffsetEnd>
            <POS>IN</POS>
          </token>
          <token id="20">
            <word>December</word>
            <lemma>December</lemma>
            <CharacterOffsetBegin>104</CharacterOffsetBegin>
            <CharacterOffsetEnd>112</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="21">
            <word>13</word>
            <lemma>13</lemma>
            <CharacterOffsetBegin>113</CharacterOffsetBegin>
            <CharacterOffsetEnd>115</CharacterOffsetEnd>
            <POS>CD</POS>
          </token>
          <token id="22">
            <word>to</word>
            <lemma>to</lemma>
            <CharacterOffsetBegin>116</CharacterOffsetBegin>
            <CharacterOffsetEnd>118</CharacterOffsetEnd>
            <POS>TO</POS>
          </token>
          <token id="23">
            <word>December</word>
            <lemma>December</lemma>
            <CharacterOffsetBegin>119</CharacterOffsetBegin>
            <CharacterOffsetEnd>127</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="24">
            <word>20</word>
            <lemma>20</lemma>
            <CharacterOffsetBegin>128</CharacterOffsetBegin>
            <CharacterOffsetEnd>130</CharacterOffsetEnd>
            <POS>CD</POS>
          </token>
          <token id="25">
            <word>,</word>
            <lemma>,</lemma>
            <CharacterOffsetBegin>130</CharacterOffsetBegin>
            <CharacterOffsetEnd>131</CharacterOffsetEnd>
            <POS>,</POS>
          </token>
          <token id="26">
            <word>2006</word>
            <lemma>2006</lemma>
            <CharacterOffsetBegin>132</CharacterOffsetBegin>
            <CharacterOffsetEnd>136</CharacterOffsetEnd>
            <POS>CD</POS>
          </token>
          <token id="27">
            <word>.</word>
            <lemma>.</lemma>
            <CharacterOffsetBegin>136</CharacterOffsetBegin>
            <CharacterOffsetEnd>137</CharacterOffsetEnd>
            <POS>.</POS>
          </token>
        </tokens>
        <parse>(ROOT (S (NP (NP (DT The) (NNP International) (NNP Watch) (NNP Company)) (PRN (-LRB- -LRB-) (NP (NNP IWC)) (-RRB- -RRB-))) (VP (VBZ is) (VP (VBG organizing) (NP (DT an) (JJ on-line) (NN auction)) (S (VP (TO to) (VP (VB take) (NP (NP (NN place)) (PP (IN in) (NP (DT the) (NN period)))) (PP (IN from) (NP (NNP December) (CD 13))) (PP (TO to) (NP (NNP December) (CD 20) (, ,) (CD 2006)))))))) (. .))) </parse>
        <dependencies type="basic-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="9">organizing</dependent>
          </dep>
          <dep type="det">
            <governor idx="4">Company</governor>
            <dependent idx="1">The</dependent>
          </dep>
          <dep type="nn">
            <governor idx="4">Company</governor>
            <dependent idx="2">International</dependent>
          </dep>
          <dep type="nn">
            <governor idx="4">Company</governor>
            <dependent idx="3">Watch</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="9">organizing</governor>
            <dependent idx="4">Company</dependent>
          </dep>
          <dep type="appos">
            <governor idx="4">Company</governor>
            <dependent idx="6">IWC</dependent>
          </dep>
          <dep type="aux">
            <governor idx="9">organizing</governor>
            <dependent idx="8">is</dependent>
          </dep>
          <dep type="det">
            <governor idx="12">auction</governor>
            <dependent idx="10">an</dependent>
          </dep>
          <dep type="amod">
            <governor idx="12">auction</governor>
            <dependent idx="11">on-line</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="9">organizing</governor>
            <dependent idx="12">auction</dependent>
          </dep>
          <dep type="aux">
            <governor idx="14">take</governor>
            <dependent idx="13">to</dependent>
          </dep>
          <dep type="xcomp">
            <governor idx="9">organizing</governor>
            <dependent idx="14">take</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="14">take</governor>
            <dependent idx="15">place</dependent>
          </dep>
          <dep type="prep">
            <governor idx="15">place</governor>
            <dependent idx="16">in</dependent>
          </dep>
          <dep type="det">
            <governor idx="18">period</governor>
            <dependent idx="17">the</dependent>
          </dep>
          <dep type="pobj">
            <governor idx="16">in</governor>
            <dependent idx="18">period</dependent>
          </dep>
          <dep type="prep">
            <governor idx="14">take</governor>
            <dependent idx="19">from</dependent>
          </dep>
          <dep type="pobj">
            <governor idx="19">from</governor>
            <dependent idx="20">December</dependent>
          </dep>
          <dep type="num">
            <governor idx="20">December</governor>
            <dependent idx="21">13</dependent>
          </dep>
          <dep type="prep">
            <governor idx="14">take</governor>
            <dependent idx="22">to</dependent>
          </dep>
          <dep type="pobj">
            <governor idx="22">to</governor>
            <dependent idx="23">December</dependent>
          </dep>
          <dep type="num">
            <governor idx="23">December</governor>
            <dependent idx="24">20</dependent>
          </dep>
          <dep type="num">
            <governor idx="23">December</governor>
            <dependent idx="26">2006</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="9">organizing</dependent>
          </dep>
          <dep type="det">
            <governor idx="4">Company</governor>
            <dependent idx="1">The</dependent>
          </dep>
          <dep type="nn">
            <governor idx="4">Company</governor>
            <dependent idx="2">International</dependent>
          </dep>
          <dep type="nn">
            <governor idx="4">Company</governor>
            <dependent idx="3">Watch</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="9">organizing</governor>
            <dependent idx="4">Company</dependent>
          </dep>
          <dep type="appos">
            <governor idx="4">Company</governor>
            <dependent idx="6">IWC</dependent>
          </dep>
          <dep type="aux">
            <governor idx="9">organizing</governor>
            <dependent idx="8">is</dependent>
          </dep>
          <dep type="det">
            <governor idx="12">auction</governor>
            <dependent idx="10">an</dependent>
          </dep>
          <dep type="amod">
            <governor idx="12">auction</governor>
            <dependent idx="11">on-line</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="9">organizing</governor>
            <dependent idx="12">auction</dependent>
          </dep>
          <dep type="aux">
            <governor idx="14">take</governor>
            <dependent idx="13">to</dependent>
          </dep>
          <dep type="xcomp">
            <governor idx="9">organizing</governor>
            <dependent idx="14">take</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="14">take</governor>
            <dependent idx="15">place</dependent>
          </dep>
          <dep type="det">
            <governor idx="18">period</governor>
            <dependent idx="17">the</dependent>
          </dep>
          <dep type="prep_in">
            <governor idx="15">place</governor>
            <dependent idx="18">period</dependent>
          </dep>
          <dep type="prep_from">
            <governor idx="14">take</governor>
            <dependent idx="20">December</dependent>
          </dep>
          <dep type="num">
            <governor idx="20">December</governor>
            <dependent idx="21">13</dependent>
          </dep>
          <dep type="prep_to">
            <governor idx="14">take</governor>
            <dependent idx="23">December</dependent>
          </dep>
          <dep type="num">
            <governor idx="23">December</governor>
            <dependent idx="24">20</dependent>
          </dep>
          <dep type="num">
            <governor idx="23">December</governor>
            <dependent idx="26">2006</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-ccprocessed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="9">organizing</dependent>
          </dep>
          <dep type="det">
            <governor idx="4">Company</governor>
            <dependent idx="1">The</dependent>
          </dep>
          <dep type="nn">
            <governor idx="4">Company</governor>
            <dependent idx="2">International</dependent>
          </dep>
          <dep type="nn">
            <governor idx="4">Company</governor>
            <dependent idx="3">Watch</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="9">organizing</governor>
            <dependent idx="4">Company</dependent>
          </dep>
          <dep type="appos">
            <governor idx="4">Company</governor>
            <dependent idx="6">IWC</dependent>
          </dep>
          <dep type="aux">
            <governor idx="9">organizing</governor>
            <dependent idx="8">is</dependent>
          </dep>
          <dep type="det">
            <governor idx="12">auction</governor>
            <dependent idx="10">an</dependent>
          </dep>
          <dep type="amod">
            <governor idx="12">auction</governor>
            <dependent idx="11">on-line</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="9">organizing</governor>
            <dependent idx="12">auction</dependent>
          </dep>
          <dep type="aux">
            <governor idx="14">take</governor>
            <dependent idx="13">to</dependent>
          </dep>
          <dep type="xcomp">
            <governor idx="9">organizing</governor>
            <dependent idx="14">take</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="14">take</governor>
            <dependent idx="15">place</dependent>
          </dep>
          <dep type="det">
            <governor idx="18">period</governor>
            <dependent idx="17">the</dependent>
          </dep>
          <dep type="prep_in">
            <governor idx="15">place</governor>
            <dependent idx="18">period</dependent>
          </dep>
          <dep type="prep_from">
            <governor idx="14">take</governor>
            <dependent idx="20">December</dependent>
          </dep>
          <dep type="num">
            <governor idx="20">December</governor>
            <dependent idx="21">13</dependent>
          </dep>
          <dep type="prep_to">
            <governor idx="14">take</governor>
            <dependent idx="23">December</dependent>
          </dep>
          <dep type="num">
            <governor idx="23">December</governor>
            <dependent idx="24">20</dependent>
          </dep>
          <dep type="num">
            <governor idx="23">December</governor>
            <dependent idx="26">2006</dependent>
          </dep>
        </dependencies>
      </sentence>
      <sentence id="2">
        <tokens>
          <token id="1">
            <word>Australian</word>
            <lemma>australian</lemma>
            <CharacterOffsetBegin>138</CharacterOffsetBegin>
            <CharacterOffsetEnd>148</CharacterOffsetEnd>
            <POS>JJ</POS>
          </token>
          <token id="2">
            <word>Immigration</word>
            <lemma>Immigration</lemma>
            <CharacterOffsetBegin>149</CharacterOffsetBegin>
            <CharacterOffsetEnd>160</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="3">
            <word>Minister</word>
            <lemma>Minister</lemma>
            <CharacterOffsetBegin>161</CharacterOffsetBegin>
            <CharacterOffsetEnd>169</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="4">
            <word>Scott</word>
            <lemma>Scott</lemma>
            <CharacterOffsetBegin>170</CharacterOffsetBegin>
            <CharacterOffsetEnd>175</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="5">
            <word>Morrison</word>
            <lemma>Morrison</lemma>
            <CharacterOffsetBegin>176</CharacterOffsetBegin>
            <CharacterOffsetEnd>184</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
        </tokens>
        <parse>(ROOT (FRAG (NP (JJ Australian) (NNP Immigration) (NNP Minister) (NNP Scott) (NNP Morrison)))) </parse>
        <dependencies type="basic-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="5">Morrison</dependent>
          </dep>
          <dep type="amod">
            <governor idx="5">Morrison</governor>
            <dependent idx="1">Australian</dependent>
          </dep>
          <dep type="nn">
            <governor idx="5">Morrison</governor>
            <dependent idx="2">Immigration</dependent>
          </dep>
          <dep type="nn">
            <governor idx="5">Morrison</governor>
            <dependent idx="3">Minister</dependent>
          </dep>
          <dep type="nn">
            <governor idx="5">Morrison</governor>
            <dependent idx="4">Scott</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="5">Morrison</dependent>
          </dep>
          <dep type="amod">
            <governor idx="5">Morrison</governor>
            <dependent idx="1">Australian</dependent>
          </dep>
          <dep type="nn">
            <governor idx="5">Morrison</governor>
            <dependent idx="2">Immigration</dependent>
          </dep>
          <dep type="nn">
            <governor idx="5">Morrison</governor>
            <dependent idx="3">Minister</dependent>
          </dep>
          <dep type="nn">
            <governor idx="5">Morrison</governor>
            <dependent idx="4">Scott</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-ccprocessed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="5">Morrison</dependent>
          </dep>
          <dep type="amod">
            <governor idx="5">Morrison</governor>
            <dependent idx="1">Australian</dependent>
          </dep>
          <dep type="nn">
            <governor idx="5">Morrison</governor>
            <dependent idx="2">Immigration</dependent>
          </dep>
          <dep type="nn">
            <governor idx="5">Morrison</governor>
            <dependent idx="3">Minister</dependent>
          </dep>
          <dep type="nn">
            <governor idx="5">Morrison</governor>
            <dependent idx="4">Scott</dependent>
          </dep>
        </dependencies>
      </sentence>
    </sentences>
  </document>
</root>


text:
with open("tale_of.txt", 'r') as file:
    l = file.read().lower().split()  # list of all of our words

new_l = []
for word in l:
    # str.isalpha is function form of the method .isalpha()
    # check word 'word' for non letters
    new_l.append("".join(list(filter(str.isalpha, word))))

# put all words into dictionary
d = {}
# d = {word: int}
for word in l:
    if word in d:
        d[word] += 1
    else:
        d[word] = 1

# find the 10 most common words

# get the values
v = list(d.values())
# sort the values
v.sort()
# get the 10th value
tenth_val = v[-10]
# filter dictionary for words w/ higher value than tenth_val
words = list(filter(lambda x: d[x] >= tenth_val, d))
# print out the words to the user
print(words)


text:
namespace Umbraco.Core.Persistence.DatabaseModelDefinitions
{
    public enum ConstraintType
    {
        PrimaryKey,
        Unique,
        NonUnique
    }
}


text:
<?php

namespace Jobqueue;

use Pheanstalk_Pheanstalk as Pheanstalk;

class Connector_Beanstalkd implements Connector_Driver
{
	private static $DEFAULT_CONFIG;

	public static function _init()
	{
		static::$DEFAULT_CONFIG = array(
			'host'    => '127.0.0.1',
			'port'    => '11300',
			'queue'   => 'default',
			'timeout' => null,
		);
	}

	/**
	 * Establish a queue connection.
	 *
	 * @param  array  $config
	 * @return \Jobqueue\Queue_Driver
	 */
	public function connect(array $config)
	{
		$config = array_merge(static::$DEFAULT_CONFIG, $config);
		$pheanstalk = new Pheanstalk($config['host'], $config['port'], $config['timeout']);

		return new Queue_Beanstalkd($pheanstalk, $config['queue']);
	}
}


text:
package org.apache.ambari.server.events.publishers;

import org.apache.ambari.server.events.TaskEvent;

import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
import com.google.inject.Singleton;

/**
 * The {@link TaskEventPublisher} is used to publish instances of
 * {@link TaskEvent} to any {@link com.google.common.eventbus.Subscribe} interested.
 * It uses a single-threaded, serial {@link EventBus}.
 */
@Singleton
public class TaskEventPublisher {

  /**
   * A single threaded, synchronous event bus for processing task events.
   */
  private final EventBus m_eventBus = new EventBus("ambari-task-report-event-bus");

  /**
   * Publishes the specified event to all registered listeners that
   * {@link Subscribe} to  {@link TaskEvent} instances.
   *
   * @param event {@link TaskEvent}
   */
  public void publish(TaskEvent event) {
    m_eventBus.post(event);
  }

  /**
   * Register a listener to receive events. The listener should use the
   * {@link Subscribe} annotation.
   *
   * @param object
   *          the listener to receive events.
   */
  public void register(Object object) {
    m_eventBus.register(object);
  }

}


text:
package com.smart.smartchart.widget.hellocharts.gesture;

public enum ZoomType {

    HORIZONTAL, VERTICAL, HORIZONTAL_AND_VERTICAL;
}


text:
module Moria
  LAYOUT_ATTRIBUTES = {
    :left => NSLayoutAttributeLeft,
    :top => NSLayoutAttributeTop,
    :right => NSLayoutAttributeRight,
    :bottom => NSLayoutAttributeBottom,
    :leading => NSLayoutAttributeLeading,
    :trailing => NSLayoutAttributeTrailing,
    :width => NSLayoutAttributeWidth,
    :height => NSLayoutAttributeHeight,
    :centerX => NSLayoutAttributeCenterX,
    :centerY => NSLayoutAttributeCenterY,
    :baseline => NSLayoutAttributeBaseline
  }
end


text:
<?php
namespace Concrete\DocumentationGenerator\Generator;

class GeneratorList implements \Iterator
{

    protected $generators = array();
    protected $index = 0;

    public function addGenerator(GeneratorInterface $generator)
    {
        $this->generators[] = $generator;
    }

    public function getGenerators()
    {
        return $this->generators;
    }

    /**
     * (PHP 5 >= 5.0.0)

     * Return the current element
     * @link http://php.net/manual/en/iterator.current.php
     * @return GeneratorInterface Can return any type.
     */
    public function current()
    {
        return array_get($this->getGenerators(), $this->index);
    }

    /**
     * (PHP 5 >= 5.0.0)

     * Move forward to next element
     * @link http://php.net/manual/en/iterator.next.php
     * @return void Any returned value is ignored.
     */
    public function next()
    {
        $this->index++;
    }

    /**
     * (PHP 5 >= 5.0.0)

     * Return the key of the current element
     * @link http://php.net/manual/en/iterator.key.php
     * @return mixed scalar on success, or null on failure.
     */
    public function key()
    {
        return $this->index;
    }

    /**
     * (PHP 5 >= 5.0.0)

     * Checks if current position is valid
     * @link http://php.net/manual/en/iterator.valid.php
     * @return boolean The return value will be casted to boolean and then evaluated.
     * Returns true on success or false on failure.
     */
    public function valid()
    {
        return $this->index < count($this->generators);
    }

    /**
     * (PHP 5 >= 5.0.0)

     * Rewind the Iterator to the first element
     * @link http://php.net/manual/en/iterator.rewind.php
     * @return void Any returned value is ignored.
     */
    public function rewind()
    {
        $this->index = 0;
    }

}


text:
/**
 * This file is automatically created by Recurly's OpenAPI generation process
 * and thus any edits you make by hand will be lost. If you wish to make a
 * change to this file, please create a Github issue explaining the changes you
 * need and we will usher them to the appropriate places.
 */
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Newtonsoft.Json;

namespace Recurly.Resources
{
    [ExcludeFromCodeCoverage]
    public class SubscriptionPurchase : Request
    {

        /// <value>Add-ons</value>
        [JsonProperty("add_ons")]
        public List<SubscriptionAddOnCreate> AddOns { get; set; }

        /// <value>Whether the subscription renews at the end of its term.</value>
        [JsonProperty("auto_renew")]
        public bool? AutoRenew { get; set; }

        /// <value>The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.</value>
        [JsonProperty("custom_fields")]
        public List<CustomField> CustomFields { get; set; }

        /// <value>If present, this sets the date the subscription's next billing period will start (`current_period_ends_at`). This can be used to align the subscription's billing to a specific day of the month. The initial invoice will be prorated for the period between the subscription's activation date and the billing period end date. Subsequent periods will be based off the plan interval. For a subscription with a trial period, this will change when the trial expires.</value>
        [JsonProperty("next_bill_date")]
        public DateTime? NextBillDate { get; set; }

        /// <value>Plan code</value>
        [JsonProperty("plan_code")]
        public string PlanCode { get; set; }

        /// <value>Plan ID</value>
        [JsonProperty("plan_id")]
        public string PlanId { get; set; }

        /// <value>Optionally override the default quantity of 1.</value>
        [JsonProperty("quantity")]
        public int? Quantity { get; set; }

        /// <value>If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.</value>
        [JsonProperty("renewal_billing_cycles")]
        public int? RenewalBillingCycles { get; set; }

        /// <value>Revenue schedule type</value>
        [JsonProperty("revenue_schedule_type")]
        [JsonConverter(typeof(RecurlyStringEnumConverter))]
        public Constants.RevenueScheduleType? RevenueScheduleType { get; set; }

        /// <value>Create a shipping address on the account and assign it to the subscription.</value>
        [JsonProperty("shipping")]
        public SubscriptionShippingPurchase Shipping { get; set; }

        /// <value>If set, the subscription will begin in the future on this date. The subscription will apply the setup fee and trial period, unless the plan has no trial.</value>
        [JsonProperty("starts_at")]
        public DateTime? StartsAt { get; set; }

        /// <value>The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if `auto_renew=true` the subscription will renew and a new term will begin, otherwise the subscription will expire.</value>
        [JsonProperty("total_billing_cycles")]
        public int? TotalBillingCycles { get; set; }

        /// <value>If set, overrides the default trial behavior for the subscription. The date must be in the future.</value>
        [JsonProperty("trial_ends_at")]
        public DateTime? TrialEndsAt { get; set; }

        /// <value>Override the unit amount of the subscription plan by setting this value. If not provided, the subscription will inherit the price from the subscription plan for the provided currency.</value>
        [JsonProperty("unit_amount")]
        public decimal? UnitAmount { get; set; }

    }
}


text:
// +build !windows

// Package app does all of the work necessary to configure and run a
// Kubernetes app process.
package app

import (
	"errors"
	"fmt"
	"net"

	"k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/types"
	utilnet "k8s.io/apimachinery/pkg/util/net"
	utilruntime "k8s.io/apimachinery/pkg/util/runtime"
	utilfeature "k8s.io/apiserver/pkg/util/feature"
	"k8s.io/client-go/tools/record"
	"k8s.io/kubernetes/pkg/apis/componentconfig"
	"k8s.io/kubernetes/pkg/features"
	"k8s.io/kubernetes/pkg/proxy"
	proxyconfig "k8s.io/kubernetes/pkg/proxy/config"
	"k8s.io/kubernetes/pkg/proxy/healthcheck"
	"k8s.io/kubernetes/pkg/proxy/iptables"
	"k8s.io/kubernetes/pkg/proxy/ipvs"
	"k8s.io/kubernetes/pkg/proxy/userspace"
	"k8s.io/kubernetes/pkg/util/configz"
	utildbus "k8s.io/kubernetes/pkg/util/dbus"
	utiliptables "k8s.io/kubernetes/pkg/util/iptables"
	utilipvs "k8s.io/kubernetes/pkg/util/ipvs"
	utilnode "k8s.io/kubernetes/pkg/util/node"
	utilsysctl "k8s.io/kubernetes/pkg/util/sysctl"
	"k8s.io/utils/exec"

	"github.com/golang/glog"
)

// NewProxyServer returns a new ProxyServer.
func NewProxyServer(config *componentconfig.KubeProxyConfiguration, cleanupAndExit bool, scheme *runtime.Scheme, master string) (*ProxyServer, error) {
	if config == nil {
		return nil, errors.New("config is required")
	}

	if c, err := configz.New("componentconfig"); err == nil {
		c.Set(config)
	} else {
		return nil, fmt.Errorf("unable to register configz: %s", err)
	}

	protocol := utiliptables.ProtocolIpv4
	if net.ParseIP(config.BindAddress).To4() == nil {
		protocol = utiliptables.ProtocolIpv6
	}

	var iptInterface utiliptables.Interface
	var ipvsInterface utilipvs.Interface
	var dbus utildbus.Interface

	// Create a iptables utils.
	execer := exec.New()

	dbus = utildbus.New()
	iptInterface = utiliptables.New(execer, dbus, protocol)
	ipvsInterface = utilipvs.New(execer)

	// We omit creation of pretty much everything if we run in cleanup mode
	if cleanupAndExit {
		return &ProxyServer{
			execer:         execer,
			IptInterface:   iptInterface,
			IpvsInterface:  ipvsInterface,
			CleanupAndExit: cleanupAndExit,
		}, nil
	}

	client, eventClient, err := createClients(config.ClientConnection, master)
	if err != nil {
		return nil, err
	}

	// Create event recorder
	hostname := utilnode.GetHostname(config.HostnameOverride)
	eventBroadcaster := record.NewBroadcaster()
	recorder := eventBroadcaster.NewRecorder(scheme, v1.EventSource{Component: "kube-proxy", Host: hostname})

	nodeRef := &v1.ObjectReference{
		Kind:      "Node",
		Name:      hostname,
		UID:       types.UID(hostname),
		Namespace: "",
	}

	var healthzServer *healthcheck.HealthzServer
	var healthzUpdater healthcheck.HealthzUpdater
	if len(config.HealthzBindAddress) > 0 {
		healthzServer = healthcheck.NewDefaultHealthzServer(config.HealthzBindAddress, 2*config.IPTables.SyncPeriod.Duration, recorder, nodeRef)
		healthzUpdater = healthzServer
	}

	var proxier proxy.ProxyProvider
	var serviceEventHandler proxyconfig.ServiceHandler
	var endpointsEventHandler proxyconfig.EndpointsHandler

	proxyMode := getProxyMode(string(config.Mode), iptInterface, iptables.LinuxKernelCompatTester{})
	if proxyMode == proxyModeIPTables {
		glog.V(0).Info("Using iptables Proxier.")
		var nodeIP net.IP
		if config.BindAddress != "0.0.0.0" {
			nodeIP = net.ParseIP(config.BindAddress)
		} else {
			nodeIP = getNodeIP(client, hostname)
		}
		if config.IPTables.MasqueradeBit == nil {
			// MasqueradeBit must be specified or defaulted.
			return nil, fmt.Errorf("unable to read IPTables MasqueradeBit from config")
		}

		// TODO this has side effects that should only happen when Run() is invoked.
		proxierIPTables, err := iptables.NewProxier(
			iptInterface,
			utilsysctl.New(),
			execer,
			config.IPTables.SyncPeriod.Duration,
			config.IPTables.MinSyncPeriod.Duration,
			config.IPTables.MasqueradeAll,
			int(*config.IPTables.MasqueradeBit),
			config.ClusterCIDR,
			hostname,
			nodeIP,
			recorder,
			healthzUpdater,
		)
		if err != nil {
			return nil, fmt.Errorf("unable to create proxier: %v", err)
		}
		iptables.RegisterMetrics()
		proxier = proxierIPTables
		serviceEventHandler = proxierIPTables
		endpointsEventHandler = proxierIPTables
		// No turning back. Remove artifacts that might still exist from the userspace Proxier.
		glog.V(0).Info("Tearing down inactive rules.")
		// TODO this has side effects that should only happen when Run() is invoked.
		userspace.CleanupLeftovers(iptInterface)
		// IPVS Proxier will generate some iptables rules,
		// need to clean them before switching to other proxy mode.
		ipvs.CleanupLeftovers(execer, ipvsInterface, iptInterface)
	} else if proxyMode == proxyModeIPVS {
		glog.V(0).Info("Using ipvs Proxier.")
		proxierIPVS, err := ipvs.NewProxier(
			iptInterface,
			ipvsInterface,
			utilsysctl.New(),
			execer,
			config.IPVS.SyncPeriod.Duration,
			config.IPVS.MinSyncPeriod.Duration,
			config.IPTables.MasqueradeAll,
			int(*config.IPTables.MasqueradeBit),
			config.ClusterCIDR,
			hostname,
			getNodeIP(client, hostname),
			recorder,
			healthzServer,
			config.IPVS.Scheduler,
		)
		if err != nil {
			return nil, fmt.Errorf("unable to create proxier: %v", err)
		}
		proxier = proxierIPVS
		serviceEventHandler = proxierIPVS
		endpointsEventHandler = proxierIPVS
		glog.V(0).Info("Tearing down inactive rules.")
		// TODO this has side effects that should only happen when Run() is invoked.
		userspace.CleanupLeftovers(iptInterface)
		iptables.CleanupLeftovers(iptInterface)
	} else {
		glog.V(0).Info("Using userspace Proxier.")
		// This is a proxy.LoadBalancer which NewProxier needs but has methods we don't need for
		// our config.EndpointsConfigHandler.
		loadBalancer := userspace.NewLoadBalancerRR()
		// set EndpointsConfigHandler to our loadBalancer
		endpointsEventHandler = loadBalancer

		// TODO this has side effects that should only happen when Run() is invoked.
		proxierUserspace, err := userspace.NewProxier(
			loadBalancer,
			net.ParseIP(config.BindAddress),
			iptInterface,
			execer,
			*utilnet.ParsePortRangeOrDie(config.PortRange),
			config.IPTables.SyncPeriod.Duration,
			config.IPTables.MinSyncPeriod.Duration,
			config.UDPIdleTimeout.Duration,
		)
		if err != nil {
			return nil, fmt.Errorf("unable to create proxier: %v", err)
		}
		serviceEventHandler = proxierUserspace
		proxier = proxierUserspace

		// Remove artifacts from the iptables and ipvs Proxier, if not on Windows.
		glog.V(0).Info("Tearing down inactive rules.")
		// TODO this has side effects that should only happen when Run() is invoked.
		iptables.CleanupLeftovers(iptInterface)
		// IPVS Proxier will generate some iptables rules,
		// need to clean them before switching to other proxy mode.
		ipvs.CleanupLeftovers(execer, ipvsInterface, iptInterface)
	}

	iptInterface.AddReloadFunc(proxier.Sync)

	return &ProxyServer{
		Client:                 client,
		EventClient:            eventClient,
		IptInterface:           iptInterface,
		IpvsInterface:          ipvsInterface,
		execer:                 execer,
		Proxier:                proxier,
		Broadcaster:            eventBroadcaster,
		Recorder:               recorder,
		ConntrackConfiguration: config.Conntrack,
		Conntracker:            &realConntracker{},
		ProxyMode:              proxyMode,
		NodeRef:                nodeRef,
		MetricsBindAddress:     config.MetricsBindAddress,
		EnableProfiling:        config.EnableProfiling,
		OOMScoreAdj:            config.OOMScoreAdj,
		ResourceContainer:      config.ResourceContainer,
		ConfigSyncPeriod:       config.ConfigSyncPeriod.Duration,
		ServiceEventHandler:    serviceEventHandler,
		EndpointsEventHandler:  endpointsEventHandler,
		HealthzServer:          healthzServer,
	}, nil
}

func getProxyMode(proxyMode string, iptver iptables.IPTablesVersioner, kcompat iptables.KernelCompatTester) string {
	if proxyMode == proxyModeUserspace {
		return proxyModeUserspace
	}

	if len(proxyMode) > 0 && proxyMode == proxyModeIPTables {
		return tryIPTablesProxy(iptver, kcompat)
	}

	if utilfeature.DefaultFeatureGate.Enabled(features.SupportIPVSProxyMode) {
		if proxyMode == proxyModeIPVS {
			return tryIPVSProxy(iptver, kcompat)
		} else {
			glog.Warningf("Can't use ipvs proxier, trying iptables proxier")
			return tryIPTablesProxy(iptver, kcompat)
		}
	}
	glog.Warningf("Flag proxy-mode=%q unknown, assuming iptables proxy", proxyMode)
	return tryIPTablesProxy(iptver, kcompat)
}

func tryIPVSProxy(iptver iptables.IPTablesVersioner, kcompat iptables.KernelCompatTester) string {
	// guaranteed false on error, error only necessary for debugging
	// IPVS Proxier relies on iptables
	useIPVSProxy, err := ipvs.CanUseIPVSProxier()
	if err != nil {
		utilruntime.HandleError(fmt.Errorf("can't determine whether to use ipvs proxy, using userspace proxier: %v", err))
		return proxyModeUserspace
	}
	if useIPVSProxy {
		return proxyModeIPVS
	}

	// TODO: Check ipvs version

	// Try to fallback to iptables before falling back to userspace
	glog.V(1).Infof("Can't use ipvs proxier, trying iptables proxier")
	return tryIPTablesProxy(iptver, kcompat)
}

func tryIPTablesProxy(iptver iptables.IPTablesVersioner, kcompat iptables.KernelCompatTester) string {
	// guaranteed false on error, error only necessary for debugging
	useIPTablesProxy, err := iptables.CanUseIPTablesProxier(iptver, kcompat)
	if err != nil {
		utilruntime.HandleError(fmt.Errorf("can't determine whether to use iptables proxy, using userspace proxier: %v", err))
		return proxyModeUserspace
	}
	if useIPTablesProxy {
		return proxyModeIPTables
	}
	// Fallback.
	glog.V(1).Infof("Can't use iptables proxy, using userspace proxier")
	return proxyModeUserspace
}


text:
package com.tuyang.test.testArrayList;

import com.tuyang.beanutils.annotation.CopyProperty;

import java.util.List;

import com.tuyang.beanutils.annotation.BeanCopySource;
import com.tuyang.beanutils.annotation.CopyCollection;

@BeanCopySource(source=FromBean.class)
public class ToBean {

	private boolean beanBool;
	private int beanInt;
	private String beanString;

	@CopyCollection(targetClass=Integer.class)
	private List<Integer> beanIntArray;
	@CopyCollection(targetClass=Long.class)
	private List<Long> beanLongArray;
	@CopyProperty
	private Float[] beanFloatArray;
	@CopyProperty
	private double[] beanDoubleArray;

	@CopyCollection(property="bean2s", targetClass=ToBean2.class)
	private List<ToBean2> toBeans;

	@CopyProperty(property="bean2sList")
	private ToBean2[] bean2sList;

	public boolean isBeanBool() {
		return beanBool;
	}

	public void setBeanBool(boolean beanBool) {
		this.beanBool = beanBool;
	}

	public int getBeanInt() {
		return beanInt;
	}

	public void setBeanInt(int beanInt) {
		this.beanInt = beanInt;
	}

	public String getBeanString() {
		return beanString;
	}

	public void setBeanString(String beanString) {
		this.beanString = beanString;
	}

	public List<Integer> getBeanIntArray() {
		return beanIntArray;
	}

	public void setBeanIntArray(List<Integer> beanIntArray) {
		this.beanIntArray = beanIntArray;
	}

	public List<Long> getBeanLongArray() {
		return beanLongArray;
	}

	public void setBeanLongArray(List<Long> beanLongArray) {
		this.beanLongArray = beanLongArray;
	}

	public Float[] getBeanFloatArray() {
		return beanFloatArray;
	}

	public void setBeanFloatArray(Float[] beanFloatArray) {
		this.beanFloatArray = beanFloatArray;
	}

	public double[] getBeanDoubleArray() {
		return beanDoubleArray;
	}

	public void setBeanDoubleArray(double[] beanDoubleArray) {
		this.beanDoubleArray = beanDoubleArray;
	}

	public List<ToBean2> getToBeans() {
		return toBeans;
	}

	public void setToBeans(List<ToBean2> toBeans) {
		this.toBeans = toBeans;
	}

	public ToBean2[] getBean2sList() {
		return bean2sList;
	}

	public void setBean2sList(ToBean2[] bean2sList) {
		this.bean2sList = bean2sList;
	}
}


text:
import * as React from "react";
import { CarbonIconProps } from "../../";
declare const PendingFilled32: React.ForwardRefExoticComponent<
  CarbonIconProps & React.RefAttributes<SVGSVGElement>
>;
export default PendingFilled32;


text:
require "spec_helper"

describe "Refinery::ApplicationController" do
  describe "DummyController", :type => :controller do
    controller do
      include ::Refinery::ApplicationController
    end

    describe ".home_page?" do
      it "matches root url" do
        controller.stub(:root_path).and_return("/")
        request.stub(:path).and_return("/")
        controller.home_page?.should be_true
      end

      it "matches localised root url" do
        controller.refinery.stub(:root_path).and_return("/en/")
        request.stub(:path).and_return("/en")
        controller.home_page?.should be_true
      end

      it "escapes regexp" do
        request.stub(:path).and_return("\/huh)")
        expect { controller.home_page? }.to_not raise_error(RegexpError)
      end
    end
  end
end


text:
package com.google.cloud.dataflow.sdk.util;

import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.extensions.java6.auth.oauth2.AbstractPromptReceiver;
import com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow;
import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets;
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
import com.google.api.client.googleapis.auth.oauth2.GoogleOAuthConstants;
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.client.util.Preconditions;
import com.google.api.client.util.store.FileDataStoreFactory;
import com.google.cloud.dataflow.sdk.options.GcpOptions;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

/**
 * Provides support for loading credentials.
 */
public class Credentials {

  private static final Logger LOG = LoggerFactory.getLogger(Credentials.class);

  /**
   * OAuth 2.0 scopes used by a local worker (not on GCE).
   * The scope cloud-platform provides access to all Cloud Platform resources.
   * cloud-platform isn't sufficient yet for talking to datastore so we request
   * those resources separately.
   *
   *
Note that trusted scope relationships don't apply to OAuth tokens, so for
   * services we access directly (GCS) as opposed to through the backend
   * (BigQuery, GCE), we need to explicitly request that scope.
   */
  private static final List<String> SCOPES = Arrays.asList(
      "https://www.googleapis.com/auth/cloud-platform",
      "https://www.googleapis.com/auth/devstorage.full_control",
      "https://www.googleapis.com/auth/userinfo.email",
      "https://www.googleapis.com/auth/datastore");

  private static class PromptReceiver extends AbstractPromptReceiver {
    @Override
    public String getRedirectUri() {
      return GoogleOAuthConstants.OOB_REDIRECT_URI;
    }
  }

  /**
   * Initializes OAuth2 credentials.
   *
   *
This can use 3 different mechanisms for obtaining a credential:
   *

   *

   *     It can fetch the
   *
   *     application default credentials.
   *

   *

   *     The user can specify a client secrets file and go through the OAuth2
   *     webflow. The credential will then be cached in the user's home
   *     directory for reuse. Provide the property "secrets_file" to use this
   *     mechanism.
   *

   *

   *     The user can specify a file containing a service account.
   *     Provide the properties "service_account_keyfile" and
   *     "service_account_name" to use this mechanism.
   *

   *

   * The default mechanism is to use the
   *
   * application default credentials. The other options can be used by providing the
   * corresponding properties.
   */
  public static Credential getCredential(GcpOptions options)
      throws IOException, GeneralSecurityException {
    String keyFile = options.getServiceAccountKeyfile();
    String accountName = options.getServiceAccountName();

    if (keyFile != null && accountName != null) {
      try {
        return getCredentialFromFile(keyFile, accountName, SCOPES);
      } catch (GeneralSecurityException e) {
        throw new IOException("Unable to obtain credentials from file", e);
      }
    }

    if (options.getSecretsFile() != null) {
      return getCredentialFromClientSecrets(options, SCOPES);
    }

    try {
      return GoogleCredential.getApplicationDefault().createScoped(SCOPES);
    } catch (IOException e) {
      throw new RuntimeException("Unable to get application default credentials. Please see "
          + "https://developers.google.com/accounts/docs/application-default-credentials "
          + "for details on how to specify credentials. This version of the SDK is "
          + "dependent on the gcloud core component version 2015.02.05 or newer to "
          + "be able to get credentials from the currently authorized user via gcloud auth.", e);
    }
  }

  /**
   * Loads OAuth2 credential from a local file.
   */
  private static Credential getCredentialFromFile(
      String keyFile, String accountId, Collection<String> scopes)
      throws IOException, GeneralSecurityException {
    GoogleCredential credential = new GoogleCredential.Builder()
        .setTransport(Transport.getTransport())
        .setJsonFactory(Transport.getJsonFactory())
        .setServiceAccountId(accountId)
        .setServiceAccountScopes(scopes)
        .setServiceAccountPrivateKeyFromP12File(new File(keyFile))
        .build();

    LOG.info("Created credential from file {}", keyFile);
    return credential;
  }

  /**
   * Loads OAuth2 credential from client secrets, which may require an
   * interactive authorization prompt.
   */
  private static Credential getCredentialFromClientSecrets(
      GcpOptions options, Collection<String> scopes)
      throws IOException, GeneralSecurityException {
    String clientSecretsFile = options.getSecretsFile();

    Preconditions.checkArgument(clientSecretsFile != null);
    HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();

    JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();
    GoogleClientSecrets clientSecrets;

    try {
      clientSecrets = GoogleClientSecrets.load(jsonFactory,
          new FileReader(clientSecretsFile));
    } catch (IOException e) {
      throw new RuntimeException(
          "Could not read the client secrets from file: " + clientSecretsFile,
          e);
    }

    FileDataStoreFactory dataStoreFactory =
        new FileDataStoreFactory(new java.io.File(options.getCredentialDir()));

    GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
        httpTransport, jsonFactory, clientSecrets, scopes)
        .setDataStoreFactory(dataStoreFactory)
        .build();

    // The credentialId identifies the credential if we're using a persistent
    // credential store.
    Credential credential =
        new AuthorizationCodeInstalledApp(flow, new PromptReceiver())
            .authorize(options.getCredentialId());

    LOG.info("Got credential from client secret");
    return credential;
  }
}


text:
select
c.room.area as area,
c.room,
CASE
  WHEN (count(o.id) + count(co.room)) = 0 THEN  'N'
  else 'Y'
end as hasObs

from study.ActiveHousing c

left join study.obs o ON (o.Id.curLocation.room = c.room and cast(o.date as date) = cast(now() as date))
left join ehr.cage_observations co ON (co.room = c.room and cast(co.date as date) = cast(now() as date))

group by c.room.area, c.room


text:
class Block {
public:
    inline void setType(mineflayer_ItemType type) {
        Q_ASSERT((uint)type <= 0xff);
        data.type = type;
    }
    inline mineflayer_ItemType type() const { return (mineflayer_ItemType)data.type; }

    // [0, 15] - how much light from non-skylight
    inline void setLight(int light) {
        Q_ASSERT((uint)light <= 0xf);
        data.light = light;
    }
    inline int light() const { return data.light; }

    // [0, 15] - how much light would be on the block from the sun if it was day
    inline void setSkyLight(int sky_light) {
        Q_ASSERT((uint)sky_light <= 0xf);
        data.sky_light = sky_light;
    }
    inline int skyLight() const { return data.sky_light; }

    inline void setMetadata(int metadata) {
        Q_ASSERT((uint)metadata <= 0xf);
        data.metadata = metadata;
    }

    // specific metadata getters
    inline Item::WoodMetadata woodMetadata() const {
        Q_ASSERT(type() == mineflayer_WoodItem);
        return (Item::WoodMetadata) data.metadata;
    }
    inline Item::LeavesMetadata leavesMetadata() const {
        Q_ASSERT(type() == mineflayer_LeavesItem);
        return (Item::LeavesMetadata) data.metadata;
    }
    inline Item::CoalMetadata coalMetadata() const {
        Q_ASSERT(type() == mineflayer_CoalItem);
        return (Item::CoalMetadata) data.metadata;
    }

    // 0x0 is a freshly planted sapling. The data value is
    // incremented at random intervals. When it becomes 15, a new tree is created in its place.
    inline int saplingMetadata() const {
        Q_ASSERT(type() == mineflayer_SaplingItem);
        return data.metadata;
    }

    // 0x0 is a freshly planted cactus. The data value is
    // incremented at random intervals. When it becomes 15, a new cactus block
    // is created on top as long as the total height does not exceed 3.
    inline int cactusMetadata() const {
        Q_ASSERT(type() == mineflayer_CactusItem);
        return data.metadata;
    }

    // 0x0 is a full block. Goes up to 0x7, If bit 0x8 is set,
    // this liquid is "falling" and only spreads downward.
    inline int waterMetadata() const {
        Q_ASSERT(type() == mineflayer_WaterItem);
        return data.metadata;
    }

    // 0x0 is a full block. Can only go up to 0x3. If bit 0x8 is set,
    // this liquid is "falling" and only spreads downward.
    inline int lavaMetadata() const {
        Q_ASSERT(type() == mineflayer_LavaItem);
        return data.metadata;
    }

    // 0x0 is dry land, 0x1-0x8 are increasing levels of
    // wetness. The wetness value depends on how far the block is away
    // from water.
    inline int farmlandMetadata() const {
        Q_ASSERT(type() == mineflayer_FarmlandItem);
        return data.metadata;
    }

    // Crops Metadata: Crops grow from 0x0 to 0x7.
    inline int cropsMetadata() const {
        Q_ASSERT(type() == mineflayer_CropsItem);
        return data.metadata;
    }
    inline Item::WoolMetadata woolMetadata() const {
        Q_ASSERT(type() == mineflayer_WoolItem);
        return (Item::WoolMetadata) data.metadata;
    }

    inline Item::DyeMetadata dyeMetadata() const {
        Q_ASSERT(type() == mineflayer_InkSacItem);
        return (Item::DyeMetadata) data.metadata;
    }

    inline Item::TorchMetadata torchMetadata() const {
        Q_ASSERT(type() == mineflayer_TorchItem);
        return (Item::TorchMetadata) data.metadata;
    }

    inline int redstoneMetadata() const {
        Q_ASSERT(type() == mineflayer_RedstoneWire_placedItem);
        return data.metadata;
    }

    inline Item::MinecartTrackMetadata minecartTrackMetadata() const {
        Q_ASSERT(type() == mineflayer_MinecartTracksItem);
        return (Item::MinecartTrackMetadata) data.metadata;
    }

    inline Item::LadderMetadata ladderMetadata() const {
        Q_ASSERT(type() == mineflayer_LadderItem);
        return (Item::LadderMetadata) data.metadata;
    }

    inline Item::StairsMetadata stairsMetadata() const {
        Q_ASSERT(type() == mineflayer_WoodenStairsItem || type() == mineflayer_CobblestoneStairsItem);
        return (Item::StairsMetadata) data.metadata;
    }

    inline bool leverState() const {
        Q_ASSERT(type() == mineflayer_LeverItem);
        return (data.metadata & 0x8) != 0;
    }
    inline Item::LeverPosition leverPosition() const {
        Q_ASSERT(type() == mineflayer_LeverItem);
        return (Item::LeverPosition)(data.metadata & 0x7);
    }
    inline bool isTopDoorHalf() const {
        Q_ASSERT(type() == mineflayer_WoodenDoor_placedItem || type() == mineflayer_IronDoor_placedItem);
        return (data.metadata & 0x8) != 0;
    }
    inline bool isDoorOpen() const {
        Q_ASSERT(type() == mineflayer_WoodenDoor_placedItem || type() == mineflayer_IronDoor_placedItem);
        return (data.metadata & 0x4) != 0;
    }
    inline Item::DoorHingeLocation doorHingeLocation() const {
        Q_ASSERT(type() == mineflayer_WoodenDoor_placedItem || type() == mineflayer_IronDoor_placedItem);
        return (Item::DoorHingeLocation)(data.metadata & 0x3);
    }
    inline bool isButtonPressed() const {
        Q_ASSERT(type() == mineflayer_StoneButtonItem);
        return (data.metadata & 0x8) != 0;
    }
    inline Item::ButtonDirection buttonDirection() const {
        Q_ASSERT(type() == mineflayer_StoneButtonItem);
        return (Item::ButtonDirection)(data.metadata & 0x7);
    }
    inline float signPostYaw() const {
        Q_ASSERT(type() == mineflayer_SignPost_placedItem);
        return (8 - data.metadata) * 3.1415926536f / 8.0f;
    }
    inline bool isPressurePlatePressed() const {
        Q_ASSERT(type() == mineflayer_StonePressurePlateItem || type() == mineflayer_WoodenPressurePlateItem);
        return (data.metadata & 0x1) != 0;
    }

    inline Item::WallSignMetadata wallSignMetadata() const {
        Q_ASSERT(type() == mineflayer_WallSign_placedItem);
        return (Item::WallSignMetadata) data.metadata;
    }
    inline Item::FurnaceMetadata furnaceMetadata() const {
        Q_ASSERT(type() == mineflayer_FurnaceItem || type() == mineflayer_BurningFurnaceItem || type() == mineflayer_DispenserItem);
        return (Item::FurnaceMetadata) data.metadata;
    }
    inline Item::PumpkinMetadata pumpkinMetadata() const {
        Q_ASSERT(type() == mineflayer_PumpkinItem || type() == mineflayer_JackOLanternItem);
        return (Item::PumpkinMetadata) data.metadata;
    }

    Block() {}
    Block(mineflayer_ItemType type, int metadata, int light, int sky_light) {
        data.type = type;
        data.metadata = metadata;
        data.light = light;
        data.sky_light = sky_light;
    }

    // There are usually > 13 million Blocks in memory, so keep it compact.
    mineflayer_Block data;
};

#endif // BLOCK_H


text:
/*
 * sigpending.c
 */

#include <signal.h>
#include <sys/syscall.h>
#include <klibc/sysconfig.h>

#if _KLIBC_USE_RT_SIG

__extern int __rt_sigpending(sigset_t *, size_t);

int sigpending(sigset_t * set)
{
	return __rt_sigpending(set, sizeof(sigset_t));
}

#endif