text:
using System.Collections.Generic;
using System.Threading.Tasks;
using Orchard.ContentManagement.Metadata.Models;

namespace Orchard.ContentManagement
{
    /// <summary>
    /// Content management functionality to deal with Orchard content items and their parts
    /// </summary>
    public interface IContentManager
    {
        IEnumerable<ContentTypeDefinition> GetContentTypeDefinitions();

        /// <summary>
        /// Instantiates a new content item with the specified type
        /// </summary>
        /// <remarks>
        /// The content item is not yet persisted!
        /// </remarks>
        /// <param name="contentType">The name of the content type</param>
        ContentItem New(string contentType);

        /// <summary>
        /// Creates (persists) a new content item
        /// </summary>
        /// <param name="contentItem">The content instance filled with all necessary data</param>
        void Create(ContentItem contentItem);

        /// <summary>
        /// Creates (persists) a new content item with the specified version
        /// </summary>
        /// <param name="contentItem">The content instance filled with all necessary data</param>
        /// <param name="options">The version to create the item with</param>
        void Create(ContentItem contentItem, VersionOptions options);

        /// <summary>
        /// Gets the content item with the specified id
        /// </summary>
        /// <param name="id">Numeric id of the content item</param>
        Task<ContentItem> GetAsync(int id);

        /// <summary>
        /// Gets the content item with the specified id and version
        /// </summary>
        /// <param name="id">Numeric id of the content item</param>
        /// <param name="options">The version option</param>
        Task<ContentItem> GetAsync(int id, VersionOptions options);

        /// <summary>
        /// Removes <see cref="ContentItem.Latest"/> and <see cref="ContentItem.Published"/> flags
        /// from a content item, making it invisible from the system. It doesn't physically delete
        /// the content item.
        /// </summary>
        /// <param name="contentItem"></param>
        Task RemoveAsync(ContentItem contentItem);

        Task PublishAsync(ContentItem contentItem);
        Task UnpublishAsync(ContentItem contentItem);
        ContentItemMetadata GetItemMetadata(IContent content);
    }

    public class VersionOptions
    {
        /// <summary>
        /// Gets the latest version.
        /// </summary>
        public static VersionOptions Latest { get { return new VersionOptions { IsLatest = true }; } }

        /// <summary>
        /// Gets the latest published version.
        /// </summary>
        public static VersionOptions Published { get { return new VersionOptions { IsPublished = true }; } }

        /// <summary>
        /// Gets the latest draft version.
        /// </summary>
        public static VersionOptions Draft { get { return new VersionOptions { IsDraft = true }; } }

        /// <summary>
        /// Gets the latest version and creates a new version draft based on it.
        /// </summary>
        public static VersionOptions DraftRequired { get { return new VersionOptions { IsDraft = true, IsDraftRequired = true }; } }

        /// <summary>
        /// Gets all versions.
        /// </summary>
        public static VersionOptions AllVersions { get { return new VersionOptions { IsAllVersions = true }; } }

        /// <summary>
        /// Gets a specific version based on its number.
        /// </summary>
        public static VersionOptions Number(int version) { return new VersionOptions { VersionNumber = version }; }

        /// <summary>
        /// Gets a specific version based on the version record identifier.
        /// </summary>
        public static VersionOptions VersionRecord(int id) { return new VersionOptions { VersionRecordId = id }; }

        /// <summary>
        /// Creates a new version based on the specified version number.
        /// </summary>
        public static VersionOptions Restore(int version, bool publish = false) { return new VersionOptions { VersionNumber = version, IsPublished = publish }; }

        public bool IsLatest { get; private set; }
        public bool IsPublished { get; private set; }
        public bool IsDraft { get; private set; }
        public bool IsDraftRequired { get; private set; }
        public bool IsAllVersions { get; private set; }
        public int VersionNumber { get; private set; }
        public int VersionRecordId { get; private set; }
    }
}


text:
using System;
using System.Collections.Generic;
using NUnit.Framework;
using Is = NUnit.DeepObjectCompare.Is;

namespace Miracle.Settings.Tests
{
    [TestFixture]
    public class NullableSettingsTest
    {
        [Test]
        public void Test()
        {
            var timespan = TimeSpan.FromMilliseconds(9514593762);
            var number = 1234567;
            var animal = AnimalType.Rabbit;

            var settingsLoader = new SettingsLoader(new DictionaryValueProvider(new Dictionary<string, string>
            {
                {nameof(NullableSettings.NullableTimespan), timespan.ToString()},
                {nameof(NullableSettings.NullableInt), number.ToString()},
                {nameof(NullableSettings.NullableAnimal), animal.ToString()},
            }));

            var setting = settingsLoader.Create<NullableSettings>();

            Assert.That(setting, Is.Not.Null);
            Assert.That(setting.NullableTimespan, Is.EqualTo(timespan));
            Assert.That(setting.NullableInt, Is.EqualTo(number));
            Assert.That(setting.NullableAnimal, Is.EqualTo(animal));
        }
    }

    [TestFixture]
    public class NullableSettingsTest2 : LoadTestBase
    {
        public NullableSettingsTest2()
            : base(TestSettingsLoader
                .GetSettingsLoader()
                .AddProvider(new EnvironmentValueProvider()))
        {
        }

