text:
import itertools
import numpy as np
from vorpy.index_map import *

def apply_along_axes (func, input_axis_v, input_array_v, *args, output_axis_v=None, func_output_shape=None, **kwargs):
    """
    This function is a generalization of numpy.apply_along_axis.

    TODO: Add a parameter for the assignment destination, so that no temporaries are created.

    Let A = (0,1,...,N-1), where N is len(input_array_v[0].shape).  input_axis_v should be* a nonempty
    subsequence of A; this means that 0 < len(input_axis_v) <= len(A), each element of input_axis_v
    must be an element of the sequence A, and input_axis_v must be strictly increasing (as A is).

    *Note that input_axis_v may contain values in the range [-N,0), in which case, N is added to
    each negative element to bring them all within the range [0,N) as valid axis indices.  For example,
    this means that -1 addresses the last axis, -2 addresses the second-to-last axis, etc.

    TODO: Allow the base case where input_array_v[0].shape = () and input_axis_v = [].

    Let I be the complementary subsequence of input_axis_v, meaning that I is the sequence consisting
    of elements of A not found in input_axis_v, and I is strictly increasing (as A is).

    func is then called on each slice of each element of input_array_v where the indices specified by I
    are fixed and the indices specified by input_axis_v are free.  The shape of the return value of func
    on the first call is used to determine the shape of the return value of apply_along_axes, or if
    func_output_shape is not None, then func_output_shape is assumed to be the shape of the return
    value of func.

    Let S denote the shape of the return value of func (which may be specified by func_output_shape as
    specified above).  Let B = (0,1,...,M-1), where M is len(I)+len(S).  The return value of
    apply_along_axes will be a numpy.ndarray having M indices.

    If output_axis_v is not None, it must be** a subsequence of B, specifying which axes of the
    return value will be used to index the output of func.  If output_axis_v is None, then it
    will be assumed to have value (L,L+1,...,M-1), where L = len(I), i.e. the output axes will
    be the last axes of the return value.

    **Note that, just as input_axis_v, output_axis_v may contain values in the range [-N,0), in which
    case, N is added to bring each negative element to bring them all within the range [0,N).

    All extra args and kwargs will be passed through to calls to func.

    Note that the single-element input_axis_v special-case call

        apply_along_axes(func, (i,), (input_array,), ...)

    should be equivalent to the standard numpy call

        numpy.apply_along_axis(func, i, input_array, ...)
    """

    assert len(input_axis_v) > 0, 'input_axis_v (which is {0}) must be a nonempty subsequence of (0,1,...,{1})'.format(input_axis_v, len(input_array.shape)-1)
    assert len(input_array_v) > 0, 'input_array_v (which has length {0}) must have length > 0'.format(len(input_array_v))
    assert len(frozenset(input_array.shape for input_array in input_array_v)) == 1, 'each element of input_array_v must have the same shape, but encountered shapes {0}'.format([input_array.shape for input_array in input_array_v])
    assert len(frozenset(input_array.dtype for input_array in input_array_v)) == 1, 'each element of input_array_v must have the same dtype, but encountered dtypes {0}'.format([input_array.dtype for input_array in input_array_v])

    input_array_shape = input_array_v[0].shape
    input_array_dtype = input_array_v[0].dtype
    N = len(input_array_shape)
    A = np.arange(N)
    # Note that the length of the complementary subsequence of N in A is N-len(input_axis_v).

    assert all(-N <= input_axis < N for input_axis in input_axis_v), 'input_axis_v (which is {0}), must contain values in the range of [-N,N) (where N = {1})'.format(input_axis_v, N)

    normalized_input_axis_v = np.fromiter((input_axis if input_axis >= 0 else input_axis+N for input_axis in input_axis_v), np.int, len(input_axis_v))

    assert is_subsequence_of_nondecreasing_sequence(normalized_input_axis_v, A), 'normalized_input_axis_v (which is {0}) must be a nonempty subsequence of [0,{1}) (right endpoint excluded)'.format(normalized_input_axis_v, len(input_array_shape))

    is_not_normalized_input_axis_v = np.array([axis_index not in normalized_input_axis_v for axis_index in A])
    non_normalized_input_axis_v = np.array([axis_index for axis_index in A if is_not_normalized_input_axis_v[axis_index]])
    input_iterator_v = [range(input_array_shape[axis_index]) if is_not_normalized_input_axis_v[axis_index] else [slice(None)] for axis_index in A]
    # print('is_not_normalized_input_axis_v = {0}'.format(is_not_normalized_input_axis_v))
    # print('non_normalized_input_axis_v = {0}'.format(non_normalized_input_axis_v))
    # print('input_iterator_v = {0}'.format(input_iterator_v))

    # If func_output_shape is not specified, then derive it.
    if func_output_shape is None:
        func_output_shape = np.shape(func(*tuple(input_array[tuple(0 if axis_index not in normalized_input_axis_v else slice(None) for axis_index in A)] for input_array in input_array_v), *args, **kwargs))
    # print('func_output_shape = {0}'.format(func_output_shape))

    # B = np.arange(N-len(normalized_input_axis_v)+len(func_output_shape))
    B = np.arange(len(non_normalized_input_axis_v)+len(func_output_shape))
    M = len(B)
    # print('B = {0}'.format(B))

    # If output_axis_v is None, then it will be assumed to be the trailing axes of the output.
    if output_axis_v is None:
        output_axis_v = np.arange(-len(func_output_shape), 0)
    # print('normalized_input_axis_v = {0}'.format(normalized_input_axis_v))
    # print('output_axis_v = {0}'.format(output_axis_v))

    assert len(func_output_shape) == len(output_axis_v), 'func_output_shape (which is {0}) must have same number of elements as output_axis_v (which is {1})'.format(func_output_shape, output_axis_v)

    normalized_output_axis_v = np.fromiter((output_axis if output_axis >= 0 else output_axis+M for output_axis in output_axis_v), np.int, len(output_axis_v))

    assert is_subsequence_of_nondecreasing_sequence(normalized_output_axis_v, B), 'normalized_output_axis_v (which is {0}) must be a subsequence of [0,{1}) (right endpoint excluded)'.format(normalized_output_axis_v, len(B))

    is_not_output_axis_v = [axis_index not in normalized_output_axis_v for axis_index in B]
    # print('is_not_output_axis_v = {0}'.format(is_not_output_axis_v))
    non_output_axis_v = [axis_index for axis_index in B if is_not_output_axis_v[axis_index]]
    # print('non_output_axis_v = {0}'.format(non_output_axis_v))
    non_output_axis_inv_v = index_map_inverse(non_output_axis_v, len(B))
    # print('non_output_axis_inv_v = {0}'.format(non_output_axis_inv_v))
    output_axis_inv_v = index_map_inverse(normalized_output_axis_v, len(B))
    # print('output_axis_inv_v = {0}'.format(output_axis_inv_v))
    # print('compose_index_maps(non_normalized_input_axis_v, non_output_axis_inv_v) = {0}'.format(compose_index_maps(non_normalized_input_axis_v, non_output_axis_inv_v)))
    output_iterator_v = [range(input_array_shape[non_normalized_input_axis_v[non_output_axis_inv_v[axis_index]]]) if is_not_output_axis_v[axis_index] else [slice(None)] for axis_index in B]
    # print('output_iterator_v = {0}'.format(output_iterator_v))

    retval = np.ndarray(tuple(input_array_shape[non_normalized_input_axis_v[non_output_axis_inv_v[axis_index]]] if is_not_output_axis_v[axis_index] else func_output_shape[output_axis_inv_v[axis_index]] for axis_index in B), dtype=input_array_dtype)
    # print('retval.shape = {0}'.format(retval.shape))
    for input_I,output_I in zip(itertools.product(*input_iterator_v), itertools.product(*output_iterator_v)):
        # print('input_I = {0}, output_I = {1}'.format(input_I, output_I))
        retval[output_I] = func(*tuple(input_array[input_I] for input_array in input_array_v), *args, **kwargs)

    # print('')
    return retval


