text:
package org.wso2.andes.server.configuration;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.apache.commons.configuration.CompositeConfiguration;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.wso2.andes.exchange.ExchangeDefaults;
import org.wso2.andes.framing.AMQShortString;
import org.wso2.andes.server.binding.Binding;
import org.wso2.andes.server.configuration.plugins.ConfigurationPlugin;
import org.wso2.andes.server.queue.AMQQueue;
import org.wso2.andes.server.registry.ApplicationRegistry;
import org.wso2.andes.server.store.MemoryMessageStore;

public class VirtualHostConfiguration extends ConfigurationPlugin {
    private String _name;
    private Map<String, QueueConfiguration> _queues = new HashMap<String, QueueConfiguration>();
    private Map<String, ExchangeConfiguration> _exchanges = new HashMap<String,
            ExchangeConfiguration>();

    public VirtualHostConfiguration(String name, Configuration config)
            throws ConfigurationException {
        _name = name;
        setConfiguration(config);
    }

    /**
     * Apply the given configuration to this VirtualHostConfiguration
     *
     * @param config
     *         the config to apply
     * @throws ConfigurationException
     *         if a problem occurs with configuration
     */
    public void setConfiguration(Configuration config) throws ConfigurationException {
        setConfiguration("virtualhosts.virtualhost", config);

        Iterator i = getListValue("queues.queue.name").iterator();

        while (i.hasNext()) {
            String queueName = (String) i.next();
            _queues.put(queueName, new QueueConfiguration(queueName, this));
        }

        i = getListValue("exchanges.exchange.name").iterator();
        int count = 0;
        while (i.hasNext()) {
            CompositeConfiguration mungedConf = new CompositeConfiguration();
            mungedConf.addConfiguration(config.subset("exchanges.exchange(" + count++ + ")"));
            mungedConf.addConfiguration(_configuration.subset("exchanges"));
            String exchName = (String) i.next();
            _exchanges.put(exchName, new ExchangeConfiguration(exchName, mungedConf));
        }
    }

    public String getName() {
        return _name;
    }

    public long getHousekeepingExpiredMessageCheckPeriod() {
        return getLongValue("housekeeping.expiredMessageCheckPeriod",
                            ApplicationRegistry.getInstance().getConfiguration()
                                               .getHousekeepingCheckPeriod());
    }

    public String getAuthenticationDatabase() {
        return getStringValue("security.authentication.name");
    }

    public List getCustomExchanges() {
        return getListValue("custom-exchanges.class-name");
    }

    public Configuration getStoreConfiguration() {
        return _configuration.subset("store");
    }

    public String getMessageStoreClass() {
        return getStringValue("store.class", MemoryMessageStore.class.getName());
    }

    public void setMessageStoreClass(String storeClass) {
        _configuration.setProperty("store.class", storeClass);
    }

    public List getExchanges() {
        return getListValue("exchanges.exchange.name");
    }

    public String[] getQueueNames() {
        return _queues.keySet().toArray(new String[_queues.size()]);
    }

    public ExchangeConfiguration getExchangeConfiguration(String exchangeName) {
        return _exchanges.get(exchangeName);
    }

    public QueueConfiguration getQueueConfiguration(String queueName) {
        // We might be asked for the config for a queue we don't know about,
        // such as one that's been dynamically created. Those get the defaults by default.
        if (_queues.containsKey(queueName)) {
            return _queues.get(queueName);
        } else {
            try {
                return new QueueConfiguration(queueName, this);
            } catch (ConfigurationException ignored) {
                // The configuration is empty so there can't be an error.
                return null;
            }
        }
    }

    public ConfigurationPlugin getQueueConfiguration(AMQQueue queue) {
        VirtualHostConfiguration hostConfig = queue.getVirtualHost().getConfiguration();

        // First check if we have a named queue configuration (the easy case)
        if (Arrays.asList(hostConfig.getQueueNames()).contains(queue.getName())) {
            return null;
        }

        // We don't have an explicit queue config we must find out what we need.
        ArrayList<Binding> bindings = new ArrayList<Binding>(queue.getBindings());

        List<AMQShortString> exchangeClasses = new ArrayList<AMQShortString>(bindings.size());

        //Remove default exchange
        for (int index = 0; index < bindings.size(); index++) {
            // Ignore the DEFAULT Exchange binding
            if (bindings.get(index).getExchange().getNameShortString()
                        .equals(ExchangeDefaults.DEFAULT_EXCHANGE_NAME)) {
                bindings.remove(index);
            } else {
                exchangeClasses.add(bindings.get(index).getExchange().getType().getName());

                if (exchangeClasses.size() > 1) {
                    // If we have more than 1 class of exchange then we can only use the global
                    // queue configuration.
                    // and this will be returned from the default getQueueConfiguration
                    return null;
                }
            }
        }

        // If we are just bound the the default exchange then use the default.
        if (bindings.isEmpty()) {
            return null;
        }

        // If we are bound to only one type of exchange then we are going
        // to have to resolve the configuration for that exchange.

        String exchangeName = bindings.get(0).getExchange().getType().getName().toString();

        // Lookup a Configuration handler for this Exchange.

        // Build the expected class name. <Exchangename>sConfiguration
        // i.e. TopicConfiguration or HeadersConfiguration
        String exchangeClass = "org.wso2.andes.server.configuration."
                               + exchangeName.substring(0, 1).toUpperCase()
                               + exchangeName.substring(1) + "Configuration";

        ExchangeConfigurationPlugin exchangeConfiguration
                = (ExchangeConfigurationPlugin) queue.getVirtualHost().getConfiguration()
                                                     .getConfiguration(exchangeClass);

        // now need to perform the queue-topic-topics-queues magic.
        // So make a new ConfigurationObject that will hold all the configuration for this queue.
        ConfigurationPlugin queueConfig = new QueueConfiguration.QueueConfig();

        // Initialise the queue with any Global values we may have
        PropertiesConfiguration newQueueConfig = new PropertiesConfiguration();
        newQueueConfig.setProperty("name", queue.getName());

        try {
            //Set the queue name
            CompositeConfiguration mungedConf = new CompositeConfiguration();
            //Set the queue name
            mungedConf.addConfiguration(newQueueConfig);
            //Set the global queue configuration
            mungedConf.addConfiguration(getConfig().subset("queues"));

            // Set configuration
            queueConfig.setConfiguration("virtualhosts.virtualhost.queues", mungedConf);
        } catch (ConfigurationException e) {
            // This will not occur as queues only require a name.
            _logger.error("QueueConfiguration requirements have changed.", e);
        }

        // Merge any configuration the Exchange wishes to apply
        if (exchangeConfiguration != null) {
            queueConfig.addConfiguration(exchangeConfiguration.getConfiguration(queue));
        }

        //Finally merge in any specific queue configuration we have.
        if (_queues.containsKey(queue.getName())) {
            queueConfig.addConfiguration(_queues.get(queue.getName()));
        }

        return queueConfig;
    }

    public long getMemoryUsageMaximum() {
        return getLongValue("queues.maximumMemoryUsage");
    }

    public long getMemoryUsageMinimum() {
        return getLongValue("queues.minimumMemoryUsage");
    }

    public int getMaximumMessageAge() {
        return getIntValue("queues.maximumMessageAge");
    }

    public Long getMaximumQueueDepth() {
        return getLongValue("queues.maximumQueueDepth");
    }

    public Long getMaximumMessageSize() {
        return getLongValue("queues.maximumMessageSize");
    }

    public Long getMaximumMessageCount() {
        return getLongValue("queues.maximumMessageCount");
    }

    public Long getMinimumAlertRepeatGap() {
        return getLongValue("queues.minimumAlertRepeatGap");
    }

    public long getCapacity() {
        return getLongValue("queues.capacity");
    }

    public long getFlowResumeCapacity() {
        return getLongValue("queues.flowResumeCapacity", getCapacity());
    }

    public String[] getElementsProcessed() {
        return new String[]{"queues", "exchanges", "custom-exchanges", "store", "housekeeping"};

    }

    @Override
    public void validateConfiguration() throws ConfigurationException {
        // QPID-3249.  Support for specifying authentication name at vhost level is no longer
        // supported.
        if (getListValue("security.authentication.name").size() > 0) {
            String message = "Validation error : security/authentication/name is no longer a " +
                             "supported element within the configuration xml."
                             + " It appears in virtual host definition : " + _name;
            throw new ConfigurationException(message);
        }
    }

    public int getHouseKeepingThreadCount() {
        return getIntValue("housekeeping.poolSize", Runtime.getRuntime().availableProcessors());
    }

    public long getTransactionTimeoutOpenWarn() {
        return getLongValue("transactionTimeout.openWarn", 0L);
    }

    public long getTransactionTimeoutOpenClose() {
        return getLongValue("transactionTimeout.openClose", 0L);
    }

    public long getTransactionTimeoutIdleWarn() {
        return getLongValue("transactionTimeout.idleWarn", 0L);
    }

    public long getTransactionTimeoutIdleClose() {
        return getLongValue("transactionTimeout.idleClose", 0L);
    }
}


text:
package edu.cmu.ri.airboat.server;

import com.google.code.microlog4android.LoggerFactory;

import java.util.Timer;
import java.util.TimerTask;

import edu.cmu.ri.crw.VehicleController;
import edu.cmu.ri.crw.VehicleServer;
import edu.cmu.ri.crw.data.Twist;
import edu.cmu.ri.crw.data.UtmPose;
import robotutils.Pose3D;

/**
 * A library of available navigation controllers that are accessible through the
 * high-level API.
 *
 * @author pkv
 * @author kss
 *
 */
public enum AirboatController {

