text:
using NUnit.Framework;
using org.apache.juddi.v3.client;
using org.apache.juddi.v3.client.config;
using org.apache.juddi.v3.client.transport;
using org.uddi.apiv3;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace juddi_client.net_mono_test
{

    [TestFixture]
    public class SerializationTests
    {

        #region basic serialization tests
        [Test]
        public void xr_subscriptionResultsList()
        {
            Console.Out.WriteLine("serialization xr_subscriptionResultsList");
            subscriptionResultsList r = new subscriptionResultsList();
            XmlSerializer xr = new XmlSerializer(typeof(subscriptionResultsList));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_subscriptionFilter()
        {
            Console.Out.WriteLine("serialization xr_subscriptionFilter");
            subscriptionFilter r = new subscriptionFilter();
            XmlSerializer xr = new XmlSerializer(typeof(subscriptionFilter));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_categoryBag()
        {

            Console.Out.WriteLine("serialization categorybag");
            categoryBag r = new categoryBag();
            XmlSerializer xr = new XmlSerializer(typeof(categoryBag));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_find_relatedBusinesses()
        {
            Console.Out.WriteLine("serialization xr_find_relatedBusinesses");
            find_relatedBusinesses r = new find_relatedBusinesses();
            XmlSerializer xr = new XmlSerializer(typeof(find_relatedBusinesses));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_keysOwned()
        {
            Console.Out.WriteLine("serialization keysOwned");
            keysOwned r = new keysOwned();
            XmlSerializer xr = new XmlSerializer(typeof(keysOwned));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_bindingTemplate()
        {

            Console.Out.WriteLine("serialization bindingTemplate");
            bindingTemplate r = new bindingTemplate();
            XmlSerializer xr = new XmlSerializer(typeof(bindingTemplate));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_instanceDetails()
        {
            Console.Out.WriteLine("serialization instanceDetails");
            instanceDetails r = new instanceDetails();
            XmlSerializer xr = new XmlSerializer(typeof(instanceDetails));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_TransformType()
        {
            Console.Out.WriteLine("serialization TransformType");
            TransformType r = new TransformType();
            XmlSerializer xr = new XmlSerializer(typeof(TransformType));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_KeyInfoType()
        {
            Console.Out.WriteLine("serialization KeyInfoType");
            KeyInfoType r = new KeyInfoType();
            XmlSerializer xr = new XmlSerializer(typeof(KeyInfoType));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_KeyValueType()
        {
            Console.Out.WriteLine("serialization xr_KeyValueType");
            KeyValueType r = new KeyValueType();
            XmlSerializer xr = new XmlSerializer(typeof(KeyValueType));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_PGPDataType()
        {
            Console.Out.WriteLine("serialization xr_PGPDataType");
            PGPDataType r = new PGPDataType();
            XmlSerializer xr = new XmlSerializer(typeof(PGPDataType));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_X509DataType()
        {
            Console.Out.WriteLine("serialization xr_X509DataType");
            X509DataType r = new X509DataType();
            XmlSerializer xr = new XmlSerializer(typeof(X509DataType));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_keyBag1()
        {
            Console.Out.WriteLine("serialization xr_keyBag1");
            keyBag1 r = new keyBag1();
            XmlSerializer xr = new XmlSerializer(typeof(keyBag1));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_SignaturePropertyType()
        {
            Console.Out.WriteLine("serialization xr_SignaturePropertyType");
            SignaturePropertyType r = new SignaturePropertyType();
            XmlSerializer xr = new XmlSerializer(typeof(SignaturePropertyType));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_validate_values()
        {
            Console.Out.WriteLine("serialization xr_validate_values");
            validate_values r = new validate_values();
            XmlSerializer xr = new XmlSerializer(typeof(validate_values));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }
        [Test]
        public void xr_discard_transferToken()
        {
            Console.Out.WriteLine("serialization xr_discard_transferToken");
            discard_transferToken r = new discard_transferToken();
            XmlSerializer xr = new XmlSerializer(typeof(discard_transferToken));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_get_changeRecords()
        {
            Console.Out.WriteLine("serialization xr_get_changeRecords");
            get_changeRecords r = new get_changeRecords();
            XmlSerializer xr = new XmlSerializer(typeof(get_changeRecords));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_changeRecordNewData()
        {
            Console.Out.WriteLine("serialization xr_changeRecordNewData");
            changeRecordNewData r = new changeRecordNewData();
            XmlSerializer xr = new XmlSerializer(typeof(changeRecordNewData));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }

        [Test]
        public void xr_overviewDoc()
        {
            Console.Out.WriteLine("serialization xr_overviewDoc");
            overviewDoc r = new overviewDoc();
            description d = new description("v", "en");
            overviewURL ol = new overviewURL("http://url", "website");

            r.overviewURLs = new overviewURL[] { ol };
            r.descriptions = new description[] { d };
            XmlSerializer xr = new XmlSerializer(typeof(overviewDoc));
            StringWriter sw = new StringWriter();
            xr.Serialize(sw, r);
            System.Console.Out.WriteLine(sw.ToString());
        }
        #endregion

        #region calls using web services

        [Test]
        public void xr_subscriptionResultsListws()
        {
            Console.Out.WriteLine("serialization xr_subscriptionResultsListws");
            subscriptionResultsList r = new subscriptionResultsList();
            UDDIClient clerkManager = null;
            Transport transport = null;
            UDDIClerk clerk = null;
            try
            {
                clerkManager = new UDDIClient("uddi.xml");
                transport = clerkManager.getTransport("default");
                org.uddi.apiv3.UDDI_Security_SoapBinding security = transport.getUDDISecurityService();
                org.uddi.apiv3.UDDI_Inquiry_SoapBinding inquiry = transport.getUDDIInquiryService();
                org.uddi.apiv3.UDDI_Publication_SoapBinding publish = transport.getUDDIPublishService();
                org.uddi.apiv3.UDDI_CustodyTransfer_SoapBinding custody = transport.getUDDICustodyTransferService();
                org.uddi.apiv3.UDDI_Subscription_SoapBinding sub = transport.getUDDISubscriptionService();
                clerk = clerkManager.getClerk("default");

            }
            catch (Exception ex)
            {
                while (ex != null)
                {
                    System.Console.WriteLine("Error! " + ex.Message);
                    ex = ex.InnerException;
                }
            }
            finally
            {
                if (transport != null && transport is IDisposable)
                {
                    ((IDisposable)transport).Dispose();
                }
                if (clerk != null)
                    clerk.Dispose();
            }
        }

        [Test]
        public void xr_subscriptionFilterws()
        {
            Console.Out.WriteLine("serialization xr_subscriptionFilterws");
            Console.Out.WriteLine("xr_subscriptionFilterws");
            subscriptionFilter r = new subscriptionFilter();
            UDDIClient clerkManager = null;
            Transport transport = null;
            UDDIClerk clerk = null;
            try
            {
                clerkManager = new UDDIClient("uddi.xml");
                transport = clerkManager.getTransport("default");
                org.uddi.apiv3.UDDI_Security_SoapBinding security = transport.getUDDISecurityService();
                org.uddi.apiv3.UDDI_Inquiry_SoapBinding inquiry = transport.getUDDIInquiryService();
                org.uddi.apiv3.UDDI_Publication_SoapBinding publish = transport.getUDDIPublishService();
                org.uddi.apiv3.UDDI_CustodyTransfer_SoapBinding custody = transport.getUDDICustodyTransferService();
                org.uddi.apiv3.UDDI_Subscription_SoapBinding sub = transport.getUDDISubscriptionService();
                clerk = clerkManager.getClerk("default");

                save_subscription ss = new save_subscription();
                ss.subscription = new subscription[] { new subscription() };
                ss.subscription[0].subscriptionFilter = r;
                sub.save_subscription(ss);
            }
            catch (Exception ex)
            {
                String s = "";
                while (ex != null)
                {
                    s = s + ex.Message;
                    ex = ex.InnerException;
                }
                if (ContainsSerializationError(s))
                    Assert.Fail(s);

            }
            finally
            {
                if (transport != null && transport is IDisposable)
                {
                    ((IDisposable)transport).Dispose();
                }
                if (clerk != null)
                    clerk.Dispose();
            }
        }

        private bool ContainsSerializationError(string s)
        {

            if (s.Contains("There was an error reflecting type"))
                return true;
            return false;
        }

    }

        #endregion

}


text:
package cn.nextop.thorin.rcp.support.swt.widget.xcalendar.event.reactor.impl.action;

import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.XCalendar;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.XCalendarModel;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config.XCalendarConfig;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;

/**
 *
 * @author Jingqi Xu
 */
public class XCalendarResizeAction extends AbstractXCalendarAction {
	//
	private final Composite parent;
	private final Rectangle bounds;

	/**
	 *
	 */
	public XCalendarResizeAction(Composite parent, Rectangle bounds) {
		super(Type.RESIZE);
		this.parent = parent; this.bounds = bounds;
	}

	/**
	 *
	 */
	@Override
	public void apply(final XCalendar calendar) {
		final XCalendarModel model = calendar.getModel();
		final XCalendarConfig config = model.getConfig();
		config.getLayout().layout(calendar, parent, bounds); calendar.redraw();
	}
}

redpajama_set_name: RedPajamaGithub


text:
/* ========================================================
 * Orientation.java
 *
 * Author:      kmchugh
 * Created:     Feb 17, 2011, 1:01:27 PM
 *
 * Description
 * --------------------------------------------------------
 * General Class Description.
 *
 * Change Log
 * --------------------------------------------------------
 * Init.Date        Ref.            Description
 * --------------------------------------------------------
 *
 * ===================================================== */

package Goliath.Graphics.Constants;

/**
 * Class Description.
 * For example:
 * <pre>
 *      Example usage
 * </pre>
 *
 * @see         Related Class
 * @version     1.0 Feb 17, 2011
 * @author      kmchugh
**/
public class Orientation extends Goliath.DynamicEnum
{
    /**
     * Creates a new instance of a StringFormatType Object
     *
     * @param tcValue The value for the string format type
     * @throws Goliath.Exceptions.InvalidParameterException
     */
    protected Orientation(String tcValue)
    {
        super(tcValue);
    }

    private static Orientation g_oHorizontal;
    public static Orientation HORIZONTAL()
    {
        if (g_oHorizontal == null)
        {
            g_oHorizontal = createEnumeration(Orientation.class, "HORIZONTAL");
        }
        return g_oHorizontal;
    }

    private static Orientation g_oVertical;
    public static Orientation VERTICAL()
    {
        if (g_oVertical == null)
        {
            g_oVertical = createEnumeration(Orientation.class, "VERTICAL");
        }
        return g_oVertical;
    }
}


text:
<?php /* Smarty version 2.6.18, created on 2012-01-02 13:19:41
         compiled from modules_header.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'template_hook', 'modules_header.tpl', 8, false),array('function', 'ft_include', 'modules_header.tpl', 73, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="<?php echo $this->_tpl_vars['LANG']['special_text_direction']; ?>
">

  <?php if (! $this->_tpl_vars['swatch']): ?><?php $this->assign('swatch', 'green'); ?><?php endif; ?>
  <title><?php echo $this->_tpl_vars['head_title']; ?>
</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <link rel="shortcut icon" href="<?php echo $this->_tpl_vars['theme_url']; ?>
/images/favicon.ico">
  <?php echo smarty_function_template_hook(array('location' => 'modules_head_top'), $this);?>

  <link type="text/css" rel="stylesheet" href="<?php echo $this->_tpl_vars['g_root_url']; ?>
/global/css/main.css?v=20110802">
  <link type="text/css" rel="stylesheet" href="<?php echo $this->_tpl_vars['theme_url']; ?>
/css/styles.css?v=20110802">
  <link type="text/css" rel="stylesheet" href="<?php echo $this->_tpl_vars['theme_url']; ?>
/css/swatch_<?php echo $this->_tpl_vars['swatch']; ?>
.css">
  <link href="<?php echo $this->_tpl_vars['theme_url']; ?>
/css/smoothness/jquery-ui-1.8.6.custom.css" rel="stylesheet" type="text/css"/>

  <?php echo $this->_tpl_vars['head_string']; ?>

  <?php echo $this->_tpl_vars['head_js']; ?>

  <?php echo $this->_tpl_vars['head_css']; ?>

  <?php echo smarty_function_template_hook(array('location' => 'modules_head_bottom'), $this);?>

        <img src="<?php echo $this->_tpl_vars['theme_url']; ?>
/images/account_section_left_<?php echo $this->_tpl_vars['swatch']; ?>
.jpg" border="0" />

          <?php if ($this->_tpl_vars['SESSION']['account']['is_logged_in']): ?>
            <?php if ($this->_tpl_vars['settings']['release_type'] == 'alpha'): ?>
              <?php echo $this->_tpl_vars['settings']['program_version']; ?>
-alpha-<?php echo $this->_tpl_vars['settings']['release_date']; ?>

            <?php elseif ($this->_tpl_vars['settings']['release_type'] == 'beta'): ?>
              <?php echo $this->_tpl_vars['settings']['program_version']; ?>
-beta-<?php echo $this->_tpl_vars['settings']['release_date']; ?>

            <?php else: ?>
              <?php echo $this->_tpl_vars['settings']['program_version']; ?>

            <?php endif; ?>
            <?php if ($this->_tpl_vars['SESSION']['account']['account_type'] == 'admin'): ?>
              |
              <?php echo $this->_tpl_vars['LANG']['word_update']; ?>

            <?php endif; ?>
          <?php endif; ?>

        <img src="<?php echo $this->_tpl_vars['theme_url']; ?>
/images/account_section_right_<?php echo $this->_tpl_vars['swatch']; ?>
.jpg" border="0" />

      <a href="<?php echo $this->_tpl_vars['settings']['logo_link']; ?>
"><img src="<?php echo $this->_tpl_vars['theme_url']; ?>
/images/logo_<?php echo $this->_tpl_vars['swatch']; ?>
.jpg" border="0" width="220" height="61" />

<?php echo $this->_tpl_vars['LANG']['phrase_module_nav']; ?>

            <?php echo smarty_function_ft_include(array('file' => "module_menu.tpl"), $this);?>

            <?php echo $this->_tpl_vars['LANG']['phrase_main_nav']; ?>

            <?php echo smarty_function_ft_include(array('file' => "menu.tpl"), $this);?>


text:
namespace EasyNetQ.Events
{
    public class ConnectionDisconnectedEvent
    {

    }
}


text:
mysql_service 'default' do

  server_root_password 	node['mysql']['server_root_password']
  version 				      node['mysql']['version']
  port 					        node['mysql']['port']
  data_dir 				      node['mysql']['data_dir']

  allow_remote_root true
  remove_anonymous_users true
  remove_test_database true

  action :create
end

template '/etc/mysql/conf.d/mysite.cnf' do
  owner 'mysql'
  source 'mysite.cnf.erb'
  notifies :restart, 'mysql_service[default]'
  action :create
end


text:
require 'socket'
require 'json'
require 'pg'

local_ip = UDPSocket.open {|s| s.connect("123.123.123.123", 1); s.addr.last}
if(local_ip =~ /192\.168|10\.0\.135/)
  dbconf = JSON.parse(File.read('../../server/database.json'))
else
  dbconf = JSON.parse(File.read('/var/www/citysdk/current/database.json'))
end

conn = PGconn.new(dbconf['host'], '5432', nil, nil, dbconf['database'], dbconf['user'], dbconf['passwd'])

rain_layer_name = 'rain'
admr_layer_name = 'admr'

res = conn.exec("SELECT id FROM layers WHERE name = '#{rain_layer_name}'");
rain_layer_id = res[0]['id'].to_i if res.cmdtuples > 0
if(rain_layer_id.nil?)
  $stderr.puts "No 'rain' layer found!"
  exit(-1)
end

res = conn.exec("SELECT id FROM layers WHERE name = '#{admr_layer_name}'");
admr_layer_id = res[0]['id'].to_i if res.cmdtuples > 0
if(rain_layer_id.nil?)
  $stderr.puts "No 'admr' layer found!"
  exit(-1)
end

truncate = <<-SQL
  DELETE FROM node_data WHERE layer_id = #{rain_layer_id}
SQL

conn.exec(truncate)

# Get all quarters and their centroid lat/lon from administrative region layer, insert into node_data
quarters = <<-SQL
  INSERT INTO node_data(id, node_id, data, layer_id, node_data_type)
  SELECT
    nextval('node_data_id_seq'), id AS node_id,
    hstore(ARRAY['centroid:lon', ST_X(centroid)::text, 'centroid:lat', ST_Y(centroid)::text]) AS data,
    #{rain_layer_id} AS layer_id, 0 AS node_data_type
  FROM (
    SELECT nodes.id, ST_AsText(ST_Centroid(geom)) AS centroid FROM nodes
    JOIN node_data ON node_data.node_id = nodes.id
    WHERE nodes.layer_id = #{admr_layer_id} AND data -> 'admn_level' = '4'
  ) c
SQL

res = conn.exec(quarters)
puts "Done! Rain node data created for #{res.cmd_tuples()} administrative regions!"


text:
import ConfigParser
DEFAULT_CONFIG = "default.conf"
CONFIG_NAME = ".scrappyrc"

import logging
import os, os.path
import ssl
import sys
import thread, threading
import time

from irclib import client as ircclient

# Logging guidelines and levels
# DEBUG - Python debugging (e.g., printing list of connected servers on startup)
# INFO - Anything we would want to see during normal operation (e.g., startup/reboot messages)
# WARNING - Things we would rather not happen (e.g., using a non-SSL connection)
# ERROR - Deviations from normal operation (e.g., failed to connect to a server)
# CRITICAL - Scrappy gonna die! But not before spitting out a final goodbye! (e.g., SIGINT)
logging.basicConfig(level=logging.DEBUG)
#logging.basicConfig(level=5)

irc_logger = logging.getLogger("irclib.client")
# Change me if you want to see IRC DEBUG lines
irc_logger.setLevel(logging.INFO)
#irc_logger.setLevel(logging.DEBUG)

# State classes

class User(object):
    def __init__(self, server, nick, host=None):
        self.server = server
        self.nick = nick
        self._host = host

        self.channels = {}

    @property
    def host(self):
        if self._host is None:
            self.server.whois((self.nick,))
            timeout = 1
            time_spent = 0
            while self._host is None and timeout > 0:
                timeout -= .01
                time.sleep(.01)
        return self._host

    @host.setter
    def host(self, value):
        self._host = value

    def join(self, channel):
        channel.usercount += 1
        self.channels[channel.name] = channel

    def part(self, channel):
        channel.usercount -= 1
        self.channels.remove(channel)

    def quit(self):
        for channel in self.channels:
            self.channels[channel].usercount -= 1

    def __str__(self):
        return "%s@%s" % (self.nick, self._host)

    def __repr__(self):
        return self.__str__()

#TODO: use weakref dictionaries for the users
class Channel(object):
    def __init__(self, server, channel_name):
        self.logger = server.logger.getChild(channel_name)
        self.server = server
        self.name = channel_name.lower()
        self.usercount = 0

class ServerState(ircclient.ServerConnection):
    def __init__(self, name, config, bot, irclibobj):
        super(ServerState, self).__init__(irclibobj)
        irclibobj.add_connection(self)

        self.logger = bot.logger.getChild(name)
        self.server_name = name

        # Register handlers
        self.add_global_handler("all_events", bot.process_event)
        # One second tick for timed functions
        self.execute_every(1, bot.on_tick, arguments=(self,))

        bot.register_event("server-%s"%name,"welcome", self.join_defaults)
        bot.register_event("server-%s"%name,"join", self.update_channel)
        bot.register_event("server-%s"%name,"part", self.update_channel)
        bot.register_event("server-%s"%name,"kick", self.update_channel)
        bot.register_event("server-%s"%name,"quit", self.update_channel)
        bot.register_event("server-%s"%name,"namreply", self.on_namereply)
        bot.register_event("server-%s"%name,"whoisuser", self.on_whoisreply)

        if "password" in config:
            password = config["password"]
        else:
            password = None

        if config["ssl"].lower() == "yes":
            factory = ircclient.connection.Factory(wrapper=ssl.wrap_socket)
        else:
            self.logger.warning("Hey, we really don't like you not using SSL!")
            factory = ircclient.connection.Factory()

        try:
            self.connect(config["server"], int(config["port"]), config["nickname"], password=password,
                        username=config["username"], ircname=config["realname"], connect_factory=factory)
        except ircclient.ServerConnectionError, err:
            self.logger.exception("Failed to connect on port %s" % (config["port"]))

        self.cmdchar = config["cmdchar"]
        self.config = config

        self.channels = {}
        self.initial_channels = config["channels"].split()

        self.users = {}

        self.temp_state = {}

        #self.channels = [Channel(x) for x in config["channels"].split()]

    # Reply to a PRIVMSG event
    def reply(self, event, message):
        if event.type == "privmsg":
            self.privmsg(event.source.nick, message)
        elif event.type == "pubmsg":
            self.privmsg(event.target, message)

    def join_defaults(self, server, event, bot):
        if server == self:
            for channel in self.initial_channels:
                self.join(channel)

    def update_channel(self, server, event, bot):
        if server == self:
            if event.type == "kick":
                nick = event.arguments[0]
                host = None
            elif event.type =="part" or event.type == "join" or event.type == "quit":
                nick = event.source.nick
                host = event.source.host

            if nick not in self.users:
                self.users[nick] = User(self, nick, host)
            user = self.users[nick]

            if event.type == "quit":
                user.quit()
                for channel in user.channels:
                    if self.channels[channel].usercount == 0:
                        del self.channels[channel]
                del self.users[nick]
                return

            if event.target not in self.channels:
                self.channels[event.target] = Channel(self, event.target)
            channel = Channel(self, event.target)

            if event.type == "join":
                user.join(channel)
            elif event.type == "part" or event.type == "kick":
                # TODO: Need to take care of the part when _I_ part a channel, shouldn't track its state anymore
                user.part(channel)
                if len(user.channels) == 0:
                    del self.users[user.nick]
                if channel.usercount == 0:
                    del self.channels[channel.name]

    def on_namereply(self, server, event, bot):
        if server == self:
            # Hoping that the namreply is only additive! In theory, we shouldn't have missed any users leaving channels though
            if event.type == "namreply":
                channel_name = event.arguments[1]
                if channel_name not in self.channels:
                    self.channels[channel_name] = Channel(self, channel_name)
                channel = self.channels[channel_name]

                nicks = event.arguments[2].strip()
                for nick in nicks.split(" "):
                    if nick not in self.users:
                        self.users[nick] = User(self, nick)
                    self.users[nick].join(channel)

    def on_whoisreply(self, server, event, bot):
        if server == self:
            if event.type == "whoisuser":
                nick = event.arguments[0]
                host = event.arguments[2]
                try:
                    user = self.users[nick]
                    user.host = host
                except KeyError:
                    return # ignore the reply, we don't know about this user

class scrappy:
    """This is our main bot class. Generally, everything past loading/unloading modules is provided
    by external python modules themselves.
    """
    def __init__(self):
        """Initialize the scrapster
        """

        self.logger = logging.getLogger("scrappy")

        self.logger.info("Scrappy bot started.")

        # Read config file at CONFIG_NAME
        if not os.path.exists(CONFIG_NAME):
            self.logger.critical("Error: Configuration file '%s' not found." % CONFIG_NAME)
            self.logger.critical("Copy %s to %s and modify as necessary." % (DEFAULT_CONFIG, CONFIG_NAME))
            sys.exit(1)
        self.config = ConfigParser.SafeConfigParser()
        self.config.read(CONFIG_NAME)

        self.modules = {}

        #our event lists.
        #each module adds functions to be called to these events.
        #each event handler calls all of the functions within its list.
        # Event types are added as they are registered
        self.events = {"privmsg":{},
                        "pubmsg":{},
                        "tick":{}}

        # Load these modules before any events occur, since core handles server welcome message
        self.load_module("core")
        self.load_module("modmanage")

        self.lock = threading.Lock()

        #start the bot
        self.__main()

    ########################################################################
    def __main(self):
        """The real work.  Initialize our connection and register events."""
        # Save arguments for rebooting (see 'core' module)
        self.argv = sys.argv
        # Create a new socket
        self.ircsock = ircclient.IRC()

        self.servers = {}
        for servername in self.config.sections():
            server = ServerState(servername, dict(self.config.items(servername)), self, self.ircsock)
            self.servers[servername] = server

        #enter main event loop after this
        try:
            self.ircsock.process_forever()
        except KeyboardInterrupt:
            for server in self.servers:
                self.servers[server].quit("BAIL OUT!!")

    ########################################################################
    def shutdown(self, code=0):
        """Exit

        Keyword arguments:
        code -- Exit code (default 0)
        """
        sys.exit(code)

    ########################################################################
    ###################
    #Event Registering#
    ###################

    def register_event(self, modname, event_type, func):
        """Register a callback to an IRC event

        Call this with an event_type and a function to call when that event_type happens.
        Arguments:
        modname -- Modules shortname
        event_type -- Event type, see irclib/events.py for events
        func -- Callback function, needs to have the signature func(server, event, scrappy)
        """

        event_dict = self.events.setdefault(event_type, {})
        event_dict.setdefault(modname, set()).add(func)
        # TODO: Nuke this. Modules can decide if they want both.
        if event_type == "msg":
            self.events["privmsg"].setdefault(modname, set()).add(func)
            self.events["pubmsg"].setdefault(modname, set()).add(func)

    def unregister_event(self, event_type, func):
        """Not Implemented - Unregister a callback to an IRC event
        """
        pass

    ########################################################################
    ##################
    #Event Handlers  #
    ##################

    def process_event(self, conn, event):
        """Processes IRC event on connection

        Arguments:
        conn -- IRC connection
        event -- IRC event
        """
        if event.type in self.events:
            for module_events in self.events[event.type].values():
                for func in module_events:
                    thread.start_new_thread(func, (conn, event, self))

        # If the on_EVENT method doesn't exist, call a NOP-like function instead
        do_nothing = lambda c, e: None
        custom_handler = getattr(self, "on_" + event.type, do_nothing)
        custom_handler(conn, event)

    ########################################################################
    def on_tick(self, conn):
        """Calls the tick event callbacks

        Arguments:
        conn -- IRC connection
        """
        for module_events in self.events["tick"].values():
            for func in module_events:
                thread.start_new_thread(func, (conn, self))

    def load_module(self, name):
        """Loads module

        Arguments:
        name -- Name of module
        """
        self.logger.debug("Loading module '%s'." % name)
        if name in self.modules:
            self.logger.debug("Actually, module '%s' already loaded, reloading." % name)
            return self.reload_module(name)

        try:
            # from modules.core.core import core
            module = __import__("modules.%s.%s" % (name, name), globals(), locals(), [name])
            # Get the class
            cls = getattr(module, name)
        except AttributeError as err:
            self.logger.exception("Module '%s' not found, make sure %s/%s.py exists." % (name,name,name))
            raise err
        except ImportError as err:
            self.logger.exception("No such module '%s'." % name)
            raise err
        except Exception as err:
            self.logger.exception("Error loading module '%s': %s" % (name, err))
            raise err

        try:
            self.modules[name] = cls(self)
        except Exception as err:
            self.logger.exception("Module '%s' failed to initialize." % name)
            raise err

        return True

    def reload_module(self, name):
        """Reloads module

        Arguments:
        name -- Name of module"""
        self.unload_module(name)
        return self.load_module(name)

    def unload_module(self, name):
        """Unloads module

        May not work consistently, see:
        http://stackoverflow.com/questions/3105801/unload-a-module-in-python

        Arguments:
        name -- Name of module"""
        with self.lock:
            if name in self.modules:
                self.unregister_module(name)
                self.modules.pop(name)
                fullname = name+"."+name
                if fullname in sys.modules:
                    # Package name is kept in sys.modules, but it doesn't seem to care if I don't delete it
                    #del(sys.modules[name])
                    del(sys.modules[fullname])
            else:
                return False

        return True

    def unregister_module(self, name):
        """Unregisters module callbacks

        Arguments:
        name -- Name of module
        """
        for event in self.events.values():
            if name in event:
                event.pop(name)

if(__name__ == "__main__"):
        bot = scrappy()


text:
import pandas as pd

from Src.BioAnalyzer.Analysis.GenePrioritization.Steps.DataIntegration.IntermediateRepresentation.Generators.IntermediateRepresentationGeneratorBase import \
    IntermediateRepresentationGeneratorBase

class SpearmanCorrelationGenerator(IntermediateRepresentationGeneratorBase):
    """"""

    def generate(self, data: pd.DataFrame) -> pd.DataFrame:
        """

        :param data:
        :return:
        """
        return data.corr(method='spearman')


text:
#include "config.h"
#include "WebKitDOMPrivate.h"

#include "Blob.h"
#include "DOMObjectCache.h"
#include "Element.h"
#include "Event.h"
#include "EventTarget.h"
#include "File.h"
#include "HTMLElement.h"
#include "HTMLNames.h"
#include "KeyboardEvent.h"
#include "MouseEvent.h"
#include "StyleSheet.h"
#include "UIEvent.h"
#include "WebKitDOMAttrPrivate.h"
#include "WebKitDOMBlobPrivate.h"
#include "WebKitDOMCDATASectionPrivate.h"
#include "WebKitDOMCSSStyleSheetPrivate.h"
#include "WebKitDOMCommentPrivate.h"
#include "WebKitDOMDOMWindowPrivate.h"
#include "WebKitDOMDocumentFragmentPrivate.h"
#include "WebKitDOMDocumentPrivate.h"
#include "WebKitDOMDocumentTypePrivate.h"
#include "WebKitDOMElementPrivate.h"
#include "WebKitDOMEventPrivate.h"
#include "WebKitDOMEventTargetPrivate.h"
#include "WebKitDOMFilePrivate.h"
#include "WebKitDOMHTMLCollectionPrivate.h"
#include "WebKitDOMHTMLDocumentPrivate.h"
#include "WebKitDOMHTMLOptionsCollectionPrivate.h"
#include "WebKitDOMHTMLPrivate.h"
#include "WebKitDOMKeyboardEventPrivate.h"
#include "WebKitDOMMouseEventPrivate.h"
#include "WebKitDOMNodePrivate.h"
#include "WebKitDOMProcessingInstructionPrivate.h"
#include "WebKitDOMStyleSheetPrivate.h"
#include "WebKitDOMTextPrivate.h"
#include "WebKitDOMUIEventPrivate.h"
#include "WebKitDOMWheelEventPrivate.h"

#if ENABLE(VIDEO_TRACK)
#include "DataCue.h"
#include "VTTCue.h"
#include "WebKitDOMDataCuePrivate.h"
#include "WebKitDOMTextTrackCuePrivate.h"
#include "WebKitDOMVTTCuePrivate.h"
#endif

namespace WebKit {

using namespace WebCore;
using namespace WebCore::HTMLNames;

WebKitDOMNode* wrap(Node* node)
{
    ASSERT(node);
    ASSERT(node->nodeType());

    switch (node->nodeType()) {
    case Node::ELEMENT_NODE:
        if (is<HTMLElement>(*node))
            return WEBKIT_DOM_NODE(wrap(downcast<HTMLElement>(node)));
        return WEBKIT_DOM_NODE(wrapElement(downcast<Element>(node)));
    case Node::ATTRIBUTE_NODE:
        return WEBKIT_DOM_NODE(wrapAttr(static_cast<Attr*>(node)));
    case Node::TEXT_NODE:
        return WEBKIT_DOM_NODE(wrapText(downcast<Text>(node)));
    case Node::CDATA_SECTION_NODE:
        return WEBKIT_DOM_NODE(wrapCDATASection(static_cast<CDATASection*>(node)));
    case Node::PROCESSING_INSTRUCTION_NODE:
        return WEBKIT_DOM_NODE(wrapProcessingInstruction(static_cast<ProcessingInstruction*>(node)));
    case Node::COMMENT_NODE:
        return WEBKIT_DOM_NODE(wrapComment(static_cast<Comment*>(node)));
    case Node::DOCUMENT_NODE:
        if (is<HTMLDocument>(*node))
            return WEBKIT_DOM_NODE(wrapHTMLDocument(downcast<HTMLDocument>(node)));
        return WEBKIT_DOM_NODE(wrapDocument(downcast<Document>(node)));
    case Node::DOCUMENT_TYPE_NODE:
        return WEBKIT_DOM_NODE(wrapDocumentType(static_cast<DocumentType*>(node)));
    case Node::DOCUMENT_FRAGMENT_NODE:
        return WEBKIT_DOM_NODE(wrapDocumentFragment(static_cast<DocumentFragment*>(node)));
    }

    return wrapNode(node);
}

WebKitDOMEvent* wrap(Event* event)
{
    ASSERT(event);

    if (event->isUIEvent()) {
        if (event->isMouseEvent())
            return WEBKIT_DOM_EVENT(wrapMouseEvent(static_cast<MouseEvent*>(event)));

        if (event->isKeyboardEvent())
            return WEBKIT_DOM_EVENT(wrapKeyboardEvent(static_cast<KeyboardEvent*>(event)));

        if (event->eventInterface() == WheelEventInterfaceType)
            return WEBKIT_DOM_EVENT(wrapWheelEvent(static_cast<WheelEvent*>(event)));

        return WEBKIT_DOM_EVENT(wrapUIEvent(static_cast<UIEvent*>(event)));
    }

    return wrapEvent(event);
}

WebKitDOMStyleSheet* wrap(StyleSheet* styleSheet)
{
    ASSERT(styleSheet);

    if (is<CSSStyleSheet>(*styleSheet))
        return WEBKIT_DOM_STYLE_SHEET(wrapCSSStyleSheet(downcast<CSSStyleSheet>(styleSheet)));
    return wrapStyleSheet(styleSheet);
}

WebKitDOMHTMLCollection* wrap(HTMLCollection* collection)
{
    ASSERT(collection);

    if (is<HTMLOptionsCollection>(*collection))
        return WEBKIT_DOM_HTML_COLLECTION(wrapHTMLOptionsCollection(downcast<HTMLOptionsCollection>(collection)));
    return wrapHTMLCollection(collection);
}

WebKitDOMEventTarget* wrap(EventTarget* eventTarget)
{
    ASSERT(eventTarget);

    if (Node* node = eventTarget->toNode())
        return WEBKIT_DOM_EVENT_TARGET(kit(node));

    if (DOMWindow* window = eventTarget->toDOMWindow())
        return WEBKIT_DOM_EVENT_TARGET(kit(window));

    return 0;
}

WebKitDOMBlob* wrap(Blob* blob)
{
    ASSERT(blob);

    if (blob->isFile())
        return WEBKIT_DOM_BLOB(wrapFile(static_cast<File*>(blob)));
    return wrapBlob(blob);
}

#if ENABLE(VIDEO_TRACK)
WebKitDOMTextTrackCue* wrap(TextTrackCue* cue)
{
    ASSERT(cue);

    switch (cue->cueType()) {
    case TextTrackCue::Data:
        return WEBKIT_DOM_TEXT_TRACK_CUE(wrapDataCue(static_cast<DataCue*>(cue)));
    case TextTrackCue::WebVTT:
    case TextTrackCue::Generic:
        return WEBKIT_DOM_TEXT_TRACK_CUE(wrapVTTCue(static_cast<VTTCue*>(cue)));
    }
    return wrapTextTrackCue(cue);
}
#endif

} // namespace WebKit


text:
/* utvector
 *
 * maintain a contiguous buffer of 'n' elements ('i' occupied)
 * the 'n' buffers are deep-inited at the time of allocation
 * the vector leaves popped slots as-is, clearing them on re-use
 * the memory management helper mm is used to define the size and
 * deep-init, deep-fini, deep-copy (into inited slots) and deep-clear.
 * deep-clear prepares a slot for re-use e.g. reset slot state.
 *
 */

#ifndef __UTVECTOR_H_
#define __UTVECTOR_H_

#include "utmm.h"

/* typical usage e.g. a vector of utstring would have
 *
   .sz = sizeof(UT_string)
   .init = utstring-init
   .fini = utstring-done
   .copy = ustring_concat
   .clear= utstring-clear
 */

typedef struct _UT_vector {
  UT_mm mm;
  unsigned i,n;/* i: index of next available slot, n: num slots */
  char *d;     /* n slots of size icd->sz*/
} UT_vector;

UT_vector *utvector_new(const UT_mm *mm);
void utvector_init(UT_vector *v, const UT_mm *mm);
void utvector_reserve(UT_vector *v, unsigned num);
void utvector_fini(UT_vector *v);
UT_vector * utvector_clone(UT_vector *src);
void utvector_clear(UT_vector *v);
void utvector_copy(UT_vector *dst, UT_vector *src);
void utvector_free(UT_vector *v);
void *utvector_extend(UT_vector *v);
void *utvector_head(UT_vector *v);
void *utvector_tail(UT_vector *v);
void *utvector_next(UT_vector *v, void *cur);
void *utvector_pop(UT_vector *v);
void *utvector_elt(UT_vector *v, unsigned i);
void utvector_shift(UT_vector *v);
void utvector_erase(UT_vector *v, unsigned i);
void *utvector_push(UT_vector *v, void *e);
unsigned utvector_len(UT_vector *v);

#endif /* __UTVECTOR_H_ */


text:
<?php
/**
 * PHP Mosaico X API (XAPI) SDK
 * Innobit s.r.l.
 * web: http://www.innobit.it
 * mail: info@innobit.it
 */

namespace XAPISdk\Data\BusinessObjects;

class TipoSoggetto extends ABaseBusinessObject {

    // region -- CONSTANTS --

    const CLASS_NAME = __CLASS__;

    // endregion

    // region -- MEMBERS --

    protected $_nome;
    protected $_descrizione;

    // endregion

    // region -- GETTERS/SETTERS --

    public function setNome($nome) {
        $this->_nome = $nome;
    }

    public function getNome() {
        return $this->_nome;
    }

    public function setDescrizione($descrizione) {
        $this->_descrizione = $descrizione;
    }

    public function getDescrizione() {
        return $this->_descrizione;
    }

    // endregion

    // region -- METHODS --

    public function toJson() {
        $toSerialize = array('nome' => $this->serializedField($this->_nome),
            'descrizione' => $this->serializedField($this->_descrizione));

        return json_encode($toSerialize);
    }

    protected function setFieldsFromJsonObj($jsonObj) {
        if (isset($jsonObj->nome))
            $this->setNome($jsonObj->nome);

        if (isset($jsonObj->descrizione))
            $this->setDescrizione($jsonObj->descrizione);
    }

    public static function getResourceName() {
        return 'tipiSoggetto';
    }

    // endregion

}


text:
import os
import sys
import traceback
import codecs
import logging
import time
import xml.etree.ElementTree as ET
import numpy as np

from optparse               import OptionParser
from gensim.models          import word2vec
from nltools                import misc, tokenizer
from align_model            import AlignModel

OUTPUT_DIR  = 'out'

#
# init, cmdline
#

misc.init_app('csv_align')

parser = OptionParser("usage: %prog [options] foo.csv")

parser.add_option ("-v", "--verbose", action="store_true", dest="verbose",
                   help="verbose output")

(options, args) = parser.parse_args()

if options.verbose:
    logging.basicConfig(level=logging.DEBUG)
else:
    logging.basicConfig(level=logging.INFO)

if len(args) != 1:
    parser.print_usage()
    sys.exit(1)

csvfn   = args[0]

#
# load model
#

align_model = AlignModel(None)
align_model.load()

#
# parse CSV input file, map uncovered questions to module:sourcefile keys
#

logging.info('parsing %s ...' % csvfn)

map_dict = {} # module -> {inp_en -> (resp_en, inp_de, resp_de)}

with codecs.open(csvfn, 'r', 'utf8') as csvf:

    cnt = 0

    for line in csvf:

        cnt += 1

        parts = line.strip().split(';')
        if len(parts) != 4:
            logging.error('failed to parse line: %s' % line.strip())
            continue

        inp_en  = parts[0]
        resp_en = parts[1]
        inp_de  = parts[2]
        resp_de = parts[3]

        mn = align_model.predict(inp_en)

        if not mn in map_dict:
            map_dict[mn] = {}

        # logging.debug (u'%6d inp_en: %s -> %s' % (cnt, inp_en, mn))
        map_dict[mn][inp_en] = (resp_en, inp_de, resp_de)

# print repr(map_dict)

#
# generate output files
#

for mn in map_dict:

    outfn = '%s/%s.csv' % (OUTPUT_DIR, mn)
    with codecs.open(outfn, 'w', 'utf8') as outf:

        for ques_en in sorted(map_dict[mn]):

            resp_en, ques_de, resp_de = map_dict[mn][ques_en]

            line = u"%s;%s;%s;%s" % (ques_en, resp_en, ques_de, resp_de)
            outf.write(u"%s\n" % line)

    logging.info ('%s written.' % outfn)


text:
require "cases/helper"
require "support/connection_helper"
require "concurrent/atomic/cyclic_barrier"

module ActiveRecord
  class PostgresqlTransactionTest < ActiveRecord::PostgreSQLTestCase
    self.use_transactional_tests = false

    class Sample < ActiveRecord::Base
      self.table_name = "samples"
    end

    setup do
      @connection = ActiveRecord::Base.connection

      @connection.transaction do
        @connection.drop_table "samples", if_exists: true
        @connection.create_table("samples") do |t|
          t.integer "value"
        end
      end

      Sample.reset_column_information
    end

    teardown do
      @connection.drop_table "samples", if_exists: true
    end

    test "raises SerializationFailure when a serialization failure occurs" do
      assert_raises(ActiveRecord::SerializationFailure) do
        before = Concurrent::CyclicBarrier.new(2)
        after = Concurrent::CyclicBarrier.new(2)

        thread = Thread.new do
          with_warning_suppression do
            Sample.transaction isolation: :serializable do
              before.wait
              Sample.create value: Sample.sum(:value)
              after.wait
            end
          end
        end

        begin
          with_warning_suppression do
            Sample.transaction isolation: :serializable do
              before.wait
              Sample.create value: Sample.sum(:value)
              after.wait
            end
          end
        ensure
          thread.join
        end
      end
    end

    test "raises Deadlocked when a deadlock is encountered" do
      with_warning_suppression do
        assert_raises(ActiveRecord::Deadlocked) do
          barrier = Concurrent::CyclicBarrier.new(2)

          s1 = Sample.create value: 1
          s2 = Sample.create value: 2

          thread = Thread.new do
            Sample.transaction do
              s1.lock!
              barrier.wait
              s2.update_attributes value: 1
            end
          end

          begin
            Sample.transaction do
              s2.lock!
              barrier.wait
              s1.update_attributes value: 2
            end
          ensure
            thread.join
          end
        end
      end
    end

    protected

      def with_warning_suppression
        log_level = ActiveRecord::Base.connection.client_min_messages
        ActiveRecord::Base.connection.client_min_messages = "error"
        yield
      ensure
        ActiveRecord::Base.connection.client_min_messages = log_level
      end
  end
end


text:
using NUnit.Framework;
using FluentAssertions;

namespace ReactiveServices.MessageBus.Tests.UnitTests
{
    [TestFixture]
    public class MessageTests
    {
        [Test]
        [Category("stable")]
        [Category("fast")]
        public void TestMessageReferenceInequality()
        {
            var aMessage = new AMessage();
            var anotherMessage = new AMessage();
            Assert.False(aMessage.Equals(anotherMessage), "Message inequality failed: {0} != {1}", aMessage, anotherMessage);
        }

        [Test]
        [Category("stable")]
        [Category("fast")]
        public void TestMessageToString()
        {
            var message = new AMessage();
            var myIdValue = message.MessageId.Value;
            message.Should().NotBeNull();
            message.ToString().Should().Be(myIdValue);
        }
    }
}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using EzTextingApiClient.Api.Messaging.Model;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace EzTextingApiClient.Api.Inbox.Model
{
    /// Message stored in your inbox folder
    public class InboxMessage : SimpleMessage
    {
        [JsonProperty("ID")]
        public long? Id { get; private set; }

        public string PhoneNumber { get; private set; }
        [JsonConverter(typeof(StringEnumConverter))]
        public MessageType? Type { get; private set; }
        public IList<string> Files { get; private set; }

        [JsonProperty("New")]
        public bool? Unread { get; private set; }

        [JsonProperty("FolderID")]
        public long? FolderId { get; private set; }

        [JsonProperty("ContactID")]
        public string ContactId { get; private set; }

        public DateTime? ReceivedOn { get; private set; }

        public override string ToString() =>
            $"InboxMessage [{base.ToString()} Id={Id}, PhoneNumber={PhoneNumber}, Type={Type}, Unread={Unread} " +
            $"Files={",".Join(Files)}, FolderId={FolderId}, ContactId={ContactId}, ReceivedOn={ReceivedOn}";
    }
}


text:
Note=Origin: [https://ec.europa.eu/info/sites/info/files/about_the_european_commission/eu_budget/condit_gen_en.pdf]

Version of January 2019

Ti=General conditions of the contract

0.1.0.sec=The contract consists of a purchase order and these general conditions. If there is any conflict between different provisions in this contract, the following rules must be applied:

0.1.1.sec=The provisions set out in the purchase order take precedence over those set out in general conditions;

0.1.2.sec=The provisions set out in the general conditions take precedence over those set out in the tender specifications;

0.1.3.sec=The provisions set out in the tender specifications take precedence over those set out in the contractor's tender.

0.1.=[G/Z/ol-a/s3]

0.2.sec=All documents issued by the contractor (end-user agreements, general terms and conditions, etc.) except its tender are held inapplicable, unless explicitly mentioned in the special conditions of this contract. In all circumstances, in the event of contradiction between this contract and documents issued by the contractor, this contract prevails, regardless of any provision to the contrary in the contractor's documents.

0.=[G/Z/paras/s2]

1.Sec={Def.Sec}

Def.=[G/EU_Europa_EC_Conditions_General/EN/Sec/Def/0.md]

1.Sec={Def.Sec}

2.Ti=ROLES AND RESPONSIBILITIES IN THE EVENT OF A JOINT TENDER

2.sec=In the event of a joint tender submitted by a group of economic operators and where the group does not have legal personality or legal capacity, one member of the group is appointed as leader of the group.

3.Ti=SEVERABILITY

3.sec=Each provision of this contract is severable and distinct from the others. If a provision is or becomes illegal, invalid or unenforceable to any extent, it must be severed from the remainder of the contract. This does not affect the legality, validity or enforceability of any other provisions of the contract, which continue in full force and effect. The illegal, invalid or unenforceable provision must be replaced by a legal, valid and enforceable substitute provision which corresponds as closely as possible with the actual intent of the parties under the illegal, invalid or unenforceable provision. The replacement of such a provision must be made in accordance with Article {11.Xnum}. The contract must be interpreted as if it had contained the substitute provision as from its entry into force.

4.Ti=PERFORMANCE OF THE CONTRACT

4.1.sec=The contractor must provide services of high quality standards, in accordance with the state of the art in the industry and the provisions of this contract, in particular the tender specifications and the terms of its tender. Where the Union has the right to make modifications to the {_results}, they must be delivered in a format and with the necessary information which effectively allow such modifications to be made in a convenient manner.

4.2.sec=The contractor must comply with the minimum requirements provided for in the tender specifications. This includes compliance with applicable obligations under environmental, social and labour law established by Union law, national law and collective agreements or by the international environmental, social and labour law provisions listed in Annex X to Directive 2014/24/EU{FtNt.1.Xref}, compliance with data protection obligations resulting from Regulation (EU) 2016/679{FtNt.2.Xref} and Regulation (EU) 2018/1725{FtNt.3.Xref}.

4.3.sec=The contractor must obtain any permit or licence required in the State where the services are to be provided.

4.4.sec=All periods specified in the contract are calculated in calendar days, unless otherwise specified.

4.5.sec=The contractor must not present itself as a representative of the contracting authority and must inform third parties that it is not part of the European public service.

4.6.0.sec=The contractor is responsible for the {_personnel} who carry out the services and exercises its authority over its {_personnel} without interference by the contracting authority. The contractor must inform its {_personnel} that:

4.6.1.sec=they may not accept any direct instructions from the contracting authority; and

4.6.2.sec=their participation in providing the services does not result in any employment or contractual relationship with the contracting authority

4.6.=[G/Z/ol-a/s2]

4.7.sec=The contractor must ensure that the {_personnel} performing the contract and any future replacement {_personnel} possess the professional qualifications and experience required to provide the services, as the case may be on the basis of the selection criteria set out in the tender specifications.

4.8.0.sec=At the contracting authority's reasoned request, the contractor must replace any member of {_personnel} who:

4.8.1.sec=does not have the expertise required to provide the services; or

4.8.2.sec=has caused disruption at the premises of the contracting authority.

4.8.00.sec=The contractor bears the cost of replacing its {_personnel} and is responsible for any delay in providing the services resulting from the replacement of {_personnel}.

4.8.=[G/Z/ol-a/s2]

4.9.sec=The contractor must record and report to the contracting authority any problem that affects its ability to provide the services. The report must describe the problem, state when it started and what action the contractor is taking to resolve it.

4.10.sec=The contractor must immediately inform the Contracting authority of any changes in the exclusion situations as declared, according to Article 137 (1) of Regulation (EU) 2018/1046.

4.=[G/Z/ol/s10]

5.Sec={Communicate.Sec}

Communicate.=[G/EU_Europa_EC_Conditions_General/EN/Sec/Communicate/0.md]

6.Ti=LIABILITY

6.1.sec=The contracting authority is not liable for any damage or loss caused by the contractor, including any damage or loss to third parties during or as a consequence of {_performance_of_the_contract}.

6.2.sec=If required by the relevant applicable legislation, the contractor must take out an insurance policy against risks and damage or loss relating to the {_performance_of_the_contract}. It must also take out supplementary insurance as reasonably required by standard practice in the industry. Upon request, the contractor must provide evidence of insurance coverage to the contracting authority.

6.3.sec=The contractor is liable for any loss or damage caused to the contracting authority during or as a consequence of {_performance_of_the_contract}, including in the event of subcontracting, but only to an amount not exceeding three times the total amount of the contract. However, if the damage or loss is caused by the gross negligence or wilful misconduct of the contractor or of its {_personnel} or subcontractors, as well as in the case of an action brought against the contracting authority by a third party for breach of its intellectual property rights, the contractor is liable for the whole amount of the damage or loss.

6.4.1.sec=If a third party brings any action against the contracting authority in connection with the {_performance_of_the_contract}, including any action for alleged breach of intellectual property rights, the contractor must assist the contracting authority in the legal proceedings, including by intervening in support of the contracting authority upon request.

6.4.2.sec=If the contracting authority's liability towards the third party is established and that such liability is caused by the contractor during or as a consequence of the {_performance_of_the_contract}, Article {6.3.Xnum} applies.

6.4.=[G/Z/paras/s2]

6.5.sec=If the contractor is composed of two or more economic operators (i.e. who submitted a joint tender), they are all jointly and severally liable to the contracting authority for the {_performance_of_the_contract}.

6.6.sec=The contracting authority is not liable for any loss or damage caused to the contractor during or as a consequence of {_performance_of_the_contract}, unless the loss or damage was caused by wilful misconduct or gross negligence of the contracting authority.

6.=[G/Z/ol/s6]

7.Ti=CONFLICT OF INTEREST AND PROFESSIONAL CONFLICTING INTERESTS

7.1.sec=The contractor must take all the necessary measures to prevent any situation of {_conflict_of_interest} or {_professional_conflicting_interest}.

7.2.1.sec=The contractor must {_notify} the contracting authority in writing as soon as possible of any situation that could constitute a {_conflict_of_interest} or a {_professional_conflicting_interest} during the {_performance_of_the_contract}. The contractor must immediately take action to rectify the situation.

7.2.2.0.sec=The contracting authority may do any of the following:

7.2.2.1.sec=verify that the contractor's action is appropriate;

7.2.2.2.sec=require the contractor to take further action within a specified deadline;

7.2.2.=[G/Z/ol-a/s2]

7.2.=[G/Z/paras/s2]

7.3.0.sec=The contractor must pass on all the relevant obligations in writing to:

7.3.1.sec=its {_personnel};

7.3.2.sec=any natural person with the power to represent it or take decisions on its behalf;

7.3.3.sec=third parties involved in the {_performance_of_the_contract}, including subcontractors.

7.3.00.sec=The contractor must also ensure that the persons referred to above are not placed in a situation which could give rise to conflicts of interest.

7.3.=[G/Z/ol-a/s3]

7.=[G/Z/ol/s3]

8.Sec={Conf.Sec}

Conf.=[G/EU_Europa_EC_Conditions_General/EN/Sec/Conf/0.md]

9.Sec={PrivateData.Sec}

PrivateData.=[G/EU_Europa_EC_Conditions_General/EN/Sec/Private_Data/0.md]

10.Ti=SUBCONTRACTING

10.1.sec=The contractor must not subcontract and have the contract performed by third parties beyond the third parties already mentioned in its tender without prior written authorisation from the contracting authority.

10.2.sec=Even if the contracting authority authorises subcontracting, the contractor remains bound by its contractual obligations and is solely responsible for the performance of this contract.

10.3.sec=The contractor must ensure that the subcontract does not affect the rights of the contracting authority under this contract, particularly those under Articles {Conf.Xnum}, {IPR.Xnum} and {22.Xnum}.

10.4.sec=The contracting authority may request the contractor to replace a subcontractor found to be in a situation provided for in points (d) and (e) of Article {18.1.Xnum}.

10.=[G/Z/ol/s4]

11.Ti=AMENDMENTS

11.1.sec=Any amendment to the contract must be made in writing before all contractual obligations have been fulfilled.

11.2.sec=Any amendment must not make changes to the contract that might alter the initial conditions of the procurement procedure or result in unequal treatment of tenderers.

11.=[G/Z/ol/s2]

12.Sec={Assign.Sec}

Assign.=[G/EU_Europa_EC_Conditions_General/EN/Sec/Assign/0.md]

13.Sec={IPR.Sec}

IPR.=[G/EU_Europa_EC_Conditions_General/EN/Sec/Intellectual_Property_Rights/0.md]

14.Sec={ForceMajeure.Sec}

ForceMajeure.=[G/EU_Europa_EC_Conditions_General/EN/Sec/Force_Majeure/0.md]

15.Ti=LIQUIDATED DAMAGES

15.1.Ti=Delay in delivery

15.1.0.sec=If the contractor fails to perform its contractual obligations within the applicable time limits set out in this contract, the contracting authority may claim liquidated damages for each day of delay using the following formula:

15.1.1.sec=0.3 x (V/d)

15.1.2.sec=where

15.1.3.sec=V is the price of the relevant purchase or deliverable or {_result} or, failing that, the amount specified in the purchase order;

15.1.4.sec=d is the duration specified in the contract for delivery of the relevant purchase or deliverable or {_result} or, failing that, the duration of {_performance_of_the_contract} specified in the purchase order, expressed in days.

15.1.00.sec=Liquidated damages may be imposed together with a reduction in price under the conditions laid down in Article {16.Xnum}.

15.1.=[G/Z/ol-none/s4]

15.2.Ti=Procedure

15.2.1.sec=The contracting authority must formally {_notify} the contractor of its intention to apply liquidated damages and the corresponding calculated amount.

15.2.2.sec=The contractor has 30 days following the date of receipt to submit observations. Failing that, the decision becomes enforceable the day after the time limit for submitting observations has elapsed.

15.2.3.0.sec=If the contractor submits observations, the contracting authority, taking into account the relevant observations, must {_notify} the contractor:

15.2.3.1.sec=of the withdrawal of its intention to apply liquidated damages; or

15.2.3.2.sec=of its final decision to apply liquidated damages and the corresponding amount.

15.2.3.=[G/Z/ol-a/s2]

15.2.=[G/Z/ol/s3]

15.3.Ti=Nature of liquidated damages

15.3.sec=The parties expressly acknowledge and agree that any amount payable under this Article is not a penalty and represents a reasonable estimate of fair compensation for the damage incurred due to failure to provide the services within the applicable time limits set out in this contract.

15.=[G/Z/ol/3]

15.4.Ti=Claims and liability

15.4.sec=Any claim for liquidated damages does not affect the contractor's actual or potential liability or the contracting authority's rights under Article {18.Xnum}.

16.Ti=REDUCTION IN PRICE

16.1.Ti=Quality standards

16.1.1.sec=If the contractor fails to provide the service in accordance with the contract ('unperformed obligations') or if it fails to provide the service in accordance with the expected quality levels specified in the tender specifications ('low quality delivery'), the contracting authority may reduce or recover payments proportionally to the seriousness of the unperformed obligations or low quality delivery. This includes in particular cases where the contracting authority cannot approve a {_result}, report or deliverable as defined in the purchase order after the contractor has submitted the required additional information, correction or new version.

16.1.2.sec=A reduction in price may be imposed together with liquidated damages under the conditions of Article {15.Xnum}.

16.1.=[G/Z/ol/s2]

16.2.Ti=Procedure

16.2.1.sec=The contracting authority must formally {_notify} the contractor of its intention to reduce payment and the corresponding calculated amount.

16.2.2.sec=The contractor has 30 days following the date of receipt to submit observations. Failing that, the decision becomes enforceable the day after the time limit for submitting observations has elapsed.

16.2.3.0.sec=If the contractor submits observations, the contracting authority, taking into account the relevant observations, must {_notify} the contractor:

16.2.3.1.sec=of the withdrawal of its intention to reduce payment; or

16.2.3.2.sec=of its final decision to reduce payment and the corresponding amount.

16.2.3.=[G/Z/ol-a/s2]

16.2.=[G/Z/ol/s3]

16.3.Ti=Claims and liability

16.3.sec=Any reduction in price does not affect the contractor's actual or potential liability or the contracting authority's rights under Article {18.Xnum}.

16.=[G/Z/ol/3]

17.Ti=SUSPENSION OF THE PERFORMANCE OF THE CONTRACT

17.1.Ti=Suspension by the contractor

17.1.1.sec=If the contractor is affected by {_force_majeure}, it may suspend the {_performance_of_the_contract}.

17.1.2.sec=The contractor must immediately {_notify} the contracting authority of the suspension. The {_notification} must include a description of the {_force_majeure} and state when the contractor expects to resume the {_performance_of_the_contract}.

17.1.3.sec=The contractor must {_notify} the contracting authority as soon as it is able to resume {_performance_of_the_contract}, unless the contracting authority has already terminated the contract.

17.1.=[G/Z/ol/s3]

17.2.Ti=Suspension by the contracting authority

17.2.1.0.sec=The contracting authority may suspend the {_performance_of_the_contract} or any part of it:

17.2.1.1.sec=if the procedure for awarding the contract or the {_performance_of_the_contract} proves to have been subject to {_irregularities}, {_fraud} or {_breach_of_obligations};

17.2.1.2.sec=in order to verify whether the presumed {_irregularities}, {_fraud} or {_breach_of_obligations} have actually occurred.

17.2.1.=[G/Z/ol-a/s2]

17.2.2.sec=The contracting authority must formally {_notify} the contractor of the suspension and the reasons for it. Suspension takes effect on the date of {_formal_notification}, or at a later date if the {_formal_notification} so provides.

17.2.3.0.sec=The contracting authority must {_notify} the contractor as soon as the verification is completed whether:

17.2.3.1.sec=it is lifting the suspension; or

17.2.3.2.sec=it intends to terminate the contract under Article {18.1.Xnum}(f) or (j).

17.2.3.=[G/Z/ol-a/s2]

17.2.4.sec=The contractor is not entitled to compensation for suspension of any part of the contract.

17.2.5.sec=The contracting authority may in addition suspend the time allowed for payments in accordance with Article {20.6.Xnum}.

17.2.=[G/Z/ol/s5]

17.=[G/Z/ol/2]

18.Sec={Terminate.Sec}

Terminate.=[G/EU_Europa_EC_Conditions_General/EN/Sec/Terminate/0.md]

19.Ti=INVOICES, VALUE ADDED TAX AND E-INVOICING

19.1.Ti=Invoices and value added tax

19.1.1.sec=Invoices must contain the contractor's (or leader's in the case of a joint tender) identification data, the amount, the currency and the date, as well as the contract reference.

19.1.2.sec=Invoices must indicate the place of taxation of the contractor (or leader in the case of a joint tender) for value added tax (VAT) purposes and must specify separately amounts not including VAT and amounts including VAT.

19.1.3.sec=The contracting authority is exempt from all taxes and duties, including VAT, in accordance with Articles 3 and 4 of the Protocol 7 of the Treaty on the Functioning of the European Union on the privileges and immunities of the European Union.

19.1.4.sec=The contractor (or leader in the case of a joint tender) must complete the necessary formalities with the relevant authorities to ensure that the supplies and services required for {_performance_of_the_contract} are exempt from taxes and duties, including VAT.

19.1.=[G/Z/ol/s4]

19.2.Ti=E-invoicing

19.2.1.sec=If provided for in the purchase order, the contractor (or leader in the case of a joint tender) submits invoices in electronic format if the conditions regarding electronic signature specified by Directive 2006/112/EC on VAT are fulfilled, i.e. using a qualified electronic signature or through electronic data interchange.

19.2.2.sec=Reception of invoices by standard format (pdf) or email is not accepted.

19.2.=[G/Z/ol/s2]

19.=[G/Z/ol/2]

20.Ti=PAYMENTS

20.1.Ti=Date of payment

20.1.sec=The date of payment is deemed to be the date on which the contracting authority's account is debited.

20.2.Ti=Currency

20.2.sec=Payments are made in euros, unless another currency is provided for in the purchase order.

20.3.Ti=Conversion

20.3.1.sec=The contracting authority makes any conversion between the euro and another currency at the daily euro exchange rate published in the Official Journal of the European Union, or failing that, at the monthly accounting exchange rate, as established by the European Commission and published on the website indicated below, applicable on the day when it issues the payment order.

20.3.2.sec=The contractor makes any conversion between the euro and another currency at the monthly accounting exchange rate, established by the Commission and published on the website indicated below, applicable on the date of the invoice.

20.3.3.sec=http://ec.europa.eu/budget/contracts_grants/info_contracts/inforeuro/inforeuro_en.cfm

20.3.=[G/Z/ol/s3]

20.4.Ti=Costs of transfer

20.4.0.sec=The costs of the transfer are borne as follows:

20.4.1.sec=the contracting authority bears the costs of dispatch charged by its bank;

20.4.2.sec=the contractor bears the costs of receipt charged by its bank,

20.4.3.sec=the party causing repetition of the transfer bears the costs for repeated transfer.

20.4.=[G/Z/ol-a/s3]

20.5.Ti=Payment of the balance

20.5.1.sec=The contractor (or leader in the case of a joint tender) must send an invoice for payment of the balance within 60 days of the end of the period of provision of the services, as provided for in the purchase order or in the tender specifications.

20.5.2.sec=Payment of the invoice and approval of documents does not imply recognition of the regularity, authenticity, completeness and correctness of the declarations and information they contain.

20.5.3.sec=Payment of the balance may take the form of recovery.

20.5.=[G/Z/ol/s3]

20.6.Ti=Suspension of the time allowed for payment

20.6.1.0.sec=The contracting authority may suspend the payment periods specified in the purchase order at any time by {_notify}ing the contractor (or leader in the case of joint tender) that its invoice cannot be processed. The reasons the contracting authority may cite for not being able to process an invoice are:

20.6.1.1.sec=because it does not comply with the contract;

20.6.1.2.sec=because the contractor has not produced the appropriate documents or deliverables; or

20.6.1.3.sec=because the contracting authority has observations on the documents or deliverables submitted with the invoice.

20.6.1.=[G/Z/ol-a/s3]

20.6.2.sec=The contracting authority must {_notify} the contractor (or leader in the case of joint tender) as soon as possible of any such suspension, giving the reasons for it. In cases b) and c) referred above, the contracting authority shall {_notify} the contractor (or leader in case of a joint tender) the time limits to submit additional information or corrections or a new version of the documents or deliverables if the contracting authority requires it.

20.6.3.sec=Suspension takes effect on the date the contracting authority sends the {_notification}. The remaining payment period resumes from the date on which the requested information or revised documents are received or the necessary further verification, including on-the-spot checks, is carried out. Where the suspension period exceeds two months, the contractor (or leader in the case of a joint tender) may request the contracting authority to justify the continued suspension.

20.6.4.sec=Where the payment periods have been suspended following rejection of a document referred to in the first paragraph of this Article and the new document produced is also rejected, the contracting authority reserves the right to terminate the contract in accordance with Article {18.1.Xnum}(c).

20.6.=[G/Z/ol/s4]

20.7.Ti=Interest on late payment

20.7.1.sec=On expiry of the payment periods specified in the purchase order, the contractor (or leader in the case of a joint tender) is entitled to interest on late payment at the rate applied by the European Central Bank for its main refinancing operations in euros (the reference rate) plus  eight points. The reference rate is the rate in force, as published in the C series of the Official Journal of the European Union, on the first day of the month in which the payment period ends.

20.7.2.sec=Suspension of the payment period as provided for in Article {20.6.Xnum} is not considered as giving rise to late payment.

20.7.3.sec=Interest on late payment covers the period running from the day following the due date for payment up to and including the date of payment as defined in Article {20.1.Xnum}.

20.7.4.sec=However, when the calculated interest is EUR 200 or less, it must be paid to the contractor (or leader in the case of a joint tender) only if it requests it within two months of receiving late payment.

20.7.=[G/Z/ol/s4]

20.=[G/Z/ol/7]

21.Ti=RECOVERY

21.1.Sec=If an amount is to be recovered under the terms of the contract, the contractor must repay the contracting authority the amount in question.

21.2.Ti=Recovery procedure

21.2.1.sec=Before recovery, the contracting authority must formally {_notify} the contractor of its intention to recover the amount it claims, specifying the amount due and the reasons for recovery and inviting the contractor to make any observations within 30 days of receipt.

21.2.2.sec=If no observations have been submitted or if, despite the observations submitted, the contracting authority decides to pursue the recovery procedure, it must confirm recovery by {_formally_notifying} a debit note to the contractor, specifying the date of payment. The contractor must pay in accordance with the provisions specified in the debit note.

21.2.3.0.sec=If the contractor does not pay by the due date, the contracting authority may, after informing the contractor in writing, recover the amounts due:

21.2.3.1.sec=by offsetting them against any amounts owed to the contractor by the Union or by the European Atomic Energy Community or by an executive agency when it implements the Union budget;

21.2.3.2.sec=by calling in a financial guarantee if the contractor has submitted one to the contracting authority;

21.2.3.3.sec=by taking legal action.

21.2.3.=[G/Z/ol-a/s3]

21.2.=[G/Z/ol/s3]

21.3.Ti=Interest on late payment

21.3.1.sec=If the contractor does not honour the obligation to pay the amount due by the date set by the contracting authority in the debit note, the amount due bears interest at the rate indicated in Article {20.7.Xnum}. Interest on late payments will cover the period starting on the day after the due date for payment and ending on the date when the contracting authority receives the full amount owed.

21.3.2.sec=Any partial payment is first entered against charges and interest on late payment and then against the principal amount.

21.3.=[G/Z/ol/s2]

21.4.Ti=Recovery rules in the case of joint tender

21.4.1.sec=If the contract is signed by a group (joint tender), the group is jointly and severally liable under the conditions set out in Article {6.Xnum} (liability). The contracting authority shall send the debit note first to the leader of the group.

21.4.2.sec=If the leader does not pay by the due date the whole amount, and if the amount due cannot be offset or can only be offset partially in accordance with Article {21.2.Xnum} (a), then the contracting authority may claim the amount still due to any other member or members of the group by respectively {_notifying} them with a debit note in conformity with the provisions laid down in Article {21.2.Xnum}.

21.4.=[G/Z/ol/s2]

21.=[G/Z/ol/4]

22.Ti=CHECKS AND AUDITS

22.1.1.sec=The contracting authority and the European Anti-Fraud Office may check or require an audit on the {_performance_of_the_contract}. This may be carried out either by OLAF's own staff or by any outside body authorised to do so on its behalf.

22.1.2.sec=Such checks and audits may be initiated at any moment during {_performance_of_the_contract} and up to five years starting from the payment of the balance.

22.1.3.sec=The audit procedure is initiated on the date of receipt of the relevant letter sent by the contracting authority. Audits are carried out on a confidential basis.

22.1.=[G/Z/paras/s3]

22.2.sec=The contractor must keep all original documents stored on any appropriate medium, including digitised originals if authorised under national law, for a period of five years starting from the payment of the balance.

22.3.sec=The contractor must grant the contracting authority's staff and outside {_personnel} authorised by the contracting authority the appropriate right of access to sites and premises where the contract is performed and to all the information, including information in electronic format, needed to conduct such checks and audits. The contractor must ensure that the information is readily available at the moment of the check or audit and, if so requested, that information is handed over in an appropriate format.

22.4.1.sec=On the basis of the findings made during the audit, a provisional report is drawn up. The contracting authority or its authorised representative must send it to the contractor, who has 30 days following the date of receipt to submit observations. The contractor must receive the final report within 60 days following the expiry of the deadline to submit observations.

22.4.2.sec=On the basis of the final audit findings, the contracting authority may recover all or part of the payments made in accordance with Article {21.Xnum} and may take any other measures which it considers necessary.

22.4.=[G/Z/paras/s2]

22.5.1.sec=In accordance with Council Regulation (Euratom, EC) No. 2185/96 of 11 November 1996 concerning on-the-spot checks and inspection carried out by the Commission in order to protect the European Communities' financial interests against {_fraud} and other {_irregularities} and Regulation (EU, Euratom) No. 883/2013 of the European Parliament and of the Council of 11 September 2013 concerning investigations conducted by the European Anti-Fraud Office, the European Anti-Fraud Office may carry out investigations, including on-the-spot checks and inspections, to establish whether there has been {_fraud}, corruption or any other illegal activity under the contract affecting the financial interests of the Union. Findings arising from an investigation may lead to criminal prosecution under national law.

22.5.2.sec=The investigations may be carried out at any moment during the provision of the services and up to five years starting from the payment of the balance.

22.5.=[G/Z/paras/s2]

22.6.sec=The Court of Auditors and the European Public Prosecutor's Office established by Council Regulation (EU) 2017/1939{FtNt.5.Xref} ('the EPPO') have the same rights as the contracting authority, particularly right of access, for the purpose of checks, audits and investigations.

22.=[G/Z/ol/s6]

00.sec={FtNt.Sec}

FtNt.Ti=Footnotes

FtNt.=[G/Z/ol/s5]

=[G/Z/ol/22]

Footnotes=

FtNt.1.sec=OJ L 94 of 28.03.2014, p. 65

FtNt.2.sec=Regulation (EU) 2016/679 of the European Parliament and of the Council of 27 April 2016 on the protection of natural persons with regard to the processing of personal data and on the free movement of such data, and repealing Directive 95/46/EC, OJ L 119,  4.5.2016, p. 1, https://eur-lex.europa.eu/legalcontent/EN/TXT/?uri=uriserv:OJ.L_.2016.119.01.0001.01.ENG

FtNt.3.sec=Regulation (EU) 2018/1725 of 23 October 2018 on the protection of natural persons with regard to the processing of personal data by the Union institutions, bodies, offices and agencies and on the free movement of such data, and repealing Regulation (EC) No 45/2001 and Decision No 1247/2002/EC, OJ L 295/39, 21.11.2018, https://eurlex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:32018R1725&from=EN

FtNt.4.sec=Regulation (EU, Euratom) 2018/1046 of the European Parliament and of the Council of 18 July 2018 on the financial rules applicable to the general budget of the Union, amending Regulations (EU) No 1296/2013, (EU) No 1301/2013, (EU) No 1303/2013, (EU) No 1304/2013, (EU) No  1309/2013, (EU) No 1316/2013, (EU) No 223/2014, (EU) No 283/2014, and Decision No 541/2014/EU and repealing Regulation (EU, Euratom) No 966/2012, OJ L 193 of 30.7.2018, p.1 https://eur-lex.europa.eu/legal-content/EN/TXT/?qid=1544791836334&uri=CELEX:32018R1046

FtNt.5.sec=Council Regulation (EU) 2017/1939 of 12 October 2017 implementing enhanced cooperation on the establishment of the European Public Prosecutor's Office

_Back_office=Back office

_Breach_of_obligations=Breach of obligations

_Confidential_information_or_document=Confidential information or document

_Conflict_of_interest=Conflict of interest

_Creator=Creator

_EDI_message=EDI message

_EDI_messages=EDI messages

_Force_majeure=Force majeure

_Formal_notification=Formal notification

_Formal_notifications=Formal notifications

_Fraud=Fraud

_Interface_control_document=Interface control document

_Irregularity=Irregularity

_Notification=Notification

_Performance_of_the_contract=Performance of the contract

_Personnel=Personnel

_Pre-existing_material=Pre-existing material

_Professional_conflicting_interest=Professional conflicting interest

_Related_person=Related person

_Result=Result

_Supplier_portal=Supplier portal

_back_office=back office

_back_offices=back offices

_breach_of_obligations=breach of obligations

_confidential_information_or_document=confidential information or document

_confidential_information_or_documents=confidential information or documents

_conflict_of_interest=conflict of interest

_creator=creator

_creators=creators

_e-PRIOR=e-PRIOR

_force_majeure=force majeure

_formal_notification=formal notification

_formally_notify=formally notify

_formally_notifying=formally notifying

_fraud=fraud

_interface_control_document=interface control document

_irregularities=irregularities

_notification=notification

_notify=notify

_notifying=notifying

_performance_of_the_contract=performance of the contract

_personnel=personnel

_pre-existing_material=pre-existing material

_pre-existing_materials=pre-existing materials

_pre-existing_right=pre-existing right

_pre-existing_rights=pre-existing rights

_professional_conflicting_interest=professional conflicting interest

_related_person=related person

_result=result

_results=results

_supplier_portal=supplier portal

1.Xnum=1

2.Xnum=2

3.Xnum=3

4.Xnum=4

Communicate.Xnum=5

6.Xnum=6

7.Xnum=7

Conf.Xnum=8

PrivateData.Xnum=9

10.Xnum=10

11.Xnum=11

12.Xnum=12

IPR.Xnum=13

ForceMajeure.Xnum=14

15.Xnum=15

16.Xnum=16

17.Xnum=17

18.Xnum=18

19.Xnum=19

20.Xnum=20

21.Xnum=21

22.Xnum=22

Note=The subsection references actually used - (Not all)

Communicate.1.Xnum={Communicate.Xnum}.1

6.3.Xnum={6.Xnum}.3

PrivateData.1.Xnum={PrivateData.Xnum}.1

PrivateData.2.Xnum={PrivateData.Xnum}.2

11.2.Xnum={11.Xnum}.2

IPR.2.Xnum={IPR.Xnum}.2

IPR.3.Xnum={IPR.Xnum}.3

IPR.4.Xnum={IPR.Xnum}.4

18.1.Xnum={18.Xnum}.1

20.1.Xnum={20.Xnum}.1

20.6.Xnum={20.Xnum}.6

20.7.Xnum={20.Xnum}.7

21.2.Xnum={21.Xnum}.2

22.2.Xnum={22.Xnum}.2

FtNt.1.Xref=1

FtNt.2.Xref=2

FtNt.3.Xref=3

FtNt.4.Xref=4

FtNt.5.Xref=5


text:
Update a domain mapping

```
kn domain update NAME
```

### Examples

```

  # Update a domain mappings 'hello.example.com' for Knative service 'hello'
  kn domain update hello.example.com --refFlags hello
```

### Options

```
  -h, --help               help for update
  -n, --namespace string   Specify the namespace to operate in.
      --ref string         Addressable target reference for Domain Mapping. You can specify a Knative service, a Knative route. Examples: '--ref' ksvc:hello' or simply '--ref hello' for a Knative service 'hello', '--ref' kroute:hello' for a Knative route 'hello'. '--ref ksvc:mysvc:mynamespace' for a Knative service 'mysvc' in another namespace 'mynamespace', If a prefix is not provided, it is considered as a Knative service in the current namespace. If referring to a Knative service in another namespace, 'ksvc:name:namespace' combination must be provided explicitly.
```

### Options inherited from parent commands

```
      --as string              username to impersonate for the operation
      --as-group stringArray   group to impersonate for the operation, this flag can be repeated to specify multiple groups
      --as-uid string          uid to impersonate for the operation
      --cluster string         name of the kubeconfig cluster to use
      --config string          kn configuration file (default: ~/.config/kn/config.yaml)
      --context string         name of the kubeconfig context to use
      --kubeconfig string      kubectl configuration file (default: ~/.kube/config)
      --log-http               log http traffic
```

### SEE ALSO

* [kn domain](kn_domain.md)	 - Manage domain mappings


text:
*   Status: **Ready**

Handles the visual representation of the controller, tracking the controller's
position in a similar manner as the `TrackHmdSystem` tracks the head.


text:
## Overview

This is an evolving repository for test programs
for the "osic1p" target of the cc65 C compiler.

## Quick Start

* Install the [srecord utility](http://srecord.sourceforge.net/), which is needed to convert cc65 object files to a format that can be uploaded via the OSI machine monitor.
* Clone the [cc65](https://github.com/cc65/cc65) and [this repository](https://github.com/smuehlst/cc65) side-by-side.
* Build the cc65 compiler.
* Build the test program(s) in the [src subdirectory](https://github.com/smuehlst/c1pctest/tree/master/src)
* The C1P object files are the *.c1p files.

The programs can be run on real machines or in the [C1Pjs JavaScript simulation
of the Challenger 1P](http://www.pcjs.org/docs/c1pjs/). The c1p target by
default links for machines with 32 kB RAM. Therefore the programs need to
be run in the
[OSI Challenger 1P (32Kb) with Disk Support](http://www.pcjs.org/devices/c1p/machine/32kb/)
machine.

The Makefile can also generate Kansas City Standard WAV files for
upload over the cassette port. For this a modified version of the Python
script kcs_encody.py by [David Beazley](http://www.dabeaz.com/py-kcs/index.html)
is used.

The [tools/win subdirectory](/tools/win) contains PowerShell scripts to upload files over
the serial port, for BASIC files and binary executables.


text:
from django.test import TestCase

from users.models import User
from recipes.models import Recipe

class RecipeTestCase(TestCase):
    def setUp(self):
        self.password1 = 'testpass1'
        self.password2 = 'testpass2'

        self.user1 = User.objects.create_user(
            'test1',
            'test1@test.com',
            self.password1)
        self.user2 = User.objects.create_user(
            'test2',
            'test2@test.com',
            self.password2)

        self.recipe1 = Recipe.objects.create(
            name='apple',
            user=self.user1,
            rating=Recipe.NOT_RATED,
            url='',
            description='')
        self.recipe1.tags.add('tag1', 'tag2')

        self.recipe2 = Recipe.objects.create(
            name='cake',
            user=self.user1,
            rating=Recipe.AWFUL,
            url='http://www.google.com/',
            description='')
        self.recipe2.tags.add('tag2', 'tag3')

        self.recipe3 = Recipe.objects.create(
            name='banana',
            user=self.user1,
            rating=Recipe.GOOD,
            url='',
            description='a test recipe')
        self.recipe3.tags.add('tag1', 'tag3')

        self.recipe4 = Recipe.objects.create(
            name='pie',
            user=self.user2,
            rating=Recipe.BAD,
            url='http://www.test.com/',
            description='')
        self.recipe4.tags.add('test', 'bad')

        self.recipe5 = Recipe.objects.create(
            name='chocolate',
            user=self.user2,
            rating=Recipe.AVERAGE,
            url='',
            description='an average recipe')
        self.recipe5.tags.add('avg')

        self.recipe6 = Recipe.objects.create(
            name='rice',
            user=self.user2,
            rating=Recipe.NOT_RATED,
            url='',
            description='')

        self.recipe7 = Recipe.objects.create(
            name='pasta',
            user=self.user2,
            rating=Recipe.GREAT,
            url='',
            description='great recipe!')
        self.recipe7.tags.add('dinner', 'great')

        self.recipe8 = Recipe.objects.create(
            name='ice cream',
            user=self.user2,
            rating=Recipe.NOT_RATED,
            url='',
            description='need to try')
        self.recipe8.tags.add('todo')

    def test_login_required(self):
        response = self.client.get('/recipes/', follow=True)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(
            response.redirect_chain[0],
            (u'http://testserver/accounts/login/?next=/recipes/', 302))

        response = self.client.get(
            '/recipes/view/' + self.recipe1.slug + '/', follow=True)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(len(response.redirect_chain), 1)
        self.assertEqual(
            response.redirect_chain[0],
            (u'http://testserver/accounts/login/?next=/recipes/view/' +
                self.recipe1.slug + '/', 302))

        response = self.client.get('/recipes/add/', follow=True)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(len(response.redirect_chain), 1)
        self.assertEqual(
            response.redirect_chain[0],
            (u'http://testserver/accounts/login/?next=/recipes/add/', 302))

        response = self.client.post('/recipes/add/', follow=True)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(len(response.redirect_chain), 1)
        self.assertEqual(
            response.redirect_chain[0],
            (u'http://testserver/accounts/login/?next=/recipes/add/', 302))

        response = self.client.get(
            '/recipes/edit/' + self.recipe2.slug + '/', follow=True)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(len(response.redirect_chain), 1)
        self.assertEqual(
            response.redirect_chain[0],
            (u'http://testserver/accounts/login/?next=/recipes/edit/' +
                self.recipe2.slug + '/', 302))

        response = self.client.post(
            '/recipes/edit/' + self.recipe2.slug + '/', follow=True)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(len(response.redirect_chain), 1)
        self.assertEqual(
            response.redirect_chain[0],
            (u'http://testserver/accounts/login/?next=/recipes/edit/' +
                self.recipe2.slug + '/', 302))

        response = self.client.get(
            '/recipes/delete/' + self.recipe2.slug + '/', follow=True)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(len(response.redirect_chain), 1)
        self.assertEqual(
            response.redirect_chain[0],
            (u'http://testserver/accounts/login/?next=/recipes/delete/' +
                self.recipe2.slug + '/', 302))

        response = self.client.post(
            '/recipes/delete/' + self.recipe2.slug + '/', follow=True)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(len(response.redirect_chain), 1)
        self.assertEqual(
            response.redirect_chain[0],
            (u'http://testserver/accounts/login/?next=/recipes/delete/' +
                self.recipe2.slug + '/', 302))

    def test_index_auth(self):
        self.assertEqual(
            self.client.login(
                username=self.user1.username,
                password=self.password1),
            True)
        response = self.client.get('/recipes/')
        self.assertEqual(response.status_code, 200)
        self.assertEqual(len(response.context['recipes']), 3)
        self.assertEqual(response.context['recipes'][0].name, 'apple')
        self.assertEqual(response.context['recipes'][1].name, 'banana')
        self.assertEqual(response.context['recipes'][2].name, 'cake')
        self.client.logout()

    def test_view(self):
        self.client.login(
            username=self.user2.username, password=self.password2)
        response = self.client.get('/recipes/view/' + self.recipe4.slug + '/')
        self.assertEqual(response.status_code, 200)
        self.assertEqual(response.context['recipe'].name, self.recipe4.name)
        self.assertEqual(
            set(response.context['recipe'].tags.names()),
            set(self.recipe4.tags.names()))
        self.client.logout()

    def test_update(self):
        self.client.login(
            username=self.user2.username, password=self.password2)
        response = self.client.get('/recipes/edit/' + self.recipe4.slug + '/')
        self.assertEqual(response.status_code, 200)
        self.assertEqual(response.context['object'].name, self.recipe4.name)
        self.assertEqual(
            set(response.context['object'].tags.names()),
            set(self.recipe4.tags.names()))
        response = self.client.post(
            '/recipes/edit/' + self.recipe4.slug + '/',
            {'rating': Recipe.AVERAGE, 'url': '', 'description': 'new',
                'tags': 'newtag1, newtag2'}, follow=True)
        self.assertEqual(
            response.redirect_chain[0],
            (u'http://testserver/recipes/', 302))
        updated_recipe = Recipe.objects.get(slug=self.recipe4.slug)
        self.assertEqual(updated_recipe.rating, Recipe.AVERAGE)
        self.assertEqual(updated_recipe.url, '')
        self.assertEqual(updated_recipe.description, 'new')
        self.assertEqual(
            set(updated_recipe.tags.names()),
            set(['newtag1', 'newtag2']))
        self.client.logout()

    def test_create(self):
        self.client.login(
            username=self.user1.username, password=self.password1)
        response = self.client.get('/recipes/add/')
        self.assertEqual(response.status_code, 200)
        response = self.client.post(
            '/recipes/add/',
            {'name': 'another test recipe', 'rating': Recipe.GREAT,
                'url': 'http://www.wonkabar.com/', 'description': 'foobar',
                'tags': 'scrumdiddlyumptious'}, follow=True)
        self.assertEqual(
            response.redirect_chain[0],
            (u'http://testserver/recipes/', 302))
        created_recipe = Recipe.objects.get(slug='another-test-recipe')
        self.assertEqual(created_recipe.rating, Recipe.GREAT)
        self.assertEqual(created_recipe.url, 'http://www.wonkabar.com/')
        self.assertEqual(created_recipe.description, 'foobar')
        self.assertEqual(
            set(created_recipe.tags.names()),
            set(['scrumdiddlyumptious']))
        self.client.logout()

    def test_delete(self):
        self.client.login(
            username=self.user1.username, password=self.password1)
        response = self.client.get(
            '/recipes/delete/' + self.recipe1.slug + '/')
        self.assertEqual(response.status_code, 200)
        response = self.client.post(
            '/recipes/delete/' + self.recipe1.slug + '/',
            follow=True)
        self.assertEqual(
            response.redirect_chain[0],
            (u'http://testserver/recipes/', 302))
        with self.assertRaises(Recipe.DoesNotExist):
            Recipe.objects.get(slug=self.recipe1.slug)
        self.client.logout()