text:
const gulp = require('gulp');
const pkg = require('./package.json');
const merge = require('event-stream').merge;
const gutil = require('gulp-util');
const runSequence = require('run-sequence');
const browserSync = require('browser-sync');
const $ = require('gulp-load-plugins')();
const eco = require('eco');
const fs = require('fs');
const ancss = require('ancss');
const autoprefixer = require('autoprefixer');
const cssnext = require('postcss-cssnext');
const immutableCss = require('immutable-css');
const reporter = require('postcss-reporter');

const prefix = __dirname + '/../build/css/';

////////////////////////////////////////
// build
////////////////////////////////////////
gulp.task('build', ['cssmin']);

////////////////////////////////////////
// stylelint
////////////////////////////////////////
gulp.task('stylelint', () => {
  return gulp.src('./src/**/*.css')
    .pipe($.stylelint({
      failAfterError: false,
      reporters: [{formatter: 'string', console: true}]
    }));
});

////////////////////////////////////////
// cssmin
////////////////////////////////////////
gulp.task('cssmin', ['generate-preview'], () => {
  return gulp.src(prefix + 'onsen-css-components.css')
    .pipe($.cssmin())
    .pipe($.rename({suffix: '.min'}))
    .pipe(gulp.dest('./build/'))
    .pipe(gulp.dest(prefix));
});

////////////////////////////////////////
// cssnext
////////////////////////////////////////
gulp.task('cssnext', ['stylelint'], () => {
  const plugins = [
    require('postcss-import'),
    require('postcss-base64')({
      extensions: ['.svg'],
      root: __dirname + '/src'
    }),
    cssnext({
      browsers: ['> 1%', 'last 2 versions', 'Firefox ESR', 'Opera 12.1']
    }),
    immutableCss(),
    reporter({clearMessage: true, throwError: false})
  ];
  return gulp.src('src/onsen-css-components.css')
    .pipe($.plumber())
    .pipe($.postcss(plugins))
    .pipe(gulp.dest('./build/'))
    .pipe(gulp.dest(prefix));
});

////////////////////////////////////////
// generate-preview
////////////////////////////////////////
gulp.task('generate-preview', ['cssnext'], () => {
  const template = fs.readFileSync(__dirname + '/templates/preview.html.eco', 'utf-8');
  const css = fs.readFileSync(prefix + 'onsen-css-components.css', 'utf-8');
  const components = ancss.parse(css, {detect: line => line.match(/^~/)});
  fs.writeFileSync(prefix + 'preview.html', eco.render(template, {components}), 'utf-8');
});

////////////////////////////////////////
// serve
////////////////////////////////////////
gulp.task('serve', ['build'], done => {
  gulp.watch(['src/**/*.css', 'templates/preview.html.eco'], ['build']);
  gulp.watch(prefix + 'preview.html').on('change', browserSync.reload);

  browserSync.init({
    server: {
      baseDir: prefix
    },
    startPath: '/preview.html'
  });
});

redpajama_set_name: RedPajamaGithub


text:
namespace DLaB.Xrm.Entities
{

	[System.Runtime.Serialization.DataContractAttribute()]
	[System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "9.0.0.9154")]
	public enum ServiceEndpoint_Contract
	{

		[System.Runtime.Serialization.EnumMemberAttribute()]
		EventHub = 7,

		[System.Runtime.Serialization.EnumMemberAttribute()]
		OneWay = 1,

		[System.Runtime.Serialization.EnumMemberAttribute()]
		Queue = 2,

		[System.Runtime.Serialization.EnumMemberAttribute()]
		Queue_Persistent = 6,

		[System.Runtime.Serialization.EnumMemberAttribute()]
		Rest = 3,

		[System.Runtime.Serialization.EnumMemberAttribute()]
		Topic = 5,

		[System.Runtime.Serialization.EnumMemberAttribute()]
		TwoWay = 4,

		[System.Runtime.Serialization.EnumMemberAttribute()]
		Webhook = 8,
	}
}