	/**
	 * This is the implementation of Yunde's controller. This controller also updates the velocities twist as done in POINT_AND_SHOOT,
	 * but instead of velocities, it passes in servo commands to the thruster and rudder. The process of converting desired velocities
	 * to thrust and angle commands used to be done in the Arduino but has been moved here. The thruster and rudder commands will be
	 * at indexes 0 and 5 respectively.
	 * UPDATE: renamed POINT_AND_SHOOT to be compatible with all code.
	 */
	POINT_AND_SHOOT(new VehicleController() {
		// variable for monitoring previous destination angle for error calculation
		private double prev_angle_destination = 0;

		// variables for buffer and integration term
		final int BUFFER_SIZE = 100;
		double[] buffer = new double[BUFFER_SIZE];
		int bIndex = 0;
		double bSum = 0;

		@Override
		public void update(VehicleServer server, double dt) {
			Twist twist = new Twist();

			// Get the position of the vehicle
			UtmPose state = server.getPose();
			Pose3D pose = state.pose;

			// Get the current waypoint, or return if there are none
			UtmPose[] waypoints = server.getWaypoints();
			if (waypoints == null || waypoints.length <= 0) {
				server.setVelocity(twist);
				return;
			}
			Pose3D waypoint = waypoints[0].pose;

			double distanceSq = planarDistanceSq(pose, waypoint);

			if (distanceSq <= 25)
			{
				// if reached the target, reset the buffer and previous angle
				bIndex = 0;
				bSum = 0;
				buffer = new double[BUFFER_SIZE];
				prev_angle_destination = 0;

				// If we are "at" the destination, de-queue current waypoint
				UtmPose[] queuedWaypoints = new UtmPose[waypoints.length - 1];
				System.arraycopy(waypoints, 1, queuedWaypoints, 0,
						queuedWaypoints.length);
				server.startWaypoints(queuedWaypoints,
						AirboatController.POINT_AND_SHOOT.toString());
			}
			else
			{
				// ANGLE CONTROL SEGMENT

				// find destination angle between boat and waypoint position
				double angle_destination = angleBetween(pose, waypoint);

				// use compass information to get heading of the boat
				double angle_boat = pose.getRotation().toYaw();
				double angle_between = normalizeAngle(angle_destination - angle_boat);

				// use gyro information from arduino to get rotation rate of heading
				double[] _gyroReadings = ((AirboatImpl) server).getGyro();
				double drz = _gyroReadings[2];

				// use previous data to get rate of change of destination angle
				double angle_destination_change = (angle_destination - prev_angle_destination) / dt;
				double error = angle_between;
				bIndex++;
				if (bIndex == BUFFER_SIZE)
					bIndex = 0;
				bSum -= buffer[bIndex];
				bSum += error;
				buffer[bIndex] = error;

				// Define PID constants and boundary pos constants
				AirboatImpl server_impl = (AirboatImpl) server;
				double[] rudder_pids = server_impl.getGains(5);

				double pos = rudder_pids[0]*(angle_between) + rudder_pids[2]*(angle_destination_change - drz) + rudder_pids[1]*bSum;

				// Ensure values are within bounds
				if (pos < -1.0)
					pos = -1.0;
				else if (pos > 1.0)
					pos = 1.0;

				// THRUST CONTROL SEGMENT
				double[] thrust_pids = server_impl.getGains(0);
				double thrust = 1.0 * thrust_pids[0]; // Use a normalized thrust value of 1.0.

				// update twist
				twist.dx(thrust);
				twist.drz(pos);
				// log relevant variables
				/*
				logger_osman.info("Waypoint: " + waypoint);
				logger_osman.info("DEBUG: " + distanceSq + " " + angle_destination + " " + angle_boat + " " + drz + " " +
						prev_angle_destination + " " + angle_destination_change + " " + pos + " " + thrust
						+ " " + bSum + " " + rudder_pids[0] + " " + rudder_pids[1] + " " + rudder_pids[2]);
				*/
				// update angle error
				prev_angle_destination = angle_destination;
				// Set the desired velocity
				server.setVelocity(twist);

			}
		}
	}),
	/**
	 * This controller simply cuts all power to the boat, letting it drift
	 * freely. It will not attempt to hold position or steer the boat in any
	 * way, and completely ignores the waypoint.
	 */
	STOP(new VehicleController() {
		@Override
		public void update(VehicleServer server, double dt) {
			server.setVelocity(new Twist());

		}
	}),
	PRIMITIVES(new VehicleController() {
		private final com.google.code.microlog4android.Logger logger = LoggerFactory
				.getLogger();
		private boolean log_boolean = true;
		@Override
		public void update(final VehicleServer server, double dt) {
			server.setVelocity(new Twist(AirboatImpl.DEFAULT_TWIST));

			final double[] first = new double[3]; // angle, time, thrust
			first[0] = server.getWaypoints()[0].pose.getX();
			first[1] = server.getWaypoints()[0].pose.getY() * 1000; // convert to ms
			first[2] = server.getWaypoints()[0].pose.getZ();

			final double[] second = new double[3];
			second[0] = server.getWaypoints()[1].pose.getX();
			second[1] = server.getWaypoints()[1].pose.getY() * 1000; // convert to ms
			second[2] = server.getWaypoints()[1].pose.getZ();

			final double[] third = new double[3]; // angle, time, thrust
			third[0] = server.getWaypoints()[2].pose.getX();
			third[1] = server.getWaypoints()[2].pose.getY() * 1000; // convert to ms
			third[2] = server.getWaypoints()[2].pose.getZ();

			final double[] fourth = new double[3];
			fourth[0] = server.getWaypoints()[3].pose.getX();
			fourth[1] = server.getWaypoints()[3].pose.getY() * 1000; // convert to ms
			fourth[2] = server.getWaypoints()[3].pose.getZ();

			if (first[1] < 0 || second[1] < 0 || third[1] < 0 || fourth[1] < 0)
			{
				logger.info("INVALID INPUT: DEFAULT ALL TO 5 SEC");
				first[1] = 5000; second[1] = 5000; third[1] = 5000; fourth[1] = 5000;
			}

			final Timer t = new Timer();
			final Timer log = new Timer();

			TimerTask first_step = new TimerTask() {
				@Override
				public void run() {
					// TODO Auto-generated method stub
					if (log_boolean) { logger.info("START"); log_boolean = false;}
					server.setVelocity(new Twist(first[2], 0, 0, 0, 0, first[0]));
					// when go testing, use AirboatImpl.CONST_THRUST
				}
			};
			TimerTask second_step = new TimerTask() {
				@Override
				public void run() {
					// TODO Auto-generated method stub
					server.setVelocity(new Twist(second[2], 0, 0, 0, 0, second[0]));

				}
			};
			TimerTask third_step = new TimerTask() {
				@Override
				public void run() {
					// TODO Auto-generated method stub
					server.setVelocity(new Twist(third[2], 0, 0, 0, 0, third[0]));

				}
			};
			TimerTask fourth_step = new TimerTask() {
				@Override
				public void run() {
					// TODO Auto-generated method stub
					server.setVelocity(new Twist(fourth[2], 0, 0, 0, 0, fourth[0]));

				}
			};
			TimerTask close = new TimerTask() {

				@Override
				public void run() {
					// TODO Auto-generated method stub
					if (!log_boolean) {logger.info("END"); log_boolean = true;}
					server.setVelocity(new Twist(500, 0, 0, 0, 0, 90));
					server.startWaypoints(new UtmPose[0], "POINT_AND_SHOOT");
					log.purge();
					log.cancel();
					t.purge();
					t.cancel();
				}
			};
			TimerTask logging = new TimerTask() {

				@Override
				public void run() {
					// TODO Auto-generated method stub
					// retrieve state information
					AirboatImpl server_impl = (AirboatImpl) server;
					double yawVel = server_impl.getGyro()[2];
					Pose3D pose = server_impl.getPose().pose;
					double xPos = pose.getX();
					double yPos = pose.getY();
					double heading = pose.getRotation().toYaw();
					double rudder = server_impl.getVelocity().drz();
					double thrust = server_impl.getVelocity().dx();

					logger.info("PROCESS: " + " " + rudder + " " + heading + " " + yawVel
							+ " " + xPos + " " + yPos + " " + thrust);
				}
			};

			t.schedule(first_step, 0);
			t.schedule(second_step, (long) first[1]);
			t.schedule(third_step, (long) (first[1] + second[1]));
			t.schedule(fourth_step, (long) (first[1] + second[1] + third[1]));
			t.schedule(close, (long) (first[1] + second[1] + third[1] + fourth[1]));
			log.scheduleAtFixedRate(logging, 0, 200); // 200 ms logging rate
		}
	}),

	/**
	 * This controller shoots a picture only if it moves to a significantly
	 * different pose
	 */
	SHOOT_ON_MOVE(new VehicleController() {
		UtmPose lastPose = new UtmPose();

		@Override
		public void update(VehicleServer server, double dt) {

			Twist twist = new Twist();

			// Get the position of the vehicle
			UtmPose state = server.getPose();
			Pose3D pose = state.pose;

			// Get the current waypoint, or return if there are none
			UtmPose[] waypoints = server.getWaypoints();
			if (waypoints == null || waypoints.length <= 0) {
				server.setVelocity(twist);
				return;
			}
			Pose3D waypoint = waypoints[0].pose;

			// TODO: handle different UTM zones!
			// Compute the distance and angle to the waypoint
			double distanceSq = planarDistanceSq(pose, waypoint);
			double angle = angleBetween(pose, waypoint)
					- pose.getRotation().toYaw();
			angle = normalizeAngle(angle);

			// Choose driving behavior depending on direction and where we are
			if (Math.abs(angle) > 1.0) {
				// If we are facing away, turn around first
				twist.dx(0.5);
				twist.drz(Math.max(Math.min(angle / 1.0, 1.0), -1.0));
			} else if (distanceSq >= 9.0) {
				// If we are far away, drive forward and turn
				twist.dx(Math.min(distanceSq / 10.0, 1.0));
				twist.drz(Math.max(Math.min(angle / 10.0, 1.0), -1.0));
			}

			// Set the desired velocity
			server.setVelocity(twist);

			System.out.println(isNovel(pose, waypoint, PlanningMethod.SIMPLE));
			// First check if we are actually set to capture
			if (lastPose == null
					|| isNovel(pose, waypoint, PlanningMethod.SIMPLE) > 0.8) {
				lastPose.pose = pose.clone();
				System.out.println("Should Capture now!!!!!");
				server.startCamera(1, 0.0, 640, 480);
			}

			// TODO: add next waypoint functionality back in!!
		}

		/**
		 * Takes a pose and determines whether the image to be taken is novel or
		 * not
		 *
		 * @param pose
		 *            The current pose
		 * @param waypoint
		 *            The current waypoint
		 * @param method
		 *            The Planning Method to be implemented
		 * @return A weight of novelty between 0 and 1
		 */
		double isNovel(Pose3D pose, Pose3D waypoint, PlanningMethod method) {

			final double CAMERA_AOV = Math.PI / 180.0f * 30; // Assuming that
																// the angle of
																// view of the
																// camera is 30
																// Degrees
			final double OVERLAP_RATIO = 0.8f;
			final double EFFECTIVE_DISTANCE = 10.0; // The effective distance
													// till which the camera
													// resolution/detection is
													// trusted
			double novelty = 0.0;
			switch (method) {
			case SIMPLE:
				// To simply calculate if the new pose is different
				/*
				 * Capture if new pose is different as per a. Change in yaw b.
				 * Change in position
				 */

				// No need to worry about the waypoint, inconsequential
				double angle = Math.abs(pose.getRotation().toYaw()
						- lastPose.pose.getRotation().toYaw());
				double distance = Math
						.sqrt((lastPose.pose.getX() - pose.getX())
								* (lastPose.pose.getX() - pose.getX())
								+ (lastPose.pose.getY() - pose.getY())
								* (lastPose.pose.getY() - pose.getY()));

				// Assign half weight to yaw, and half to distance
				if (angle >= CAMERA_AOV * OVERLAP_RATIO) {
					// i.e. if the current yaw has changed more than the
					// previous orientation by greater than 30 degrees * overlap
					// factor

					// This is because ANY yaw greater than the angle of view
					// will have completely new info (Think sectors)
					novelty = 0.5 * angle / (CAMERA_AOV * OVERLAP_RATIO);

					// Assuming that the zone of overlap is not useful
					// information
				}

				novelty += (distance / EFFECTIVE_DISTANCE) * 0.5;

				break;
			case GEOMETRIC:
				throw new UnsupportedOperationException("Not implemented Yet!");

			}
			return novelty;
		}

	});

	public enum PlanningMethod {
		SIMPLE, GEOMETRIC
	}

	/**
	 * The controller implementation associated with this library name.
	 */
	public final VehicleController controller;

	/**
	 * Instantiates a library entry with the specified controller.
	 *
	 * @param controller
	 *            the controller to be used by this entry.
	 */
	AirboatController(VehicleController controller) {
		this.controller = controller;
	}

	/**
	 * Takes an angle and shifts it to be in the range -Pi to Pi.
	 *
	 * @param angle
	 *            an angle in radians
	 * @return the same angle as given, normalized to the range -Pi to Pi.
	 */
	public static double normalizeAngle(double angle) {
		while (angle > Math.PI)
			angle -= 2 * Math.PI;
		while (angle < -Math.PI)
			angle += 2 * Math.PI;
		return angle;
	}

	/**
	 * Computes the squared XY-planar Euclidean distance between two points.
	 * Using the squared distance is cheaper (it avoid a sqrt), and for constant
	 * comparisons, it makes no difference (just square the constant).
	 *
	 * @param a
	 *            the first pose
	 * @param b
	 *            the second pose
	 * @return the XY-planar Euclidean distance
	 */
	public static double planarDistanceSq(Pose3D a, Pose3D b) {
		double dx = a.getX() - b.getX();
		double dy = a.getY() - b.getY();
		return dx * dx + dy * dy;
	}