        [Test]
        public void NullableLoadTest()
        {

            // NOTE! This will fail in .NET Core due to bug in Json Configuration loader
            // Only reason this will work is because properties is annotated with [Setting(IgnoreValue = "")]
            var settings = SettingsLoader.Create<NullableSettings>();

            Assert.That(settings.NullableTimespan, Is.Null);
            Assert.That(settings.NullableInt, Is.Null);
            Assert.That(settings.NullableAnimal, Is.Null);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package sun;

public class Relevant_word {
	public Word word;
	public double score;
	public Relevant_word(Word w, double score){
		this.word=w;
		this.score=score;
	}
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.9.1: http://docutils.sourceforge.net/" />
<title>GraphicsMagick Color Quantization</title>
<link rel="stylesheet" href="docutils-articles.css" type="text/css" />

GraphicsMagick
<form action="http://www.google.com/search">
	<input type="hidden" name="domains" value="www.graphicsmagick.org" />
	<input type="hidden" name="sitesearch" value="www.graphicsmagick.org" />
    <input type="text" name="q" size="25" maxlength="255" /> <input type="submit" name="sa" value="Search" />
</form>

Home

Project

Download

Install

Source

News

Utilities

Programming

Reference

GraphicsMagick Color Quantization

This document describes how GraphicsMagick performs color
reduction on an image. To fully understand this document,
you should have a knowledge of basic imaging techniques and
the tree data structure and terminology.

Description

For purposes of color allocation, an image is a set of n pixels, where
each pixel is a point in RGB space. RGB space is a 3-dimensional vector
space, and each pixel, p(i), is defined by an ordered triple of red,
green, and blue coordinates, (r(i),g(i),b(i)).

Each primary color component (red, green, or blue) represents an
intensity which varies linearly from 0 to a maximum value, Cmax, which
corresponds to full saturation of that color. Color allocation is defined
over a domain consisting of the cube in RGB space with opposite vertices
at (0,0,0) and (Cmax ,Cmax,Cmax). GraphicsMagick requires Cmax= 255.

The algorithm maps this domain onto a tree in which each node represents
a cube within that domain. In the following discussion, these cubes are
defined by the coordinate of two opposite vertices: The vertex nearest
the origin in RGB space and the vertex farthest from the origin.

The tree's root node represents the the entire domain, (0,0,0) through
(Cmax, Cmax,Cmax). Each lower level in the tree is generated by
subdividing one node's cube into eight smaller cubes of equal size. This
corresponds to bisecting the parent cube with planes passing through the
midpoints of each edge.

The basic algorithm operates in three phases:

Classification,

Reduction, and

Assignment.

Classification builds a color description tree for the image. Reduction
collapses the tree until the number it represents, at most, is the number
of colors desired in the output image. Assignment defines the output
image's color map and sets each pixel's color by reclassification in the
reduced tree. Our goal is to minimize the numerical discrepancies between
the original colors and quantized colors. To learn more about
quantization error, see Measuring Color Reduction Error later in this
document.

Classification begins by initializing a color description tree of
sufficient depth to represent each possible input color in a leaf.
However, it is impractical to generate a fully-formed color description
tree in the classification phase for realistic values of Cmax. If color
components in the input image are quantized to k-bit precision, so that
Cmax = 2^k-1, the tree would need k levels below the root node to allow
representing each possible input color in a leaf. This becomes
prohibitive because the tree's:

total number of nodes = 1+Sum(8^i), i=1,k

For k=8,
Number of nodes= 1 + (8^1+8^2+....+8^8)
8^8 - 1
= 1 + 8.-----------
8 - 1
= 19,173,961

Therefore, to avoid building a fully populated tree, GraphicsMagick:

Initializes data structures for nodes only as they are needed;

Chooses a maximum depth for the tree as a function of the desired
number of colors in the output image (currently based-two logarithm
of Cmax).

For Cmax=255,

Maximum tree depth = log (256)
2

= log (256) / log (2)
e e

= 8

A tree of this depth generally allows the best representation of the
source image with the fastest computational speed and the least amount of
memory. However, the default depth is inappropriate for some images.
Therefore, the caller can request a specific tree depth.

For each pixel in the input image, classification scans downward from the
root of the color description tree. At each level of the tree, it
identifies the single node which represents a cube in RGB space
containing the pixel's color. It updates the following data for each such
node:

n1:

Number of pixels whose color is contained in the RGB cube which
this node represents;

n2:

Number of pixels whose color is not represented in a node at lower
depth in the tree; initially, n2=0 for all nodes except leaves of
the tree.

Sr,Sg,Sb:

Sums of the red, green, and blue component values for all pixels
not classified at a lower depth. The combination of these sums and
n2 will ultimately characterize the mean color of a set of pixels
represented by this node.

E:

The distance squared in RGB space between each pixel contained
within a node and the nodes' center. This represents the
quantization error for a node.

Reduction repeatedly prunes the tree until the number of nodes with n2 >
0 is less than or equal to the maximum number of colors allowed in the
output image. On any given iteration over the tree, it selects those
nodes whose E value is minimal for pruning and merges their color
statistics upward. It uses a pruning threshold, Ep, to govern node
selection as follows:

Ep = 0
while number of nodes with (n2 > 0) > required maximum number of colors
prune all nodes such that E <= Ep
Set Ep to minimum E in remaining nodes

This has the effect of minimizing any quantization error when merging two
nodes together.

When a node to be pruned has offspring, the pruning procedure invokes
itself recursively in order to prune the tree from the leaves upward. The
values of n2 ,Sr, Sg and Sb in a node being pruned are always added to
the corresponding data in that node's parent. This retains the pruned
node's color characteristics for later averaging.

For each node, n2 pixels exist for which that node represents the
smallest volume in RGB space containing those pixel's colors. When n2 > 0
the node will uniquely define a color in the output image. At the
beginning of reduction, n2 = 0 for all nodes except the leaves of the
tree which represent colors present in the input image.

The other pixel count, n1, indicates the total number of colors within
the cubic volume which the node represents. This includes n1 - n2 pixels
whose colors should be defined by nodes at a lower level in the tree.

Assignment generates the output image from the pruned tree. The output
image consists of two parts:

A color map, which is an array of color descriptions (RGB triples)
for each color present in the output image.

A pixel array, which represents each pixel as an index into the
color map array.

First, the assignment phase makes one pass over the pruned color
description tree to establish the image's color map. For each node with
n2 > 0, it divides Sr, Sg, and Sb by n2. This produces the mean color of
all pixels that classify no lower than this node. Each of these colors
becomes an entry in the color map.

Finally, the assignment phase reclassifies each pixel in the pruned tree
to identify the deepest node containing the pixel's color. The pixel's
value in the pixel array becomes the index of this node's mean color in
the color map.

Empirical evidence suggests that the distances in color spaces such as
YUV, or YIQ correspond to perceptual color differences more closely than
do distances in RGB space. These color spaces may give better results
when color reducing an image. Here the algorithm is as described except
each pixel is a point in the alternate color space. For convenience, the
color components are normalized to the range 0 to a maximum value, Cmax.
The color reduction can then proceed as described.

Measuring Color Reduction Error

Depending on the image, the color reduction error may be obvious or
invisible. Images with high spatial frequencies (such as hair or grass)
will show error much less than pictures with large smoothly shaded areas
(such as faces). This is because the high-frequency contour edges
introduced by the color reduction process are masked by the high
frequencies in the image.

To measure the difference between the original and color reduced images
(the total color reduction error), GraphicsMagick sums over all pixels in
an image the distance squared in RGB space between each original pixel
value and its color reduced value. GraphicsMagick prints several error
measurements including the mean error per pixel, the normalized mean
error, and the normalized maximum error.

The normalized error measurement can be used to compare images. In
general, the closer the mean error is to zero the more the quantized
image resembles the source image. Ideally, the error should be
perceptually-based, since the human eye is the final judge of
quantization quality.

These errors are measured and printed when -verbose and -colorsare
specified on the command line:

mean error per pixel:

is the mean error for any single pixel in the image.

normalized mean square error:

is the normalized mean square quantization error for any single
pixel in the image.
This distance measure is normalized to a range between 0 and 1. It
is independent of the range of red, green, and blue values in the
image.

normalized maximum square error:

is the largest normalized square quantization error for any single
pixel in the image.
This distance measure is normalized to a range between and blue
values in the image.

Authors

John Cristy, magick@imagemagick.org, ImageMagick Studio.

Acknowledgements

Paul Raveling, USC Information Sciences Institute, for the original idea
of using space subdivision for the color reduction algorithm. With Paul's
permission, this document is an adaptation from a document he wrote.

Copyright © GraphicsMagick Group 2002 - 2015


text:
<?php
// WARNING, this is a read only file created by import scripts
// WARNING
// WARNING,  Changes made to this file will be clobbered
// WARNING
// WARNING,  Please make changes on poeditor instead of here
//
//
?>
Asunto: Fichero(s) eliminado(s)

{alternative:plain}

Hola,

Su transferencia n°{transfer.id} ha sido eliminada del servicio FileSender de {cfg:site_name} y ya no está disponible para su descarga ({transfer.link}).

Saludos,
{cfg:site_name}

{alternative:html}

    Hola,

    Su transferencia n°{transfer.id} ha sido eliminada del servicio FileSender de {cfg:site_name} y ya no está disponible para su descarga.

    Saludos,

    {cfg:site_name}


text:
import { Router } from 'express';
import authController from '../controllers/authController';
import { requireSignIn } from '../middleware/passport';

/**
 * Follow this format for normal routing
 */
const auth = () => {
  let api = Router();
  api.post('/signup', authController.signUp);
  api.post('/signin', requireSignIn, authController.signIn);
  return api;
}

export default auth();


text:
@implementation FusionActor
@synthesize name = _name;

-(id)initWithConfig:(NSDictionary *)config {
    self = [super init];
    if (self) {
        _config = SafeRetain(config);

        NSDictionary *filterConfig = [_config valueForKey:@"filter"];
        if (filterConfig && [filterConfig isKindOfClass:[NSNull class]] == NO) {
            _filter = [[NSClassFromString([filterConfig valueForKey:@"class"]) alloc] initWithConfig:filterConfig];
        }
    }
    return self;
}

- (BOOL)filterFusionNativeMessage:(FusionNativeMessage *)message {
    if (_filter) {
        return [_filter filterFusionNativeMessage:message];
    }
    return YES;
}

- (void)processFusionNativeMessage:(FusionNativeMessage *)message {

}

- (void)processCallbackMessage:(FusionNativeMessage *)message
                 ParentMessage:(FusionNativeMessage *)parent {
    if ([parent getChildrenCount] == 0)
        [parent setState:FusionNativeMessageFinish];
}

- (void)cancelFusionNativeMessage:(FusionNativeMessage *)message {
    if ([message getChildrenCount] != 0) {
        [[FusionCore getInstance] dispatchCancelMessageArray:[message getChildren]];
        [message clearSubMessage];
    }
}

-(void)dealloc {
    SafeRelease(_filter);
    SafeRelease(_config);
    SafeRelease(_name);
    SafeSuperDealloc(super);
}
@end


text:
package geflo.pattern;

public interface GeFLoPattern {

	/**
	 * Checks if this pattern or any sub pattern
	 * equals to the first argument.
	 *
	 * @param pattern
	 * @return
	 */
	public boolean owns(GeFLoPattern pattern);

	/**
	 * Get the pattern as a regular expression compatible
	 * to the Java-Pattern implementation.
	 *
	 * @return
	 */
	public String toJavaPattern();

	/**
	 * This method does nearly the same like:
	 * 	@see{GeFLoPattern.toJavaPattern()}
	 * But as difference the last sub pattern will be
	 * prepared as line number matcher. This causes
	 * that the Java-Pattern will be prefixed by a
	 * line number matching pattern.
	 *
	 * @throws LineMatchingNotSupportedException
	 * @return
	 */
	public String toLineMatchingJavaPattern();

}


text:
class VRPN_API vrpn_Tracker_Crossbow: public vrpn_Tracker_Serial {
public:
	/// The constructor is given the name of the tracker (the name of
	/// the sender it should use), the connection on which it is to
	/// send its messages, the name of the serial port it is to open
	/// (default is /dev/ttyS0 (first serial port in Linux), the baud
	/// rate at which it is to communicate (default 38400), the linear
	/// acceleration range of the sensor in Gs (default 2), and the
	/// angular acceleration range of the sensor in degrees per second
	/// (default 100).

	vrpn_Tracker_Crossbow(const char *name, vrpn_Connection *c,
				const char *port = "/dev/ttyS0", long baud = 38400,
				float g_range = 2.0f, float ar_range = 100.0f);

	~vrpn_Tracker_Crossbow();

	// Run through the main loop once, sending notification messages as necessary
	virtual void mainloop();

	// Reset the tracker.
	void reset();

	// Get reports from the serial port
	int get_report();

	// Retrieve the device's serial number. This is cached between resets.
	vrpn_uint32 get_serial_number();

	// Retrieve the device's version string. This is cached between resets.
	const char *get_version_string();

	// Recalibrates and zeros the device's rate sensors over a specified # of samples.
	// This takes about 3-4ms per sample, during which time the process blocks.
	// The device does not have to be level when zeroing, but must be still.
	void recalibrate(vrpn_uint16 num_samples = 20000);

protected:
	struct raw_packet {
		vrpn_uint16 header;
		vrpn_int16 roll_angle;
		vrpn_int16 pitch_angle;
		vrpn_int16 yaw_rate;
		vrpn_int16 accel_x;
		vrpn_int16 accel_y;
		vrpn_int16 accel_z;
		vrpn_uint16 timer;
		vrpn_int16 temp_voltage;
		vrpn_int16 part_number;
		vrpn_int16 status;
		vrpn_uint16 checksum;
	};

	struct timeval init_time;
	float lin_accel_range;
	float ang_accel_range;

	vrpn_uint32 device_serial; // Device serial number
	char *device_version; // Device version string

	int just_read_something;

	void unbuffer_packet(raw_packet &dest, unsigned char *buffer);
	int validate_packet(const raw_packet &packet);
	void process_packet(const raw_packet &packet);

	float convert_scalar(vrpn_int16 data, float scale) const;
	void xb_quat_from_euler(q_type destQuat, double pitch, double roll) const;

	void send_report();

	void ping();

};

#endif


text:
package org.apache.camel.builder.endpoint.dsl;

import java.util.*;
import java.util.Map;
import java.util.concurrent.*;
import java.util.function.*;
import java.util.stream.*;
import javax.annotation.Generated;
import org.apache.camel.builder.EndpointConsumerBuilder;
import org.apache.camel.builder.EndpointProducerBuilder;
import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;

/**
 * Schedule sending of messages using the Quartz 2.x scheduler.
 *
 * Generated by camel build tools - do NOT edit this file!
 */
@Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
public interface QuartzEndpointBuilderFactory {

    /**
     * Builder for endpoint for the Quartz component.
     */
    public interface QuartzEndpointBuilder extends EndpointConsumerBuilder {
        default AdvancedQuartzEndpointBuilder advanced() {
            return (AdvancedQuartzEndpointBuilder) this;
        }
        /**
         * Allows for bridging the consumer to the Camel routing Error Handler,
         * which mean any exceptions occurred while the consumer is trying to
         * pickup incoming messages, or the likes, will now be processed as a
         * message and handled by the routing Error Handler. By default the
         * consumer will use the org.apache.camel.spi.ExceptionHandler to deal
         * with exceptions, that will be logged at WARN or ERROR level and
         * ignored.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: consumer
         *
         * @param bridgeErrorHandler the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder bridgeErrorHandler(
                boolean bridgeErrorHandler) {
            doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
            return this;
        }
        /**
         * Allows for bridging the consumer to the Camel routing Error Handler,
         * which mean any exceptions occurred while the consumer is trying to
         * pickup incoming messages, or the likes, will now be processed as a
         * message and handled by the routing Error Handler. By default the
         * consumer will use the org.apache.camel.spi.ExceptionHandler to deal
         * with exceptions, that will be logged at WARN or ERROR level and
         * ignored.
         *
         * The option will be converted to a boolean
         * type.
         *
         * Default: false
         * Group: consumer
         *
         * @param bridgeErrorHandler the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder bridgeErrorHandler(
                String bridgeErrorHandler) {
            doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
            return this;
        }
        /**
         * Specifies a cron expression to define when to trigger.
         *
         * The option is a: java.lang.String type.
         *
         * Group: consumer
         *
         * @param cron the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder cron(String cron) {
            doSetProperty("cron", cron);
            return this;
        }
        /**
         * If set to true, then the trigger automatically delete when route
         * stop. Else if set to false, it will remain in scheduler. When set to
         * false, it will also mean user may reuse pre-configured trigger with
         * camel Uri. Just ensure the names match. Notice you cannot have both
         * deleteJob and pauseJob set to true.
         *
         * The option is a: boolean type.
         *
         * Default: true
         * Group: consumer
         *
         * @param deleteJob the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder deleteJob(boolean deleteJob) {
            doSetProperty("deleteJob", deleteJob);
            return this;
        }
        /**
         * If set to true, then the trigger automatically delete when route
         * stop. Else if set to false, it will remain in scheduler. When set to
         * false, it will also mean user may reuse pre-configured trigger with
         * camel Uri. Just ensure the names match. Notice you cannot have both
         * deleteJob and pauseJob set to true.
         *
         * The option will be converted to a boolean
         * type.
         *
         * Default: true
         * Group: consumer
         *
         * @param deleteJob the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder deleteJob(String deleteJob) {
            doSetProperty("deleteJob", deleteJob);
            return this;
        }
        /**
         * Whether or not the job should remain stored after it is orphaned (no
         * triggers point to it).
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: consumer
         *
         * @param durableJob the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder durableJob(boolean durableJob) {
            doSetProperty("durableJob", durableJob);
            return this;
        }
        /**
         * Whether or not the job should remain stored after it is orphaned (no
         * triggers point to it).
         *
         * The option will be converted to a boolean
         * type.
         *
         * Default: false
         * Group: consumer
         *
         * @param durableJob the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder durableJob(String durableJob) {
            doSetProperty("durableJob", durableJob);
            return this;
        }
        /**
         * If set to true, then the trigger automatically pauses when route
         * stop. Else if set to false, it will remain in scheduler. When set to
         * false, it will also mean user may reuse pre-configured trigger with
         * camel Uri. Just ensure the names match. Notice you cannot have both
         * deleteJob and pauseJob set to true.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: consumer
         *
         * @param pauseJob the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder pauseJob(boolean pauseJob) {
            doSetProperty("pauseJob", pauseJob);
            return this;
        }
        /**
         * If set to true, then the trigger automatically pauses when route
         * stop. Else if set to false, it will remain in scheduler. When set to
         * false, it will also mean user may reuse pre-configured trigger with
         * camel Uri. Just ensure the names match. Notice you cannot have both
         * deleteJob and pauseJob set to true.
         *
         * The option will be converted to a boolean
         * type.
         *
         * Default: false
         * Group: consumer
         *
         * @param pauseJob the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder pauseJob(String pauseJob) {
            doSetProperty("pauseJob", pauseJob);
            return this;
        }
        /**
         * Instructs the scheduler whether or not the job should be re-executed
         * if a 'recovery' or 'fail-over' situation is encountered.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: consumer
         *
         * @param recoverableJob the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder recoverableJob(boolean recoverableJob) {
            doSetProperty("recoverableJob", recoverableJob);
            return this;
        }
        /**
         * Instructs the scheduler whether or not the job should be re-executed
         * if a 'recovery' or 'fail-over' situation is encountered.
         *
         * The option will be converted to a boolean
         * type.
         *
         * Default: false
         * Group: consumer
         *
         * @param recoverableJob the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder recoverableJob(String recoverableJob) {
            doSetProperty("recoverableJob", recoverableJob);
            return this;
        }
        /**
         * Uses a Quartz PersistJobDataAfterExecution and
         * DisallowConcurrentExecution instead of the default job.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: consumer
         *
         * @param stateful the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder stateful(boolean stateful) {
            doSetProperty("stateful", stateful);
            return this;
        }
        /**
         * Uses a Quartz PersistJobDataAfterExecution and
         * DisallowConcurrentExecution instead of the default job.
         *
         * The option will be converted to a boolean
         * type.
         *
         * Default: false
         * Group: consumer
         *
         * @param stateful the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder stateful(String stateful) {
            doSetProperty("stateful", stateful);
            return this;
        }
        /**
         * Whether or not the scheduler should be auto started.
         *
         * The option is a: boolean type.
         *
         * Default: true
         * Group: scheduler
         *
         * @param autoStartScheduler the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder autoStartScheduler(
                boolean autoStartScheduler) {
            doSetProperty("autoStartScheduler", autoStartScheduler);
            return this;
        }
        /**
         * Whether or not the scheduler should be auto started.
         *
         * The option will be converted to a boolean
         * type.
         *
         * Default: true
         * Group: scheduler
         *
         * @param autoStartScheduler the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder autoStartScheduler(
                String autoStartScheduler) {
            doSetProperty("autoStartScheduler", autoStartScheduler);
            return this;
        }
        /**
         * In case of scheduler has already started, we want the trigger start
         * slightly after current time to ensure endpoint is fully started
         * before the job kicks in. Negative value shifts trigger start time in
         * the past.
         *
         * The option is a: long type.
         *
         * Default: 500
         * Group: scheduler
         *
         * @param triggerStartDelay the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder triggerStartDelay(long triggerStartDelay) {
            doSetProperty("triggerStartDelay", triggerStartDelay);
            return this;
        }
        /**
         * In case of scheduler has already started, we want the trigger start
         * slightly after current time to ensure endpoint is fully started
         * before the job kicks in. Negative value shifts trigger start time in
         * the past.
         *
         * The option will be converted to a long type.
         *
         * Default: 500
         * Group: scheduler
         *
         * @param triggerStartDelay the value to set
         * @return the dsl builder
         */
        default QuartzEndpointBuilder triggerStartDelay(String triggerStartDelay) {
            doSetProperty("triggerStartDelay", triggerStartDelay);
            return this;
        }
    }

    /**
     * Advanced builder for endpoint for the Quartz component.
     */
    public interface AdvancedQuartzEndpointBuilder
            extends
                EndpointConsumerBuilder {
        default QuartzEndpointBuilder basic() {
            return (QuartzEndpointBuilder) this;
        }
        /**
         * To let the consumer use a custom ExceptionHandler. Notice if the
         * option bridgeErrorHandler is enabled then this option is not in use.
         * By default the consumer will deal with exceptions, that will be
         * logged at WARN or ERROR level and ignored.
         *
         * The option is a:
         * org.apache.camel.spi.ExceptionHandler type.
         *
         * Group: consumer (advanced)
         *
         * @param exceptionHandler the value to set
         * @return the dsl builder
         */
        default AdvancedQuartzEndpointBuilder exceptionHandler(
                org.apache.camel.spi.ExceptionHandler exceptionHandler) {
            doSetProperty("exceptionHandler", exceptionHandler);
            return this;
        }
        /**
         * To let the consumer use a custom ExceptionHandler. Notice if the
         * option bridgeErrorHandler is enabled then this option is not in use.
         * By default the consumer will deal with exceptions, that will be
         * logged at WARN or ERROR level and ignored.
         *
         * The option will be converted to a
         * org.apache.camel.spi.ExceptionHandler type.
         *
         * Group: consumer (advanced)
         *
         * @param exceptionHandler the value to set
         * @return the dsl builder
         */
        default AdvancedQuartzEndpointBuilder exceptionHandler(
                String exceptionHandler) {
            doSetProperty("exceptionHandler", exceptionHandler);
            return this;
        }
        /**
         * Sets the exchange pattern when the consumer creates an exchange.
         *
         * The option is a:
         * org.apache.camel.ExchangePattern type.
         *
         * Group: consumer (advanced)
         *
         * @param exchangePattern the value to set
         * @return the dsl builder
         */
        default AdvancedQuartzEndpointBuilder exchangePattern(
                org.apache.camel.ExchangePattern exchangePattern) {
            doSetProperty("exchangePattern", exchangePattern);
            return this;
        }
        /**
         * Sets the exchange pattern when the consumer creates an exchange.
         *
         * The option will be converted to a
         * org.apache.camel.ExchangePattern type.
         *
         * Group: consumer (advanced)
         *
         * @param exchangePattern the value to set
         * @return the dsl builder
         */
        default AdvancedQuartzEndpointBuilder exchangePattern(
                String exchangePattern) {
            doSetProperty("exchangePattern", exchangePattern);
            return this;
        }
        /**
         * Specifies a custom calendar to avoid specific range of date.
         *
         * The option is a: org.quartz.Calendar type.
         *
         * Group: advanced
         *
         * @param customCalendar the value to set
         * @return the dsl builder
         */
        default AdvancedQuartzEndpointBuilder customCalendar(
                org.quartz.Calendar customCalendar) {
            doSetProperty("customCalendar", customCalendar);
            return this;
        }
        /**
         * Specifies a custom calendar to avoid specific range of date.
         *
         * The option will be converted to a
         * org.quartz.Calendar type.
         *
         * Group: advanced
         *
         * @param customCalendar the value to set
         * @return the dsl builder
         */
        default AdvancedQuartzEndpointBuilder customCalendar(
                String customCalendar) {
            doSetProperty("customCalendar", customCalendar);
            return this;
        }
        /**
         * To configure additional options on the job.
         *
         * The option is a: java.util.Map<java.lang.String,
         * java.lang.Object> type.
         * The option is multivalued, and you can use the jobParameters(String,
         * Object) method to add a value (call the method multiple times to set
         * more values).
         *
         * Group: advanced
         *
         * @param key the option key
         * @param value the option value
         * @return the dsl builder
         */
        default AdvancedQuartzEndpointBuilder jobParameters(
                String key,
                Object value) {
            doSetMultiValueProperty("jobParameters", "job." + key, value);
            return this;
        }
        /**
         * To configure additional options on the job.
         *
         * The option is a: java.util.Map<java.lang.String,
         * java.lang.Object> type.
         * The option is multivalued, and you can use the jobParameters(String,
         * Object) method to add a value (call the method multiple times to set
         * more values).
         *
         * Group: advanced
         *
         * @param values the values
         * @return the dsl builder
         */
        default AdvancedQuartzEndpointBuilder jobParameters(Map values) {
            doSetMultiValueProperties("jobParameters", "job.", values);
            return this;
        }
        /**
         * Whether the job name should be prefixed with endpoint id.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: advanced
         *
         * @param prefixJobNameWithEndpointId the value to set
         * @return the dsl builder
         */
        default AdvancedQuartzEndpointBuilder prefixJobNameWithEndpointId(
                boolean prefixJobNameWithEndpointId) {
            doSetProperty("prefixJobNameWithEndpointId", prefixJobNameWithEndpointId);
            return this;
        }
        /**
         * Whether the job name should be prefixed with endpoint id.
         *
         * The option will be converted to a boolean
         * type.
         *
         * Default: false
         * Group: advanced
         *
         * @param prefixJobNameWithEndpointId the value to set
         * @return the dsl builder
         */
        default AdvancedQuartzEndpointBuilder prefixJobNameWithEndpointId(
                String prefixJobNameWithEndpointId) {
            doSetProperty("prefixJobNameWithEndpointId", prefixJobNameWithEndpointId);
            return this;
        }
        /**
         * To configure additional options on the trigger. The parameter
         * timeZone is supported if the cron option is present. Otherwise the
         * parameters repeatInterval and repeatCount are supported. Note: When
         * using repeatInterval values of 1000 or less, the first few events
         * after starting the camel context may be fired more rapidly than
         * expected.
         *
         * The option is a: java.util.Map<java.lang.String,
         * java.lang.Object> type.
         * The option is multivalued, and you can use the
         * triggerParameters(String, Object) method to add a value (call the
         * method multiple times to set more values).
         *
         * Group: advanced
         *
         * @param key the option key
         * @param value the option value
         * @return the dsl builder
         */
        default AdvancedQuartzEndpointBuilder triggerParameters(
                String key,
                Object value) {
            doSetMultiValueProperty("triggerParameters", "trigger." + key, value);
            return this;
        }
        /**
         * To configure additional options on the trigger. The parameter
         * timeZone is supported if the cron option is present. Otherwise the
         * parameters repeatInterval and repeatCount are supported. Note: When
         * using repeatInterval values of 1000 or less, the first few events
         * after starting the camel context may be fired more rapidly than
         * expected.
         *
         * The option is a: java.util.Map<java.lang.String,
         * java.lang.Object> type.
         * The option is multivalued, and you can use the
         * triggerParameters(String, Object) method to add a value (call the
         * method multiple times to set more values).
         *
         * Group: advanced
         *
         * @param values the values
         * @return the dsl builder
         */
        default AdvancedQuartzEndpointBuilder triggerParameters(Map values) {
            doSetMultiValueProperties("triggerParameters", "trigger.", values);
            return this;
        }
        /**
         * If it is true, JobDataMap uses the CamelContext name directly to
         * reference the CamelContext, if it is false, JobDataMap uses use the
         * CamelContext management name which could be changed during the deploy
         * time.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: advanced
         *
         * @param usingFixedCamelContextName the value to set
         * @return the dsl builder
         */
        default AdvancedQuartzEndpointBuilder usingFixedCamelContextName(
                boolean usingFixedCamelContextName) {
            doSetProperty("usingFixedCamelContextName", usingFixedCamelContextName);
            return this;
        }
        /**
         * If it is true, JobDataMap uses the CamelContext name directly to
         * reference the CamelContext, if it is false, JobDataMap uses use the
         * CamelContext management name which could be changed during the deploy
         * time.
         *
         * The option will be converted to a boolean
         * type.
         *
         * Default: false
         * Group: advanced
         *
         * @param usingFixedCamelContextName the value to set
         * @return the dsl builder
         */
        default AdvancedQuartzEndpointBuilder usingFixedCamelContextName(
                String usingFixedCamelContextName) {
            doSetProperty("usingFixedCamelContextName", usingFixedCamelContextName);
            return this;
        }
    }

    public interface QuartzBuilders {
        /**
         * Quartz (camel-quartz)
         * Schedule sending of messages using the Quartz 2.x scheduler.
         *
         * Category: scheduling
         * Since: 2.12
         * Maven coordinates: org.apache.camel:camel-quartz
         *
         * Syntax: quartz:groupName/triggerName
         *
         * Path parameter: groupName
         * The quartz group name to use. The combination of group name and
         * trigger name should be unique.
         * Default value: Camel
         *
         * Path parameter: triggerName (required)
         * The quartz trigger name to use. The combination of group name and
         * trigger name should be unique.
         *
         * @param path groupName/triggerName
         * @return the dsl builder
         */
        default QuartzEndpointBuilder quartz(String path) {
            return QuartzEndpointBuilderFactory.endpointBuilder("quartz", path);
        }
        /**
         * Quartz (camel-quartz)
         * Schedule sending of messages using the Quartz 2.x scheduler.
         *
         * Category: scheduling
         * Since: 2.12
         * Maven coordinates: org.apache.camel:camel-quartz
         *
         * Syntax: quartz:groupName/triggerName
         *
         * Path parameter: groupName
         * The quartz group name to use. The combination of group name and
         * trigger name should be unique.
         * Default value: Camel
         *
         * Path parameter: triggerName (required)
         * The quartz trigger name to use. The combination of group name and
         * trigger name should be unique.
         *
         * @param componentName to use a custom component name for the endpoint
         * instead of the default name
         * @param path groupName/triggerName
         * @return the dsl builder
         */
        default QuartzEndpointBuilder quartz(String componentName, String path) {
            return QuartzEndpointBuilderFactory.endpointBuilder(componentName, path);
        }
    }
    static QuartzEndpointBuilder endpointBuilder(
            String componentName,
            String path) {
        class QuartzEndpointBuilderImpl extends AbstractEndpointBuilder implements QuartzEndpointBuilder, AdvancedQuartzEndpointBuilder {
            public QuartzEndpointBuilderImpl(String path) {
                super(componentName, path);
            }
        }
        return new QuartzEndpointBuilderImpl(path);
    }
}


text:
"""
Decision Tree Regression Example.
"""
from __future__ import print_function

import sys

from pyspark import SparkContext, SQLContext
# $example on$
from pyspark.ml import Pipeline
from pyspark.ml.regression import DecisionTreeRegressor
from pyspark.ml.feature import VectorIndexer
from pyspark.ml.evaluation import RegressionEvaluator
# $example off$

if __name__ == "__main__":
    sc = SparkContext(appName="decision_tree_classification_example")
    sqlContext = SQLContext(sc)

    # $example on$
    # Load the data stored in LIBSVM format as a DataFrame.
    data = sqlContext.read.format("libsvm").load("data/mllib/sample_libsvm_data.txt")

    # Automatically identify categorical features, and index them.
    # We specify maxCategories so features with > 4 distinct values are treated as continuous.
    featureIndexer =\
        VectorIndexer(inputCol="features", outputCol="indexedFeatures", maxCategories=4).fit(data)

    # Split the data into training and test sets (30% held out for testing)
    (trainingData, testData) = data.randomSplit([0.7, 0.3])

    # Train a DecisionTree model.
    dt = DecisionTreeRegressor(featuresCol="indexedFeatures")

    # Chain indexer and tree in a Pipeline
    pipeline = Pipeline(stages=[featureIndexer, dt])

    # Train model.  This also runs the indexer.
    model = pipeline.fit(trainingData)

    # Make predictions.
    predictions = model.transform(testData)

    # Select example rows to display.
    predictions.select("prediction", "label", "features").show(5)

    # Select (prediction, true label) and compute test error
    evaluator = RegressionEvaluator(
        labelCol="label", predictionCol="prediction", metricName="rmse")
    rmse = evaluator.evaluate(predictions)
    print("Root Mean Squared Error (RMSE) on test data = %g" % rmse)

    treeModel = model.stages[1]
    # summary only
    print(treeModel)
    # $example off$


text:
[![Gem Version](https://badge.fury.io/rb/sidekiq-field-encryptor.png)](https://rubygems.org/gems/sidekiq-field-encryptor)
[![Build Status](https://travis-ci.org/aptible/sidekiq-field-encryptor.png?branch=master)](https://travis-ci.org/aptible/sidekiq-field-encryptor)
[![Dependency Status](https://gemnasium.com/aptible/sidekiq-field-encryptor.png)](https://gemnasium.com/aptible/sidekiq-field-encryptor)

This is a utility which is intended to be used for encrypting sensitive data in Sidekiq jobs. The data is encrypted before sending it to Redis, and decrypted right before the Sidekiq job is executed.

## Installation

Add the following line to your application's Gemfile.

    gem 'sidekiq-field-encryptor'

And then run `bundle install`.

## Usage

This middleware configures encryption of any fields that can contain sensitive
information. Keys in the hash are Sidekiq job classes and values are hashes
that map indices in the args array to either "true" (encrypt the entire arg)
or a list of keys (encrypt certain values in a hash argument). For example,
the configuration hash:

    { 'Job::Foo' => { 0 => true, 3 => [ 'secret', 'id' ] } }

When applied to the Sidekiq job:

    {
      'class' => 'Job::Foo',
      'args' => [{'x' => 1}, 'y', 'z', { 'public' => 'a', 'secret' => 'b' }],
      ...
    }

Will encrypt the values {'x' => 1} and 'b' when storing the job in Redis and
decrypt the values inside the client before the job is executed.

## Contributing

1. Fork the project.
1. Commit your changes, with specs.
1. Ensure that your code passes specs (`rake spec`) and meets Aptible's Ruby style guide (`rake rubocop`).
1. Create a new pull request on GitHub.

## Copyright and License

MIT License, see [LICENSE](LICENSE.md) for details.

Copyright (c) 2019 [Aptible](https://www.aptible.com), Blake Pettersson, and contributors.


text:
<!DOCTYPE html>
<html>
  <head>
    <title>Alerts</title>
  </head>
  <body>
    <input id=alert type=button onclick="alert('ok')" value=Alert>
    <input id=confirm type=button onclick="this.value = confirm('set the value')" value=Confirm>
    <input id=prompt type=button onclick='this.value = prompt("enter your name", "John Doe")' value=Prompt>
    <input id=timeout-alert type=button onclick="setTimeout('alert(\'ok\')', 3000)" value=Timeout-Alert>
  </body>
</html>


text:
import os
import pytest

import oddt
from oddt.utils import check_molecule, chunker, compose_iter

test_data_dir = os.path.dirname(os.path.abspath(__file__))

# common file names
dude_data_dir = os.path.join(test_data_dir, 'data', 'dude', 'xiap')
xiap_crystal_ligand = os.path.join(dude_data_dir, 'crystal_ligand.sdf')
xiap_protein = os.path.join(dude_data_dir, 'receptor_rdkit.pdb')

def test_check_molecule():
    with pytest.raises(ValueError, match='Molecule object'):
        check_molecule([])

    ligand = next(oddt.toolkit.readfile('sdf', xiap_crystal_ligand))
    check_molecule(ligand)

    # force protein
    protein = next(oddt.toolkit.readfile('pdb', xiap_protein))
    with pytest.raises(ValueError, match='marked as a protein'):
        check_molecule(protein, force_protein=True)

    protein.protein = True
    check_molecule(protein, force_protein=True)

    # force coordinates
    mol = oddt.toolkit.readstring('smi', 'c1ccccc1')
    with pytest.raises(ValueError, match='3D coordinates'):
        check_molecule(mol, force_coords=True)

    mol.make3D()
    check_molecule(mol, force_coords=True)

    # with pytest.raises(ValueError, match='positional'):
    #     check_molecule(mol, True)

    mol = oddt.toolkit.readstring('sdf', '''mol_title
 handmade

  0  0  0  0  0  0  0  0  0  0999 V2000
M  END
                          ''')
    with pytest.raises(ValueError, match='has zero atoms'):
        check_molecule(mol, non_zero_atoms=True)

def test_func_composition():
    def double(x):
        return [i * 2 for i in x]

    def inc(x):
        return [i + 1 for i in x]

    assert compose_iter([1], funcs=[double, inc]) == [3]
    assert compose_iter([3], funcs=[double, inc]) == [7]
    assert compose_iter([10], funcs=[double, inc]) == [21]

def test_chunks():
    chunks = chunker('ABCDEFG', 2)
    assert list(chunks), [['A', 'B'], ['C', 'D'], ['E', 'F'] == ['G']]


text:
// define a root UIComponent which exposes the main view
/*global jQuery, sap */
jQuery.sap.declare("cpv2.templates.HeaderFooter.Component");
jQuery.sap.require("sap.ui.core.UIComponent");
jQuery.sap.require("sap.ui.core.routing.Router");

// new Component
sap.ui.core.UIComponent.extend("cpv2.templates.HeaderFooter.Component", {

	oMainView: null,

	// use inline declaration instead of component.json to save 1 round trip
	metadata: {
		manifest: "json"
	},

	createContent: function() {
		"use strict";
		this.oMainView = sap.ui.view({
			type: sap.ui.core.mvc.ViewType.XML,
			viewName: "cpv2.templates.HeaderFooter.Template",
			id: this.createId("MainView")
		});

		return this.oMainView;
	}
});


text:
package categories

import (
	"reflect"
	"testing"

	"github.com/googleapis/gnostic/OpenAPIv2"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"k8s.io/apimachinery/pkg/version"
	"github.com/hyperhq/client-go/discovery"
	restclient "github.com/hyperhq/client-go/rest"
	"github.com/hyperhq/client-go/rest/fake"
)

func TestCategoryExpansion(t *testing.T) {
	tests := []struct {
		name string
		arg  string

		expected   []schema.GroupResource
		expectedOk bool
	}{
		{
			name:     "no-replacement",
			arg:      "service",
			expected: nil,
		},
		{
			name: "all-replacement",
			arg:  "all",
			expected: []schema.GroupResource{
				{Resource: "pods"},
				{Resource: "replicationcontrollers"},
				{Resource: "services"},
				{Resource: "statefulsets", Group: "apps"},
				{Resource: "horizontalpodautoscalers", Group: "autoscaling"},
				{Resource: "jobs", Group: "batch"},
				{Resource: "cronjobs", Group: "batch"},
				{Resource: "daemonsets", Group: "extensions"},
				{Resource: "deployments", Group: "extensions"},
				{Resource: "replicasets", Group: "extensions"},
			},
			expectedOk: true,
		},
	}

	for _, test := range tests {
		actual, actualOk := LegacyCategoryExpander.Expand(test.arg)
		if e, a := test.expected, actual; !reflect.DeepEqual(e, a) {
			t.Errorf("%s:  expected %s, got %s", test.name, e, a)
		}
		if e, a := test.expectedOk, actualOk; e != a {
			t.Errorf("%s:  expected %v, got %v", test.name, e, a)
		}
	}
}

func TestDiscoveryCategoryExpander(t *testing.T) {
	tests := []struct {
		category       string
		serverResponse []*metav1.APIResourceList
		expected       []schema.GroupResource
	}{
		{
			category: "all",
			serverResponse: []*metav1.APIResourceList{
				{
					GroupVersion: "batch/v1",
					APIResources: []metav1.APIResource{
						{
							Name:       "jobs",
							ShortNames: []string{"jz"},
							Categories: []string{"all"},
						},
					},
				},
			},
			expected: []schema.GroupResource{
				{
					Group:    "batch",
					Resource: "jobs",
				},
			},
		},
		{
			category: "all",
			serverResponse: []*metav1.APIResourceList{
				{
					GroupVersion: "batch/v1",
					APIResources: []metav1.APIResource{
						{
							Name:       "jobs",
							ShortNames: []string{"jz"},
						},
					},
				},
			},
		},
		{
			category: "targaryens",
			serverResponse: []*metav1.APIResourceList{
				{
					GroupVersion: "batch/v1",
					APIResources: []metav1.APIResource{
						{
							Name:       "jobs",
							ShortNames: []string{"jz"},
							Categories: []string{"all"},
						},
					},
				},
			},
		},
	}

	dc := &fakeDiscoveryClient{}
	for _, test := range tests {
		dc.serverResourcesHandler = func() ([]*metav1.APIResourceList, error) {
			return test.serverResponse, nil
		}
		expander, err := NewDiscoveryCategoryExpander(SimpleCategoryExpander{}, dc)
		if err != nil {
			t.Fatalf("unexpected error %v", err)
		}
		expanded, _ := expander.Expand(test.category)
		if !reflect.DeepEqual(expanded, test.expected) {
			t.Errorf("expected %v, got %v", test.expected, expanded)
		}
	}

}

type fakeDiscoveryClient struct {
	serverResourcesHandler func() ([]*metav1.APIResourceList, error)
}

var _ discovery.DiscoveryInterface = &fakeDiscoveryClient{}

func (c *fakeDiscoveryClient) RESTClient() restclient.Interface {
	return &fake.RESTClient{}
}

func (c *fakeDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) {
	return nil, nil
}

func (c *fakeDiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) {
	return &metav1.APIResourceList{}, nil
}

func (c *fakeDiscoveryClient) ServerResources() ([]*metav1.APIResourceList, error) {
	return c.serverResourcesHandler()
}

func (c *fakeDiscoveryClient) ServerPreferredResources() ([]*metav1.APIResourceList, error) {
	return nil, nil
}

func (c *fakeDiscoveryClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) {
	return nil, nil
}

func (c *fakeDiscoveryClient) ServerVersion() (*version.Info, error) {
	return &version.Info{}, nil
}

func (c *fakeDiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) {
	return &openapi_v2.Document{}, nil
}


text:
/*
 * EDITING INSTRUCTIONS
 * This file is referenced in Subscriber's javadoc. Any change to this file should be reflected in
 * PubSub's javadoc.
 */

package com.google.cloud.examples.pubsub.snippets;

import com.google.api.gax.core.RpcFuture;
import com.google.cloud.pubsub.spi.v1.MessageReceiver;
import com.google.cloud.pubsub.spi.v1.Subscriber;
import com.google.pubsub.v1.SubscriptionName;
import java.util.concurrent.Executor;

public class SubscriberSnippets {

  private final SubscriptionName subscription;
  private final MessageReceiver receiver;
  private final RpcFuture<Void> done;
  private final Executor executor;

  public SubscriberSnippets(
      SubscriptionName subscription,
      MessageReceiver receiver,
      RpcFuture<Void> done,
      Executor executor) {
    this.subscription = subscription;
    this.receiver = receiver;
    this.done = done;
    this.executor = executor;
  }

  /**
   * Example of receiving a specific number of messages.
   */
  // [TARGET startAsync()]
  public void startAsync() throws Exception {
    // [START startAsync]
    Subscriber subscriber = Subscriber.newBuilder(subscription, receiver).build();
    subscriber.addListener(new Subscriber.SubscriberListener() {
      public void failed(Subscriber.State from, Throwable failure) {
        // Handle error.
      }
    }, executor);
    subscriber.startAsync();

    // Wait for a stop signal.
    done.get();
    subscriber.stopAsync().awaitTerminated();
    // [END startAsync]
  }
}


text:
<android.support.v4.view.ViewPager
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/food_meals_fragment"
    tools:context="edu.milton.miltonmobileandroid.food.meals.MealsFragment.FlikFragment">
    <android.support.v4.view.PagerTitleStrip
        android:id="@+id/pager_title_strip"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="top"
        android:background="#004685"
        android:paddingBottom="4dp"
        android:paddingTop="4dp"
        android:textColor="#fff" />
</android.support.v4.view.ViewPager>


text:
ACCEPTED

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

#### Published in
Stud. Mycol. 50: 217 (2004)

#### Original name
Chaetomidium galaicum Stchigel & Guarro, 2004

### Remarks
null


text:
<?php

namespace App\Listeners\Auth;

use App\Events\Auth\SocialLogin;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class SocialLoginListener
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  SocialLogin  $event
     * @return void
     */
    public function handle(SocialLogin $event)
    {
        //
    }
}


text:
package enforcerui

import (
	"fmt"

	"github.com/scjalliance/resourceful/lease"
	"github.com/scjalliance/resourceful/policy"
)

// State holds a snapshot of enforcer state that is relevant to the UI.
type State struct {
	Policies policy.Set
	Leases   lease.Set
	Running  []lease.Properties
}

// Summary returns a single-line text summary of the state.
func (s State) Summary() string {
	var summary string

	switch count := len(s.Policies); count {
	case 1:
		summary = "Enforcing 1 policy"
	default:
		summary = fmt.Sprintf("Enforcing %d policies", count)
	}

	switch count := len(s.Running); count {
	case 0:
	case 1:
		summary += "on 1 process"
	default:
		summary += fmt.Sprintf("on %d processes", count)
	}

	return summary
}


text:
package org.commoncrawl.io.internal;

import java.io.IOException;
import java.net.InetSocketAddress;

public interface NIOServerSocket extends NIOSocket {

	/** open (bind) a server socket to the specified port (+address if specified) **/
	public void open(InetSocketAddress address) throws IOException;

	/** a new client has connected to the server **/
	public void acceptable();
}


text: [anchor link](anchor1.md#anchor)


text:
package error

// error の値。
const (
	Access_denied              = "access_denied"
	Account_selection_required = "account_selection_required"
	Consent_required           = "consent_required"
	Interaction_required       = "interaction_required"
	Invalid_client             = "invalid_client"
	Invalid_grant              = "invalid_grant"
	Invalid_request            = "invalid_request"
	Invalid_scope              = "invalid_scope"
	Login_required             = "login_required"
	Registration_not_supported = "registration_not_supported"
	Request_not_supported      = "request_not_supported"
	Request_uri_not_supported  = "request_uri_not_supported"
	Server_error               = "server_error"
	Unsupported_grant_type     = "unsupported_grant_type"
	Unsupported_response_type  = "unsupported_response_type"
	// OpenID Connect の仕様ではサンプルとしてしか登場しない。
	Invalid_token = "invalid_token"
)

const (
	tagDebug             = "debug"
	tagError             = "error"
	tagError_description = "error_description"

	tagCache_control = "Cache-Control"
	tagContent_type  = "Content-Type"
	tagPragma        = "Pragma"

	tagNo_cache = "no-cache"
	tagNo_store = "no-store"
)

const (
	contTypeHtml = "text/html"
	contTypeJson = "application/json"
)


text:
#include <autovector.h>

void hispeed_isr() __interrupt HISPEED_ISR {}


text:
/**
 * Rutilus
 *
 * @homepage https://gmrutilus.github.io
 * @license Apache-2.0
 */

/** @module */

/**
 * Packs the dashboard
 * @param {Boolean} inProduction
 * @param {String} rootDirectory
 * @param {String} analyticsLocation
 * @param {MessageLogger} logger
 * @param {Array<ExtraInformation>} extraInformation
 * @param {JoinsLib} joinsLib
 * @param {Function} cb
 */
module.exports = function ({
    inProduction,
    rootDirectory,
    analyticsLocation,
    logger,
    extraInformation,
    joinsLib,
}, cb) {

    /**
     * @type {{
     *   optimize: {
     *     DedupePlugin: Function,
     *     OccurenceOrderPlugin: Function,
     *     UglifyJsPlugin: Function,
     *   },
     *   DefinePlugin: Function,
     * }|Function}
     */
    const webpack = require('webpack');

    //------------------------------------------------------------------------------
    // WEBPACK

    let bundledCode = '';

    const plugins = [];
    plugins.push(new webpack.DefinePlugin({
        ANALYTICS_HOST: JSON.stringify(analyticsLocation),
        IN_PRODUCTION: inProduction,
        EXTRA_INFORMATION: JSON.stringify(extraInformation),
        JOINS_SCHEMA: JSON.stringify(joinsLib),
        'process.env': {
            'NODE_ENV': JSON.stringify(inProduction ? 'production' : 'development'),
        }
    }));

    logger.info(`Packing Dashboard in ${inProduction ? 'PRODUCTION' : 'DEVELOPMENT'}`);
    logger.info(`Using Analytics API at ${analyticsLocation}`);

    // IN PRODUCTION
    if (inProduction) {
        plugins.push(new webpack.optimize.UglifyJsPlugin({
            mangle: true,
            sourcemap: false,
            compress: {
                warnings: false
            }
        }));
    }

    // IN DEVELOPMENT
    else {
        //...
    }

    const bundler = webpack({
        context: `${rootDirectory}/lib/dashboard`,
        entry: `./index.js`,
        devtool: inProduction ? '' : "inline-sourcemap",
        module: {
            rules: [{
                test: /\.jsx?$/,
                loader: "babel-loader",
                exclude: [/node_modules\/(?!rutilus-analytics-node-js)/],
                options: {
                    presets: ['react', 'stage-0', 'es2015'],
                    plugins: ['transform-object-rest-spread']
                }
            }]
        },
        output: {
            path: '/'
        },
        plugins
    });

    bundler.outputFileSystem = {
        mkdirp(u, cb) {
            cb(null, u);
        },
        join() {
            let args = [ ...arguments ];
            args = args.join('/');
            args = args.replace(/\/\//g, '/');
            return args;
        },
        writeFile(file, content, cb) {
            if (typeof content !== 'string') {
                content = content.toString('utf8');
            }

            bundledCode = content;
            cb();
        }
    };

    bundler.run((err, stats) => {
        if (err) {
            logger.error('Dashboard NOT compiled');
            logger.error(err);
            return;
        }

        logger.info({
            message: 'Dashboard compiled',
            stats: stats.toString({
                chunks: false,
                colors: true,
            })
        });

        cb(bundledCode);

    });

};


text:
package org.jdal.vaadin.data;

import java.beans.PropertyDescriptor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.PropertyAccessorFactory;

import com.vaadin.data.Item;
import com.vaadin.data.Property;

/**
 * An adapter to use beans as {@link Item Items} delegating work to
 * Spring {@link BeanWrapper}
 *
 * @author Jose Luis Martin
 * @since 2.1
 */
public class BeanWrapperItem implements Item {

	private List<String> properties = new ArrayList<String>();
	private BeanWrapper beanWrapper;

	public BeanWrapperItem (Object bean) {
		this(bean, null);
	}

	public BeanWrapperItem(Object bean, List<String> properties) {
		this.beanWrapper = PropertyAccessorFactory.forBeanPropertyAccess(bean);

		if (properties == null) {
			for (PropertyDescriptor pd : BeanUtils.getPropertyDescriptors(bean.getClass()))
				this.properties.add(pd.getName());
		}
		else {
			this.properties = properties;
		}

	}

	@Override
	@SuppressWarnings("rawtypes")
	public Property getItemProperty(Object id) {
		return new BeanWrapperProperty(this.beanWrapper, (String) id);
	}

	@Override
	public Collection<?> getItemPropertyIds() {
		return this.properties;
	}

	@Override
	@SuppressWarnings("rawtypes")
	public boolean addItemProperty(Object id, Property property)
			throws UnsupportedOperationException {
		this.properties.add((String) id);

		return true;
	}

	@Override
	public boolean removeItemProperty(Object id)
			throws UnsupportedOperationException {
		return this.properties.remove((String) id);
	}

	public Object getBean() {
		return this.beanWrapper.getWrappedInstance();
	}

}


text:
using namespace cv;
using namespace std;

class Detector
{
    enum Mode { Default, Daimler } m;
    HOGDescriptor hog, hog_d;
public:
    Detector() : m(Default), hog(), hog_d(Size(48, 96), Size(16, 16), Size(8, 8), Size(8, 8), 9)
    {
        hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector());
        hog_d.setSVMDetector(HOGDescriptor::getDaimlerPeopleDetector());
    }
    void toggleMode() { m = (m == Default ? Daimler : Default); }
    string modeName() const { return (m == Default ? "Default" : "Daimler"); }
    vector<Rect> detect(InputArray img)
    {
        // Run the detector with default parameters. to get a higher hit-rate
        // (and more false alarms, respectively), decrease the hitThreshold and
        // groupThreshold (set groupThreshold to 0 to turn off the grouping completely).
        vector<Rect> found;
        if (m == Default)
            hog.detectMultiScale(img, found, 0, Size(8,8), Size(), 1.05, 2, false);
        else if (m == Daimler)
            hog_d.detectMultiScale(img, found, 0, Size(8,8), Size(), 1.05, 2, true);
        return found;
    }
    void adjustRect(Rect & r) const
    {
        // The HOG detector returns slightly larger rectangles than the real objects,
        // so we slightly shrink the rectangles to get a nicer output.
        r.x += cvRound(r.width*0.1);
        r.width = cvRound(r.width*0.8);
        r.y += cvRound(r.height*0.07);
        r.height = cvRound(r.height*0.8);
    }
};

static const string keys = "{ help h   |   | print help message }"
                           "{ camera c | 0 | capture video from camera (device index starting from 0) }"
                           "{ video v  |   | use video as input }";

int main(int argc, char** argv)
{
    CommandLineParser parser(argc, argv, keys);
    parser.about("This sample demonstrates the use of the HoG descriptor.");
    if (parser.has("help"))
    {
        parser.printMessage();
        return 0;
    }
    int camera = parser.get<int>("camera");
    string file = parser.get<string>("video");
    if (!parser.check())
    {
        parser.printErrors();
        return 1;
    }

    VideoCapture cap;
    if (file.empty())
        cap.open(camera);
    else
    {
        file = samples::findFileOrKeep(file);
        cap.open(file);
    }
    if (!cap.isOpened())
    {
        cout << "Can not open video stream: '" << (file.empty() ? "<camera>" : file) << "'" << endl;
        return 2;
    }

    cout << "Press 'q' or <ESC> to quit." << endl;
    cout << "Press <space> to toggle between Default and Daimler detector" << endl;
    Detector detector;
    Mat frame;
    for (;;)
    {
        cap >> frame;
        if (frame.empty())
        {
            cout << "Finished reading: empty frame" << endl;
            break;
        }
        int64 t = getTickCount();
        vector<Rect> found = detector.detect(frame);
        t = getTickCount() - t;

        // show the window
        {
            ostringstream buf;
            buf << "Mode: " << detector.modeName() << " ||| "
                << "FPS: " << fixed << setprecision(1) << (getTickFrequency() / (double)t);
            putText(frame, buf.str(), Point(10, 30), FONT_HERSHEY_PLAIN, 2.0, Scalar(0, 0, 255), 2, LINE_AA);
        }
        for (vector<Rect>::iterator i = found.begin(); i != found.end(); ++i)
        {
            Rect &r = *i;
            detector.adjustRect(r);
            rectangle(frame, r.tl(), r.br(), cv::Scalar(0, 255, 0), 2);
        }
        imshow("People detector", frame);

        // interact with user
        const char key = (char)waitKey(1);
        if (key == 27 || key == 'q') // ESC
        {
            cout << "Exit requested" << endl;
            break;
        }
        else if (key == ' ')
        {
            detector.toggleMode();
        }
    }
    return 0;
}


text:
from google.cloud.security import privateca_v1

async def sample_update_certificate_authority():
    # Create a client
    client = privateca_v1.CertificateAuthorityServiceAsyncClient()

    # Initialize request argument(s)
    certificate_authority = privateca_v1.CertificateAuthority()
    certificate_authority.type_ = "SUBORDINATE"
    certificate_authority.key_spec.cloud_kms_key_version = "cloud_kms_key_version_value"

    request = privateca_v1.UpdateCertificateAuthorityRequest(
        certificate_authority=certificate_authority,
    )

    # Make the request
    operation = client.update_certificate_authority(request=request)

    print("Waiting for operation to complete...")

    response = await operation.result()

    # Handle the response
    print(response)

# [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async]


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.prestosql.operator.aggregation.state;

import io.airlift.stats.TDigest;
import io.prestosql.array.DoubleBigArray;
import io.prestosql.array.ObjectBigArray;
import io.prestosql.spi.function.AccumulatorStateFactory;
import org.openjdk.jol.info.ClassLayout;

import static java.util.Objects.requireNonNull;

public class TDigestAndPercentileStateFactory
        implements AccumulatorStateFactory<TDigestAndPercentileState>
{
    @Override
    public TDigestAndPercentileState createSingleState()
    {
        return new SingleTDigestAndPercentileState();
    }

    @Override
    public Class<? extends TDigestAndPercentileState> getSingleStateClass()
    {
        return SingleTDigestAndPercentileState.class;
    }

    @Override
    public TDigestAndPercentileState createGroupedState()
    {
        return new GroupedTDigestAndPercentileState();
    }

    @Override
    public Class<? extends TDigestAndPercentileState> getGroupedStateClass()
    {
        return GroupedTDigestAndPercentileState.class;
    }

    public static class GroupedTDigestAndPercentileState
            extends AbstractGroupedAccumulatorState
            implements TDigestAndPercentileState
    {
        private static final int INSTANCE_SIZE = ClassLayout.parseClass(GroupedTDigestAndPercentileState.class).instanceSize();
        private final ObjectBigArray<TDigest> digests = new ObjectBigArray<>();
        private final DoubleBigArray percentiles = new DoubleBigArray();
        private long size;

        @Override
        public void ensureCapacity(long size)
        {
            digests.ensureCapacity(size);
            percentiles.ensureCapacity(size);
        }

        @Override
        public TDigest getDigest()
        {
            return digests.get(getGroupId());
        }

        @Override
        public void setDigest(TDigest digest)
        {
            requireNonNull(digest, "value is null");
            digests.set(getGroupId(), digest);
        }

        @Override
        public double getPercentile()
        {
            return percentiles.get(getGroupId());
        }

        @Override
        public void setPercentile(double percentile)
        {
            percentiles.set(getGroupId(), percentile);
        }

        @Override
        public void addMemoryUsage(int value)
        {
            size += value;
        }

        @Override
        public long getEstimatedSize()
        {
            return INSTANCE_SIZE + size + digests.sizeOf() + percentiles.sizeOf();
        }
    }

    public static class SingleTDigestAndPercentileState
            implements TDigestAndPercentileState
    {
        public static final int INSTANCE_SIZE = ClassLayout.parseClass(SingleTDigestAndPercentileState.class).instanceSize();
        private TDigest digest;
        private double percentile;

        @Override
        public TDigest getDigest()
        {
            return digest;
        }

        @Override
        public void setDigest(TDigest digest)
        {
            this.digest = digest;
        }

        @Override
        public double getPercentile()
        {
            return percentile;
        }

        @Override
        public void setPercentile(double percentile)
        {
            this.percentile = percentile;
        }

        @Override
        public void addMemoryUsage(int value)
        {
            // noop
        }

        @Override
        public long getEstimatedSize()
        {
            long estimatedSize = INSTANCE_SIZE;
            if (digest != null) {
                estimatedSize += digest.estimatedInMemorySizeInBytes();
            }
            return estimatedSize;
        }
    }
}


text:
 //  										LIBRARY FOR BUTTON DEBOUNCING				AUTHOR:- SAMIRAN PATRA
//######################################################################################################################################
#ifndef ButtonPress
#define ButtonPress

//########################### Warning: Define numberOfButtons in the main routine ####################################################

#include <avr/io.h>

char ButtonPressed(int buttonNumber, unsigned char pinOfButton, unsigned char portBit, int confidenceLevel);

char Pressed[numberOfButtons];
int Pressed_Confidence_Level[numberOfButtons]; //Measure button press cofidence
int Released_Confidence_Level[numberOfButtons]; //Measure button release confidence

char ButtonPressed(int buttonNumber, unsigned char pinOfButton, unsigned char portBit, int confidenceLevel)
{
	if (bit_is_clear(pinOfButton, portBit))
	{
		Pressed_Confidence_Level[buttonNumber] ++; //Increase Pressed Conficence
		Released_Confidence_Level[buttonNumber] = 0; //Reset released button confidence since there is a button press
		if (Pressed_Confidence_Level[buttonNumber] > confidenceLevel) //Indicator of good button press
			{
				if (Pressed[buttonNumber] == 0)
					{
						Pressed[buttonNumber] = 1;
						return 1;
					}
					//Zero it so a new pressed condition can be evaluated
				Pressed_Confidence_Level[buttonNumber] = 0;
			}
	}
	else
	{
		Released_Confidence_Level[buttonNumber] ++; //This works just like the pressed
		Pressed_Confidence_Level[buttonNumber] = 0; //Reset pressed button confidence since the button is released
		if (Released_Confidence_Level[buttonNumber] > confidenceLevel)
		{
			Pressed[buttonNumber] = 0;
			Released_Confidence_Level[buttonNumber] = 0;
		}
	}
	return 0;
}

#endif


text:
from django.db import models
from django.contrib.auth.models import User, UserManager

from django.db.models.signals import post_save
from django.dispatch import receiver

'''
	RFIDTag is a representation of an RFID device. Each RFID Tag is
	associated with a single user.
'''
class RFIDTag(models.Model):
	tag     = models.CharField(max_length=200)
	user    = models.ForeignKey(User)

	def __unicode__(self):
		return (self.user.username+"_"+self.tag).strip().replace(" ", "")

'''
	A CheckIn represents a single actuation of the RFID reader. A timestamp
	(currently server-recorded, 12/21/13) and a user is associated.

	TODO: Do we want to keep all checkins?
'''
class CheckIn(models.Model):
	time     = models.DateTimeField(auto_now=False, auto_now_add=True)
	user     = models.ForeignKey(User)
	tag      = models.ForeignKey(RFIDTag)

	def __unicode__(self):
		return self.user.username+'@'+self.time.strftime('%x_%X')

'''
	** Note. This is *NOT* how user data should be handled in Django.
	If I wasn't pressed for time this would certainly be encompassed in a
	subclass of django.contrib.auth.models.User.

	UserProfile adds additional data to each user. It holds onto the most recentCheckin,
	whether or not the user is home, and their RFIDTags

	TODO: Figure out if that RFID tag parameter is necessary even a little.

'''
class UserProfile(models.Model):
	user = models.ForeignKey(User, unique=True)
	recentCheckin = models.ForeignKey(CheckIn, null=True)
	isPresent = models.BooleanField(default=True)
	RFIDTag = models.ForeignKey(RFIDTag, null=True)

	def __unicode__(self):
		return self.user.username+'_profile'

	def togglePresent(self):
		self.isPresent = not self.isPresent

# Here are Django Signal handlers, actuated when instances of the above models
# are created.

'''
	Actuated on creation of a *new* checkin.
	* Toggles user's "is present" parameter in User Profile
	* Adds itself to most recent checkin parameter in corresponding user profile
'''
@receiver(post_save, sender=CheckIn)
def toggle(sender, created, instance, **kwargs):
	if created:
		profile = instance.user.get_profile()
		profile.isPresent = not profile.isPresent
		profile.recentCheckin = instance
		profile.save()

'''
	Creates a new user profile to correspond with the creation of
	each new user by Django's auth modules.
'''
@receiver(post_save, sender=User)
def makeProfile(sender, created, instance, **kwargs):
	if created:
		profile = UserProfile(user=instance)
		profile.save()


text:
// Copyright (c) Microsoft Corporation.  All rights reserved.
// Licensed under the MIT License.  See License.txt in the project root for license information.

using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Microsoft.OData.Edm;
using Microsoft.AspNet.OData.Common;

namespace Microsoft.AspNet.OData
{
    /// <summary>
    /// Represents an <see cref="IEdmObject"/> that is a collection of <see cref="IEdmEnumObject"/>s.
    /// </summary>
    [NonValidatingParameterBinding]
    public class EdmEnumObjectCollection : Collection<IEdmEnumObject>, IEdmObject
    {
        private IEdmCollectionTypeReference _edmType;

        /// <summary>
        /// Initialzes a new instance of the <see cref="EdmEnumObjectCollection"/> class.
        /// </summary>
        /// <param name="edmType">The edm type of the collection.</param>
        public EdmEnumObjectCollection(IEdmCollectionTypeReference edmType)
            : this(edmType, Enumerable.Empty<IEdmEnumObject>().ToList())
        {
        }

        /// <summary>
        /// Initialzes a new instance of the <see cref="EdmEnumObjectCollection"/> class.
        /// </summary>
        /// <param name="edmType">The edm type of the collection.</param>
        /// <param name="list">The list that is wrapped by the new collection.</param>
        public EdmEnumObjectCollection(IEdmCollectionTypeReference edmType, IList<IEdmEnumObject> list)
            : base(list)
        {
            Initialize(edmType);
        }

        /// <inheritdoc/>
        public IEdmTypeReference GetEdmType()
        {
            return _edmType;
        }

        private void Initialize(IEdmCollectionTypeReference edmType)
        {
            if (edmType == null)
            {
                throw Error.ArgumentNull("edmType");
            }
            if (!edmType.ElementType().IsEnum())
            {
                throw Error.Argument("edmType",
                    SRResources.UnexpectedElementType, edmType.ElementType().ToTraceString(), edmType.ToTraceString(), typeof(IEdmEnumType).Name);
            }

            _edmType = edmType;
        }
    }
}


text:
#include "Firestore/core/src/nanopb/fields_array.h"

#include "gmock/gmock.h"
#include "gtest/gtest.h"

namespace firebase {
namespace firestore {
namespace nanopb {
namespace {

TEST(FieldsArrayTest, firestore_client_MaybeDocument) {
  ASSERT_EQ(FieldsArray<firestore_client_MaybeDocument>(),
            firestore_client_MaybeDocument_fields);
}

TEST(FieldsArrayTest, firestore_client_MutationQueue) {
  ASSERT_EQ(FieldsArray<firestore_client_MutationQueue>(),
            firestore_client_MutationQueue_fields);
}

TEST(FieldsArrayTest, firestore_client_Target) {
  ASSERT_EQ(FieldsArray<firestore_client_Target>(),
            firestore_client_Target_fields);
}

TEST(FieldsArrayTest, firestore_client_TargetGlobal) {
  ASSERT_EQ(FieldsArray<firestore_client_TargetGlobal>(),
            firestore_client_TargetGlobal_fields);
}

TEST(FieldsArrayTest, firestore_client_WriteBatch) {
  ASSERT_EQ(FieldsArray<firestore_client_WriteBatch>(),
            firestore_client_WriteBatch_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_BatchGetDocumentsRequest) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_BatchGetDocumentsRequest>(),
            google_firestore_v1_BatchGetDocumentsRequest_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_BatchGetDocumentsResponse) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_BatchGetDocumentsResponse>(),
            google_firestore_v1_BatchGetDocumentsResponse_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_CommitRequest) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_CommitRequest>(),
            google_firestore_v1_CommitRequest_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_CommitResponse) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_CommitResponse>(),
            google_firestore_v1_CommitResponse_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_ListenRequest) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_ListenRequest>(),
            google_firestore_v1_ListenRequest_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_ListenResponse) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_ListenResponse>(),
            google_firestore_v1_ListenResponse_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_RunQueryRequest) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_RunQueryRequest>(),
            google_firestore_v1_RunQueryRequest_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_StructuredQuery_Filter) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_StructuredQuery_Filter>(),
            google_firestore_v1_StructuredQuery_Filter_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_Target_DocumentsTarget) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_Target_DocumentsTarget>(),
            google_firestore_v1_Target_DocumentsTarget_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_TargetChange) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_TargetChange>(),
            google_firestore_v1_TargetChange_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_Target_QueryTarget) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_Target_QueryTarget>(),
            google_firestore_v1_Target_QueryTarget_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_Value) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_Value>(),
            google_firestore_v1_Value_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_ArrayValue) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_ArrayValue>(),
            google_firestore_v1_ArrayValue_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_MapValue) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_MapValue>(),
            google_firestore_v1_MapValue_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_MapValue_FieldsEntry) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_MapValue_FieldsEntry>(),
            google_firestore_v1_MapValue_FieldsEntry_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_Write) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_Write>(),
            google_firestore_v1_Write_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_WriteRequest) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_WriteRequest>(),
            google_firestore_v1_WriteRequest_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_WriteResponse) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_WriteResponse>(),
            google_firestore_v1_WriteResponse_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_WriteResult) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_WriteResult>(),
            google_firestore_v1_WriteResult_fields);
}