text:
.class public final Lcom/google/zxing/common/reedsolomon/ReedSolomonException;
.super Ljava/lang/Exception;

# direct methods
.method public constructor <init>(Ljava/lang/String;)V
    .locals 0

    invoke-direct {p0, p1}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V

    return-void
.end method


text:
package net.inpercima.runandfun.app.model;

import java.util.Date;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Mapping;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * @author Sebastian Peters
 */
@Document(indexName = "activity", type = "activity")
@Mapping(mappingPath = "mapping.json")
public class AppActivity {

    public static final String FIELD_ID = "id";

    public static final String FIELD_USERNAME = "username";

    public static final String FIELD_TYPE = "type";

    public static final String FIELD_DATE = "date";

    public static final String FIELD_DISTANCE = "distance";

    public static final String FIELD_DURATION = "duration";

    @Id
    private final String id;

    private final String username;

    private final String type;

    private final Date date;

    private final double distance;

    private final String duration;

    @JsonCreator
    public AppActivity(@JsonProperty(value = FIELD_ID) final String id, @JsonProperty(value = FIELD_USERNAME) final String username,
            @JsonProperty(value = FIELD_TYPE) final String type, @JsonProperty(value = FIELD_DATE) final Date date,
            @JsonProperty(value = FIELD_DISTANCE) final double distance, @JsonProperty(value = FIELD_DURATION) final String duration) {
        this.id = id;
        this.username = username;
        this.type = type;
        this.date = date;
        this.distance = distance;
        this.duration = duration;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

    public String getId() {
        return id;
    }

    public String getUsername() {
        return username;
    }

    public String getType() {
        return type;
    }

    public Date getDate() {
        return date;
    }

    public double getDistance() {
        return distance;
    }

    public String getDuration() {
        return duration;
    }

}


text:
/*  A class representing a set of point names that is used
 * as a template a user can fill out to create a PickedPoints
 *
 *
 * @author Oscar Barney
 */

#include "pickPointsTemplate.h"

#include <QtGui>
//xml stuff
#include <QtXml/QDomDocument>
#include <QtXml/QDomElement>
#include <QtXml/QDomNode>

//Define Constants
const QString PickPointsTemplate::fileExtension = ".pptpl";
const QString PickPointsTemplate::rootName = "PickPointsTemplate";
const QString PickPointsTemplate::pointElementName = "point";
const QString PickPointsTemplate::pointName = "name";

bool PickPointsTemplate::save(QString filename,
		std::vector<QString> *pointNameVector){
	QDomDocument doc(rootName);
	QDomElement root = doc.createElement(rootName);
	doc.appendChild(root);

	//create an element for each point
	for (int i = 0; i < pointNameVector->size(); ++i) {
		QString name = pointNameVector->at(i);

		QDomElement tag = doc.createElement(pointElementName);
		tag.setAttribute(pointName, name);

		//append the element to the root
		root.appendChild(tag);
	}

	//create a file and write the data
	QFile file(filename);
	file.open(QIODevice::WriteOnly);
	QTextStream qstream(&file);
	doc.save(qstream,1);
	file.close();
	return true;
}

bool PickPointsTemplate::load(QString filename,
		std::vector<QString> *pointNameVector){

	QDomDocument doc;
	pointNameVector->clear();

	QFile file(filename);

	QString errorMessage;
	if (file.open(QIODevice::ReadOnly) && doc.setContent(&file, &errorMessage))
	{
		file.close();
		QDomElement root = doc.documentElement();
		if (root.nodeName() == rootName)
	    {
			qDebug() << "About to read a " << rootName << " xml document";

			for(QDomElement element = root.firstChildElement(pointElementName);
				!element.isNull();
				element = element.nextSiblingElement(pointElementName))
			{
				QString name = element.attribute(pointName);
				qDebug() << "Reading point with name " << name;

				pointNameVector->push_back(name);

			}
	    } else {
	    	//file is of unknown type
	    	qDebug() << "Failed, tried to read a " << rootName << " xml document";
	    	return false;
	    }

	} else {
		// problem opening the file
		qDebug() << "problem reading from the file, setContent error: " <<  errorMessage;
		return false;
	}
	return true;
}

QString PickPointsTemplate::getDefaultTemplateFileName()
{
	return QDir::homePath() + "/.pickPointsTemplate" + fileExtension;
}


text:
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Web;
using System.Web.SessionState;

namespace MvcContrib.TestHelper
{
	internal class MockSession : HttpSessionStateBase
	{
		private readonly IDictionary _objects;

		/// <summary>
		/// Initializes a new instance of the <see cref="MockSession"/> class.
		/// </summary>
		public MockSession()
		{
			// As per reflected HttpStaticObjectsCollection
			_objects = new Hashtable(StringComparer.OrdinalIgnoreCase);
		}

		//#region HttpSessionStateBase Members

		/// <summary>
		/// Adds the specified name.
		/// </summary>
		/// <param name="name">The name.</param>
		/// <param name="value">The value.</param>
		public override void Add(string name, object value)
		{
			_objects.Add(name, value);
		}

		/// <summary>
		/// Clears this instance.
		/// </summary>
		public override void Clear()
		{
			_objects.Clear();
		}

		/// <summary>
		/// Gets the contents.
		/// </summary>
		/// <value>The contents.</value>
		public override HttpSessionStateBase Contents
		{
			get { return this; }
		}

		/// <summary>
		/// Removes the specified name.
		/// </summary>
		/// <param name="name">The name.</param>
		public override void Remove(string name)
		{
			_objects.Remove(name);
		}

		/// <summary>
		/// Removes all.
		/// </summary>
		public override void RemoveAll()
		{
			Clear();
		}