	/**
	 * Computes a direction vector from a source pose to a destination pose, as
	 * projected onto the XY-plane. Returns an angle representing the direction
	 * in the XY-plane to take if starting at the source pose to reach the
	 * destination pose.
	 *
	 * @param src
	 *            the source (starting) pose
	 * @param dest
	 *            the destination (final) pose
	 * @return an angle in the XY-plane (around +Z-axis) to get to destination
	 */
	public static double angleBetween(Pose3D src, Pose3D dest) {
		return Math.atan2((dest.getY() - src.getY()),
				(dest.getX() - src.getX()));
	}
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

let Stream;
let React;
let ReactDOMFizzServer;

describe('ReactDOMFizzServer', () => {
  beforeEach(() => {
    jest.resetModules();
    React = require('react');
    ReactDOMFizzServer = require('react-dom/unstable-fizz');
    Stream = require('stream');
  });

  function getTestWritable() {
    const writable = new Stream.PassThrough();
    writable.setEncoding('utf8');
    writable.result = '';
    writable.on('data', chunk => (writable.result += chunk));
    return writable;
  }

  it('should call pipeToNodeWritable', () => {
    const writable = getTestWritable();
    ReactDOMFizzServer.pipeToNodeWritable(
hello world
, writable);
    jest.runAllTimers();
    expect(writable.result).toBe('
hello world
');
  });
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<viewport window="true">
    <customformpanel id="form" title="分配TMK" saveUrl="/sendToTmkSave.json" load="true" loadUrl="/sendToTmkLoad.json" inwindow="true">
        <element field="mother" type="text" validate="" desc="母亲姓名" readonly="true"/>
        <element field="motherPhone" type="text" validate="" desc="母亲电话" readonly="true"/>
        <element field="father" type="text" validate="" desc="父亲姓名" readonly="true"/>
        <element field="fatherPhone" type="text" validate="" desc="父亲电话" readonly="true"/>
        <element field="homePhone" type="text" validate="" desc="家庭电话" readonly="true"/>
        <element field="child" type="text" validate="" desc="家庭电话" readonly="true"/>
        <element field="centerName" type="text" validate="" desc="所属中心" readonly="true"/>
        <element field="tcid" type="hidden" validate="" desc=""/>
        <element field="employeeId" type="remoteSelect" url="/employeeListByRoleId.json?id=11" valueField="userId" descField="reallyName" desc="分配TMK"/>
    </customformpanel>
</viewport>


text:
************
Installation
************

Generic requirements
====================

* Python 2.6 or later, 3.2 or later, PyPy 2.0 or later. It is the only
  non-optional requirement.
* C compiler. Required to build powerline client on linux. If it is not present
  then powerline will fall back to shell script or python client.
* ``socat`` program. Required for shell variant of client which runs a bit
  faster than python version of the client, but still slower than C version.
* ``psutil`` python package. Required for some segments like cpu_percent. Some
  segments have linux-only fallbacks for ``psutil`` functionality.
* ``mercurial`` python package (note: *not* standalone executable). Required to
  work with mercurial repositories.
* ``pygit2`` python package or ``git`` executable. Required to work with ``git``
  repositories.
* ``bzr`` python package (note: *not* standalone executable). Required to work
  with bazaar repositories.
* ``pyuv`` python package. Required for :ref:`libuv-based watcher
  <config-common-watcher>` to work.
* ``i3-py``, `available on github <https://github.com/ziberna/i3-py>`_. Required
  for i3wm bindings and segments.

.. note::
    Until mercurial and bazaar support Python-3 or PyPy powerline will not
    support repository information when running in these interpreters.

Pip installation
================

This project is currently unavailable from PyPI due to a naming conflict with an
unrelated project, thus you will have to use the following command to install
powerline with ``pip``:

.. code-block:: sh

    pip install --user git+git://github.com/Lokaltog/powerline

. You may also choose to clone powerline repository somewhere and use

.. code-block:: sh

    pip install -e --user {path_to_powerline}

, but note that in this case ``pip`` will not install ``powerline`` executable
and you will have to do something like

.. code-block:: sh

    ln -s {path_to_powerline}/scripts/powerline ~/.local/bin

(:file:`~/.local/bin` should be replaced with some path present in ``$PATH``).

.. note::
    If your ISP blocks git protocol for some reason github also provides ``ssh``
    (``git+ssh://git@github.com/Lokaltog/powerline``) and ``https``
    (``git+https://github.com/Lokaltog/powerline``) protocols. ``git`` protocol
    should be the fastest, but least secure one though.

To install release version uploaded to PyPI use

.. code-block:: sh

   pip install powerline-status

Fonts installation
==================

Powerline uses several special glyphs to get the arrow effect and some custom
symbols for developers. This requires that you either have a symbol font or
a patched font on your system. Your terminal emulator must also support either
patched fonts or fontconfig for Powerline to work properly.

You can also enable :ref:`24-bit color support <config-common-term_truecolor>`
if your terminal emulator supports it (see :ref:`the terminal emulator support
matrix <usage-terminal-emulators>`).

There are basically two ways to get powerline glyphs displayed: use
:file:`PowerlineSymbols.otf` font as a fallback for one of the existing fonts or
install a patched font.

.. _installation-patched-fonts:

Patched fonts
-------------

This method is the fallback method and works for every terminal, with the
exception of :ref:`rxvt-unicode <tips-and-tricks-urxvt>`.

Download the font of your choice from `powerline-fonts`_. If you can't find
your preferred font in the `powerline-fonts`_ repo, you'll have to patch your
own font instead.

.. _powerline-fonts: https://github.com/Lokaltog/powerline-fonts

After downloading this font refer to platform-specific instructions.

Installation on various platforms
=================================

.. toctree::

   Linux <installation/linux>
   OS X <installation/osx>


text:
require 'ncc/client'
require 'noms/client/version'
require 'spec_helper'

describe NCC::Client do
    before(:all) do
        init_test
        NCC::Client.mock! nil
    end

    context "initializing" do

        it "creates an NCC::Client object" do
            ncc = NCC::Client.new $opt
            expect(ncc).to be_an_instance_of NCC::Client
        end

    end

    describe '#clouds' do

        before(:each) do
            @ncc = NCC::Client.new $opt
            # Necessary to exercise mock--should be abstracted?
            @ncc.do_request :PUT => '/clouds/os0', :body => {
                'name' => 'os0',
                'status' => 'ok',
                'provider' => 'openstack',
                'service' => 'Fog::Compute::OpenStack::Mock'
            }
        end

        it "returns a list of cloud objects" do
            result = @ncc.clouds
            expect(result.size).to eq(1)
            expect(result.first['name']).to eq('os0')
        end

        it "returns a specific cloud object" do
            result = @ncc.clouds('os0')
            expect(result).to have_key 'provider'
            expect(result['provider']).to eq 'openstack'
        end

    end

    describe '#info' do
        before(:each) do
            @ncc = NCC::Client.new $opt
            @ncc.do_request :PUT => '', :body => {
                'version' => NOMS::Client::VERSION
            }
        end

        it "returns version info" do
            info = @ncc.info
            expect(info).to have_key 'version'
            expect(info['version']).to eq NOMS::Client::VERSION
        end
    end

    describe '#console' do
        before(:each) do
            @ncc = NCC::Client.new $opt
            @ncc.do_request :PUT => 'clouds/os0/instances/1', :body => {
                'name' => 'testinst1.local',
                'id' => '1',
                'role' => [ ],
                'status' => 'active',
                'size' => 'm1.small',
                'image' => 'deb6',
                'host' => 'ostack01.local',
                'ip_address' => '127.0.0.1'
            }
            @ncc.do_request :PUT => 'clouds/os0/instances/1/console', :body => {
                'url' => 'vnc://ostack01:5959'
            }
        end

        it "returns a console URL" do
            console = @ncc.console('os0', '1')
            expect(console).to have_key 'url'
            expect(console['url']).to eq 'vnc://ostack01:5959'
        end
    end

end


text:
/*************************************************************************
 *
 * INFIVERVE TECHNOLOGIES PTE LIMITED CONFIDENTIAL
 * __________________
 *
 * (C) INFIVERVE TECHNOLOGIES PTE LIMITED, SINGAPORE
 * All Rights Reserved.
 * Product / Project: Flint IT Automation Platform
 * NOTICE:  All information contained herein is, and remains
 * the property of INFIVERVE TECHNOLOGIES PTE LIMITED.
 * The intellectual and technical concepts contained
 * herein are proprietary to INFIVERVE TECHNOLOGIES PTE LIMITED.
 * Dissemination of this information or any form of reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from INFIVERVE TECHNOLOGIES PTE LIMITED, SINGAPORE.
 */

//Starting execution of flintbit
log.trace("Started executing 'flint-util:http:operation:workflow:post.js'");

//method
method = "post";

input_clone = JSON.parse(input); //For checking purposes

//Connector name - mandatory
connector_name = "http";
connector_call = call.connector(connector_name);
log.info("Connector Name: " + connector_name);

//URL - mandatory
if (input_clone.hasOwnProperty("url")) {
    url = input.get("url");
    if (url != null || url != "") {
        connector_call.set("url", url);
        log.info("URL: " + url);
    }
    else {
        log.error("URL is null or empty string.");
    }
}
else {
    log.error("'url' key not given in input JSON");
}

//Body - mandatory
if (input_clone.hasOwnProperty("body")) {
    body = input.get("body");
    if (body != null || body != "") {
        connector_call.set("body", body);
        log.info("Body: " + body);
    }
    else {
        log.error("Body is null or empty string.");
    }
}
else {
    log.error("'body' key not given in input JSON");
}

//Headers - not mandatory
if (input_clone.hasOwnProperty("headers")) {
    headers = input.get("headers");
    // Headers array
    if (headers != null || headers != "") {
        if (typeof headers == "object") {
            log.trace("Headers is an array")
            log.trace(headers)
            connector_call.set("headers", headers);

            // Multiple Headers
        } else if (headers.match(',')) {
            log.trace("Removing spaces if any: " + headers)
            log.trace("Multiple headers are given")
            headers = headers.split(',')
            for (index in headers) {
                log.trace("=============>> " + headers[index].indexOf('Authorization') >= 0)
                if (headers[index].indexOf('Authorization') >= 0) {
                    log.trace("Authorization header is >>>>>>> " + headers[index])

                } else {
                    headers[index].replace(/ /g, '')
                    log.trace('Removing whitespaces  >>> ' + headers)
                }
            }

            connector_call.set("headers", headers);
            log.info("Headers: " + headers);
            log.info("Type of header is "+typeof headers)
        } else {
            // Single header
            log.info("One header is given: " + headers)
            // Single headers
            if (headers.indexOf('Authorization') >= 0) {
                log.trace("Single header: Authorization is given")
                connector_call.set("headers", headers);
            } else {
                headers = headers.replace(/ /g, '')
                connector_call.set("headers", headers);
            }
        }
    } else {
        log.trace("Headers are empty or null")
    }
}

//Is Proxy - not mandatory
if (input_clone.hasOwnProperty("is_proxy")) {
    is_proxy = input.get("is_proxy");
    if (is_proxy != null & is_proxy != "") {
        if (typeof is_proxy == "boolean") {
            connector_call.set("is-proxy", is_proxy);
        } else {
            if (is_proxy == "true") {
                is_proxy = true
            } else if (is_proxy == "false") {
                is_proxy = false
            } else {
                is_proxy = false
                connector_call.set("is-proxy", is_proxy);
                log.info("Is Proxy?: " + is_proxy);
            }
        }
    }
}

//Proxy - not mandatory
if (input_clone.hasOwnProperty("proxy")) {
    proxy = input.get("proxy");
    if (proxy != null || proxy != "") {
        connector_call.set("proxy", proxy);
        log.info("Proxy: " + proxy);
    }
}

//Timeout - not mandatory
if (input_clone.hasOwnProperty("timeout")) {
    timeout = input.get("timeout");
    if (timeout != null && timeout != "") {
        timeout = parseInt(timeout);
    }
    else {
        timeout = 60000;
    }
}
else {
    timeout = 60000;
}
connector_call.set("timeout", timeout);
log.info("Timeout: " + timeout);

//Calling the HTTP connector
response = connector_call.set("method", method).sync();

log.trace("POST Response:: "+response)
//Response's meta parameters
response_exitcode = response.exitcode();
response_message = response.message();
log.trace("Response message:: "+response_message)

//Response's Body
response_body = response.get("body");

//Response's Headers
response_headers = response.get("headers");

if (response_exitcode == 0) {
    log.info("Successfull execution of method:" + method);
    log.info("Method result:" + response_body);
    //User Message
    user_message = "Response-Body: " + response_body + "  |  Response-Headers: " + response_headers;
    output.set("exit-code", 0).set("result", response_body).set("user_message", user_message);
    log.trace("Finished executing 'flint-util:http:operation:workflow:post.js' successfully")
}

else {
    log.error("Failure in execution of method:" + method);
    log.error("Error: "+response_message)
    log.error("Failed to execute POST request:: "+response_body)
    output.set("error", response_message).set("exit-code", response_exitcode).set('response-body', response_body);
    log.trace("Finished executing 'flint-util:http:operation:workflow:post.js' with errors");
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>

    <link href="<?= base_url();?>bootstrap/css/bootstrap.css" rel="stylesheet">

    <?php include 'base.inc'; ?>

        <fieldset>
            <legend>Cadet Reports Options</legend>
            <form class="form-horizontal" role="form" action='<?= base_url();?>index.php/main/cadet_reports' method="post">

                        From:*

                            <input type="date" class="form-control" name="select_from" id="select_from" value="<?php echo $select_from;?>" >

                        To:*

                            <input type="date" class="form-control" name="select_to" id="select_to" value="<?php echo $select_to;?>">

                        Version:*

                            <select class="form-control" name="cadet_version" id="cadet_version" >
                                <option value="">Choose</option>
                                <?php foreach ($cadet_version as $key => $value) { ?>
                                    <option value="<?=$value->id;?>" <?php echo ($selected_version == $value->id)? 'selected':'';?>><?=$value->name;?></option>
                                <?php }?>
                            </select>

                        Sort By:*

                            <select class="form-control" name="sort_by" id="sort_by">
                                <option value="0" <?php if ($sort_by == 0) echo 'selected';?>>Unit</option>
                                <option value="1" <?php if ($sort_by == 1) echo 'selected';?>>Highest</option>
                                <option value="2" <?php if ($sort_by == 2) echo 'selected';?>>Lowest</option>
                            </select>

                            <button type="submit" class="btn btn-success" >Search</button>

                            <a href="<?= base_url();?>index.php/main/cadet_reports" class="btn btn-default" >Clear

                            <a href="<?= base_url();?>index.php/main" class="btn btn-info" >Home

            </form>

            Shown From <?=date('M d, Y',strtotime($select_from)); ;?> -- <?=date('M d, Y',strtotime($select_to)); ;?>
             Total in Days: <?=$total_duties;?>

                    UNIT #
                    NAME
                    Total Rendered

                <?php if (isset($duties)) {
                    foreach ($duties as $key => $n) {?>

                            <?php echo $n->unit; ?>
                            <?php echo $n->full_name; ?>
                            <?php echo $n->total_duties; ?>

                    <?php } ?>
                <?php } else {
                    echo '
No records found.
';
                }?>

                    ** Red color is at < 75%

                                Please mind the date when querying.

        </fieldset>


text:
using namespace AnnotatorLib;
using std::shared_ptr;

namespace AnnotatorLib {
class Session;
}

namespace Annotator {
namespace Plugins {

class CorrelationTracker : public Plugin {
  Q_OBJECT
  Q_PLUGIN_METADATA(IID "annotator.correlationtracker" FILE
                        "correlationtracker.json")
  Q_INTERFACES(Annotator::Plugin)

 public:
  CorrelationTracker();
  ~CorrelationTracker();
  QString getName() override;
  QWidget *getWidget() override;

  bool setFrame(shared_ptr<Frame> frame, cv::Mat image) override;
  void setObject(shared_ptr<Object> object) override;
  shared_ptr<Object> getObject() const override;
  void setLastAnnotation(shared_ptr<Annotation> annotation) override;
  std::vector<shared_ptr<Commands::Command>> getCommands() override;

 protected:
  cv::Mat frameImg;
  shared_ptr<Annotation> lastAnnotation = nullptr;
  shared_ptr<Object> object = nullptr;

  cv::Rect trackWindow, selection;
  cv::Mat hsv, hist, hue, mask, backproj;

  std::pair<cv::Rect, float> findObject();

  Widget widget;

  shared_ptr<Frame> frame = 0;
  shared_ptr<Frame> lastFrame = 0;

  dlib::correlation_tracker tracker;
  bool trackerStarted = false;

  int vmin = 10;
  int vmax = 256;
  int smin = 30;

  int hsize = 16;
  float hranges[2];
  const float *phranges;
};
}
}

#endif  // CORRELATIONTRACKER_H


text:
import { positionUtils } from '../deps/testcafe-core';

function calcOffset (size) {
    const offset = size / 2;

    return offset < 1 ? 0 : Math.round(offset);
}

export function getDefaultAutomationOffsets (element) {
    const rect    = positionUtils.getElementRectangle(element);
    const offsetX = calcOffset(rect.width);
    const offsetY = calcOffset(rect.height);

    return { offsetX, offsetY };
}

export function getOffsetOptions (element, offsetX, offsetY) {
    const defaultOffsets = getDefaultAutomationOffsets(element);

    offsetX = typeof offsetX === 'number' ? Math.round(offsetX) : defaultOffsets.offsetX;
    offsetY = typeof offsetY === 'number' ? Math.round(offsetY) : defaultOffsets.offsetY;

    if (offsetX > 0 && offsetY > 0)
        return { offsetX, offsetY };

    const dimensions = positionUtils.getClientDimensions(element);
    const width      = Math.round(Math.max(element.scrollWidth, dimensions.width));
    const height     = Math.round(Math.max(element.scrollHeight, dimensions.height));
    const maxX       = dimensions.scrollbar.right + dimensions.border.left + dimensions.border.right + width;
    const maxY       = dimensions.scrollbar.bottom + dimensions.border.top + dimensions.border.bottom + height;

    return {
        offsetX: offsetX < 0 ? maxX + offsetX : offsetX,
        offsetY: offsetY < 0 ? maxY + offsetY : offsetY
    };
}


text:
Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
    writeData();
    readData();
}

Widget::~Widget()
{
    delete ui;
}
void Widget::writeData(){
    QFile file;
    file.setFileName("../demo.txt");
    bool isopen = file.open(QIODevice::WriteOnly);
    if(isopen == true){
        QTextStream stream(&file);
        //指定编码
        stream.setCodec("UTF-8");
        stream << QString("主要看气质") <<250;
    }
    file.close();
}
void Widget::readData(){
    QFile file;
    file.setFileName("../demo.txt");
    bool isopen = file.open(QIODevice::ReadOnly);
    if(isopen == true){
        QTextStream stream(&file);
        //指定编码
        stream.setCodec("UTF-8");
        QString str;
        int a;
        stream >> str >> a;
        cout<<"str == "<<str.toUtf8().data()<<" a == "<<a;
    }
    file.close();
}

void Widget::on_pushButton_clicked()
{

    QString path = QFileDialog::getOpenFileName(this,"open","../");
    if(path.isEmpty() == false){
        QFile file;
        file.setFileName(path);
        bool isopen = file.open(QIODevice::ReadOnly);
        if(isopen == true){
            QTextStream stream(&file);
            //指定编码
            stream.setCodec("UTF-8");

            QString content = stream.readAll();
            ui->textEdit->setText(content);
            QString str;
            int a;
            stream >> str >> a;
            cout<<"str == "<<str.toUtf8().data()<<" a == "<<a;
        }
        file.close();
    }

}


text:
using System;

namespace System.Configuration {

        public enum ConfigurationUserLevel
        {
                None = 0,
                PerUserRoaming = 10,
                PerUserRoamingAndLocal = 20
        }
}


text:
package com.google.pubsub.proxy.publish;

import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutureCallback;
import com.google.api.core.ApiFutures;
import com.google.cloud.ServiceOptions;
import com.google.cloud.pubsub.v1.Publisher;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.protobuf.ByteString;
import com.google.protobuf.Timestamp;
import com.google.protobuf.util.Timestamps;
import com.google.pubsub.proxy.entities.Message;
import com.google.pubsub.proxy.entities.Request;
import com.google.pubsub.v1.ProjectTopicName;
import com.google.pubsub.v1.PubsubMessage;
import com.google.pubsub.v1.PubsubMessage.Builder;
import java.io.IOException;
import java.text.ParseException;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;

/** Publishes messages to Cloud Pub/Sub */
@Path("/publish")
public class PublishMessage {

  private static final String projectId = ServiceOptions.getDefaultProjectId();
  private Map<String, Publisher> publishers = new ConcurrentHashMap<>();
  private static final Logger LOGGER = Logger.getLogger(PublishMessage.class.getName());

  private Map<String, Publisher> getPublishers() {
    return publishers;
  }

  void setPublishers(Map<String, Publisher> publishers) {
    this.publishers = Collections.unmodifiableMap(publishers);
  }

  /**
   * Entry point for POST /publish Enforces token validation
   *
   * @param req - POJO translated user request
   */
  @POST
  @Consumes(MediaType.APPLICATION_JSON)
  public Response doPost(Request req) throws Exception {

    if (null == req.getTopic()) {
      return invalidRequest("Pub/Sub topic required");
    }
    if (null == req.getMessages()) {
      return invalidRequest("Message required");
    }
    if (req.getMessages().isEmpty()) {
      return invalidRequest("Message cannot be empty");
    }

    Publisher publisher = getPublisher(req.getTopic());
    for (final Message msg : req.getMessages()) {
      publishMessage(publisher, msg);
    }

    return Response.ok().build();
  }

  /** Populates PubSub publisher Publishes messages downstream */
  private void publishMessage(Publisher publisher, Message msg) throws Exception {

    Builder builder = PubsubMessage.newBuilder();
    if (null != msg.getData()) {
      builder.setData(ByteString.copyFromUtf8(msg.getData()));
    }
    if (null != msg.getMessageId()) {
      builder.setMessageId(msg.getMessageId());
    }
    if (null != msg.getPublishTime()) {
      builder.setPublishTime(getTimeStamp(msg.getPublishTime()));
    }
    if (null != msg.getAttributes()) {
      builder.putAllAttributes(getAllAttributes(msg.getAttributes()));
    }

    ApiFuture<String> future = publisher.publish(builder.build());
    ApiFutures.addCallback(
        future,
        new ApiFutureCallback<String>() {
          public void onFailure(Throwable throwable) {
            LOGGER.severe("Failed to publish message: " + throwable.getMessage());
          }

          public void onSuccess(String msgId) {
            LOGGER.info("Successfully published: " + msgId);
          }
        },
        MoreExecutors.directExecutor());
  }

  /** Creates PubSub publisher if one doesn't exist */
  private Publisher getPublisher(String topic) throws IOException {

    if (getPublishers().containsKey(topic)) {
      return getPublishers().get(topic);
    }

    LOGGER.info("Creating new publisher for: " + topic);
    Publisher publisher = Publisher.newBuilder(ProjectTopicName.of(projectId, topic)).build();
    getPublishers().put(topic, publisher);
    return publisher;
  }

  /** Handle missing parameters in incoming requests */
  private Response invalidRequest(String msg) {
    return Response.status(Status.BAD_REQUEST).entity(msg).type(MediaType.APPLICATION_JSON).build();
  }

  /** Returns timestamp from string */
  private Timestamp getTimeStamp(String s) throws ParseException {
    return Timestamps.parse(s);
  }

  /** Attributes captured as generic object returned in the format understandable by PubSub */
  @SuppressWarnings("unchecked")
  private static Map<String, String> getAllAttributes(Object attributes) {
    return (Map<String, String>) attributes;
  }
}


text:
<?php

namespace PhpGitHooks\Module\Configuration\Service;

use PhpGitHooks\Infrastructure\CommandBus\CommandBus\CommandBus;
use PhpGitHooks\Infrastructure\CommandBus\QueryBus\QueryBus;
use PhpGitHooks\Module\Git\Contract\Command\GitIgnoreWriterCommand;
use PhpGitHooks\Module\Git\Contract\Query\GitIgnoreExtractorQuery;
use PhpGitHooks\Module\Git\Contract\Response\GitIgnoreDataResponse;

class PhpGuardCoverageGitIgnoreConfigurator
{
    const FILE_TO_IGNORE = '.guard_coverage';
    /**
     * @var QueryBus
     */
    private $queryBus;
    /**
     * @var CommandBus
     */
    private $commandBus;

    /**
     * PhpGuardCoverageGitIgnoreConfigurator constructor.
     *
     * @param QueryBus   $queryBus
     * @param CommandBus $commandBus
     */
    public function __construct(QueryBus $queryBus, CommandBus $commandBus)
    {
        $this->queryBus = $queryBus;
        $this->commandBus = $commandBus;
    }

    public function configure()
    {
        /** @var GitIgnoreDataResponse $gitIgnoreContent */
        $gitIgnoreContent = $this->queryBus->handle(new GitIgnoreExtractorQuery());

        if (false === $this->isFileIgnored($gitIgnoreContent->getContent())) {
            $content = $this->getContent($gitIgnoreContent->getContent());

            $this->commandBus->handle(new GitIgnoreWriterCommand($content));
        }
    }

    /**
     * @param $data
     *
     * @return bool
     */
    private function isFileIgnored($data)
    {
        return false !== strpos($data, static::FILE_TO_IGNORE);
    }

    /**
     * @param string $gitIgnoreContent
     *
     * @return string
     */
    private function getContent($gitIgnoreContent)
    {
        return trim($gitIgnoreContent)."\n#Entry generated by php-git-hooks tool.\n".self::FILE_TO_IGNORE;
    }
}


text:
namespace blink {

class MockWebFrameClient : public WebFrameClient {
};

class ProgrammaticScrollTest : public testing::Test {
public:
    ProgrammaticScrollTest()
        : m_baseURL("http://www.test.com/")
    {
    }

    void TearDown() override
    {
        Platform::current()->unitTestSupport()->unregisterAllMockedURLs();
    }

protected:

    void registerMockedHttpURLLoad(const std::string& fileName)
    {
        URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8(fileName.c_str()));
    }

    std::string m_baseURL;
    MockWebFrameClient m_mockWebFrameClient;
};

TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithScale)
{
    registerMockedHttpURLLoad("long_scroll.html");

    FrameTestHelpers::WebViewHelper webViewHelper;
    WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "long_scroll.html", true, 0, 0);
    webView->resize(WebSize(1000, 1000));
    webView->updateAllLifecyclePhases();

    WebViewImpl* webViewImpl = toWebViewImpl(webView);
    FrameLoader& loader = webViewImpl->mainFrameImpl()->frame()->loader();
    loader.setLoadType(FrameLoadTypeBackForward);

    webViewImpl->setPageScaleFactor(3.0f);
    webViewImpl->mainFrame()->setScrollOffset(WebSize(0, 500));
    loader.documentLoader()->initialScrollState().wasScrolledByUser = false;
    loader.currentItem()->setPageScaleFactor(2);
    loader.currentItem()->setScrollPoint(WebPoint(0, 200));

    // Flip back the wasScrolledByUser flag which was set to true by setPageScaleFactor
    // because otherwise FrameLoader::restoreScrollPositionAndViewState does nothing.
    loader.documentLoader()->initialScrollState().wasScrolledByUser = false;
    loader.restoreScrollPositionAndViewState();

    // Expect that both scroll and scale were restored.
    EXPECT_EQ(2.0f, webViewImpl->pageScaleFactor());
    EXPECT_EQ(200, webViewImpl->mainFrameImpl()->scrollOffset().height);
}

TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithoutScale)
{
    registerMockedHttpURLLoad("long_scroll.html");

    FrameTestHelpers::WebViewHelper webViewHelper;
    WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "long_scroll.html", true, 0, 0);
    webView->resize(WebSize(1000, 1000));
    webView->updateAllLifecyclePhases();

    WebViewImpl* webViewImpl = toWebViewImpl(webView);
    FrameLoader& loader = webViewImpl->mainFrameImpl()->frame()->loader();
    loader.setLoadType(FrameLoadTypeBackForward);

    webViewImpl->setPageScaleFactor(3.0f);
    webViewImpl->mainFrame()->setScrollOffset(WebSize(0, 500));
    loader.documentLoader()->initialScrollState().wasScrolledByUser = false;
    loader.currentItem()->setPageScaleFactor(0);
    loader.currentItem()->setScrollPoint(WebPoint(0, 400));

    // FrameLoader::restoreScrollPositionAndViewState flows differently if scale is zero.
    loader.restoreScrollPositionAndViewState();

    // Expect that only the scroll position was restored.
    EXPECT_EQ(3.0f, webViewImpl->pageScaleFactor());
    EXPECT_EQ(400, webViewImpl->mainFrameImpl()->scrollOffset().height);
}

} // namespace blink


text:
import pytest

from spacy import registry
from spacy.tokens import Doc, Span
from spacy.language import Language
from spacy.lang.en import English
from spacy.pipeline import EntityRuler, EntityRecognizer, merge_entities
from spacy.pipeline.ner import DEFAULT_NER_MODEL
from spacy.errors import MatchPatternError
from spacy.tests.util import make_tempdir

from thinc.api import NumpyOps, get_current_ops

@pytest.fixture
def nlp():
    return Language()

@pytest.fixture
@registry.misc("entity_ruler_patterns")
def patterns():
    return [
        {"label": "HELLO", "pattern": "hello world"},
        {"label": "BYE", "pattern": [{"LOWER": "bye"}, {"LOWER": "bye"}]},
        {"label": "HELLO", "pattern": [{"ORTH": "HELLO"}]},
        {"label": "COMPLEX", "pattern": [{"ORTH": "foo", "OP": "*"}]},
        {"label": "TECH_ORG", "pattern": "Apple", "id": "a1"},
        {"label": "TECH_ORG", "pattern": "Microsoft", "id": "a2"},
    ]

@Language.component("add_ent")
def add_ent_component(doc):
    doc.ents = [Span(doc, 0, 3, label="ORG")]
    return doc

@pytest.mark.issue(3345)
def test_issue3345():
    """Test case where preset entity crosses sentence boundary."""
    nlp = English()
    doc = Doc(nlp.vocab, words=["I", "live", "in", "New", "York"])
    doc[4].is_sent_start = True
    ruler = EntityRuler(nlp, patterns=[{"label": "GPE", "pattern": "New York"}])
    cfg = {"model": DEFAULT_NER_MODEL}
    model = registry.resolve(cfg, validate=True)["model"]
    ner = EntityRecognizer(doc.vocab, model)
    # Add the OUT action. I wouldn't have thought this would be necessary...
    ner.moves.add_action(5, "")
    ner.add_label("GPE")
    doc = ruler(doc)
    # Get into the state just before "New"
    state = ner.moves.init_batch([doc])[0]
    ner.moves.apply_transition(state, "O")
    ner.moves.apply_transition(state, "O")
    ner.moves.apply_transition(state, "O")
    # Check that B-GPE is valid.
    assert ner.moves.is_valid(state, "B-GPE")

@pytest.mark.issue(4849)
def test_issue4849():
    nlp = English()
    patterns = [
        {"label": "PERSON", "pattern": "joe biden", "id": "joe-biden"},
        {"label": "PERSON", "pattern": "bernie sanders", "id": "bernie-sanders"},
    ]
    ruler = nlp.add_pipe("entity_ruler", config={"phrase_matcher_attr": "LOWER"})
    ruler.add_patterns(patterns)
    text = """
    The left is starting to take aim at Democratic front-runner Joe Biden.
    Sen. Bernie Sanders joined in her criticism: "There is no 'middle ground' when it comes to climate policy."
    """
    # USING 1 PROCESS
    count_ents = 0
    for doc in nlp.pipe([text], n_process=1):
        count_ents += len([ent for ent in doc.ents if ent.ent_id > 0])
    assert count_ents == 2
    # USING 2 PROCESSES
    if isinstance(get_current_ops, NumpyOps):
        count_ents = 0
        for doc in nlp.pipe([text], n_process=2):
            count_ents += len([ent for ent in doc.ents if ent.ent_id > 0])
        assert count_ents == 2

@pytest.mark.issue(5918)
def test_issue5918():
    # Test edge case when merging entities.
    nlp = English()
    ruler = nlp.add_pipe("entity_ruler")
    patterns = [
        {"label": "ORG", "pattern": "Digicon Inc"},
        {"label": "ORG", "pattern": "Rotan Mosle Inc's"},
        {"label": "ORG", "pattern": "Rotan Mosle Technology Partners Ltd"},
    ]
    ruler.add_patterns(patterns)