TEST(FieldsArrayTest, firestore_BundleMetadata) {
  ASSERT_EQ(FieldsArray<firestore_BundleMetadata>(),
            firestore_BundleMetadata_fields);
}

TEST(FieldsArrayTest, firestore_NamedQuery) {
  ASSERT_EQ(FieldsArray<firestore_NamedQuery>(), firestore_NamedQuery_fields);
}

TEST(FieldsArrayTest, google_firestore_admin_v1_Index) {
  ASSERT_EQ(FieldsArray<google_firestore_admin_v1_Index>(),
            google_firestore_admin_v1_Index_fields);
}

TEST(FieldsArrayTest, google_protobuf_Empty) {
  ASSERT_EQ(FieldsArray<google_protobuf_Empty>(), google_protobuf_Empty_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_AggregationResult) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_AggregationResult>(),
            google_firestore_v1_AggregationResult_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_RunAggregationQueryRequest) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_RunAggregationQueryRequest>(),
            google_firestore_v1_RunAggregationQueryRequest_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_RunAggregationQueryResponse) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_RunAggregationQueryResponse>(),
            google_firestore_v1_RunAggregationQueryResponse_fields);
}

TEST(FieldsArrayTest, google_firestore_v1_StructuredAggregationQuery) {
  ASSERT_EQ(FieldsArray<google_firestore_v1_StructuredAggregationQuery>(),
            google_firestore_v1_StructuredAggregationQuery_fields);
}