		/// <summary>
		/// Removes an object at the index.
		/// </summary>
		/// <param name="index">The index.</param>
		public override void RemoveAt(int index)
		{
			string key = GetKeyFromIndex(index);
			if (!string.IsNullOrEmpty(key))
				Remove(key);
		}

		/// <summary>
		/// Gets or sets the <see cref="System.Object"/> with the specified name.
		/// </summary>
		/// <value></value>
		public override object this[string name]
		{
			get { return _objects[name]; }
			set { _objects[name] = value; }
		}

		/// <summary>
		/// Gets or sets the <see cref="System.Object"/> at the specified index.
		/// </summary>
		/// <value></value>
		public override object this[int index]
		{
			get
			{
				string key = GetKeyFromIndex(index);
				return _objects[key];
			}
			set
			{
				string key = GetKeyFromIndex(index);
				_objects[key] = value;
			}
		}

		/// <summary>
		/// Copies the elements of the <see cref="T:System.Collections.ICollection"/> to an <see cref="T:System.Array"/>, starting at a particular <see cref="T:System.Array"/> index.
		/// </summary>
		/// <param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:System.Collections.ICollection"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
		/// <param name="index">The zero-based index in <paramref name="array"/> at which copying begins.</param>
		/// <exception cref="T:System.ArgumentNullException">
		/// 	<paramref name="array"/> is null. </exception>
		/// <exception cref="T:System.ArgumentOutOfRangeException">
		/// 	<paramref name="index"/> is less than zero. </exception>
		/// <exception cref="T:System.ArgumentException">
		/// 	<paramref name="array"/> is multidimensional.-or- <paramref name="index"/> is equal to or greater than the length of <paramref name="array"/>.-or- The number of elements in the source <see cref="T:System.Collections.ICollection"/> is greater than the available space from <paramref name="index"/> to the end of the destination <paramref name="array"/>. </exception>
		/// <exception cref="T:System.ArgumentException">The type of the source <see cref="T:System.Collections.ICollection"/> cannot be cast automatically to the type of the destination <paramref name="array"/>. </exception>
		public override void CopyTo(Array array, int index)
		{
			_objects.CopyTo(array, index);
		}

		/// <summary>
		/// Gets the number of elements contained in the <see cref="T:System.Collections.ICollection"/>.
		/// </summary>
		/// <value></value>
		/// <returns>The number of elements contained in the <see cref="T:System.Collections.ICollection"/>.</returns>
		public override int Count
		{
			get { return _objects.Count; }
		}

		/// <summary>
		/// Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection"/> is synchronized (thread safe).
		/// </summary>
		/// <value></value>
		/// <returns>true if access to the <see cref="T:System.Collections.ICollection"/> is synchronized (thread safe); otherwise, false.</returns>
		public override bool IsSynchronized
		{
			get { return _objects.IsSynchronized; }
		}

		/// <summary>
		/// Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"/>.
		/// </summary>
		/// <value></value>
		/// <returns>An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"/>.</returns>
		public override object SyncRoot
		{
			get { return _objects.SyncRoot; }
		}

		public override IEnumerator GetEnumerator()
		{
			return _objects.GetEnumerator();
		}

		//All interface methods below this are not implemented

		/// <summary>
		/// Not Implemented
		/// </summary>
		public override void Abandon()
		{
			throw new NotImplementedException();
		}

		/// <summary>
		/// Not Implemented
		/// </summary>
		public override string SessionID
		{
			get { throw new NotImplementedException(); }
		}

		/// <summary>
		/// Not Implemented
		/// </summary>
		public override HttpStaticObjectsCollectionBase StaticObjects
		{
			get { throw new NotImplementedException(); }
		}

		/// <summary>
		/// Not Implemented
		/// </summary>
		public override int Timeout
		{
			get { throw new NotImplementedException(); }
			set { throw new NotImplementedException(); }
		}

		/// <summary>
		/// Not Implemented
		/// </summary>
		public override HttpCookieMode CookieMode
		{
			get { throw new NotImplementedException(); }
		}

		/// <summary>
		/// Not Implemented
		/// </summary>
		public override bool IsCookieless
		{
			get { throw new NotImplementedException(); }
		}

		/// <summary>
		/// Not Implemented
		/// </summary>
		public override bool IsNewSession
		{
			get { throw new NotImplementedException(); }
		}

		/// <summary>
		/// Not Implemented
		/// </summary>
		public override bool IsReadOnly
		{
			get { throw new NotImplementedException(); }
		}

		/// <summary>
		/// Not Implemented
		/// </summary>
		//NameObjectCollectionBase.KeysCollection.ctor is marked internal
		public override NameObjectCollectionBase.KeysCollection Keys
		{
			get { throw new NotImplementedException(); }
		}

		/// <summary>
		/// Not Implemented
		/// </summary>
		public override int LCID
		{
			get { throw new NotImplementedException(); }
			set { throw new NotImplementedException(); }
		}

		/// <summary>
		/// Not Implemented
		/// </summary>
		public override SessionStateMode Mode
		{
			get { throw new NotImplementedException(); }
		}

		/// <summary>
		/// Not Implemented
		/// </summary>
		public override int CodePage
		{
			get { throw new NotImplementedException(); }
			set { throw new NotImplementedException(); }
		}

		//#endregion