    text = """
        Digicon Inc said it has completed the previously-announced disposition
        of its computer systems division to an investment group led by
        Rotan Mosle Inc's Rotan Mosle Technology Partners Ltd affiliate.
        """
    doc = nlp(text)
    assert len(doc.ents) == 3
    # make it so that the third span's head is within the entity (ent_iob=I)
    # bug #5918 would wrongly transfer that I to the full entity, resulting in 2 instead of 3 final ents.
    # TODO: test for logging here
    # with pytest.warns(UserWarning):
    #     doc[29].head = doc[33]
    doc = merge_entities(doc)
    assert len(doc.ents) == 3

@pytest.mark.issue(8168)
def test_issue8168():
    nlp = English()
    ruler = nlp.add_pipe("entity_ruler")
    patterns = [
        {"label": "ORG", "pattern": "Apple"},
        {
            "label": "GPE",
            "pattern": [{"LOWER": "san"}, {"LOWER": "francisco"}],
            "id": "san-francisco",
        },
        {
            "label": "GPE",
            "pattern": [{"LOWER": "san"}, {"LOWER": "fran"}],
            "id": "san-francisco",
        },
    ]
    ruler.add_patterns(patterns)

    assert ruler._ent_ids == {8043148519967183733: ("GPE", "san-francisco")}

@pytest.mark.issue(8216)
def test_entity_ruler_fix8216(nlp, patterns):
    """Test that patterns don't get added excessively."""
    ruler = nlp.add_pipe("entity_ruler", config={"validate": True})
    ruler.add_patterns(patterns)
    pattern_count = sum(len(mm) for mm in ruler.matcher._patterns.values())
    assert pattern_count > 0
    ruler.add_patterns([])
    after_count = sum(len(mm) for mm in ruler.matcher._patterns.values())
    assert after_count == pattern_count

def test_entity_ruler_init(nlp, patterns):
    ruler = EntityRuler(nlp, patterns=patterns)
    assert len(ruler) == len(patterns)
    assert len(ruler.labels) == 4
    assert "HELLO" in ruler
    assert "BYE" in ruler
    ruler = nlp.add_pipe("entity_ruler")
    ruler.add_patterns(patterns)
    doc = nlp("hello world bye bye")
    assert len(doc.ents) == 2
    assert doc.ents[0].label_ == "HELLO"
    assert doc.ents[1].label_ == "BYE"

def test_entity_ruler_no_patterns_warns(nlp):
    ruler = EntityRuler(nlp)
    assert len(ruler) == 0
    assert len(ruler.labels) == 0
    nlp.add_pipe("entity_ruler")
    assert nlp.pipe_names == ["entity_ruler"]
    with pytest.warns(UserWarning):
        doc = nlp("hello world bye bye")
    assert len(doc.ents) == 0

def test_entity_ruler_init_patterns(nlp, patterns):
    # initialize with patterns
    ruler = nlp.add_pipe("entity_ruler")
    assert len(ruler.labels) == 0
    ruler.initialize(lambda: [], patterns=patterns)
    assert len(ruler.labels) == 4
    doc = nlp("hello world bye bye")
    assert doc.ents[0].label_ == "HELLO"
    assert doc.ents[1].label_ == "BYE"
    nlp.remove_pipe("entity_ruler")
    # initialize with patterns from misc registry
    nlp.config["initialize"]["components"]["entity_ruler"] = {
        "patterns": {"@misc": "entity_ruler_patterns"}
    }
    ruler = nlp.add_pipe("entity_ruler")
    assert len(ruler.labels) == 0
    nlp.initialize()
    assert len(ruler.labels) == 4
    doc = nlp("hello world bye bye")
    assert doc.ents[0].label_ == "HELLO"
    assert doc.ents[1].label_ == "BYE"

def test_entity_ruler_init_clear(nlp, patterns):
    """Test that initialization clears patterns."""
    ruler = nlp.add_pipe("entity_ruler")
    ruler.add_patterns(patterns)
    assert len(ruler.labels) == 4
    ruler.initialize(lambda: [])
    assert len(ruler.labels) == 0

def test_entity_ruler_clear(nlp, patterns):
    """Test that initialization clears patterns."""
    ruler = nlp.add_pipe("entity_ruler")
    ruler.add_patterns(patterns)
    assert len(ruler.labels) == 4
    doc = nlp("hello world")
    assert len(doc.ents) == 1
    ruler.clear()
    assert len(ruler.labels) == 0
    with pytest.warns(UserWarning):
        doc = nlp("hello world")
    assert len(doc.ents) == 0

def test_entity_ruler_existing(nlp, patterns):
    ruler = nlp.add_pipe("entity_ruler")
    ruler.add_patterns(patterns)
    nlp.add_pipe("add_ent", before="entity_ruler")
    doc = nlp("OH HELLO WORLD bye bye")
    assert len(doc.ents) == 2
    assert doc.ents[0].label_ == "ORG"
    assert doc.ents[1].label_ == "BYE"

def test_entity_ruler_existing_overwrite(nlp, patterns):
    ruler = nlp.add_pipe("entity_ruler", config={"overwrite_ents": True})
    ruler.add_patterns(patterns)
    nlp.add_pipe("add_ent", before="entity_ruler")
    doc = nlp("OH HELLO WORLD bye bye")
    assert len(doc.ents) == 2
    assert doc.ents[0].label_ == "HELLO"
    assert doc.ents[0].text == "HELLO"
    assert doc.ents[1].label_ == "BYE"

def test_entity_ruler_existing_complex(nlp, patterns):
    ruler = nlp.add_pipe("entity_ruler", config={"overwrite_ents": True})
    ruler.add_patterns(patterns)
    nlp.add_pipe("add_ent", before="entity_ruler")
    doc = nlp("foo foo bye bye")
    assert len(doc.ents) == 2
    assert doc.ents[0].label_ == "COMPLEX"
    assert doc.ents[1].label_ == "BYE"
    assert len(doc.ents[0]) == 2
    assert len(doc.ents[1]) == 2

def test_entity_ruler_entity_id(nlp, patterns):
    ruler = nlp.add_pipe("entity_ruler", config={"overwrite_ents": True})
    ruler.add_patterns(patterns)
    doc = nlp("Apple is a technology company")
    assert len(doc.ents) == 1
    assert doc.ents[0].label_ == "TECH_ORG"
    assert doc.ents[0].ent_id_ == "a1"

def test_entity_ruler_cfg_ent_id_sep(nlp, patterns):
    config = {"overwrite_ents": True, "ent_id_sep": "**"}
    ruler = nlp.add_pipe("entity_ruler", config=config)
    ruler.add_patterns(patterns)
    assert "TECH_ORG**a1" in ruler.phrase_patterns
    doc = nlp("Apple is a technology company")
    assert len(doc.ents) == 1
    assert doc.ents[0].label_ == "TECH_ORG"
    assert doc.ents[0].ent_id_ == "a1"

def test_entity_ruler_serialize_bytes(nlp, patterns):
    ruler = EntityRuler(nlp, patterns=patterns)
    assert len(ruler) == len(patterns)
    assert len(ruler.labels) == 4
    ruler_bytes = ruler.to_bytes()
    new_ruler = EntityRuler(nlp)
    assert len(new_ruler) == 0
    assert len(new_ruler.labels) == 0
    new_ruler = new_ruler.from_bytes(ruler_bytes)
    assert len(new_ruler) == len(patterns)
    assert len(new_ruler.labels) == 4
    assert len(new_ruler.patterns) == len(ruler.patterns)
    for pattern in ruler.patterns:
        assert pattern in new_ruler.patterns
    assert sorted(new_ruler.labels) == sorted(ruler.labels)

def test_entity_ruler_serialize_phrase_matcher_attr_bytes(nlp, patterns):
    ruler = EntityRuler(nlp, phrase_matcher_attr="LOWER", patterns=patterns)
    assert len(ruler) == len(patterns)
    assert len(ruler.labels) == 4
    ruler_bytes = ruler.to_bytes()
    new_ruler = EntityRuler(nlp)
    assert len(new_ruler) == 0
    assert len(new_ruler.labels) == 0
    assert new_ruler.phrase_matcher_attr is None
    new_ruler = new_ruler.from_bytes(ruler_bytes)
    assert len(new_ruler) == len(patterns)
    assert len(new_ruler.labels) == 4
    assert new_ruler.phrase_matcher_attr == "LOWER"

def test_entity_ruler_validate(nlp):
    ruler = EntityRuler(nlp)
    validated_ruler = EntityRuler(nlp, validate=True)