TEST(FieldsArrayTest,
     google_firestore_v1_StructuredAggregationQuery_Aggregation) {
  ASSERT_EQ(
      FieldsArray<google_firestore_v1_StructuredAggregationQuery_Aggregation>(),
      google_firestore_v1_StructuredAggregationQuery_Aggregation_fields);
}

TEST(FieldsArrayTest,
     google_firestore_v1_StructuredAggregationQuery_Aggregation_Count) {
  ASSERT_EQ(
      FieldsArray<
          google_firestore_v1_StructuredAggregationQuery_Aggregation_Count>(),
      google_firestore_v1_StructuredAggregationQuery_Aggregation_Count_fields);
}

}  //  namespace
}  //  namespace nanopb
}  //  namespace firestore
}  //  namespace firebase


text:
package proxy

import (
	"os/user"
	"path/filepath"
)

// Return the home directory.
func getHomeDir() string {
	usr, _ := user.Current()
	return usr.HomeDir
}

// Return the absolute path of the default SSH key.
func getDefaultKey() string {
	defaultKey := ".ssh/id_rsa"
	return filepath.Join(getHomeDir(), defaultKey)
}

// Return the default port
func getDefaultPort() int {
	return 22
}

// New - Create a new SSHProxy object with given values.
func New(user, host string, port int, key string) *SSHProxy {
	return &SSHProxy{
		User: user,
		Host: host,
		Port: port,
		Key:  key,
	}
}