		protected string GetKeyFromIndex(int index)
		{
			if (index < 0 || index >= _objects.Count)
				throw new ArgumentOutOfRangeException();
			int i = _objects.Count - 1; //Standard session implements as list, hashtable implements as stack
			foreach (var key in _objects.Keys)
			{
				if (i-- == index)
				{
					return key as string;
				}
			}
			return null;
		}
	}
}


text:
'use strict';

const standalone = require('../standalone');
const stripIndent = require('common-tags').stripIndent;

it('descriptionlessDisables', async () => {
	const config = {
		rules: { 'block-no-empty': true },
	};

	const css = stripIndent`
		/* stylelint-disable -- Description */
		a {}
		/* stylelint-enable */
		a {
			b {} /* stylelint-disable-line block-no-empty -- Description */
		}
		/* stylelint-disable-next-line block-no-empty
		 * --
		 * Description */
		a {}

		/* stylelint-disable */
		a {}
		/* stylelint-enable */
		a {
			b {} /* stylelint-disable-line block-no-empty */
		}
		/* stylelint-disable-next-line block-no-empty */
		a {}`;

	const linted = await standalone({
		config,
		code: css,
		reportDescriptionlessDisables: true,
	});
	const results = linted.results;

	expect(results).toHaveLength(1);
	const warnings = results[0].warnings.filter(
		(warning) => warning.rule === '--report-descriptionless-disables',
	);

	expect(warnings).toEqual([
		{
			line: 12,
			column: 1,
			endLine: 12,
			endColumn: 23,
			rule: '--report-descriptionless-disables',
			severity: 'error',
			text: 'Disable for "all" is missing a description',
		},
		{
			line: 16,
			column: 7,
			endLine: 16,
			endColumn: 49,
			rule: '--report-descriptionless-disables',
			severity: 'error',
			text: 'Disable for "block-no-empty" is missing a description',
		},
		{
			line: 18,
			column: 1,
			endLine: 18,
			endColumn: 48,
			rule: '--report-descriptionless-disables',
			severity: 'error',
			text: 'Disable for "block-no-empty" is missing a description',
		},
	]);
});

it('descriptionlessDisables from config', async () => {
	const config = {
		reportDescriptionlessDisables: true,
		rules: { 'block-no-empty': true },
	};

	const css = stripIndent`
		/* stylelint-disable -- Description */
		a {}
		/* stylelint-enable */
		a {
			b {} /* stylelint-disable-line block-no-empty -- Description */
		}
		/* stylelint-disable-next-line block-no-empty
		 * --
		 * Description */
		a {}

		/* stylelint-disable */
		a {}
		/* stylelint-enable */
		a {
			b {} /* stylelint-disable-line block-no-empty */
		}
		/* stylelint-disable-next-line block-no-empty */
		a {}`;

	const linted = await standalone({
		config,
		code: css,
	});
	const results = linted.results;

	expect(results).toHaveLength(1);
	const warnings = results[0].warnings.filter(
		(warning) => warning.rule === '--report-descriptionless-disables',
	);

	expect(warnings).toEqual([
		{
			line: 12,
			column: 1,
			endLine: 12,
			endColumn: 23,
			rule: '--report-descriptionless-disables',
			severity: 'error',
			text: 'Disable for "all" is missing a description',
		},
		{
			line: 16,
			column: 7,
			endLine: 16,
			endColumn: 49,
			rule: '--report-descriptionless-disables',
			severity: 'error',
			text: 'Disable for "block-no-empty" is missing a description',
		},
		{
			line: 18,
			column: 1,
			endLine: 18,
			endColumn: 48,
			rule: '--report-descriptionless-disables',
			severity: 'error',
			text: 'Disable for "block-no-empty" is missing a description',
		},
	]);
});

it('descriptionlessDisables true except', async () => {
	const config = {
		rules: { 'block-no-empty': true },
	};

	const css = stripIndent`
		/* stylelint-disable -- Description */
		a {}
		/* stylelint-enable */
		a {
			b {} /* stylelint-disable-line block-no-empty -- Description */
		}
		/* stylelint-disable-next-line block-no-empty
		 * --
		 * Description */
		a {}

		/* stylelint-disable */
		a {}
		/* stylelint-enable */
		a {
			b {} /* stylelint-disable-line invalid-hex-case */
		}
		/* stylelint-disable-next-line block-no-empty */
		a {}`;

	const linted = await standalone({
		config,
		code: css,
		reportDescriptionlessDisables: [true, { except: ['invalid-hex-case'] }],
	});
	const results = linted.results;

	expect(results).toHaveLength(1);
	const warnings = results[0].warnings.filter(
		(warning) => warning.rule === '--report-descriptionless-disables',
	);

	expect(warnings).toEqual([
		{
			line: 12,
			column: 1,
			endLine: 12,
			endColumn: 23,
			rule: '--report-descriptionless-disables',
			severity: 'error',
			text: 'Disable for "all" is missing a description',
		},
		{
			line: 18,
			column: 1,
			endLine: 18,
			endColumn: 48,
			rule: '--report-descriptionless-disables',
			severity: 'error',
			text: 'Disable for "block-no-empty" is missing a description',
		},
	]);
});

it('descriptionlessDisables false except', async () => {
	const config = {
		rules: { 'block-no-empty': true },
	};

	const css = stripIndent`
		/* stylelint-disable -- Description */
		a {}
		/* stylelint-enable */
		a {
			b {} /* stylelint-disable-line block-no-empty -- Description */
		}
		/* stylelint-disable-next-line block-no-empty
		 * --
		 * Description */
		a {}

		/* stylelint-disable */
		a {}
		/* stylelint-enable */
		a {
			b {} /* stylelint-disable-line invalid-hex-case */
		}
		/* stylelint-disable-next-line block-no-empty */
		a {}`;

	const linted = await standalone({
		config,
		code: css,
		reportDescriptionlessDisables: [false, { except: ['invalid-hex-case'] }],
	});
	const results = linted.results;

	expect(results).toHaveLength(1);
	const warnings = results[0].warnings.filter(
		(warning) => warning.rule === '--report-descriptionless-disables',
	);

	expect(warnings).toEqual([
		{
			line: 16,
			column: 7,
			endLine: 16,
			endColumn: 51,
			rule: '--report-descriptionless-disables',
			severity: 'error',
			text: 'Disable for "invalid-hex-case" is missing a description',
		},
	]);
});

it('descriptionlessDisables severity', async () => {
	const config = {
		rules: { 'block-no-empty': true },
	};

	const css = stripIndent`
		/* stylelint-disable -- Description */
		a {}
		/* stylelint-enable */
		a {
			b {} /* stylelint-disable-line block-no-empty -- Description */
		}
		/* stylelint-disable-next-line block-no-empty
		 * --
		 * Description */
		a {}

		/* stylelint-disable */
		a {}
		/* stylelint-enable */
		a {
			b {} /* stylelint-disable-line block-no-empty */
		}
		/* stylelint-disable-next-line block-no-empty */
		a {}`;

	const linted = await standalone({
		config,
		code: css,
		reportDescriptionlessDisables: [true, { severity: 'warning' }],
	});
	const results = linted.results;

	expect(results).toHaveLength(1);
	const warnings = results[0].warnings.filter(
		(warning) => warning.rule === '--report-descriptionless-disables',
	);

	expect(warnings).toEqual([
		{
			line: 12,
			column: 1,
			endLine: 12,
			endColumn: 23,
			rule: '--report-descriptionless-disables',
			severity: 'warning',
			text: 'Disable for "all" is missing a description',
		},
		{
			line: 16,
			column: 7,
			endLine: 16,
			endColumn: 49,
			rule: '--report-descriptionless-disables',
			severity: 'warning',
			text: 'Disable for "block-no-empty" is missing a description',
		},
		{
			line: 18,
			column: 1,
			endLine: 18,
			endColumn: 48,
			rule: '--report-descriptionless-disables',
			severity: 'warning',
			text: 'Disable for "block-no-empty" is missing a description',
		},
	]);
});


text:
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl\nsIRemoteOpenFileListener.idl
 */

#ifndef __gen_nsIRemoteOpenFileListener_h__
#define __gen_nsIRemoteOpenFileListener_h__

#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif

/* starting interface:    nsIRemoteOpenFileListener */
#define NS_IREMOTEOPENFILELISTENER_IID_STR "5c89208c-fe2b-4e04-9783-93bcf5c3b783"

#define NS_IREMOTEOPENFILELISTENER_IID \
  {0x5c89208c, 0xfe2b, 0x4e04, \
    { 0x97, 0x83, 0x93, 0xbc, 0xf5, 0xc3, 0xb7, 0x83 }}

class NS_NO_VTABLE nsIRemoteOpenFileListener : public nsISupports {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IREMOTEOPENFILELISTENER_IID)