    valid_pattern = {"label": "HELLO", "pattern": [{"LOWER": "HELLO"}]}
    invalid_pattern = {"label": "HELLO", "pattern": [{"ASDF": "HELLO"}]}

    # invalid pattern raises error without validate
    with pytest.raises(ValueError):
        ruler.add_patterns([invalid_pattern])

    # valid pattern is added without errors with validate
    validated_ruler.add_patterns([valid_pattern])

    # invalid pattern raises error with validate
    with pytest.raises(MatchPatternError):
        validated_ruler.add_patterns([invalid_pattern])

def test_entity_ruler_properties(nlp, patterns):
    ruler = EntityRuler(nlp, patterns=patterns, overwrite_ents=True)
    assert sorted(ruler.labels) == sorted(["HELLO", "BYE", "COMPLEX", "TECH_ORG"])
    assert sorted(ruler.ent_ids) == ["a1", "a2"]

def test_entity_ruler_overlapping_spans(nlp):
    ruler = EntityRuler(nlp)
    patterns = [
        {"label": "FOOBAR", "pattern": "foo bar"},
        {"label": "BARBAZ", "pattern": "bar baz"},
    ]
    ruler.add_patterns(patterns)
    doc = ruler(nlp.make_doc("foo bar baz"))
    assert len(doc.ents) == 1
    assert doc.ents[0].label_ == "FOOBAR"

@pytest.mark.parametrize("n_process", [1, 2])
def test_entity_ruler_multiprocessing(nlp, n_process):
    if isinstance(get_current_ops, NumpyOps) or n_process < 2:
        texts = ["I enjoy eating Pizza Hut pizza."]