// NewGlobal - Create a new SSHProxy object
// that will be used as a global config.
func NewGlobal() *SSHProxy {
	return &SSHProxy{
		User: "",
		Host: "",
		Port: getDefaultPort(),
		Key:  getDefaultKey(),
	}
}

// Default test.
func Default() *SSHProxy {
	return &SSHProxy{}
}


text:
<?php declare(strict_types = 1);

namespace DrdPlus\Tables\Properties;

use Granam\Integer\IntegerInterface;

/**
 * Just an interface to cover requirements. It is not implemented in this library.
 */
interface HeightInterface extends IntegerInterface
{
}


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>le3d - LightEngine 3D: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

le3d - LightEngine 3D

A straightforward C++ 3D software engine for real-time graphics

Main Page

Related Pages

Namespaces

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Members

LeColor Member List

This is the complete list of members for LeColor, including all inherited members.

a	LeColor

b	LeColor

g	LeColor

LeColor()	LeColor	inline

LeColor(uint8_t const &_r, uint8_t const &_g, uint8_t const &_b, uint8_t const &_a)	LeColor	inline

LeColor(int const &color)	LeColor	inlineexplicit

operator int()	LeColor	inline

operator=(LeColor const &color)	LeColor	inline

operator=(int const &color)	LeColor	inline