  /* void onRemoteFileOpenComplete (in nsresult aOpenStatus); */
  NS_IMETHOD OnRemoteFileOpenComplete(nsresult aOpenStatus) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIRemoteOpenFileListener, NS_IREMOTEOPENFILELISTENER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIREMOTEOPENFILELISTENER \
  NS_IMETHOD OnRemoteFileOpenComplete(nsresult aOpenStatus) override;

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIREMOTEOPENFILELISTENER(_to) \
  NS_IMETHOD OnRemoteFileOpenComplete(nsresult aOpenStatus) override { return _to OnRemoteFileOpenComplete(aOpenStatus); }

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIREMOTEOPENFILELISTENER(_to) \
  NS_IMETHOD OnRemoteFileOpenComplete(nsresult aOpenStatus) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OnRemoteFileOpenComplete(aOpenStatus); }

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsRemoteOpenFileListener : public nsIRemoteOpenFileListener
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIREMOTEOPENFILELISTENER

  nsRemoteOpenFileListener();

private:
  ~nsRemoteOpenFileListener();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsRemoteOpenFileListener, nsIRemoteOpenFileListener)

nsRemoteOpenFileListener::nsRemoteOpenFileListener()
{
  /* member initializers and constructor code */
}

nsRemoteOpenFileListener::~nsRemoteOpenFileListener()
{
  /* destructor code */
}

/* void onRemoteFileOpenComplete (in nsresult aOpenStatus); */
NS_IMETHODIMP nsRemoteOpenFileListener::OnRemoteFileOpenComplete(nsresult aOpenStatus)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif

#endif /* __gen_nsIRemoteOpenFileListener_h__ */


text:
package com.novoda.merlin.demo.connectivity.display;

import android.app.Activity;
import android.view.View;

import de.keyboardsurfer.android.widget.crouton.Crouton;
import de.keyboardsurfer.android.widget.crouton.LifecycleCallback;
import de.keyboardsurfer.android.widget.crouton.Style;

public class NovodaCrouton {

    private final Activity activity;

    private Crouton currentCrouton;

    public NovodaCrouton(Activity activity) {
        this.activity = activity;
    }

    public boolean isShown() {
        return currentCrouton != null;
    }

    public void show(CroutonStyles croutonStyles) {
        hideCurrent();
        Crouton crouton = makeCrouton(croutonStyles);
        setClickListener(crouton);
        setCurrent(crouton);
        crouton.show();
    }

    private Crouton makeCrouton(CroutonStyles croutonStyles) {
        Style style = croutonStyles.getStyle(activity);
        return Crouton.makeText(activity, croutonStyles.getStringResId(), style);
    }

    private void hideCurrent() {
        if (isShown()) {
            Crouton.hide(currentCrouton);
        }
    }

    private void setClickListener(final Crouton crouton) {
        crouton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                hideCrouton(crouton);
            }
        });
    }

    private void hideCrouton(Crouton crouton) {
        Crouton.hide(crouton);
    }

    private void setCurrent(Crouton crouton) {
        setLifecycle(crouton);
    }

    private void setLifecycle(final Crouton crouton) {
        crouton.setLifecycleCallback(new LifecycleCallback() {
            @Override
            public void onDisplayed() {
                currentCrouton = crouton;
            }

            @Override
            public void onRemoved() {
                currentCrouton = null;
            }
        });
    }

    public void close() {
        Crouton.cancelAllCroutons();
        currentCrouton = null;
    }

}