        patterns = [{"label": "FASTFOOD", "pattern": "Pizza Hut", "id": "1234"}]

        ruler = nlp.add_pipe("entity_ruler")
        ruler.add_patterns(patterns)

        for doc in nlp.pipe(texts, n_process=2):
            for ent in doc.ents:
                assert ent.ent_id_ == "1234"

def test_entity_ruler_serialize_jsonl(nlp, patterns):
    ruler = nlp.add_pipe("entity_ruler")
    ruler.add_patterns(patterns)
    with make_tempdir() as d:
        ruler.to_disk(d / "test_ruler.jsonl")
        ruler.from_disk(d / "test_ruler.jsonl")  # read from an existing jsonl file
        with pytest.raises(ValueError):
            ruler.from_disk(d / "non_existing.jsonl")  # read from a bad jsonl file

def test_entity_ruler_serialize_dir(nlp, patterns):
    ruler = nlp.add_pipe("entity_ruler")
    ruler.add_patterns(patterns)
    with make_tempdir() as d:
        ruler.to_disk(d / "test_ruler")
        ruler.from_disk(d / "test_ruler")  # read from an existing directory
        with pytest.raises(ValueError):
            ruler.from_disk(d / "non_existing_dir")  # read from a bad directory

def test_entity_ruler_remove_basic(nlp):
    ruler = EntityRuler(nlp)
    patterns = [
        {"label": "PERSON", "pattern": "Duygu", "id": "duygu"},
        {"label": "ORG", "pattern": "ACME", "id": "acme"},
        {"label": "ORG", "pattern": "ACM"},
    ]
    ruler.add_patterns(patterns)
    doc = ruler(nlp.make_doc("Duygu went to school"))
    assert len(ruler.patterns) == 3
    assert len(doc.ents) == 1
    assert doc.ents[0].label_ == "PERSON"
    assert doc.ents[0].text == "Duygu"
    assert "PERSON||duygu" in ruler.phrase_matcher
    ruler.remove("duygu")
    doc = ruler(nlp.make_doc("Duygu went to school"))
    assert len(doc.ents) == 0
    assert "PERSON||duygu" not in ruler.phrase_matcher
    assert len(ruler.patterns) == 2

def test_entity_ruler_remove_same_id_multiple_patterns(nlp):
    ruler = EntityRuler(nlp)
    patterns = [
        {"label": "PERSON", "pattern": "Duygu", "id": "duygu"},
        {"label": "ORG", "pattern": "DuyguCorp", "id": "duygu"},
        {"label": "ORG", "pattern": "ACME", "id": "acme"},
    ]
    ruler.add_patterns(patterns)
    doc = ruler(nlp.make_doc("Duygu founded DuyguCorp and ACME."))
    assert len(ruler.patterns) == 3
    assert "PERSON||duygu" in ruler.phrase_matcher
    assert "ORG||duygu" in ruler.phrase_matcher
    assert len(doc.ents) == 3
    ruler.remove("duygu")
    doc = ruler(nlp.make_doc("Duygu founded DuyguCorp and ACME."))
    assert len(ruler.patterns) == 1
    assert "PERSON||duygu" not in ruler.phrase_matcher
    assert "ORG||duygu" not in ruler.phrase_matcher
    assert len(doc.ents) == 1

def test_entity_ruler_remove_nonexisting_pattern(nlp):
    ruler = EntityRuler(nlp)
    patterns = [
        {"label": "PERSON", "pattern": "Duygu", "id": "duygu"},
        {"label": "ORG", "pattern": "ACME", "id": "acme"},
        {"label": "ORG", "pattern": "ACM"},
    ]
    ruler.add_patterns(patterns)
    assert len(ruler.patterns) == 3
    with pytest.raises(ValueError):
        ruler.remove("nepattern")
        assert len(ruler.patterns) == 3

def test_entity_ruler_remove_several_patterns(nlp):
    ruler = EntityRuler(nlp)
    patterns = [
        {"label": "PERSON", "pattern": "Duygu", "id": "duygu"},
        {"label": "ORG", "pattern": "ACME", "id": "acme"},
        {"label": "ORG", "pattern": "ACM"},
    ]
    ruler.add_patterns(patterns)
    doc = ruler(nlp.make_doc("Duygu founded her company ACME."))
    assert len(ruler.patterns) == 3
    assert len(doc.ents) == 2
    assert doc.ents[0].label_ == "PERSON"
    assert doc.ents[0].text == "Duygu"
    assert doc.ents[1].label_ == "ORG"
    assert doc.ents[1].text == "ACME"
    ruler.remove("duygu")
    doc = ruler(nlp.make_doc("Duygu founded her company ACME"))
    assert len(ruler.patterns) == 2
    assert len(doc.ents) == 1
    assert doc.ents[0].label_ == "ORG"
    assert doc.ents[0].text == "ACME"
    ruler.remove("acme")
    doc = ruler(nlp.make_doc("Duygu founded her company ACME"))
    assert len(ruler.patterns) == 1
    assert len(doc.ents) == 0

def test_entity_ruler_remove_patterns_in_a_row(nlp):
    ruler = EntityRuler(nlp)
    patterns = [
        {"label": "PERSON", "pattern": "Duygu", "id": "duygu"},
        {"label": "ORG", "pattern": "ACME", "id": "acme"},
        {"label": "DATE", "pattern": "her birthday", "id": "bday"},
        {"label": "ORG", "pattern": "ACM"},
    ]
    ruler.add_patterns(patterns)
    doc = ruler(nlp.make_doc("Duygu founded her company ACME on her birthday"))
    assert len(doc.ents) == 3
    assert doc.ents[0].label_ == "PERSON"
    assert doc.ents[0].text == "Duygu"
    assert doc.ents[1].label_ == "ORG"
    assert doc.ents[1].text == "ACME"
    assert doc.ents[2].label_ == "DATE"
    assert doc.ents[2].text == "her birthday"
    ruler.remove("duygu")
    ruler.remove("acme")
    ruler.remove("bday")
    doc = ruler(nlp.make_doc("Duygu went to school"))
    assert len(doc.ents) == 0

def test_entity_ruler_remove_all_patterns(nlp):
    ruler = EntityRuler(nlp)
    patterns = [
        {"label": "PERSON", "pattern": "Duygu", "id": "duygu"},
        {"label": "ORG", "pattern": "ACME", "id": "acme"},
        {"label": "DATE", "pattern": "her birthday", "id": "bday"},
    ]
    ruler.add_patterns(patterns)
    assert len(ruler.patterns) == 3
    ruler.remove("duygu")
    assert len(ruler.patterns) == 2
    ruler.remove("acme")
    assert len(ruler.patterns) == 1
    ruler.remove("bday")
    assert len(ruler.patterns) == 0
    with pytest.warns(UserWarning):
        doc = ruler(nlp.make_doc("Duygu founded her company ACME on her birthday"))
        assert len(doc.ents) == 0

def test_entity_ruler_remove_and_add(nlp):
    ruler = EntityRuler(nlp)
    patterns = [{"label": "DATE", "pattern": "last time"}]
    ruler.add_patterns(patterns)
    doc = ruler(
        nlp.make_doc("I saw him last time we met, this time he brought some flowers")
    )
    assert len(ruler.patterns) == 1
    assert len(doc.ents) == 1
    assert doc.ents[0].label_ == "DATE"
    assert doc.ents[0].text == "last time"
    patterns1 = [{"label": "DATE", "pattern": "this time", "id": "ttime"}]
    ruler.add_patterns(patterns1)
    doc = ruler(
        nlp.make_doc("I saw him last time we met, this time he brought some flowers")
    )
    assert len(ruler.patterns) == 2
    assert len(doc.ents) == 2
    assert doc.ents[0].label_ == "DATE"
    assert doc.ents[0].text == "last time"
    assert doc.ents[1].label_ == "DATE"
    assert doc.ents[1].text == "this time"
    ruler.remove("ttime")
    doc = ruler(
        nlp.make_doc("I saw him last time we met, this time he brought some flowers")
    )
    assert len(ruler.patterns) == 1
    assert len(doc.ents) == 1
    assert doc.ents[0].label_ == "DATE"
    assert doc.ents[0].text == "last time"
    ruler.add_patterns(patterns1)
    doc = ruler(
        nlp.make_doc("I saw him last time we met, this time he brought some flowers")
    )
    assert len(ruler.patterns) == 2
    assert len(doc.ents) == 2
    patterns2 = [{"label": "DATE", "pattern": "another time", "id": "ttime"}]
    ruler.add_patterns(patterns2)
    doc = ruler(
        nlp.make_doc(
            "I saw him last time we met, this time he brought some flowers, another time some chocolate."
        )
    )
    assert len(ruler.patterns) == 3
    assert len(doc.ents) == 3
    ruler.remove("ttime")
    doc = ruler(
        nlp.make_doc(
            "I saw him last time we met, this time he brought some flowers, another time some chocolate."
        )
    )
    assert len(ruler.patterns) == 1
    assert len(doc.ents) == 1


text:
/**
 * Layout component that queries for data
 * with Gatsby's useStaticQuery component
 *
 * See: https://www.gatsbyjs.org/docs/use-static-query/
 */

import React from 'react';
import PropTypes from 'prop-types';
import { useStaticQuery, graphql } from 'gatsby';
import 'normalize.css';

import Header from './header';
import './layout.css';

const Layout: React.FC = ({ children }) => {
  const data = useStaticQuery(graphql`
    query SiteTitleQuery {
      site {
        siteMetadata {
          title
        }
      }
    }
  `);

  return (
    <>

        {children}

    </>
  );
};

Layout.propTypes = {
  children: PropTypes.node.isRequired,
};

export default Layout;


text:
import argparse
import subprocess
from .config import conf
from .__about__ import __version__
from .command import Command

def main():