r	LeColor

rgb(uint32_t const &rgb)	LeColor	inlinestatic

rgba(uint32_t const &rgba)	LeColor	inlinestatic

<address class="footer">
Generated by

 1.8.10
</address>


text:
import { Injectable } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';

import { CollectionStringMapperService } from 'app/core/core-services/collection-string-mapper.service';
import { BasePollDialogService } from 'app/core/ui-services/base-poll-dialog.service';
import { AssignmentPollDialogComponent } from '../components/assignment-poll-dialog/assignment-poll-dialog.component';
import { AssignmentPollService } from './assignment-poll.service';
import { ViewAssignmentPoll } from '../../../models/view-assignment-poll';

/**
 * Subclassed to provide the right `PollService` and `DialogComponent`
 */
@Injectable({
    providedIn: 'root'
})
export class AssignmentPollDialogService extends BasePollDialogService<ViewAssignmentPoll, AssignmentPollService> {
    protected dialogComponent = AssignmentPollDialogComponent;

    public constructor(dialog: MatDialog, mapper: CollectionStringMapperService) {
        super(dialog, mapper);
    }
}


text:
from timeit import timeit

from algorithms.path_search.bellman_ford import bellman_ford
from algorithms.path_search.wave import wave
from algorithms.path_search.tests.data import graphs