text:
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<!-- Maven coordinates -->
	<parent>
		<groupId>org.kurento</groupId>
		<artifactId>kurento-integration-tests</artifactId>
		<version>6.18.1-SNAPSHOT</version>
	</parent>
	<artifactId>kurento-client-test</artifactId>
	<packaging>jar</packaging>

	<!-- Project-level information -->
	<name>Kurento Integration tests - Kurento Client</name>
	<description>
		The Kurento Client project allows server applications to control media
		server resources. This project contains the tests for the kurento-client
		project
	</description>

	<!-- Project configuration -->

	<dependencies>
		<dependency>
			<groupId>org.kurento</groupId>
			<artifactId>kurento-client</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.kurento</groupId>
			<artifactId>kurento-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty.websocket</groupId>
			<artifactId>websocket-client</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

</project>


text:
package lock;

import javax.swing.SwingUtilities;

/**
 * A main class that starts the server.
 *
 * @author Peter Johansson, Andree Höög, Jesper Hansen
 */
public class MainServer {
	public static void main( String[] args ) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				new ServerGUI( 5555 );
			}
		});
	}
}


text:
<form id="formulario" class="col-md-12" method="post" action="/lib/admin.php" enctype="multipart/form-data">

Adicionar rotativo

			<input type="text" name="titulo" class="txt col-md-6 required" placeholder="Título"/>
			<input type="text" name="link" class="txt col-md-6 required pull-right" placeholder="Link"/>
			<fieldset class="col-md-12">
				<legend class="legenda">Imagem(1500x600)</legend>
		        <input type="file" name="arq1" class="arq"/>
			</fieldset>

                <input type="submit" name="rotativoadd" class="btn" value="Salvar alterações"/>

</form>


text:
/**
 * @file
 * Drupal's off-canvas library.
 */