    args = parse_args()

    if args.command == 'smbmod':

        if args.subcommand == 'init':
            # Until refactored
            subprocess.call([conf['smb_init_script']])

        if args.subcommand == 'update':
            subprocess.call([conf['smb_update_script']])

        if args.subcommand == 'build':
            subprocess.call([conf['smb_build_script']])

        if args.subcommand == 'sync':

            if args.all:
                subprocess.call([conf['smb_update_script']])
                subprocess.call([conf['smb_build_script']])

            subprocess.call(['rsync', '-azvh', conf['smb_cache_path'] + '/', conf['data_csprogs']])

    if args.command == 'servers':

        command = Command(conf=conf)

        if args.subcommand == 'start':
            command.start(engine=args.engine)

        # supervisor conf needs to be generated if using supervisor
        if args.subcommand == 'build':
            command.generate_engine_configs()
            command.generate_server_configs()

def parse_args():

    parser = argparse.ArgumentParser(description='Xonotic Server Management Suite is a tool to help manage Xonotic servers.')

    parser.add_argument('--version', action='version',
                        version='%(prog)s {version}'.format(version=__version__))

    subparsers = parser.add_subparsers(dest='command')
    subparsers.required = True

    parser_smbmod = subparsers.add_parser('smbmod', help='take actions related to the SMB mod')
    parser_smbmod.add_argument('subcommand', choices=['init', 'build', 'update', 'sync'], type=str)
    parser_smbmod.add_argument('--all', '-A', help='Sync smb mod and build as well?', action='store_true')

    parser_servers = subparsers.add_parser('servers', help='take actions related to the servers')
    parser_servers.add_argument('subcommand', choices=['start', 'build'], type=str)
    parser_servers.add_argument('--engine', '-e', choices=['screen', 'tmux', 'supervisor'], help='What engine to start with')

    return parser.parse_args()

if __name__ == '__main__':
    main()


text:
package io.rapid;

import io.rapid.executor.RapidExecutor;

public class RapidActionFuture extends RapidFuture {
	private final String mActionId;
	private RapidConnection mRapidConnection;

	RapidActionFuture(RapidExecutor handler, String actionId, RapidConnection rapidConnection) {
		super(handler);
		mActionId = actionId;
		mRapidConnection = rapidConnection;
	}

	public RapidFuture cancel() {
		return mRapidConnection.cancelOnDisconnect(mActionId);
	}

}


text:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <FrameLayout
        android:id="@+id/content_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <android.support.design.widget.NavigationView
        android:id="@+id/navigation_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="@color/white"
        app:headerLayout="@layout/drawer_header"
        app:itemIconTint="@drawable/drawer_icon_selector"
        app:itemTextColor="@drawable/drawer_text_selector"
        app:menu="@menu/drawer" />

</android.support.v4.widget.DrawerLayout>


text:
namespace BWAPI
{
  class TechType;
  class UpgradeType;
  class DamageType;
  class ExplosionType;
  class UnitType;

  /// namespace containing weapon types.
  /// @see WeaponType
  namespace WeaponTypes
  {
    /// Enumeration of weapon types.
    /// @see WeaponType
    namespace Enum
    {
      /// Enumeration of weapon types.
      /// @see WeaponType
      enum Enum
      {
        Gauss_Rifle = 0,
        Gauss_Rifle_Jim_Raynor = 1,
        C_10_Canister_Rifle = 2,
        C_10_Canister_Rifle_Sarah_Kerrigan = 3,
        Fragmentation_Grenade = 4,
        Fragmentation_Grenade_Jim_Raynor = 5,
        Spider_Mines = 6,
        Twin_Autocannons = 7,
        Hellfire_Missile_Pack = 8,
        Twin_Autocannons_Alan_Schezar = 9,
        Hellfire_Missile_Pack_Alan_Schezar = 10,
        Arclite_Cannon = 11,
        Arclite_Cannon_Edmund_Duke = 12,
        Fusion_Cutter = 13,

        Gemini_Missiles = 15,
        Burst_Lasers = 16,
        Gemini_Missiles_Tom_Kazansky = 17,
        Burst_Lasers_Tom_Kazansky = 18,
        ATS_Laser_Battery = 19,
        ATA_Laser_Battery = 20,
        ATS_Laser_Battery_Hero = 21,
        ATA_Laser_Battery_Hero = 22,
        ATS_Laser_Battery_Hyperion = 23,
        ATA_Laser_Battery_Hyperion = 24,
        Flame_Thrower = 25,
        Flame_Thrower_Gui_Montag = 26,
        Arclite_Shock_Cannon = 27,
        Arclite_Shock_Cannon_Edmund_Duke = 28,
        Longbolt_Missile = 29,
        Yamato_Gun = 30,
        Nuclear_Strike = 31,
        Lockdown = 32,
        EMP_Shockwave = 33,
        Irradiate = 34,
        Claws = 35,
        Claws_Devouring_One = 36,
        Claws_Infested_Kerrigan = 37,
        Needle_Spines = 38,
        Needle_Spines_Hunter_Killer = 39,
        Kaiser_Blades = 40,
        Kaiser_Blades_Torrasque = 41,
        Toxic_Spores = 42,
        Spines = 43,

        Acid_Spore = 46,
        Acid_Spore_Kukulza = 47,
        Glave_Wurm = 48,
        Glave_Wurm_Kukulza = 49,

        Seeker_Spores = 52,
        Subterranean_Tentacle = 53,
        Suicide_Infested_Terran = 54,
        Suicide_Scourge = 55,
        Parasite = 56,
        Spawn_Broodlings = 57,
        Ensnare = 58,
        Dark_Swarm = 59,
        Plague = 60,
        Consume = 61,
        Particle_Beam = 62,

        Psi_Blades = 64,
        Psi_Blades_Fenix = 65,
        Phase_Disruptor = 66,
        Phase_Disruptor_Fenix = 67,

        Psi_Assault = 69,
        Psionic_Shockwave = 70,
        Psionic_Shockwave_TZ_Archon = 71,

        Dual_Photon_Blasters = 73,
        Anti_Matter_Missiles = 74,
        Dual_Photon_Blasters_Mojo = 75,
        Anti_Matter_Missiles_Mojo = 76,
        Phase_Disruptor_Cannon = 77,
        Phase_Disruptor_Cannon_Danimoth = 78,
        Pulse_Cannon = 79,
        STS_Photon_Cannon = 80,
        STA_Photon_Cannon = 81,
        Scarab = 82,
        Stasis_Field = 83,
        Psionic_Storm = 84,
        Warp_Blades_Zeratul = 85,
        Warp_Blades_Hero = 86,

        Platform_Laser_Battery = 92,
        Independant_Laser_Battery = 93,

        Twin_Autocannons_Floor_Trap = 96,
        Hellfire_Missile_Pack_Wall_Trap = 97,
        Flame_Thrower_Wall_Trap = 98,
        Hellfire_Missile_Pack_Floor_Trap = 99,

        Neutron_Flare = 100,
        Disruption_Web = 101,
        Restoration = 102,
        Halo_Rockets = 103,
        Corrosive_Acid = 104,
        Mind_Control = 105,
        Feedback = 106,
        Optical_Flare = 107,
        Maelstrom = 108,
        Subterranean_Spines = 109,

        Warp_Blades = 111,
        C_10_Canister_Rifle_Samir_Duran = 112,
        C_10_Canister_Rifle_Infested_Duran = 113,
        Dual_Photon_Blasters_Artanis = 114,
        Anti_Matter_Missiles_Artanis = 115,
        C_10_Canister_Rifle_Alexei_Stukov = 116,

        None = 130,
        Unknown,
        MAX
      };
    }
  }
  /// This object identifies a weapon type used by a unit to attack and deal damage.
  /// Some weapon types can be upgraded while others are used for special abilities.
  ///
  /// @see WeaponTypes
  /// @ingroup TypeClasses
  class WeaponType : public Type<WeaponType, WeaponTypes::Enum::Unknown>
  {
    public:
      /// @copydoc Type::Type(int)
      WeaponType(int id = WeaponTypes::Enum::None);

      /// Retrieves the technology type that must be researched before this weapon can
      /// be used.
      ///
      /// @returns TechType required by this weapon.
      /// @retval TechTypes::None if no tech type is required to use this weapon.
      /// @see TechType::getWeapon
      TechType getTech() const;

      /// Retrieves the unit type that is intended to use this weapon type.
      ///
      /// @note There is a rare case where some hero unit types use the same weapon.
      ///
      /// @todo specify which types use the same weapon
      ///
      /// @returns The UnitType that uses this weapon.
      /// @see UnitType::groundWeapon, UnitType::airWeapon
      UnitType whatUses() const;

      /// Retrieves the base amount of damage that this weapon can deal per attack.
      ///
      /// @note That this damage amount must go through a DamageType and UnitSizeType filter
      /// before it is applied to a unit.
      ///
      /// @returns Amount of base damage that this weapon deals.
      int damageAmount() const;

      /// Determines the bonus amount of damage that this weapon type increases by for every
      /// upgrade to this type.
      ///
      /// @see upgradeType
      /// @returns Amount of damage added for every weapon upgrade.
      int damageBonus() const;

      /// Retrieves the base amount of cooldown time between each attack, in frames.
      ///
      /// @returns The amount of base cooldown applied to the unit after an attack.
      /// @see UnitInterface::getGroundWeaponCooldown, UnitInterface::getAirWeaponCooldown
      int damageCooldown() const;

      /// Obtains the intended number of missiles/attacks that are used.
      /// This is used to multiply with the damage amount to obtain the full amount of damage
      /// for an attack.
      ///
      /// @returns The damage factor multiplied by the amount to obtain the total damage.
      /// @see damageAmount
      int damageFactor() const;

      /// Retrieves the upgrade type that increases this weapon's damage output.
      ///
      /// @returns The UpgradeType used to upgrade this weapon's damage.
      /// @see damageBonus
      UpgradeType upgradeType() const;

      /// Retrieves the damage type that this weapon applies to a unit type.
      ///
      /// @returns DamageType used for damage calculation.
      /// @see DamageType, UnitSizeType
      DamageType damageType() const;

      /// Retrieves the explosion type that indicates how the weapon deals damage.
      ///
      /// @returns ExplosionType identifying how damage is applied to a target location.
      ExplosionType explosionType() const;

      /// Retrieves the minimum attack range of the weapon, measured in pixels.
      /// This value is 0 for almost all weapon types, except for WeaponTypes::Arclite_Shock_Cannon
      /// and WeaponTypes::Arclite_Shock_Cannon_Edmund_Duke.
      ///
      /// @returns Minimum attack range, in pixels.
      int minRange() const;