def test(func, *args, **kwargs):
    def timeit_callable():
        func(*args, **kwargs)

    execution_time = timeit(timeit_callable, number=1000)
    print(func.__name__, 'algorithm execution time:', execution_time)

test(wave, **graphs['ordered_unweighted'])
test(bellman_ford, **graphs['ordered_weighted'])


text:
from ....testing import assert_equal
from ..minc import Calc

def test_Calc_inputs():
    input_map = dict(args=dict(argstr='%s',
    ),
    check_dimensions=dict(argstr='-check_dimensions',
    xor=('check_dimensions', 'no_check_dimensions'),
    ),
    clobber=dict(argstr='-clobber',
    usedefault=True,
    ),
    copy_header=dict(argstr='-copy_header',
    xor=('copy_header', 'no_copy_header'),
    ),
    debug=dict(argstr='-debug',
    ),
    environ=dict(nohash=True,
    usedefault=True,
    ),
    eval_width=dict(argstr='-eval_width %s',
    usedefault=False,
    ),
    expfile=dict(argstr='-expfile %s',
    mandatory=True,
    xor=('expression', 'expfile'),
    ),
    expression=dict(argstr="-expression '%s'",
    mandatory=True,
    xor=('expression', 'expfile'),
    ),
    filelist=dict(argstr='-filelist %s',
    mandatory=True,
    xor=('input_files', 'filelist'),
    ),
    format_byte=dict(argstr='-byte',
    xor=('format_filetype', 'format_byte', 'format_short', 'format_int', 'format_long', 'format_float', 'format_double', 'format_signed', 'format_unsigned'),
    ),
    format_double=dict(argstr='-double',
    xor=('format_filetype', 'format_byte', 'format_short', 'format_int', 'format_long', 'format_float', 'format_double', 'format_signed', 'format_unsigned'),
    ),
    format_filetype=dict(argstr='-filetype',
    xor=('format_filetype', 'format_byte', 'format_short', 'format_int', 'format_long', 'format_float', 'format_double', 'format_signed', 'format_unsigned'),
    ),
    format_float=dict(argstr='-float',
    xor=('format_filetype', 'format_byte', 'format_short', 'format_int', 'format_long', 'format_float', 'format_double', 'format_signed', 'format_unsigned'),
    ),
    format_int=dict(argstr='-int',
    xor=('format_filetype', 'format_byte', 'format_short', 'format_int', 'format_long', 'format_float', 'format_double', 'format_signed', 'format_unsigned'),
    ),
    format_long=dict(argstr='-long',
    xor=('format_filetype', 'format_byte', 'format_short', 'format_int', 'format_long', 'format_float', 'format_double', 'format_signed', 'format_unsigned'),
    ),
    format_short=dict(argstr='-short',
    xor=('format_filetype', 'format_byte', 'format_short', 'format_int', 'format_long', 'format_float', 'format_double', 'format_signed', 'format_unsigned'),
    ),
    format_signed=dict(argstr='-signed',
    xor=('format_filetype', 'format_byte', 'format_short', 'format_int', 'format_long', 'format_float', 'format_double', 'format_signed', 'format_unsigned'),
    ),
    format_unsigned=dict(argstr='-unsigned',
    xor=('format_filetype', 'format_byte', 'format_short', 'format_int', 'format_long', 'format_float', 'format_double', 'format_signed', 'format_unsigned'),
    ),
    ignore_exception=dict(nohash=True,
    usedefault=True,
    ),
    ignore_nan=dict(argstr='-ignore_nan',
    ),
    input_files=dict(argstr='%s',
    mandatory=True,
    position=-2,
    sep=' ',
    ),
    max_buffer_size_in_kb=dict(argstr='-max_buffer_size_in_kb %d',
    usedefault=False,
    ),
    no_check_dimensions=dict(argstr='-nocheck_dimensions',
    xor=('check_dimensions', 'no_check_dimensions'),
    ),
    no_copy_header=dict(argstr='-nocopy_header',
    xor=('copy_header', 'no_copy_header'),
    ),
    outfiles=dict(),
    output_file=dict(argstr='%s',
    genfile=True,
    hash_files=False,
    name_source=['input_files'],
    name_template='%s_calc.mnc',
    position=-1,
    ),
    output_illegal=dict(argstr='-illegal_value',
    xor=('output_nan', 'output_zero', 'output_illegal_value'),
    ),
    output_nan=dict(argstr='-nan',
    xor=('output_nan', 'output_zero', 'output_illegal_value'),
    ),
    output_zero=dict(argstr='-zero',
    xor=('output_nan', 'output_zero', 'output_illegal_value'),
    ),
    propagate_nan=dict(argstr='-propagate_nan',
    ),
    quiet=dict(argstr='-quiet',
    xor=('verbose', 'quiet'),
    ),
    terminal_output=dict(nohash=True,
    ),
    two=dict(argstr='-2',
    ),
    verbose=dict(argstr='-verbose',
    xor=('verbose', 'quiet'),
    ),
    voxel_range=dict(argstr='-range %d %d',
    ),
    )
    inputs = Calc.input_spec()

    for key, metadata in list(input_map.items()):
        for metakey, value in list(metadata.items()):
            yield assert_equal, getattr(inputs.traits()[key], metakey), value

def test_Calc_outputs():
    output_map = dict(output_file=dict(),
    )
    outputs = Calc.output_spec()

    for key, metadata in list(output_map.items()):
        for metakey, value in list(metadata.items()):
            yield assert_equal, getattr(outputs.traits()[key], metakey), value