(($, Drupal, debounce, displace) => {
  /**
   * Off-canvas dialog implementation using jQuery Dialog.
   *
   * Transforms the regular dialogs created using Drupal.dialog when the dialog
   * element equals '#drupal-off-canvas' into a side-loading dialog.
   *
   * @namespace
   */
  Drupal.offCanvas = {
    /**
     * Storage for position information about the tray.
     *
     * @type {?String}
     */
    position: null,

    /**
     * The minimum height of the tray when opened at the top of the page.
     *
     * @type {Number}
     */
    minimumHeight: 30,

    /**
     * The minimum width to use body displace needs to match the width at which
     * the tray will be 100% width. @see core/misc/dialog/off-canvas.css
     *
     * @type {Number}
     */
    minDisplaceWidth: 768,

    /**
     * Wrapper used to position off-canvas dialog.
     *
     * @type {jQuery}
     */
    $mainCanvasWrapper: $('[data-off-canvas-main-canvas]'),

    /**
     * Determines if an element is an off-canvas dialog.
     *
     * @param {jQuery} $element
     *   The dialog element.
     *
     * @return {bool}
     *   True this is currently an off-canvas dialog.
     */
    isOffCanvas($element) {
      return $element.is('#drupal-off-canvas');
    },

    /**
     * Remove off-canvas dialog events.
     *
     * @param {jQuery} $element
     *   The target element.
     */
    removeOffCanvasEvents($element) {
      $element.off('.off-canvas');
      $(document).off('.off-canvas');
      $(window).off('.off-canvas');
    },

    /**
     * Handler fired before an off-canvas dialog has been opened.
     *
     * @param {Object} settings
     *   Settings related to the composition of the dialog.
     *
     * @return {undefined}
     */
    beforeCreate({ settings, $element }) {
      // Clean up previous dialog event handlers.
      Drupal.offCanvas.removeOffCanvasEvents($element);

      $('body').addClass('js-off-canvas-dialog-open');
      // @see http://api.jqueryui.com/position/
      settings.position = {
        my: 'left top',
        at: `${Drupal.offCanvas.getEdge()} top`,
        of: window,
      };

      /**
       * Applies initial height and with to dialog based depending on position.
       * @see http://api.jqueryui.com/dialog for all dialog options.
       */
      const position = settings.drupalOffCanvasPosition;
      const height = position === 'side' ? $(window).height() : settings.height;
      const width = position === 'side' ? settings.width : '100%';
      settings.height = height;
      settings.width = width;
    },

    /**
     * Handler fired after an off-canvas dialog has been closed.
     *
     * @return {undefined}
     */
    beforeClose({ $element }) {
      $('body').removeClass('js-off-canvas-dialog-open');
      // Remove all *.off-canvas events
      Drupal.offCanvas.removeOffCanvasEvents($element);
      Drupal.offCanvas.resetPadding();
    },

    /**
     * Handler fired when an off-canvas dialog has been opened.
     *
     * @param {jQuery} $element
     *   The off-canvas dialog element.
     * @param {Object} settings
     *   Settings related to the composition of the dialog.
     *
     * @return {undefined}
     */
    afterCreate({ $element, settings }) {
      const eventData = { settings, $element, offCanvasDialog: this };

      $element
        .on(
          'dialogContentResize.off-canvas',
          eventData,
          Drupal.offCanvas.handleDialogResize,
        )
        .on(
          'dialogContentResize.off-canvas',
          eventData,
          Drupal.offCanvas.bodyPadding,
        );

      Drupal.offCanvas
        .getContainer($element)
        .attr(`data-offset-${Drupal.offCanvas.getEdge()}`, '');

      $(window)
        .on(
          'resize.off-canvas',
          eventData,
          debounce(Drupal.offCanvas.resetSize, 100),
        )
        .trigger('resize.off-canvas');
    },

    /**
     * Toggle classes based on title existence.
     * Called with Drupal.offCanvas.afterCreate.
     *
     * @param {Object} settings
     *   Settings related to the composition of the dialog.
     *
     * @return {undefined}
     */
    render({ settings }) {
      $(
        '.ui-dialog-off-canvas, .ui-dialog-off-canvas .ui-dialog-titlebar',
      ).toggleClass('ui-dialog-empty-title', !settings.title);
    },

    /**
     * Adjusts the dialog on resize.
     *
     * @param {jQuery.Event} event
     *   The event triggered.
     * @param {object} event.data
     *   Data attached to the event.
     */
    handleDialogResize(event) {
      const $element = event.data.$element;
      const $container = Drupal.offCanvas.getContainer($element);

      const $offsets = $container.find(
        '> :not(#drupal-off-canvas, .ui-resizable-handle)',
      );
      let offset = 0;

      // Let scroll element take all the height available.
      $element.css({ height: 'auto' });
      const modalHeight = $container.height();

      $offsets.each((i, e) => {
        offset += $(e).outerHeight();
      });

      // Take internal padding into account.
      const scrollOffset = $element.outerHeight() - $element.height();
      $element.height(modalHeight - offset - scrollOffset);
    },

    /**
     * Resets the size of the dialog.
     *
     * @param {jQuery.Event} event
     *   The event triggered.
     * @param {object} event.data
     *   Data attached to the event.
     */
    resetSize(event) {
      const $element = event.data.$element;
      const container = Drupal.offCanvas.getContainer($element);
      const position = event.data.settings.drupalOffCanvasPosition;

      // Only remove the `data-offset-*` attribute if the value previously
      // exists and the orientation is changing.
      if (Drupal.offCanvas.position && Drupal.offCanvas.position !== position) {
        container.removeAttr(`data-offset-${Drupal.offCanvas.position}`);
      }
      // Set a minimum height on $element
      if (position === 'top') {
        $element.css('min-height', `${Drupal.offCanvas.minimumHeight}px`);
      }

      displace();

      const offsets = displace.offsets;

      const topPosition =
        position === 'side' && offsets.top !== 0 ? `+${offsets.top}` : '';
      const adjustedOptions = {
        // @see http://api.jqueryui.com/position/
        position: {
          my: `${Drupal.offCanvas.getEdge()} top`,
          at: `${Drupal.offCanvas.getEdge()} top${topPosition}`,
          of: window,
        },
      };

      const height =
        position === 'side'
          ? `${$(window).height() - (offsets.top + offsets.bottom)}px`
          : event.data.settings.height;
      container.css({
        position: 'fixed',
        height,
      });

      $element
        .dialog('option', adjustedOptions)
        .trigger('dialogContentResize.off-canvas');

      Drupal.offCanvas.position = position;
    },

    /**
     * Adjusts the body padding when the dialog is resized.
     *
     * @param {jQuery.Event} event
     *   The event triggered.
     * @param {object} event.data
     *   Data attached to the event.
     */
    bodyPadding(event) {
      const position = event.data.settings.drupalOffCanvasPosition;
      if (
        position === 'side' &&
        $('body').outerWidth() < Drupal.offCanvas.minDisplaceWidth
      ) {
        return;
      }
      Drupal.offCanvas.resetPadding();
      const $element = event.data.$element;
      const $container = Drupal.offCanvas.getContainer($element);
      const $mainCanvasWrapper = Drupal.offCanvas.$mainCanvasWrapper;

      const width = $container.outerWidth();
      const mainCanvasPadding = $mainCanvasWrapper.css(
        `padding-${Drupal.offCanvas.getEdge()}`,
      );
      if (position === 'side' && width !== mainCanvasPadding) {
        $mainCanvasWrapper.css(
          `padding-${Drupal.offCanvas.getEdge()}`,
          `${width}px`,
        );
        $container.attr(`data-offset-${Drupal.offCanvas.getEdge()}`, width);
        displace();
      }

      const height = $container.outerHeight();
      if (position === 'top') {
        $mainCanvasWrapper.css('padding-top', `${height}px`);
        $container.attr('data-offset-top', height);
        displace();
      }
    },

    /**
     * The HTML element that surrounds the dialog.
     * @param {HTMLElement} $element
     *   The dialog element.
     *
     * @return {HTMLElement}
     *   The containing element.
     */
    getContainer($element) {
      return $element.dialog('widget');
    },

    /**
     * The edge of the screen that the dialog should appear on.
     *
     * @return {string}
     *   The edge the tray will be shown on, left or right.
     */
    getEdge() {
      return document.documentElement.dir === 'rtl' ? 'left' : 'right';
    },

    /**
     * Resets main canvas wrapper and toolbar padding / margin.
     */
    resetPadding() {
      Drupal.offCanvas.$mainCanvasWrapper.css(
        `padding-${Drupal.offCanvas.getEdge()}`,
        0,
      );
      Drupal.offCanvas.$mainCanvasWrapper.css('padding-top', 0);
      displace();
    },
  };

  /**
   * Attaches off-canvas dialog behaviors.
   *
   * @type {Drupal~behavior}
   *
   * @prop {Drupal~behaviorAttach} attach
   *   Attaches event listeners for off-canvas dialogs.
   */
  Drupal.behaviors.offCanvasEvents = {
    attach: () => {
      if (!once('off-canvas', 'html').length) {
        return;
      }
      $(window).on({
        'dialog:beforecreate': (event, dialog, $element, settings) => {
          if (Drupal.offCanvas.isOffCanvas($element)) {
            Drupal.offCanvas.beforeCreate({ dialog, $element, settings });
          }
        },
        'dialog:aftercreate': (event, dialog, $element, settings) => {
          if (Drupal.offCanvas.isOffCanvas($element)) {
            Drupal.offCanvas.render({ dialog, $element, settings });
            Drupal.offCanvas.afterCreate({ $element, settings });
          }
        },
        'dialog:beforeclose': (event, dialog, $element) => {
          if (Drupal.offCanvas.isOffCanvas($element)) {
            Drupal.offCanvas.beforeClose({ dialog, $element });
          }
        },
      });
    },
  };
})(jQuery, Drupal, Drupal.debounce, Drupal.displace);