      /// Retrieves the maximum attack range of the weapon, measured in pixels.
      ///
      /// @returns Maximum attack range, in pixels.
      int maxRange() const;

      /// Retrieves the inner radius used for splash damage calculations, in pixels.
      ///
      /// @returns Radius of the inner splash area, in pixels.
      ///
      /// @todo Add damage calculation.
      int innerSplashRadius() const;

      /// Retrieves the middle radius used for splash damage calculations, in pixels.
      ///
      /// @returns Radius of the middle splash area, in pixels.
      ///
      /// @todo Add damage calculation.
      int medianSplashRadius() const;

      /// Retrieves the outer radius used for splash damage calculations, in pixels.
      ///
      /// @returns Radius of the outer splash area, in pixels.
      ///
      /// @todo Add damage calculation.
      int outerSplashRadius() const;

      /// Checks if this weapon type can target air units.
      ///
      /// @returns true if this weapon type can target air units, and false otherwise.
      /// @see UnitInterface::isFlying, UnitType::isFlyer
      bool targetsAir() const;

      /// Checks if this weapon type can target ground units.
      ///
      /// @returns true if this weapon type can target ground units, and false otherwise.
      /// @see UnitInterface::isFlying, UnitType::isFlyer
      bool targetsGround() const;

      /// Checks if this weapon type can only target mechanical units.
      ///
      /// @returns true if this weapon type can only target mechanical units, and false otherwise.
      /// @see targetsOrgOrMech, UnitType::isMechanical
      bool targetsMechanical() const;

      /// Checks if this weapon type can only target organic units.
      ///
      /// @returns true if this weapon type can only target organic units, and false otherwise.
      /// @see targetsOrgOrMech, UnitType::isOrganic
      bool targetsOrganic() const;

      /// Checks if this weapon type cannot target structures.
      ///
      /// @returns true if this weapon type cannot target buildings, and false if it can.
      /// @see UnitType::isBuilding
      bool targetsNonBuilding() const;

      /// Checks if this weapon type cannot target robotic units.
      ///
      /// @returns true if this weapon type cannot target robotic units, and false if it can.
      /// @see UnitType::isRobotic
      bool targetsNonRobotic() const;

      /// Checks if this weapon type can target the ground.
      ///
      /// @note This is more for attacks like @Psi_Storm which can target a location, not to be
      /// confused with attack move.
      ///
      /// @returns true if this weapon type can target a location, and false otherwise.
      bool targetsTerrain() const;

      /// Checks if this weapon type can only target organic or mechanical units.
      ///
      /// @returns true if this weapon type can only target organic or mechanical units, and false otherwise.
      /// @see targetsOrganic, targetsMechanical, UnitType::isOrganic, UnitType::isMechanical
      bool targetsOrgOrMech() const;

      /// Checks if this weapon type can only target units owned by the same player.
      /// This is used for WeaponTypes::Consume.
      ///
      /// @returns true if this weapon type can only target your own units, and false otherwise.
      /// @see UnitInterface::getPlayer
      bool targetsOwn() const;
  };

  /// @ingroup Types
  namespace WeaponTypes
  {
    /// Retrieves the set of all defined weapon types. This is a union between
    /// the normal and special weapon types.
    ///
    /// @returns set consisting of all defined weapon types.
    /// @see normalWeaponTypes, specialWeaponTypes
    const WeaponType::set& allWeaponTypes();

    /// Retrieves the set of all defined normal weapon types. This set contains
    /// all weapons that are not used for abilities.
    ///
    /// @returns constant set consisting of all normal weapon types.
    const WeaponType::set& normalWeaponTypes();

    /// Retrieves the set of all special weapon types. This set contains all
    /// weapons that are used exclusively for special unit abilities.
    ///
    /// @returns constant set consisting of all special weapon types.
    const WeaponType::set& specialWeaponTypes();

    /// @name Normal Weapons
    ///@{
    extern const WeaponType Gauss_Rifle;
    extern const WeaponType Gauss_Rifle_Jim_Raynor;
    extern const WeaponType C_10_Canister_Rifle;
    extern const WeaponType C_10_Canister_Rifle_Sarah_Kerrigan;
    extern const WeaponType C_10_Canister_Rifle_Samir_Duran;
    extern const WeaponType C_10_Canister_Rifle_Infested_Duran;
    extern const WeaponType C_10_Canister_Rifle_Alexei_Stukov;
    extern const WeaponType Fragmentation_Grenade;
    extern const WeaponType Fragmentation_Grenade_Jim_Raynor;
    extern const WeaponType Spider_Mines;
    extern const WeaponType Twin_Autocannons;
    extern const WeaponType Twin_Autocannons_Alan_Schezar;
    extern const WeaponType Hellfire_Missile_Pack;
    extern const WeaponType Hellfire_Missile_Pack_Alan_Schezar;
    extern const WeaponType Arclite_Cannon;
    extern const WeaponType Arclite_Cannon_Edmund_Duke;
    extern const WeaponType Fusion_Cutter;
    extern const WeaponType Gemini_Missiles;
    extern const WeaponType Gemini_Missiles_Tom_Kazansky;
    extern const WeaponType Burst_Lasers;
    extern const WeaponType Burst_Lasers_Tom_Kazansky;
    extern const WeaponType ATS_Laser_Battery;
    extern const WeaponType ATS_Laser_Battery_Hero;
    extern const WeaponType ATS_Laser_Battery_Hyperion;
    extern const WeaponType ATA_Laser_Battery;
    extern const WeaponType ATA_Laser_Battery_Hero;
    extern const WeaponType ATA_Laser_Battery_Hyperion;
    extern const WeaponType Flame_Thrower;
    extern const WeaponType Flame_Thrower_Gui_Montag;
    extern const WeaponType Arclite_Shock_Cannon;
    extern const WeaponType Arclite_Shock_Cannon_Edmund_Duke;
    extern const WeaponType Longbolt_Missile;
    extern const WeaponType Claws;
    extern const WeaponType Claws_Devouring_One;
    extern const WeaponType Claws_Infested_Kerrigan;
    extern const WeaponType Needle_Spines;
    extern const WeaponType Needle_Spines_Hunter_Killer;
    extern const WeaponType Kaiser_Blades;
    extern const WeaponType Kaiser_Blades_Torrasque;
    extern const WeaponType Toxic_Spores;
    extern const WeaponType Spines;
    extern const WeaponType Acid_Spore;
    extern const WeaponType Acid_Spore_Kukulza;
    extern const WeaponType Glave_Wurm;
    extern const WeaponType Glave_Wurm_Kukulza;
    extern const WeaponType Seeker_Spores;
    extern const WeaponType Subterranean_Tentacle;
    extern const WeaponType Suicide_Infested_Terran;
    extern const WeaponType Suicide_Scourge;
    extern const WeaponType Particle_Beam;
    extern const WeaponType Psi_Blades;
    extern const WeaponType Psi_Blades_Fenix;
    extern const WeaponType Phase_Disruptor;
    extern const WeaponType Phase_Disruptor_Fenix;
    extern const WeaponType Psi_Assault;
    extern const WeaponType Psionic_Shockwave;
    extern const WeaponType Psionic_Shockwave_TZ_Archon;
    extern const WeaponType Dual_Photon_Blasters;
    extern const WeaponType Dual_Photon_Blasters_Mojo;
    extern const WeaponType Dual_Photon_Blasters_Artanis;
    extern const WeaponType Anti_Matter_Missiles;
    extern const WeaponType Anti_Matter_Missiles_Mojo;
    extern const WeaponType Anti_Matter_Missiles_Artanis;
    extern const WeaponType Phase_Disruptor_Cannon;
    extern const WeaponType Phase_Disruptor_Cannon_Danimoth;
    extern const WeaponType Pulse_Cannon;
    extern const WeaponType STS_Photon_Cannon;
    extern const WeaponType STA_Photon_Cannon;
    extern const WeaponType Scarab;
    extern const WeaponType Neutron_Flare;
    extern const WeaponType Halo_Rockets;
    extern const WeaponType Corrosive_Acid;
    extern const WeaponType Subterranean_Spines;
    extern const WeaponType Warp_Blades;
    extern const WeaponType Warp_Blades_Hero;
    extern const WeaponType Warp_Blades_Zeratul;
    extern const WeaponType Independant_Laser_Battery;
    extern const WeaponType Twin_Autocannons_Floor_Trap;
    extern const WeaponType Hellfire_Missile_Pack_Wall_Trap;
    extern const WeaponType Flame_Thrower_Wall_Trap;
    extern const WeaponType Hellfire_Missile_Pack_Floor_Trap;
    ///@}

    /// @name Special Weapons
    ///@{
    extern const WeaponType Yamato_Gun;
    extern const WeaponType Nuclear_Strike;
    extern const WeaponType Lockdown;
    extern const WeaponType EMP_Shockwave;
    extern const WeaponType Irradiate;
    extern const WeaponType Parasite;
    extern const WeaponType Spawn_Broodlings;
    extern const WeaponType Ensnare;
    extern const WeaponType Dark_Swarm;
    extern const WeaponType Plague;
    extern const WeaponType Consume;
    extern const WeaponType Stasis_Field;
    extern const WeaponType Psionic_Storm;
    extern const WeaponType Disruption_Web;
    extern const WeaponType Restoration;
    extern const WeaponType Mind_Control;
    extern const WeaponType Feedback;
    extern const WeaponType Optical_Flare;
    extern const WeaponType Maelstrom;
    ///@}

    extern const WeaponType None;
    extern const WeaponType Unknown;
  }

  static_assert(sizeof(WeaponType) == sizeof(int), "Expected type to resolve to primitive size.");
}


text:
package org.apache.river.test.spec.activation.util;
import java.util.logging.Logger;
import java.util.logging.Level;
import net.jini.activation.arg.ActivationSystem;
import net.jini.activation.arg.ActivationDesc;
import net.jini.activation.arg.ActivationID;
import net.jini.activation.arg.ActivationGroupDesc;
import net.jini.activation.arg.ActivationGroupID;
import net.jini.activation.arg.ActivationInstantiator;
import net.jini.activation.arg.ActivationMonitor;
import net.jini.activation.arg.ActivationException;
import net.jini.activation.arg.UnknownGroupException;
import net.jini.activation.arg.UnknownObjectException;
import java.rmi.RemoteException;

/**
 * A fake implementation of the ActivationSystem
 * abstract class for test purposes.
 */
public class FakeActivationSystem implements ActivationSystem {
    Logger logger;

    public FakeActivationSystem(Logger logger) {
        super();
        this.logger = logger;
        logger.log(Level.FINEST, "(" + logger + ")");
    }

    public ActivationID registerObject(ActivationDesc desc)
            throws ActivationException, UnknownGroupException, RemoteException {
        logger.log(Level.FINEST, "");
        return null;
    };

    public void unregisterObject(ActivationID id)
            throws ActivationException, UnknownObjectException,
            RemoteException {
        logger.log(Level.FINEST, "");
    };

    public ActivationGroupID registerGroup(ActivationGroupDesc desc)
            throws ActivationException, RemoteException {
        logger.log(Level.FINEST, "");
        return null;
    };

    public ActivationMonitor activeGroup(ActivationGroupID id,
            ActivationInstantiator group, long incarnation)
            throws UnknownGroupException, ActivationException, RemoteException {
        logger.log(Level.FINEST, "");
        return null;
    };

    public void unregisterGroup(ActivationGroupID id)
            throws ActivationException, UnknownGroupException, RemoteException {
        logger.log(Level.FINEST, "");
        return;
    };

    public void shutdown() throws RemoteException { };

    public ActivationDesc setActivationDesc(ActivationID id,
            ActivationDesc desc)
            throws ActivationException, UnknownObjectException,
            UnknownGroupException, RemoteException {
        logger.log(Level.FINEST, "");
        return null;
    };

    public ActivationGroupDesc setActivationGroupDesc(ActivationGroupID id,
            ActivationGroupDesc desc)
            throws ActivationException, UnknownGroupException, RemoteException {
        logger.log(Level.FINEST, "");
        return null;
    };

    public ActivationDesc getActivationDesc(ActivationID id)
            throws ActivationException, UnknownObjectException,
            RemoteException {
        logger.log(Level.FINEST, "");
        return null;
    };

    public ActivationGroupDesc getActivationGroupDesc(ActivationGroupID id)
            throws ActivationException, UnknownGroupException, RemoteException {
        logger.log(Level.FINEST, "");
        return null;
    };
}