text:
import pandas as pd
import numpy as np
from statistics import mode

class manudataclean:
    '''
    H.1) Human assisted Data Cleaning; identify invalid values and/or rows,
    create a list of possible actions that could be taken and create an user interface for a human to decide what to do
    - NAN, missing, outliers, unreliable values, out of the range.
    Once the action is chosen, perform the action.

    Reference - http://pandas.pydata.org/pandas-docs/stable/missing_data.html

    Process -

    1. Check type of column - numeric/non-numeric
    2. For non-numeric -
        a. Replace missing and out of range by most common (mode) in dev
    3. For numeric -
        a. Compute dev mean, median, min and max excluding outliers and unreliable values
        b. For automated -
            i. Replace NA and unreliable by mean of dev
            ii. Replace outliers and out of range by min or max of dev as applicable
        c. For human assisted -
            i. For NAs and unreliable values, give option of replacing by mean, median or user input value
            ii. For outliers and out of range values, give option of replacing by mean, median, min, max or user input

    Note - Replacement values are always computed on dev and replacements in val are always same as dev treatment

    Note - Exclude ID and target from cleaning process

    Note - case 1 : one file, like MBD_FA2; case 2 : multiple files, one dev and others val, test, oot etc.
    '''

    def __init__(self, traindata, testdata = None):
        '''Constructor for this class'''
        self.traindata = pd.DataFrame(traindata)
        if testdata is not None:
            self.testdata = pd.DataFrame(testdata)
        else:
            self.testdata = None
        self.main()

    def main(self):
        numerics = ['int16', 'int32', 'int64', 'float16', 'float32', 'float64']
        idtargetlist = ['id', 'ob_target', 'ID', 'TARGET']

        dev_num_manual = self.traindata.select_dtypes(include=numerics)
        dev_nonnum_manual = self.traindata.select_dtypes(exclude=numerics)

        if self.testdata is not None:
            val_num_manual = self.testdata.select_dtypes(include=numerics)
            val_nonnum_manual = self.testdata.select_dtypes(exclude=numerics)

        colnames_num_manual = list(dev_num_manual.columns.values)
        colnames_nonnum_manual = list(dev_nonnum_manual.columns.values)

        for names in idtargetlist:
            if names in colnames_num_manual:
                colnames_num_manual.remove(names)
            if names in colnames_nonnum_manual:
                colnames_nonnum_manual.remove(names)

        print("Processing non-numeric variables")

        for column in colnames_nonnum_manual:
            print("Processing variable ", column)
            colmode = mode(dev_nonnum_manual.loc[:, column])
            dev_nonnum_manual.loc[:, column].to_replace(to_replace="", value=colmode)
            allvalues = np.unique(dev_nonnum_manual.loc[:, column])
            if val_filename != "NA":
                val_nonnum_manual.loc[:, column].to_replace(to_replace="", value=colmode)
                for row in val_nonnum_manual.loc[:, column]:
                    if row not in allvalues:
                        row = colmode
            print("Variable ", column, "is clean")

        print("Processing numeric variables")

        for column in colnames_num_manual:
            print("Processing variable ", column)
            colmeanorig = np.mean(dev_num_manual.loc[:, column])
            colstdev = np.std(dev_num_manual.loc[:, column])
            temp = dev_num_manual.loc[:, column].tolist()
            for i in temp:
                if np.abs((i - colmeanorig)) > 3 * colstdev:
                    temp.remove(i)
            colmean = np.mean(temp)
            colmedian = np.median(temp)
            colmin = np.min(temp)
            colmax = np.max(temp)
            na_unreliable_replacement = int(input(
                "Choose NA and unreliable value replacement method : 1.Mean 2.Median 3.Specific user-input value, by entering the corresponding number : "))
            if na_unreliable_replacement == 1:
                dev_num_manual.loc[:, column].fillna(colmean)
            elif na_unreliable_replacement == 2:
                dev_num_manual.loc[:, column].fillna(colmedian)
            else:
                na_unreliable_replacement_value = input("Enter the value to replace NAs and unreliable values with : ")
                dev_num_manual.loc[:, column].fillna(na_unreliable_replacement_value)
            outlier_outofrange_replacement = int(input(
                "Choose outlier and out of range value replacement method : 1.Mean 2.Median 3. Minimum or maximum value based on value 4.Specific user-input value, by entering the corresponding number : "))
            if outlier_outofrange_replacement not in (1, 2, 3):
                outlier_outofrange_replacement_value_lower = input(
                    "Enter the value to replace lower end outliers and out of range values with : ")
                outlier_outofrange_replacement_value_higher = input(
                    "Enter the value to replace higher end outliers and out of range values with : ")
            for row in dev_num_manual.loc[:, column]:
                if float(row) < colmeanorig - 3 * colstdev:
                    if outlier_outofrange_replacement == 1:
                        row = colmean
                    elif outlier_outofrange_replacement == 2:
                        row = colmedian
                    elif outlier_outofrange_replacement == 3:
                        row = colmin
                    else:
                        row = outlier_outofrange_replacement_value_lower
                if float(row) > colmeanorig + 3 * colstdev:
                    if outlier_outofrange_replacement == 1:
                        row = colmean
                    elif outlier_outofrange_replacement == 2:
                        row = colmedian
                    elif outlier_outofrange_replacement == 3:
                        row = colmax
                    else:
                        row = outlier_outofrange_replacement_value_higher
            if self.testdata is not None:
                if na_unreliable_replacement == 1:
                    val_num_manual.loc[:, column].fillna(colmean)
                elif na_unreliable_replacement == 2:
                    val_num_manual.loc[:, column].fillna(colmedian)
                else:
                    val_num_manual.loc[:, column].fillna(na_unreliable_replacement_value)
                for row in val_num_manual.loc[:, column]:
                    if float(row) < colmin or float(row) < colmeanorig - 3 * colstdev:
                        if outlier_outofrange_replacement == 1:
                            row = colmean
                        elif outlier_outofrange_replacement == 2:
                            row = colmedian
                        elif outlier_outofrange_replacement == 3:
                            row = colmin
                        else:
                            row = outlier_outofrange_replacement_value_lower
                    if float(row) > colmax or float(row) > colmeanorig + 3 * colstdev:
                        if outlier_outofrange_replacement == 1:
                            row = colmean
                        elif outlier_outofrange_replacement == 2:
                            row = colmedian
                        elif outlier_outofrange_replacement == 3:
                            row = colmax
                        else:
                            row = outlier_outofrange_replacement_value_higher
            print("Variable ", column, "is clean\n\n")

        print("Manual cleaning is complete")
        print("Cleaned numeric variables are available in dev_num_manual and val_num_manual")
        print("Cleaned non-numeric variables are available in dev_nonnum_manual and val_nonnum_manual")

# dev = pd.read_csv("dev.csv")
# oot = pd.read_csv("oot0.csv")
# A = manudataclean(dev,oot)


text:
<?xml version="1.0" encoding="UTF-8"?>

<!--

 Copyright 2003 - 2010 The eFaps Team

 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.

 Author:          The eFaps Team
 Revision:        $Rev$
 Last Changed:    $Date$
 Last Changed By: $Author$

-->

<datamodel-sqltable  xmlns="http://www.efaps.org/xsd"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="http://www.efaps.org/xsd http://www.efaps.org/xsd/eFaps_1.0.xsd">
    <uuid>f4f343b1-6b0e-485f-b3a9-4f1fc23f8cf6</uuid>
    <file-application>eFapsApp-HumanResource</file-application>
    <file-revision>$Rev$</file-revision>
    <definition>
        <version-expression>(version==latest)</version-expression>
        <profiles>
            <profile name="eFaps"/>
        </profiles>
        <name>HumanResource_ClassLocationSQLTable</name>
        <database>
            <table-name>T_HRCLASSLOC</table-name>
            <column name="EMPLOYEEID"       type="INTEGER"          not-null="true" />
            <column name="STREET"           type="STRING_SHORT"     not-null="true" length="255"/>
            <column name="CITY"             type="STRING_SHORT"     not-null="true" length="255"/>
            <column name="ZIP"              type="STRING_SHORT"                     length="255"/>
            <foreign name="T_HRCLASSFT_FK_CONTACTID"        key="EMPLOYEEID" reference="T_HREMPLOYEE(ID)" />
        </database>
    </definition>

    <definition >
        <version-expression>(version==latest)</version-expression>
        <profiles>
            <profile name="ubicaciones"/>
        </profiles>
        <name>HumanResource_ClassLocationSQLTable</name>
        <database>
            <table-name>T_HRCLASSLOC</table-name>
            <column name="EMPLOYEEID"       type="INTEGER"          not-null="true" />
            <column name="STREET"           type="STRING_SHORT"     not-null="true" length="255"/>
            <column name="CITY"             type="STRING_SHORT"     not-null="true" length="255"/>
            <column name="ZIP"              type="STRING_SHORT"                     length="255"/>
            <column name="DEPARTMENTID"     type="INTEGER" />
            <column name="PROVINCEID"       type="INTEGER" />
            <column name="DISTRICTID"       type="INTEGER" />
            <foreign name="T_HRCLASSFT_FK_CONTACTID"        key="EMPLOYEEID" reference="T_HREMPLOYEE(ID)" />
            <foreign name="T_HRCLASSFT_FK_DEPARTMENTID"     key="DEPARTMENTID" reference="T_UBICACION(ID)" />
        </database>
    </definition>
</datamodel-sqltable>

redpajama_set_name: RedPajamaGithub


text:
With Windows Azure Mobile Services you can add a scalable backend to your connected client applications in minutes. To learn more, visit our [Developer Center](http://www.windowsazure.com/en-us/develop/mobile).

## Getting Started

If you are new to Mobile Services, you can get started by following our tutorials for connecting your Mobile Services cloud backend to [Windows Store apps](https://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started/) and [iOS apps](https://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-ios/).

## Download Source Code

To get the source code of our SDKs and samples via **git** just type:

    git clone https://github.com/xamarin/azure-mobile-services.git
    cd azure-mobile-services
    git submodule init
    git submodule update

## Xamarin and Azure: Xamarin.iOS and Xamarin.Android Client SDK

Our client SDK makes it incredibly easy to use Mobile Services from your Xamarin.iOS and Xamarin.Android applications. You can download the source code using the instructions above and then you will find the SDKs under ```/azure-mobile-services/sdk/xamarin/ios``` and ```/azure-mobile-services/sdk/xamarin/android```.

### Prerequisities

The SDK requires Xamarin.iOS or Xamarin.Android.

### Running the Tests

The Xamarin.iOS SDK has a suite of unit tests.

1. Open the ```/azure-mobile-services/sdk/ios/Microsoft.Azure.Zumo.iOS.sln``` solution file.
2. Right click on the ```ZumoTests``` project in the solution explorer and select ```Set as StartUp Project```.
3. Start the application
4. A Xamarin.iOS application will appear, press ```Run Everything```

### Sample Application: Todo

Todo is a simple todo list application that demonstrates some features of Windows Azure Mobile Services. You can find todo under ```/azure-mobile-services/samples/todo```.

### Need Help?

Be sure to check out the Mobile Services [Developer Forum](http://social.msdn.microsoft.com/Forums/en-US/azuremobile/) if you are having trouble. The Mobile Services product team actively monitors the forum and will be more than happy to assist you.

### Contribute Code or Provide Feedback

If you would like to become an active contributor to this project please follow the instructions provided in [Windows Azure Projects Contribution Guidelines](http://windowsazure.github.com/guidelines.html).

If you encounter any bugs with the library please file an issue in the [Issues](https://github.com/xamarin/azure-mobile-services/issues) section of the project.

## Learn More
[Windows Azure Mobile Services Developer Center](http://www.windowsazure.com/en-us/develop/mobile)


text:
package org.apache.sysds.runtime.instructions.spark;

import org.apache.spark.api.java.JavaPairRDD;
import org.apache.sysds.common.Types.DataType;
import org.apache.sysds.common.Types.ValueType;
import org.apache.sysds.lops.SortKeys;
import org.apache.sysds.runtime.DMLRuntimeException;
import org.apache.sysds.runtime.controlprogram.context.ExecutionContext;
import org.apache.sysds.runtime.controlprogram.context.SparkExecutionContext;
import org.apache.sysds.runtime.instructions.InstructionUtils;
import org.apache.sysds.runtime.instructions.cp.CPOperand;
import org.apache.sysds.runtime.instructions.spark.utils.RDDSortUtils;
import org.apache.sysds.runtime.matrix.data.MatrixBlock;
import org.apache.sysds.runtime.matrix.data.MatrixIndexes;
import org.apache.sysds.runtime.meta.DataCharacteristics;

/**
 * This class supports two variants of sort operation on a 1-dimensional input matrix.
 * The two variants are <code> weighted </code> and <code> unweighted </code>.
 * Example instructions:
 *     sort:mVar1:mVar2 (input=mVar1, output=mVar2)
 *     sort:mVar1:mVar2:mVar3 (input=mVar1, weights=mVar2, output=mVar3)
 *
 */
public class QuantileSortSPInstruction extends UnarySPInstruction {

	private QuantileSortSPInstruction(CPOperand in, CPOperand out, String opcode, String istr) {
		this(in, null, out, opcode, istr);
	}

	private QuantileSortSPInstruction(CPOperand in1, CPOperand in2, CPOperand out, String opcode,
			String istr) {
		super(SPType.QSort, null, in1, in2, out, opcode, istr);
	}

	public static QuantileSortSPInstruction parseInstruction ( String str ) {
		CPOperand in1 = new CPOperand("", ValueType.UNKNOWN, DataType.UNKNOWN);
		CPOperand in2 = null;
		CPOperand out = new CPOperand("", ValueType.UNKNOWN, DataType.UNKNOWN);

		String[] parts = InstructionUtils.getInstructionPartsWithValueType(str);
		String opcode = parts[0];

		if ( opcode.equalsIgnoreCase(SortKeys.OPCODE) ) {
			if ( parts.length == 3 ) {
				// Example: sort:mVar1:mVar2 (input=mVar1, output=mVar2)
				parseUnaryInstruction(str, in1, out);
				return new QuantileSortSPInstruction(in1, out, opcode, str);
			}
			else if ( parts.length == 4 ) {
				// Example: sort:mVar1:mVar2:mVar3 (input=mVar1, weights=mVar2, output=mVar3)
				in2 = new CPOperand("", ValueType.UNKNOWN, DataType.UNKNOWN);
				parseUnaryInstruction(str, in1, in2, out);
				return new QuantileSortSPInstruction(in1, in2, out, opcode, str);
			}
			else {
				throw new DMLRuntimeException("Invalid number of operands in instruction: " + str);
			}
		}
		else {
			throw new DMLRuntimeException("Unknown opcode while parsing a SortSPInstruction: " + str);
		}
	}

	@Override
	public void processInstruction(ExecutionContext ec) {
		SparkExecutionContext sec = (SparkExecutionContext)ec;
		boolean weighted = (input2 != null);

		//get input rdds
		JavaPairRDD<MatrixIndexes,MatrixBlock> in = sec.getBinaryMatrixBlockRDDHandleForVariable( input1.getName() );
		JavaPairRDD<MatrixIndexes,MatrixBlock> inW = weighted ? sec.getBinaryMatrixBlockRDDHandleForVariable( input2.getName() ) : null;
		DataCharacteristics mc = sec.getDataCharacteristics(input1.getName());

		JavaPairRDD<MatrixIndexes,MatrixBlock> out = null;
		long clen = -1;
		if( !weighted ) { //W/O WEIGHTS (default)
			out = RDDSortUtils.sortByVal(in, mc.getRows(), mc.getBlocksize());
			clen = 1;
		}
		else { //W/ WEIGHTS
			out = RDDSortUtils.sortByVal(in, inW, mc.getRows(), mc.getBlocksize());
			clen = 2;
		}

		//put output RDD handle into symbol table
		sec.setRDDHandleForVariable(output.getName(), out);
		sec.addLineageRDD(output.getName(), input1.getName());
		if( weighted )
			sec.addLineageRDD(output.getName(), input2.getName());

		//update output matrix characteristics
		DataCharacteristics mcOut = sec.getDataCharacteristics(output.getName());
		mcOut.set(mc.getRows(), clen, mc.getBlocksize(), mc.getBlocksize());
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textSize="@dimen/text_size_large"
    android:id="@+id/tv_title"
    android:clickable="false"
    android:focusable="false"/>


text:
#import <objc/runtime.h>

#import <Foundation/Foundation.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 Returns object on given index for obj in its ivar layout.
 It will try to map the object to an Objective-C object, so if the index
 is invalid it will crash with BAD_ACCESS.

 It cannot be called under ARC.
 */
id FBExtractObjectByOffset(id obj, NSUInteger index);

#ifdef __cplusplus
}
#endif


text:
package fakes

import (
	"autoscaler/healthendpoint"
	"sync"

	"github.com/prometheus/client_golang/prometheus"
)

type FakeHTTPStatusCollector struct {
	DescribeStub        func(chan<- *prometheus.Desc)
	describeMutex       sync.RWMutex
	describeArgsForCall []struct {
		arg1 chan<- *prometheus.Desc
	}
	CollectStub        func(chan<- prometheus.Metric)
	collectMutex       sync.RWMutex
	collectArgsForCall []struct {
		arg1 chan<- prometheus.Metric
	}
	IncConcurrentHTTPRequestStub        func()
	incConcurrentHTTPRequestMutex       sync.RWMutex
	incConcurrentHTTPRequestArgsForCall []struct{}
	DecConcurrentHTTPRequestStub        func()
	decConcurrentHTTPRequestMutex       sync.RWMutex
	decConcurrentHTTPRequestArgsForCall []struct{}
	invocations                         map[string][][]interface{}
	invocationsMutex                    sync.RWMutex
}

func (fake *FakeHTTPStatusCollector) Describe(arg1 chan<- *prometheus.Desc) {
	fake.describeMutex.Lock()
	fake.describeArgsForCall = append(fake.describeArgsForCall, struct {
		arg1 chan<- *prometheus.Desc
	}{arg1})
	fake.recordInvocation("Describe", []interface{}{arg1})
	fake.describeMutex.Unlock()
	if fake.DescribeStub != nil {
		fake.DescribeStub(arg1)
	}
}

func (fake *FakeHTTPStatusCollector) DescribeCallCount() int {
	fake.describeMutex.RLock()
	defer fake.describeMutex.RUnlock()
	return len(fake.describeArgsForCall)
}

func (fake *FakeHTTPStatusCollector) DescribeArgsForCall(i int) chan<- *prometheus.Desc {
	fake.describeMutex.RLock()
	defer fake.describeMutex.RUnlock()
	return fake.describeArgsForCall[i].arg1
}

func (fake *FakeHTTPStatusCollector) Collect(arg1 chan<- prometheus.Metric) {
	fake.collectMutex.Lock()
	fake.collectArgsForCall = append(fake.collectArgsForCall, struct {
		arg1 chan<- prometheus.Metric
	}{arg1})
	fake.recordInvocation("Collect", []interface{}{arg1})
	fake.collectMutex.Unlock()
	if fake.CollectStub != nil {
		fake.CollectStub(arg1)
	}
}

func (fake *FakeHTTPStatusCollector) CollectCallCount() int {
	fake.collectMutex.RLock()
	defer fake.collectMutex.RUnlock()
	return len(fake.collectArgsForCall)
}

func (fake *FakeHTTPStatusCollector) CollectArgsForCall(i int) chan<- prometheus.Metric {
	fake.collectMutex.RLock()
	defer fake.collectMutex.RUnlock()
	return fake.collectArgsForCall[i].arg1
}

func (fake *FakeHTTPStatusCollector) IncConcurrentHTTPRequest() {
	fake.incConcurrentHTTPRequestMutex.Lock()
	fake.incConcurrentHTTPRequestArgsForCall = append(fake.incConcurrentHTTPRequestArgsForCall, struct{}{})
	fake.recordInvocation("IncConcurrentHTTPRequest", []interface{}{})
	fake.incConcurrentHTTPRequestMutex.Unlock()
	if fake.IncConcurrentHTTPRequestStub != nil {
		fake.IncConcurrentHTTPRequestStub()
	}
}

func (fake *FakeHTTPStatusCollector) IncConcurrentHTTPRequestCallCount() int {
	fake.incConcurrentHTTPRequestMutex.RLock()
	defer fake.incConcurrentHTTPRequestMutex.RUnlock()
	return len(fake.incConcurrentHTTPRequestArgsForCall)
}

func (fake *FakeHTTPStatusCollector) DecConcurrentHTTPRequest() {
	fake.decConcurrentHTTPRequestMutex.Lock()
	fake.decConcurrentHTTPRequestArgsForCall = append(fake.decConcurrentHTTPRequestArgsForCall, struct{}{})
	fake.recordInvocation("DecConcurrentHTTPRequest", []interface{}{})
	fake.decConcurrentHTTPRequestMutex.Unlock()
	if fake.DecConcurrentHTTPRequestStub != nil {
		fake.DecConcurrentHTTPRequestStub()
	}
}

func (fake *FakeHTTPStatusCollector) DecConcurrentHTTPRequestCallCount() int {
	fake.decConcurrentHTTPRequestMutex.RLock()
	defer fake.decConcurrentHTTPRequestMutex.RUnlock()
	return len(fake.decConcurrentHTTPRequestArgsForCall)
}

func (fake *FakeHTTPStatusCollector) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.describeMutex.RLock()
	defer fake.describeMutex.RUnlock()
	fake.collectMutex.RLock()
	defer fake.collectMutex.RUnlock()
	fake.incConcurrentHTTPRequestMutex.RLock()
	defer fake.incConcurrentHTTPRequestMutex.RUnlock()
	fake.decConcurrentHTTPRequestMutex.RLock()
	defer fake.decConcurrentHTTPRequestMutex.RUnlock()
	return fake.invocations
}

func (fake *FakeHTTPStatusCollector) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ healthendpoint.HTTPStatusCollector = new(FakeHTTPStatusCollector)


text:
Returns the truth value of (x <= y) element-wise.

*NOTE*: `LessEqual` supports broadcasting. More about broadcasting
[here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)

##### Args:

*  <b>`x`</b>: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `int64`, `uint8`, `int16`, `int8`, `uint16`, `half`.
*  <b>`y`</b>: A `Tensor`. Must have the same type as `x`.
*  <b>`name`</b>: A name for the operation (optional).

##### Returns:

  A `Tensor` of type `bool`.


text:
package com.jetbrains.python.psi.impl;

public interface PyOverridingTypeProvider extends PyTypeProvider {
}


text:
// Template Source: BaseEntityCollectionWithReferencesRequestBuilder.java.tt
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.  See License in the project root for license information.
// ------------------------------------------------------------------------------

package com.microsoft.graph.requests;

import com.microsoft.graph.http.IRequestBuilder;
import com.microsoft.graph.core.ClientException;
import com.microsoft.graph.models.DocumentSet;
import com.microsoft.graph.models.ColumnDefinition;
import java.util.Arrays;
import java.util.EnumSet;
import javax.annotation.Nullable;
import javax.annotation.Nonnull;

import com.microsoft.graph.http.BaseCollectionWithReferencesRequestBuilder;
import com.microsoft.graph.core.IBaseClient;

// **NOTE** This file was generated by a tool and any changes will be overwritten.

/**
 * The class for the Column Definition Collection With References Request Builder.
 */
public class ColumnDefinitionCollectionWithReferencesRequestBuilder extends BaseCollectionWithReferencesRequestBuilder<ColumnDefinition, ColumnDefinitionWithReferenceRequest, ColumnDefinitionReferenceRequestBuilder, ColumnDefinitionWithReferenceRequestBuilder, ColumnDefinitionCollectionResponse, ColumnDefinitionCollectionWithReferencesPage, ColumnDefinitionCollectionReferenceRequest, ColumnDefinitionCollectionReferenceRequestBuilder> {

    /**
     * The request builder for this collection of DocumentSet
     *
     * @param requestUrl     the request URL
     * @param client         the service client
     * @param requestOptions the options for this request
     */
    public ColumnDefinitionCollectionWithReferencesRequestBuilder(@Nonnull final String requestUrl, @Nonnull final IBaseClient<?> client, @Nullable final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions) {
        super(requestUrl, client, requestOptions, ColumnDefinitionReferenceRequestBuilder.class, ColumnDefinitionCollectionReferenceRequest.class, ColumnDefinitionCollectionReferenceRequestBuilder.class);
    }
}


text:
// +build !ignore_autogenerated

// This file was autogenerated by deepcopy-gen. Do not edit it manually!

package unversioned

import (
	conversion "k8s.io/client-go/pkg/conversion"
	time "time"
)

func DeepCopy_unversioned_APIGroup(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*APIGroup)
		out := out.(*APIGroup)
		out.TypeMeta = in.TypeMeta
		out.Name = in.Name
		if in.Versions != nil {
			in, out := &in.Versions, &out.Versions
			*out = make([]GroupVersionForDiscovery, len(*in))
			for i := range *in {
				(*out)[i] = (*in)[i]
			}
		} else {
			out.Versions = nil
		}
		out.PreferredVersion = in.PreferredVersion
		if in.ServerAddressByClientCIDRs != nil {
			in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
			*out = make([]ServerAddressByClientCIDR, len(*in))
			for i := range *in {
				(*out)[i] = (*in)[i]
			}
		} else {
			out.ServerAddressByClientCIDRs = nil
		}
		return nil
	}
}

func DeepCopy_unversioned_APIGroupList(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*APIGroupList)
		out := out.(*APIGroupList)
		out.TypeMeta = in.TypeMeta
		if in.Groups != nil {
			in, out := &in.Groups, &out.Groups
			*out = make([]APIGroup, len(*in))
			for i := range *in {
				if err := DeepCopy_unversioned_APIGroup(&(*in)[i], &(*out)[i], c); err != nil {
					return err
				}
			}
		} else {
			out.Groups = nil
		}
		return nil
	}
}

func DeepCopy_unversioned_APIResource(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*APIResource)
		out := out.(*APIResource)
		out.Name = in.Name
		out.Namespaced = in.Namespaced
		out.Kind = in.Kind
		return nil
	}
}

func DeepCopy_unversioned_APIResourceList(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*APIResourceList)
		out := out.(*APIResourceList)
		out.TypeMeta = in.TypeMeta
		out.GroupVersion = in.GroupVersion
		if in.APIResources != nil {
			in, out := &in.APIResources, &out.APIResources
			*out = make([]APIResource, len(*in))
			for i := range *in {
				(*out)[i] = (*in)[i]
			}
		} else {
			out.APIResources = nil
		}
		return nil
	}
}

func DeepCopy_unversioned_APIVersions(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*APIVersions)
		out := out.(*APIVersions)
		out.TypeMeta = in.TypeMeta
		if in.Versions != nil {
			in, out := &in.Versions, &out.Versions
			*out = make([]string, len(*in))
			copy(*out, *in)
		} else {
			out.Versions = nil
		}
		if in.ServerAddressByClientCIDRs != nil {
			in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
			*out = make([]ServerAddressByClientCIDR, len(*in))
			for i := range *in {
				(*out)[i] = (*in)[i]
			}
		} else {
			out.ServerAddressByClientCIDRs = nil
		}
		return nil
	}
}

func DeepCopy_unversioned_Duration(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*Duration)
		out := out.(*Duration)
		out.Duration = in.Duration
		return nil
	}
}

func DeepCopy_unversioned_ExportOptions(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*ExportOptions)
		out := out.(*ExportOptions)
		out.TypeMeta = in.TypeMeta
		out.Export = in.Export
		out.Exact = in.Exact
		return nil
	}
}

func DeepCopy_unversioned_GroupKind(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*GroupKind)
		out := out.(*GroupKind)
		out.Group = in.Group
		out.Kind = in.Kind
		return nil
	}
}

func DeepCopy_unversioned_GroupResource(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*GroupResource)
		out := out.(*GroupResource)
		out.Group = in.Group
		out.Resource = in.Resource
		return nil
	}
}

func DeepCopy_unversioned_GroupVersion(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*GroupVersion)
		out := out.(*GroupVersion)
		out.Group = in.Group
		out.Version = in.Version
		return nil
	}
}

func DeepCopy_unversioned_GroupVersionForDiscovery(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*GroupVersionForDiscovery)
		out := out.(*GroupVersionForDiscovery)
		out.GroupVersion = in.GroupVersion
		out.Version = in.Version
		return nil
	}
}

func DeepCopy_unversioned_GroupVersionKind(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*GroupVersionKind)
		out := out.(*GroupVersionKind)
		out.Group = in.Group
		out.Version = in.Version
		out.Kind = in.Kind
		return nil
	}
}

func DeepCopy_unversioned_GroupVersionResource(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*GroupVersionResource)
		out := out.(*GroupVersionResource)
		out.Group = in.Group
		out.Version = in.Version
		out.Resource = in.Resource
		return nil
	}
}

func DeepCopy_unversioned_LabelSelector(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*LabelSelector)
		out := out.(*LabelSelector)
		if in.MatchLabels != nil {
			in, out := &in.MatchLabels, &out.MatchLabels
			*out = make(map[string]string)
			for key, val := range *in {
				(*out)[key] = val
			}
		} else {
			out.MatchLabels = nil
		}
		if in.MatchExpressions != nil {
			in, out := &in.MatchExpressions, &out.MatchExpressions
			*out = make([]LabelSelectorRequirement, len(*in))
			for i := range *in {
				if err := DeepCopy_unversioned_LabelSelectorRequirement(&(*in)[i], &(*out)[i], c); err != nil {
					return err
				}
			}
		} else {
			out.MatchExpressions = nil
		}
		return nil
	}
}

func DeepCopy_unversioned_LabelSelectorRequirement(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*LabelSelectorRequirement)
		out := out.(*LabelSelectorRequirement)
		out.Key = in.Key
		out.Operator = in.Operator
		if in.Values != nil {
			in, out := &in.Values, &out.Values
			*out = make([]string, len(*in))
			copy(*out, *in)
		} else {
			out.Values = nil
		}
		return nil
	}
}

func DeepCopy_unversioned_ListMeta(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*ListMeta)
		out := out.(*ListMeta)
		out.SelfLink = in.SelfLink
		out.ResourceVersion = in.ResourceVersion
		return nil
	}
}

func DeepCopy_unversioned_Patch(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*Patch)
		out := out.(*Patch)
		_ = in
		_ = out
		return nil
	}
}

func DeepCopy_unversioned_RootPaths(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*RootPaths)
		out := out.(*RootPaths)
		if in.Paths != nil {
			in, out := &in.Paths, &out.Paths
			*out = make([]string, len(*in))
			copy(*out, *in)
		} else {
			out.Paths = nil
		}
		return nil
	}
}

func DeepCopy_unversioned_ServerAddressByClientCIDR(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*ServerAddressByClientCIDR)
		out := out.(*ServerAddressByClientCIDR)
		out.ClientCIDR = in.ClientCIDR
		out.ServerAddress = in.ServerAddress
		return nil
	}
}

func DeepCopy_unversioned_Status(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*Status)
		out := out.(*Status)
		out.TypeMeta = in.TypeMeta
		out.ListMeta = in.ListMeta
		out.Status = in.Status
		out.Message = in.Message
		out.Reason = in.Reason
		if in.Details != nil {
			in, out := &in.Details, &out.Details
			*out = new(StatusDetails)
			if err := DeepCopy_unversioned_StatusDetails(*in, *out, c); err != nil {
				return err
			}
		} else {
			out.Details = nil
		}
		out.Code = in.Code
		return nil
	}
}

func DeepCopy_unversioned_StatusCause(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*StatusCause)
		out := out.(*StatusCause)
		out.Type = in.Type
		out.Message = in.Message
		out.Field = in.Field
		return nil
	}
}

func DeepCopy_unversioned_StatusDetails(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*StatusDetails)
		out := out.(*StatusDetails)
		out.Name = in.Name
		out.Group = in.Group
		out.Kind = in.Kind
		if in.Causes != nil {
			in, out := &in.Causes, &out.Causes
			*out = make([]StatusCause, len(*in))
			for i := range *in {
				(*out)[i] = (*in)[i]
			}
		} else {
			out.Causes = nil
		}
		out.RetryAfterSeconds = in.RetryAfterSeconds
		return nil
	}
}

func DeepCopy_unversioned_Time(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*Time)
		out := out.(*Time)
		if newVal, err := c.DeepCopy(&in.Time); err != nil {
			return err
		} else {
			out.Time = *newVal.(*time.Time)
		}
		return nil
	}
}

func DeepCopy_unversioned_Timestamp(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*Timestamp)
		out := out.(*Timestamp)
		out.Seconds = in.Seconds
		out.Nanos = in.Nanos
		return nil
	}
}

func DeepCopy_unversioned_TypeMeta(in interface{}, out interface{}, c *conversion.Cloner) error {
	{
		in := in.(*TypeMeta)
		out := out.(*TypeMeta)
		out.Kind = in.Kind
		out.APIVersion = in.APIVersion
		return nil
	}
}


text:
class Sphere
	: public MaterialSceneObject
{
public:
	Sphere( Scene *scene, Material *mat )
		: MaterialSceneObject( scene, mat )
	{
	}

	virtual bool intersectLocal(ray& r, isect& i ) const;
	virtual bool hasBoundingBoxCapability() const { return true; }

    virtual BoundingBox ComputeLocalBoundingBox()
    {
        BoundingBox localbounds;
		localbounds.setMin(glm::dvec3(-1.0f, -1.0f, -1.0f));
		localbounds.setMax(glm::dvec3(1.0f, 1.0f, 1.0f));
        return localbounds;
    }

protected:
	void glDrawLocal(int quality, bool actualMaterials, bool actualTextures) const;
};
#endif // __SPHERE_H__


text:
/***
* Inferno Engine v4 2015-2017
* Written by Tomasz "Rex Dex" Jonarski
*
* [# filter: canvas #]
***/

// The Canvas class is heavily based on nanovg project by Mikko Mononen
// Adaptations were made to fit the rest of the source code in here

//
// Copyright (c) 2013 Mikko Mononen memon@inside.org
//
// This software is provided 'as-is', without any express or implied
// warranty.  In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
//    claim that you wrote the original software. If you use this software
//    in a product, an acknowledgment in the product documentation would be
//    appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//    misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//

#pragma once

#include <base/containers/include/flags.h>
#include "canvasStyle.h"
#include "canvasGeometryBuilder.h"

namespace base
{
    namespace canvas
    {
        namespace prv
        {

            enum class PointTypeFlag : Uint8
            {
                Corner = 0x01,
                Left = 0x02,
                Bevel = 0x04,
                InnerBevel = 0x08,
            };

            typedef DirectFlags<PointTypeFlag> PointTypeFlags;

            struct PathPoint
            {
                math::Vector2 pos; // position of point
                math::Vector2 d; // normalized delta to next point
                Float len; // length to next point
                math::Vector2 dm;
                PointTypeFlags flags; // flags, is this a corner

                FORCEINLINE PathPoint(const math::Vector2& _pos, const PointTypeFlags _flags)
                    : pos(_pos)
                    , d(0,0)
                    , len(0.0f)
                    , dm(0,0)
                    , flags(_flags)
                {}
            };

            struct PathData
            {
                Uint32 first; // first point in the point list
                Uint32 count; // number of points in the path so far
                Winding winding;
                Bool closed;
                Bool convex;

                Uint32 bevelCount; // number of extra bevel vertices needed

                FORCEINLINE PathData()
                    : first(0)
                    , count(0)
                    , winding(Winding::CCW)
                    , closed(false)
                    , convex(false)
                    , bevelCount(0)
                {}
            };

            struct PathCache
            {
                typedef Array<PathPoint> TPoints;
                typedef Array<PathData> TPaths;

                Float m_minPointDist;
                Float m_tessTol;
                TPoints m_points;
                TPaths m_paths;

                math::Vector2 m_boundsMin;
                math::Vector2 m_boundsMax;

                /*typedef Array<RenderPath> TPolygons;
                PathPoint* points;
                Uint32 npoints;
                Uint32 cpoints;
                RenderPath* paths;
                Uint32 npaths;
                Uint32 cpaths;
                RenderVertex* verts;
                Uint32 nverts;
                Uint32 cverts;*/

                //--

                PathCache(const Float minPointDist, const Float tesseltationTollerance);

                FORCEINLINE const PathPoint* lastPoint() const
                {
                    return m_points.empty() ? nullptr : &m_points.back();
                }

                FORCEINLINE const Bool isConvex() const
                {
                    return m_paths.size() == 1 && m_paths[0].convex;
                }

                void addPath();
                void addPoint(const Float x, const Float y, const PointTypeFlags flags);
                void addPoint(const math::Vector2& pos, const PointTypeFlags flags);
                void addBezier(const math::Vector2& p0, const math::Vector2& p1, const math::Vector2& p2, const math::Vector2& p3, const Uint32 level, const PointTypeFlags flags);
                void closePath();
                void setWinding(Winding winding);

                void computeDeltas();
                void computeJoints(const Float w, const LineJoin lineJoin, const Float mitterLimit);

                Uint32 computeFillVertexCount(const Bool hasFringe) const;
                Uint32 computeStrokeVertexCount(const LineJoin lineJoin, const LineCap lineCap, const Float strokeWidth) const;
            };

        } // prv
    } // canvas
} // base


text:
__author__ = "saeedamen"  # Saeed Amen

#
# Copyright 2016 Cuemacro
#
# 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 a "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.
#

from twython import Twython

from findatapy.util import DataConstants, LoggerManager

class Twitter(object):
    """Has functions to tweet from Python (using Twython library)

    """

    def __init__(self, *args, **kwargs):
        self.logger = LoggerManager().getLogger(__name__)

    def set_key(self, APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET):
        self.twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN,
                               OAUTH_TOKEN_SECRET)

    def auto_set_key(self):
        self.twitter = Twython(DataConstants().APP_KEY,
                               DataConstants().APP_SECRET,
                               DataConstants().OAUTH_TOKEN,
                               DataConstants().OAUTH_TOKEN_SECRET)

    def update_status(self, msg, link = None, picture = None):
        # 22 chars URL
        # 23 chars picture

        chars_lim = 140

        if link is not None: chars_lim = chars_lim - (22 * link)
        if picture is not None: chars_lim = chars_lim - 23

        if (len(msg) > chars_lim):
            self.logger.info("Message too long for Twitter!")

        if picture is None:
            self.twitter.update_status(status=msg)
        else:
            photo = open(picture, 'rb')
            self.twitter.update_status_with_media(status=msg, media=photo)


text:
include(CheckCCompilerFlag)
include(WaffleCheckThreadLocalStorage)

function(waffle_add_c_flag flag var)
    check_c_compiler_flag("${flag}" ${var})
    if(${var})
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}" PARENT_SCOPE)
    endif()
endfunction()

if (NOT MSVC)
    #
    # compiler flags
    #
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --std=c99")
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
    set(CMAKE_C_FLAGS_DEBUG "-g3 -O0 -DDEBUG")

    # Use '-g1' to produce enough debug info for generating backtraces, but not
    # enough for single-stepping.
    set(CMAKE_C_FLAGS_RELEASE "-g1 -O2 -DNDEBUG")

    waffle_add_c_flag("-Werror=implicit-function-declaration" WERROR_IMPLICIT_FUNCTION_DECLARATION)
    waffle_add_c_flag("-fvisibility=hidden" WITH_VISIBILITY_HIDDEN)

    waffle_add_c_flag("-Werror=incompatible-pointer-types" WERROR_INCOMPATIBLE_POINTER_TYPES)
    waffle_add_c_flag("-Werror=int-conversion" WERROR_INT_CONVERSION)

    if(waffle_on_linux)
        # On MacOS, the SSE2 headers trigger this error.
        waffle_add_c_flag("-Werror=missing-prototypes" WERROR_MISSING_PROTOTYPES)
    endif()

    if(egl_FOUND)
        foreach(FLAG ${egl_CFLAGS_OTHER})
            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAG}")
        endforeach()
    endif(egl_FOUND)

    if(MINGW)
        # Avoid depending on MinGW runtime DLLs
        check_c_compiler_flag(-static-libgcc HAVE_STATIC_LIBGCC_FLAG)
        if (HAVE_STATIC_LIBGCC_FLAG)
            set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc")
            set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc")
            set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -static-libgcc")
        endif ()
    else()
        # Avoid using TLS with MinGW builds.
        waffle_check_thread_local_storage()
    endif()
else()
   # XXX: and update the threads code
   # http://msdn.microsoft.com/en-us/library/aa383745.aspx
    if(CMAKE_GENERATOR_TOOLSET MATCHES "_xp$")
        # Windows XP
        add_definitions(-D_WIN32_WINNT=0x0501 -DWINVER=0x0501)
    else()
        # Windows 7
        add_definitions(-D_WIN32_WINNT=0x0601 -DWINVER=0x0601)
    endif()

    # Adjust warnings
    add_definitions(-D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)

    # Use static runtime
    # http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F
    foreach(flag_var
        CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
    )
        if(${flag_var} MATCHES "/MD")
            string (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
        endif()
    endforeach(flag_var)

endif()

if(waffle_on_mac)
    add_definitions(-DWAFFLE_HAS_CGL -DGL_SILENCE_DEPRECATION)
endif()

if(waffle_on_linux)
    if(waffle_has_glx)
        add_definitions(-DWAFFLE_HAS_GLX)
    endif()

    if(waffle_has_wayland)
        add_definitions(-DWAFFLE_HAS_WAYLAND)
    endif()

    if(waffle_has_x11_egl)
        add_definitions(-DWAFFLE_HAS_X11_EGL)
    endif()

    if(waffle_has_gbm)
        add_definitions(-DWAFFLE_HAS_GBM)
    endif()

    if(waffle_has_surfaceless_egl)
        add_definitions(-DWAFFLE_HAS_SURFACELESS_EGL)
    endif()

    if(waffle_has_tls)
        add_definitions(-DWAFFLE_HAS_TLS)
    endif()

    if(waffle_has_tls_model_initial_exec)
        add_definitions(-DWAFFLE_HAS_TLS_MODEL_INITIAL_EXEC)
    endif()

    add_definitions(-D_XOPEN_SOURCE=700)
endif()

if(waffle_on_windows)
    add_definitions(-DWAFFLE_HAS_WGL)
endif()


text:
<?php

namespace vendor;

class Acl
{
    protected $resources = [];
    protected $groups    = [];
    protected $rights    = [];

    /**
     * 添加资源和动作
     * @param string $resource
     * @param array $actions
     */
    public function addResource($resource, $actions = [])
    {
        $this->resources[$resource] = $actions;
    }

    /**
     * 添加组
     * @param string $name
     * @param boolean $isSuperAdmin
     */
    public function addGroup($name, $isSuperAdmin = false)
    {
        $this->groups[$name] = $isSuperAdmin;
    }

    /**
     * 验证组是否存在
     * @param string $group
     * @return boolean
     */
    public function hasGroup($group)
    {
        return isset($this->groups[$group]);
    }

    /**
     * 获取所有组
     * @return array
     */
    public function getGroups()
    {
        return $this->groups;
    }

    /**
     * 获取所有资源
     * @return array
     */
    public function getResources()
    {
        return $this->resources;
    }

    /**
     * 获取允许资源
     * return array
     */
    public function getRights()
    {
        return $this->rights;
    }

    /**
     * 设置允许资源
     * @param string $group
     * @param string $resource
     * @param array $actions
     */
    public function allow($group, $resource, $actions = [])
    {
        $actions = (array) $actions;
        if(!count($actions)){
            $actions = $this->resources[$resource];
        }
        foreach($actions as &$action){
            $this->rights[$group][$resource][$action] = true;
        }
    }

    /**
     * 禁用组资源
     * @param string $group
     * @param string $resource
     * @param array $actions
     */
    public function deny($group, $resource, $actions = [])
    {
        $actions = (array) $actions;
        if(!count($actions)){
            $actions = $this->resources[$resource];
        }
        foreach($actions as &$action){
            if(isset($this->rights[$group][$resource][$action])){
                unset($this->rights[$group][$resource][$action]);
            }
        }

    }

    /**
     * 验证是否有权限
     * @param array|string $groups
     * @param string $resource
     * @param array|String $actions
     * @return boolean
     */
    public function hasAccess($groups, $resource, $actions)
    {
        $groups  = (array) $groups;
        $actions = (array) $actions;
        if(!isset($this->resources[$resource])) {
            return false;
        }
        foreach($groups as $g) {
            if(!isset($this->groups[$g])) continue;
            if($this->groups[$g]==true) return true; // isSuperAdmin
            foreach($actions as $action) {
                if(isset($this->rights[$g][$resource][$action])) {
                    return true;
                }
            }
        }
        return false;
    }

}


text:
from django.conf import settings
from django.utils.cache import add_never_cache_headers

class NeverCacheHttpHeadersMiddleware:
    """
    Callable middleware that sets cache-control headers without impacting server-side caching
    """

    def __init__(self, get_response):
        self.get_response = get_response

    def __call__(self, request):
        response = self.get_response(request)
        if request.path in settings.NEVER_CACHE_HTTP_HEADER_PATHS:
            add_never_cache_headers(response)
        return response


text:
typedef void (^CoinbaseCompletionBlock)(id response, NSError *error);

/// NSError domain for Coinbase errors.
extern NSString *const CoinbaseErrorDomain;

/// NSError codes for Coinbase errors.
typedef NS_ENUM(NSInteger, CoinbaseErrorCode) {
    CoinbaseOAuthError,
    CoinbaseServerErrorUnknown,
    CoinbaseServerErrorWithMessage
};

/// HTTP methods for use with the Coinbase API.
typedef NS_ENUM(NSUInteger, CoinbaseRequestType) {
    CoinbaseRequestTypeGet,
    CoinbaseRequestTypePost,
    CoinbaseRequestTypePut,
    CoinbaseRequestTypeDelete
};

/// The `Coinbase` class is the interface to the Coinbase API. Create a `Coinbase` object using
/// `coinbaseWithOAuthAccessToken:` or `coinbaseWithApiKey:secret:` to call API methods.
@interface Coinbase : NSObject

/// Create a Coinbase object for an OAuth access token. Please note that when this access token
/// expires, requests made on this object will start failing with a 401 Unauthorized error. Obtain new tokens
/// with your refresh token if this occurs.
+ (Coinbase *)coinbaseWithOAuthAccessToken:(NSString *)accessToken;

/// Create a Coinbase object for an API key and secret.
+ (Coinbase *)coinbaseWithApiKey:(NSString *)key
                          secret:(NSString *)secret;

/// Create a Coinbase object with no authentication. You can only use unauthenticated APIs with this client.
+ (Coinbase *)unauthenticatedCoinbase;

/// Make a GET request to the Coinbase API.
- (void)doGet:(NSString *)path
                parameters:(NSDictionary *)parameters
                completion:(CoinbaseCompletionBlock)completion;

/// Make a POST request to the Coinbase API.
- (void)doPost:(NSString *)path
    parameters:(NSDictionary *)parameters
    completion:(CoinbaseCompletionBlock)completion;

/// Make a PUT request to the Coinbase API.
- (void)doPut:(NSString *)path
   parameters:(NSDictionary *)parameters
   completion:(CoinbaseCompletionBlock)completion;

/// Make a DELETE request to the Coinbase API.
- (void)doDelete:(NSString *)path
      parameters:(NSDictionary *)parameters
      completion:(CoinbaseCompletionBlock)completion;

/// Make a request to the Coinbase API. Specify the HTTP method as a CoinbaseRequestType enum member.
- (void)doRequestType:(CoinbaseRequestType)type
                 path:(NSString *)path
           parameters:(NSDictionary *)parameters
           completion:(CoinbaseCompletionBlock)completion;

@end


text:
const path = require('path')
const test = require('tape')
const router = require('..')

let match = router(path.join(__dirname, '/fixtures/verbs'))
const verbs = ['GET', 'PUT', 'POST', 'PATCH', 'DELETE', 'OPTIONS']

test('correctly maps various verbs', t => {
  t.plan(verbs.length * 2)
  verbs.forEach(verb => {
    let fn = match({ url: '/verbs', method: verb })
    t.equal(typeof fn, 'function', `${verb} is a function`)
    t.equal(fn(), verb, `${verb} is properly mapped`)
  })
})


text:
(function() {
    'use strict';

    var mongoose = require('mongoose'),
        Schema = mongoose.Schema;

    var QuestionSetSchema = new Schema({
        _id: Number,
        name: {
            type: String,
            validate: {
                validator: function(v) {
                    return v.length<=200;
                },
                message: '{VALUE} is is too long!'
            }
        },
        description: String,
        user: String,
        createDate: Date,
        practiceTimes: Number,
        questions: [{
            type: Number,
            ref: 'Question'
        }],
        isDefault: Boolean,
        userPractice:[{
            practiceTimes:Number,
            user:String
        }]
    }, {
        collection: 'questionSets'
    });
    QuestionSetSchema.index({name: 1, user: 1}, {unique: true});
    module.exports = mongoose.model('QuestionSet', QuestionSetSchema);
})();


text:
from .helper import timestamp_to_datetime
import six

class ApiModel(object):

    @classmethod
    def object_from_dictionary(cls, entry):
        # make dict keys all strings
        if entry is None:
            return ""
        entry_str_dict = dict([(str(key), value) for key, value in entry.items()])
        return cls(**entry_str_dict)

    def __repr__(self):
        return str(self)
        # if six.PY2:
        #     return six.text_type(self).encode('utf8')
        # else:
        #     return self.encode('utf8')

    def __str__(self):
        if six.PY3:
            return self.__unicode__()
        else:
            return unicode(self).encode('utf-8')

class Image(ApiModel):

    def __init__(self, url, width, height, **kwargs):
        self.url = url
        self.height = height
        self.width = width

    def __unicode__(self):
        return "Image: %s" % self.url

class Video(Image):

    def __unicode__(self):
        return "Video: %s" % self.url

class Media(ApiModel):

    def __init__(self, id=None, **kwargs):
        self.id = id
        for key, value in six.iteritems(kwargs):
            setattr(self, key, value)

    def get_standard_resolution_url(self):
        if self.type == 'image':
            return self.images['standard_resolution'].url
        else:
            return self.videos['standard_resolution'].url

    def get_low_resolution_url(self):
        if self.type == 'image':
            return self.images['low_resolution'].url
        else:
            return self.videos['low_resolution'].url

    def get_thumbnail_url(self):
        return self.images['thumbnail'].url

    def __unicode__(self):
        return "Media: %s" % self.id

    @classmethod
    def object_from_dictionary(cls, entry):
        new_media = Media(id=entry['id'])
        new_media.type = entry['type']

        new_media.user = User.object_from_dictionary(entry['user'])

        new_media.images = {}
        for version, version_info in six.iteritems(entry['images']):
            new_media.images[version] = Image.object_from_dictionary(version_info)

        if new_media.type == 'video':
            new_media.videos = {}
            for version, version_info in six.iteritems(entry['videos']):
                new_media.videos[version] = Video.object_from_dictionary(version_info)

        if 'user_has_liked' in entry:
            new_media.user_has_liked = entry['user_has_liked']
        new_media.like_count = entry['likes']['count']
        new_media.likes = []
        if 'data' in entry['likes']:
            for like in entry['likes']['data']:
                new_media.likes.append(User.object_from_dictionary(like))

        new_media.comment_count = entry['comments']['count']
        new_media.comments = []
        for comment in entry['comments']['data']:
            new_media.comments.append(Comment.object_from_dictionary(comment))

        new_media.users_in_photo = []
        if entry.get('users_in_photo'):
            for user_in_photo in entry['users_in_photo']:
                new_media.users_in_photo.append(UserInPhoto.object_from_dictionary(user_in_photo))

        new_media.created_time = timestamp_to_datetime(entry['created_time'])

        if entry['location'] and 'id' in entry:
            new_media.location = Location.object_from_dictionary(entry['location'])

        new_media.caption = None
        if entry['caption']:
            new_media.caption = Comment.object_from_dictionary(entry['caption'])

        new_media.tags = []
        if entry['tags']:
            for tag in entry['tags']:
                new_media.tags.append(Tag.object_from_dictionary({'name': tag}))

        new_media.link = entry['link']

        new_media.filter = entry.get('filter')

        return new_media

class MediaShortcode(Media):

    def __init__(self, shortcode=None, **kwargs):
        self.shortcode = shortcode
        for key, value in six.iteritems(kwargs):
            setattr(self, key, value)

class Tag(ApiModel):
    def __init__(self, name, **kwargs):
        self.name = name
        for key, value in six.iteritems(kwargs):
            setattr(self, key, value)

    def __unicode__(self):
        return "Tag: %s" % self.name

class Comment(ApiModel):
    def __init__(self, *args, **kwargs):
        for key, value in six.iteritems(kwargs):
            setattr(self, key, value)

    @classmethod
    def object_from_dictionary(cls, entry):
        user = User.object_from_dictionary(entry['from'])
        text = entry['text']
        created_at = timestamp_to_datetime(entry['created_time'])
        id = entry['id']
        return Comment(id=id, user=user, text=text, created_at=created_at)

    def __unicode__(self):
        return "Comment: %s said \"%s\"" % (self.user.username, self.text)

class Point(ApiModel):
    def __init__(self, latitude, longitude):
        self.latitude = latitude
        self.longitude = longitude

    def __unicode__(self):
        return "Point: (%s, %s)" % (self.latitude, self.longitude)

class Location(ApiModel):
    def __init__(self, id, *args, **kwargs):
        self.id = str(id)
        for key, value in six.iteritems(kwargs):
            setattr(self, key, value)

    @classmethod
    def object_from_dictionary(cls, entry):
        point = None
        if 'latitude' in entry:
            point = Point(entry.get('latitude'),
                          entry.get('longitude'))
        location = Location(entry.get('id', 0),
                       point=point,
                       name=entry.get('name', ''))
        return location

    def __unicode__(self):
        return "Location: %s (%s)" % (self.id, self.point)

class User(ApiModel):

    def __init__(self, id, *args, **kwargs):
        self.id = id
        for key, value in six.iteritems(kwargs):
            setattr(self, key, value)

    def __unicode__(self):
        return "User: %s" % self.username

class Relationship(ApiModel):

    def __init__(self, incoming_status="none", outgoing_status="none", target_user_is_private=False):
        self.incoming_status = incoming_status
        self.outgoing_status = outgoing_status
        self.target_user_is_private = target_user_is_private

    def __unicode__(self):
        follows = False if self.outgoing_status == 'none' else True
        followed = False if self.incoming_status == 'none' else True

        return "Relationship: (Follows: %s, Followed by: %s)" % (follows, followed)

class Position(ApiModel):
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def __unicode__(self):
        return "Position: (%s, %s)" % (self.x, self.y)

    @classmethod
    def object_from_dictionary(cls, entry):
        if 'x' in entry:
            return Position(entry['x'], entry['y'])

class UserInPhoto(ApiModel):
    def __init__(self, user, position):
        self.position = position
        self.user = user

    def __unicode__(self):
        return "UserInPhoto: (%s, %s)" % (self.user, self.position)

    @classmethod
    def object_from_dictionary(cls, entry):
        user = None
        if 'user' in entry:
            user = User.object_from_dictionary(entry['user'])

        if 'position' in entry:
            position = Position(entry['position']['x'], entry['position']['y'])

        return UserInPhoto(user, position)


text:
package requests

import (
	"github.com/grokify/ringcentral-sdk-go/rcsdk/definitions"
)

type AccountExtensionSmsPostRequestBody struct {
	From definitions.CallerInfo   `json:"from,omitempty"`
	Text string                   `json:"text,omitempty"`
	To   []definitions.CallerInfo `json:"to,omitempty"`
}


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.11"/>
<title>LostInCompilation: FunctionFactory Class Reference</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" />

LostInCompilation
    0.1.0

Main Page

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 Hierarchy

Class Members

Static Public Member Functions |
List of all members

FunctionFactory Class Reference

#include <FunctionFactory.h>

Static Public Member Functions

static FunctionPtr 	getFunction (std::string funcName)

Detailed Description

A factory method that creates an associated Function object

Since

0.1

Member Function Documentation

          FunctionPtr FunctionFactory::getFunction
          (
          std::string
          funcName	)

static

The documentation for this class was generated from the following files:

include/compile/eval/function/FunctionFactory.h

src/compile/eval/function/FunctionFactory.cpp

<address class="footer">
Generated on Sun Apr 2 2017 23:26:21 for LostInCompilation by

 1.8.11
</address>


text:
package interfaces;

public interface CofeeFactory {

     Cofee makeCofee(cofeeType type, Boolean isSugar);

}


text:
import React from 'react';
import Footer from '../../../components/Footer';
import Navbar from '../../../components/Navbar';
import { ThemeProvider } from '@material-ui/core';
import theme from '../../../theme';
import withRoot from '../../../withRoot';
import CallForPapers2021 from './../../../posts/bai2021/CallForPapers2021.md';
import Submissions2021 from './../../../posts/bai2021/Submissions2021.md';
import ContentFile from '../../../components/Markdown/readfile';
import WorkshopPageHeader from '../../../components/WorkshopPageHeader';
import image from './../../../assets/img/general/header-bai-2021.png';
import Loader from '../../../loader';

function CallForPapers() {
    return (
        <ThemeProvider theme={theme}>
            <Loader />
            <Navbar />
            <WorkshopPageHeader src={image}/>
            <ContentFile href={CallForPapers2021}>
                Black in AI 2021 - Call For Papers Submissions
            </ContentFile>
            <ContentFile href={Submissions2021}/>
            <Footer />
        </ThemeProvider>
    );
}

export default withRoot(CallForPapers);


text:
set USE_THUMB_MODE=NO
set DEBUG=-g
set OPTIM=-O0
set RUN_MODE=RUN_FROM_RAM
set LDSCRIPT=lpc2106-ram.ld
make


text:
package com.gemstone.gemfire.pdx.internal.json;

import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;

import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonGenerator;

public class JsonHelper {

  public static void getJsonFromPrimitiveBoolArray(JsonGenerator jg, boolean[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (boolean obj : array)
    {
      jg.writeBoolean(obj);
    }
    jg.writeEndArray();
  }

  public static void getJsonFromPrimitiveByteArray(JsonGenerator jg, byte[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (byte obj : array)
    {
      jg.writeNumber(obj);
    }
    jg.writeEndArray();
  }

  public static void getJsonFromPrimitiveShortArray(JsonGenerator jg, short[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (short obj : array)
    {
      jg.writeNumber(obj);
    }
    jg.writeEndArray();
  }

  public static void getJsonFromPrimitiveIntArray(JsonGenerator jg, int[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (int obj : array)
    {
      jg.writeNumber(obj);
    }
    jg.writeEndArray();
  }

  public static void getJsonFromPrimitiveLongArray(JsonGenerator jg, long[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (long obj : array)
    {
      jg.writeNumber(obj);
    }
    jg.writeEndArray();
  }

  public static void getJsonFromPrimitiveFloatArray(JsonGenerator jg, float[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (float obj : array)
    {
      jg.writeNumber(obj);
    }
    jg.writeEndArray();
  }

  public static void getJsonFromPrimitiveDoubleArray(JsonGenerator jg, double[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (double obj : array)
    {
      jg.writeNumber(obj);
    }
    jg.writeEndArray();
  }

  public static void getJsonFromWrapperBoolArray(JsonGenerator jg, Boolean[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (Boolean obj : array)
    {
      jg.writeBoolean(obj.booleanValue());
    }
    jg.writeEndArray();
  }

  public static void getJsonFromWrapperByteArray(JsonGenerator jg, Byte[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (Byte obj : array)
    {
      jg.writeNumber(obj.byteValue());
    }
    jg.writeEndArray();
  }

  public static void getJsonFromWrapperShortArray(JsonGenerator jg, Short[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (Short obj : array)
    {
      jg.writeNumber(obj.shortValue());
    }
    jg.writeEndArray();
  }

  public static void getJsonFromWrapperIntArray(JsonGenerator jg, Integer[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (Integer obj : array)
    {
      jg.writeNumber(obj.intValue());
    }
    jg.writeEndArray();
  }

  public static void getJsonFromWrapperLongArray(JsonGenerator jg, Long[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (Long obj : array)
    {
      jg.writeNumber(obj.longValue());
    }
    jg.writeEndArray();
  }

  public static void getJsonFromWrapperFloatArray(JsonGenerator jg, Float[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (Float obj : array)
    {
      jg.writeNumber(obj.floatValue());
    }
    jg.writeEndArray();
  }

  public static void getJsonFromWrapperDoubleArray(JsonGenerator jg, Double[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (Double obj : array)
    {
      jg.writeNumber(obj.doubleValue());
    }
    jg.writeEndArray();
  }

  public static void getJsonFromBigIntArray(JsonGenerator jg, BigInteger[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (BigInteger obj : array)
    {
      jg.writeNumber(obj);
    }
    jg.writeEndArray();
  }

  public static void getJsonFromBigDecimalArray(JsonGenerator jg, BigDecimal[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (BigDecimal obj : array)
    {
      jg.writeNumber(obj);
    }
    jg.writeEndArray();
  }

  public static void getJsonFromStringArray(JsonGenerator jg, String[] array, String pf) throws JsonGenerationException, IOException{
    jg.writeStartArray();
    for (String obj : array)
    {
      jg.writeString(obj);
    }
    jg.writeEndArray();
  }

}


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * ORCID class for use globally
 * @author Minh Duc Nguyen <minh.nguyen@ands.org.au>
 */
class Orcid_api {

	private $api_uri = null;
    private $service_uri = null;
    private $client_id = null;
    private $client_secret = null;
    private $redirect_uri = null;
    private $access_token = null;
    private $orcid_id = null;

    private $db;
    private $log_table = 'logs';

	/**
	 * Construction of this class
	 */
	function __construct(){
        $this->CI =& get_instance();
		$this->CI->load->library('session');
        $this->db = $this->CI->db;
		$this->init();
    }

    function init(){
        $this->service_uri = $this->CI->config->item('gORCID_SERVICE_BASE_URI');
        $this->api_uri = $this->CI->config->item('gORCID_API_URI');
        $this->client_id = $this->CI->config->item('gORCID_CLIENT_ID');
        $this->client_secret = $this->CI->config->item('gORCID_CLIENT_SECRET');
        $this->redirect_uri = registry_url('orcid/auth');
    }

    /**
     * Authenticate with the API service using oauth
     * @param  string $code auth_code
     * @return data
     */
    function oauth($code){
        $post_array = array(
            'client_id'=>$this->client_id,
            'client_secret'=>$this->client_secret,
            'grant_type'=>'authorization_code',
            'code'=>$code,
            'redirect_uri'=>$this->redirect_uri
        );
        $post_string = http_build_query($post_array);
        $url = $this->api_uri.'oauth/token';
        $data = curl_post($url, $post_string, array('Accept: application/json'));
        return $data;
    }

    function log($orcid_id){
        $this->db->insert($this->log_table,
            array(
                "type_id" => $orcid_id,
                "date_modified" => date('Y-m-d H:i:s',time()),
                "type" => "orcid_auth",
                "msg" => 'orcid authentication for '. $orcid_id
            )
        );
        return $this->db->insert_id();
    }

    function set_orcid_id($id){
        $this->orcid_id = $id;
        $this->CI->session->set_userdata('orcid_id', $id);
    }

    function get_orcid_id(){
        if($this->orcid_id){
            return $this->orcid_id;
        }else{
            if($this->CI->session->userdata('orcid_id')){
                return $this->CI->session->userdata('orcid_id');
            }else{
                return false;
            }
        }
        return false;
    }

    function set_access_token($token){
        $this->access_token = $token;
        $this->CI->session->set_userdata('access_token', $token);
    }

    function get_access_token(){
        if($this->access_token){
            return $this->access_token;
        }else{
            if($this->CI->session->userdata('access_token')){
                return $this->CI->session->userdata('access_token');
            }else{
                return false;
            }
        }
        return false;
    }

    /**
     * Get orcid XML of orcid id, if access_token is not set, it will return public information
     * @return object_xml
     */
    function get_full(){
        $opts = array(
            'method'=>'GET',
            'header'=>'Accept: application/orcid+json'
        );
        $header = array("Accept:application/orcid+json; charset=utf-8");
        if(!$this->get_orcid_id() && !$this->get_access_token()){
            return false;
        }else{
            $url = $this->api_uri.'v1.1/'.$this->get_orcid_id().'/orcid-profile/';
            // $context = stream_context_create($opts);
            if($this->get_access_token()) $url.='?access_token='.$this->get_access_token();
            // $result = @file_get_contents($url.'s', true, $context);
            // $result = curl_post($url,'', array('header'=>'Accept: application/orcid+json'));
            $result = curl_file_get_contents($url, $header);
            $re = json_decode($result, true);
            if(isset($re['error'])){
                return false;
            }else{
                return $result;
            }
        }
    }

    /**
     * POST xml to orcid works
     * @param  [type] $xml [description]
     * @return [type]      [description]
     */
    function append_works($xml){
        if(!$this->get_orcid_id() && !$this->get_access_token()){
            return false;
        }
        $url = $this->api_uri.'v1.1/'.$this->get_orcid_id().'/orcid-works/';
        $url.='?access_token='.$this->get_access_token();
        $data = curl_post($url, $xml);
        if(trim($data)==''){
            return 1;
        }else return $data;
    }

}


text:
package com.handcraftedbits.bamboo.plugin.go.task.common;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import com.atlassian.bamboo.task.TaskContext;
import com.handcraftedbits.bamboo.plugin.go.capability.GoCapabilityTypeModule;

public class GoTaskConfiguration {
     private final TaskContext taskContext;
     private final GoTaskHelper taskHelper;

     public GoTaskConfiguration (@NotNull final GoTaskHelper taskHelper, @NotNull final TaskContext taskContext) {
          this.taskContext = taskContext;
          this.taskHelper = taskHelper;
     }

     @Nullable
     public String getGoExecutable () {
          return this.taskHelper.getCapabilityValue(GoCapabilityTypeModule.CAPABILITY_KEY_GO);
     }

     @Nullable
     public String getGodepExecutable () {
          return this.taskHelper.getCapabilityValue(GoCapabilityTypeModule.CAPABILITY_KEY_GODEP);
     }

     @NotNull
     public String getSourcePath () {
          return this.taskContext.getConfigurationMap().get(AbstractGoExecutableTaskConfigurator.CONFIG_SOURCE_PATH);
     }

     @NotNull
     protected TaskContext getTaskContext () {
          return this.taskContext;
     }

     GoTaskHelper getTaskHelper () {
          return this.taskHelper;
     }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<sem:triples uri="http://www.lds.org/vrl/concepts/nature-and-time/fog" xmlns:sem="http://marklogic.com/semantics">
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/concepts/nature-and-time/fog</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate>
    <sem:object datatype="xsd:string" xml:lang="eng">Fog</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/concepts/nature-and-time/fog</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/concept-scheme/vrl</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/concepts/nature-and-time/fog</sem:subject>
    <sem:predicate>http://www.lds.org/core#entityType</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/Topic</sem:object>
  </sem:triple>
</sem:triples>


text:
<?php
// $Id$
require_once(dirname(__FILE__) . '/../autorun.php');
require_once(dirname(__FILE__) . '/../encoding.php');
require_once(dirname(__FILE__) . '/../http.php');
require_once(dirname(__FILE__) . '/../socket.php');
require_once(dirname(__FILE__) . '/../cookies.php');
Mock::generate('SimpleSocket');
Mock::generate('SimpleCookieJar');
Mock::generate('SimpleRoute');
Mock::generatePartial(
		'SimpleRoute',
		'PartialSimpleRoute',
array('createSocket'));
Mock::generatePartial(
        'SimpleProxyRoute',
        'PartialSimpleProxyRoute',
array('createSocket'));

class TestOfDirectRoute extends UnitTestCase {

	function testDefaultGetRequest() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("GET /here.html HTTP/1.0\r\n"));
		$socket->expectAt(1, 'write', array("Host: a.valid.host\r\n"));
		$socket->expectAt(2, 'write', array("Connection: close\r\n"));
		$socket->expectCallCount('write', 3);
		$route = new PartialSimpleRoute();
		$route->setReturnReference('createSocket', $socket);
		$route->__construct(new SimpleUrl('http://a.valid.host/here.html'));
		$this->assertSame($route->createConnection('GET', 15), $socket);
	}

	function testDefaultPostRequest() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("POST /here.html HTTP/1.0\r\n"));
		$socket->expectAt(1, 'write', array("Host: a.valid.host\r\n"));
		$socket->expectAt(2, 'write', array("Connection: close\r\n"));
		$socket->expectCallCount('write', 3);
		$route = new PartialSimpleRoute();
		$route->setReturnReference('createSocket', $socket);
		$route->__construct(new SimpleUrl('http://a.valid.host/here.html'));

		$route->createConnection('POST', 15);
	}

	function testDefaultDeleteRequest() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("DELETE /here.html HTTP/1.0\r\n"));
		$socket->expectAt(1, 'write', array("Host: a.valid.host\r\n"));
		$socket->expectAt(2, 'write', array("Connection: close\r\n"));
		$socket->expectCallCount('write', 3);
		$route = new PartialSimpleRoute();
		$route->setReturnReference('createSocket', $socket);
		$route->__construct(new SimpleUrl('http://a.valid.host/here.html'));
		$this->assertSame($route->createConnection('DELETE', 15), $socket);
	}

	function testDefaultHeadRequest() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("HEAD /here.html HTTP/1.0\r\n"));
		$socket->expectAt(1, 'write', array("Host: a.valid.host\r\n"));
		$socket->expectAt(2, 'write', array("Connection: close\r\n"));
		$socket->expectCallCount('write', 3);
		$route = new PartialSimpleRoute();
		$route->setReturnReference('createSocket', $socket);
		$route->__construct(new SimpleUrl('http://a.valid.host/here.html'));
		$this->assertSame($route->createConnection('HEAD', 15), $socket);
	}

	function testGetWithPort() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("GET /here.html HTTP/1.0\r\n"));
		$socket->expectAt(1, 'write', array("Host: a.valid.host:81\r\n"));
		$socket->expectAt(2, 'write', array("Connection: close\r\n"));
		$socket->expectCallCount('write', 3);

		$route = new PartialSimpleRoute();
		$route->setReturnReference('createSocket', $socket);
		$route->__construct(new SimpleUrl('http://a.valid.host:81/here.html'));

		$route->createConnection('GET', 15);
	}

	function testGetWithParameters() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("GET /here.html?a=1&b=2 HTTP/1.0\r\n"));
		$socket->expectAt(1, 'write', array("Host: a.valid.host\r\n"));
		$socket->expectAt(2, 'write', array("Connection: close\r\n"));
		$socket->expectCallCount('write', 3);

		$route = new PartialSimpleRoute();
		$route->setReturnReference('createSocket', $socket);
		$route->__construct(new SimpleUrl('http://a.valid.host/here.html?a=1&b=2'));

		$route->createConnection('GET', 15);
	}
}

class TestOfProxyRoute extends UnitTestCase {

	function testDefaultGet() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("GET http://a.valid.host/here.html HTTP/1.0\r\n"));
		$socket->expectAt(1, 'write', array("Host: my-proxy:8080\r\n"));
		$socket->expectAt(2, 'write', array("Connection: close\r\n"));
		$socket->expectCallCount('write', 3);

		$route = new PartialSimpleProxyRoute();
		$route->setReturnReference('createSocket', $socket);
		$route->__construct(
		new SimpleUrl('http://a.valid.host/here.html'),
		new SimpleUrl('http://my-proxy'));
		$route->createConnection('GET', 15);
	}

	function testDefaultPost() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("POST http://a.valid.host/here.html HTTP/1.0\r\n"));
		$socket->expectAt(1, 'write', array("Host: my-proxy:8080\r\n"));
		$socket->expectAt(2, 'write', array("Connection: close\r\n"));
		$socket->expectCallCount('write', 3);

		$route = new PartialSimpleProxyRoute();
		$route->setReturnReference('createSocket', $socket);
		$route->__construct(
		new SimpleUrl('http://a.valid.host/here.html'),
		new SimpleUrl('http://my-proxy'));
		$route->createConnection('POST', 15);
	}

	function testGetWithPort() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("GET http://a.valid.host:81/here.html HTTP/1.0\r\n"));
		$socket->expectAt(1, 'write', array("Host: my-proxy:8081\r\n"));
		$socket->expectAt(2, 'write', array("Connection: close\r\n"));
		$socket->expectCallCount('write', 3);

		$route = new PartialSimpleProxyRoute();
		$route->setReturnReference('createSocket', $socket);
		$route->__construct(
		new SimpleUrl('http://a.valid.host:81/here.html'),
		new SimpleUrl('http://my-proxy:8081'));
		$route->createConnection('GET', 15);
	}

	function testGetWithParameters() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("GET http://a.valid.host/here.html?a=1&b=2 HTTP/1.0\r\n"));
		$socket->expectAt(1, 'write', array("Host: my-proxy:8080\r\n"));
		$socket->expectAt(2, 'write', array("Connection: close\r\n"));
		$socket->expectCallCount('write', 3);

		$route = new PartialSimpleProxyRoute();
		$route->setReturnReference('createSocket', $socket);
		$route->__construct(
		new SimpleUrl('http://a.valid.host/here.html?a=1&b=2'),
		new SimpleUrl('http://my-proxy'));
		$route->createConnection('GET', 15);
	}

	function testGetWithAuthentication() {
		$encoded = base64_encode('Me:Secret');

		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("GET http://a.valid.host/here.html HTTP/1.0\r\n"));
		$socket->expectAt(1, 'write', array("Host: my-proxy:8080\r\n"));
		$socket->expectAt(2, 'write', array("Proxy-Authorization: Basic $encoded\r\n"));
		$socket->expectAt(3, 'write', array("Connection: close\r\n"));
		$socket->expectCallCount('write', 4);

		$route = new PartialSimpleProxyRoute();
		$route->setReturnReference('createSocket', $socket);
		$route->__construct(
		new SimpleUrl('http://a.valid.host/here.html'),
		new SimpleUrl('http://my-proxy'),
                'Me',
                'Secret');
		$route->createConnection('GET', 15);
	}
}

class TestOfHttpRequest extends UnitTestCase {

	function testReadingBadConnection() {
		$socket = new MockSimpleSocket();
		$route = new MockSimpleRoute();
		$route->setReturnReference('createConnection', $socket);
		$request = new SimpleHttpRequest($route, new SimpleGetEncoding());
		$reponse = $request->fetch(15);
		$this->assertTrue($reponse->isError());
	}

	function testReadingGoodConnection() {
		$socket = new MockSimpleSocket();
		$socket->expectOnce('write', array("\r\n"));

		$route = new MockSimpleRoute();
		$route->setReturnReference('createConnection', $socket);
		$route->expect('createConnection', array('GET', 15));

		$request = new SimpleHttpRequest($route, new SimpleGetEncoding());
		$this->assertIsA($request->fetch(15), 'SimpleHttpResponse');
	}

	function testWritingAdditionalHeaders() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("My: stuff\r\n"));
		$socket->expectAt(1, 'write', array("\r\n"));
		$socket->expectCallCount('write', 2);

		$route = new MockSimpleRoute();
		$route->setReturnReference('createConnection', $socket);

		$request = new SimpleHttpRequest($route, new SimpleGetEncoding());
		$request->addHeaderLine('My: stuff');
		$request->fetch(15);
	}

	function testCookieWriting() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("Cookie: a=A\r\n"));
		$socket->expectAt(1, 'write', array("\r\n"));
		$socket->expectCallCount('write', 2);

		$route = new MockSimpleRoute();
		$route->setReturnReference('createConnection', $socket);

		$jar = new SimpleCookieJar();
		$jar->setCookie('a', 'A');

		$request = new SimpleHttpRequest($route, new SimpleGetEncoding());
		$request->readCookiesFromJar($jar, new SimpleUrl('/'));
		$this->assertIsA($request->fetch(15), 'SimpleHttpResponse');
	}

	function testMultipleCookieWriting() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("Cookie: a=A;b=B\r\n"));

		$route = new MockSimpleRoute();
		$route->setReturnReference('createConnection', $socket);

		$jar = new SimpleCookieJar();
		$jar->setCookie('a', 'A');
		$jar->setCookie('b', 'B');

		$request = new SimpleHttpRequest($route, new SimpleGetEncoding());
		$request->readCookiesFromJar($jar, new SimpleUrl('/'));
		$request->fetch(15);
	}

    function testReadingDeleteConnection() {
		$socket = new MockSimpleSocket();

		$route = new MockSimpleRoute();
		$route->setReturnReference('createConnection', $socket);
		$route->expect('createConnection', array('DELETE', 15));

		$request = new SimpleHttpRequest($route, new SimpleDeleteEncoding());
		$this->assertIsA($request->fetch(15), 'SimpleHttpResponse');
    }
}

class TestOfHttpPostRequest extends UnitTestCase {

	function testReadingBadConnectionCausesErrorBecauseOfDeadSocket() {
		$socket = new MockSimpleSocket();
		$route = new MockSimpleRoute();
		$route->setReturnReference('createConnection', $socket);
		$request = new SimpleHttpRequest($route, new SimplePostEncoding());
		$reponse = $request->fetch(15);
		$this->assertTrue($reponse->isError());
	}

	function testReadingGoodConnection() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("Content-Length: 0\r\n"));
		$socket->expectAt(1, 'write', array("Content-Type: application/x-www-form-urlencoded\r\n"));
		$socket->expectAt(2, 'write', array("\r\n"));
		$socket->expectAt(3, 'write', array(""));

		$route = new MockSimpleRoute();
		$route->setReturnReference('createConnection', $socket);
		$route->expect('createConnection', array('POST', 15));

		$request = new SimpleHttpRequest($route, new SimplePostEncoding());
		$this->assertIsA($request->fetch(15), 'SimpleHttpResponse');
	}

	function testContentHeadersCalculatedWithUrlEncodedParams() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("Content-Length: 3\r\n"));
		$socket->expectAt(1, 'write', array("Content-Type: application/x-www-form-urlencoded\r\n"));
		$socket->expectAt(2, 'write', array("\r\n"));
		$socket->expectAt(3, 'write', array("a=A"));

		$route = new MockSimpleRoute();
		$route->setReturnReference('createConnection', $socket);
		$route->expect('createConnection', array('POST', 15));

		$request = new SimpleHttpRequest(
		$route,
		new SimplePostEncoding(array('a' => 'A')));
		$this->assertIsA($request->fetch(15), 'SimpleHttpResponse');
	}

	function testContentHeadersCalculatedWithRawEntityBody() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("Content-Length: 8\r\n"));
		$socket->expectAt(1, 'write', array("Content-Type: text/plain\r\n"));
		$socket->expectAt(2, 'write', array("\r\n"));
		$socket->expectAt(3, 'write', array("raw body"));

		$route = new MockSimpleRoute();
		$route->setReturnReference('createConnection', $socket);
		$route->expect('createConnection', array('POST', 15));

		$request = new SimpleHttpRequest(
		$route,
		new SimplePostEncoding('raw body'));
		$this->assertIsA($request->fetch(15), 'SimpleHttpResponse');
	}

	function testContentHeadersCalculatedWithXmlEntityBody() {
		$socket = new MockSimpleSocket();
		$socket->expectAt(0, 'write', array("Content-Length: 27\r\n"));
		$socket->expectAt(1, 'write', array("Content-Type: text/xml\r\n"));
		$socket->expectAt(2, 'write', array("\r\n"));
		$socket->expectAt(3, 'write', array("one<c>two</c>"));

		$route = new MockSimpleRoute();
		$route->setReturnReference('createConnection', $socket);
		$route->expect('createConnection', array('POST', 15));

		$request = new SimpleHttpRequest(
		$route,
		new SimplePostEncoding('one<c>two</c>', 'text/xml'));
		$this->assertIsA($request->fetch(15), 'SimpleHttpResponse');
	}
}

class TestOfHttpHeaders extends UnitTestCase {

	function testParseBasicHeaders() {
		$headers = new SimpleHttpHeaders(
                "HTTP/1.1 200 OK\r\n" .
                "Date: Mon, 18 Nov 2002 15:50:29 GMT\r\n" .
                "Content-Type: text/plain\r\n" .
                "Server: Apache/1.3.24 (Win32) PHP/4.2.3\r\n" .
                "Connection: close");
		$this->assertIdentical($headers->getHttpVersion(), "1.1");
		$this->assertIdentical($headers->getResponseCode(), 200);
		$this->assertEqual($headers->getMimeType(), "text/plain");
	}

	function testNonStandardResponseHeader() {
		$headers = new SimpleHttpHeaders(
                "HTTP/1.1 302 (HTTP-Version SP Status-Code CRLF)\r\n" .
                "Connection: close");
		$this->assertIdentical($headers->getResponseCode(), 302);
	}

	function testCanParseMultipleCookies() {
		$jar = new MockSimpleCookieJar();
		$jar->expectAt(0, 'setCookie', array('a', 'aaa', 'host', '/here/', 'Wed, 25 Dec 2002 04:24:20 GMT'));
		$jar->expectAt(1, 'setCookie', array('b', 'bbb', 'host', '/', false));

		$headers = new SimpleHttpHeaders(
                "HTTP/1.1 200 OK\r\n" .
                "Date: Mon, 18 Nov 2002 15:50:29 GMT\r\n" .
                "Content-Type: text/plain\r\n" .
                "Server: Apache/1.3.24 (Win32) PHP/4.2.3\r\n" .
                "Set-Cookie: a=aaa; expires=Wed, 25-Dec-02 04:24:20 GMT; path=/here/\r\n" .
                "Set-Cookie: b=bbb\r\n" .
                "Connection: close");
		$headers->writeCookiesToJar($jar, new SimpleUrl('http://host'));
	}

	function testCanRecogniseRedirect() {
		$headers = new SimpleHttpHeaders("HTTP/1.1 301 OK\r\n" .
                "Content-Type: text/plain\r\n" .
                "Content-Length: 0\r\n" .
                "Location: http://www.somewhere-else.com/\r\n" .
                "Connection: close");
		$this->assertIdentical($headers->getResponseCode(), 301);
		$this->assertEqual($headers->getLocation(), "http://www.somewhere-else.com/");
		$this->assertTrue($headers->isRedirect());
	}

	function testCanParseChallenge() {
		$headers = new SimpleHttpHeaders("HTTP/1.1 401 Authorization required\r\n" .
                "Content-Type: text/plain\r\n" .
                "Connection: close\r\n" .
                "WWW-Authenticate: Basic realm=\"Somewhere\"");
		$this->assertEqual($headers->getAuthentication(), 'Basic');
		$this->assertEqual($headers->getRealm(), 'Somewhere');
		$this->assertTrue($headers->isChallenge());
	}
}

class TestOfHttpResponse extends UnitTestCase {

	function testBadRequest() {
		$socket = new MockSimpleSocket();
		$socket->setReturnValue('getSent', '');

		$response = new SimpleHttpResponse($socket, new SimpleUrl('here'), new SimpleGetEncoding());
		$this->assertTrue($response->isError());
		$this->assertPattern('/Nothing fetched/', $response->getError());
		$this->assertIdentical($response->getContent(), false);
		$this->assertIdentical($response->getSent(), '');
	}

	function testBadSocketDuringResponse() {
		$socket = new MockSimpleSocket();
		$socket->setReturnValueAt(0, "read", "HTTP/1.1 200 OK\r\n");
		$socket->setReturnValueAt(1, "read", "Date: Mon, 18 Nov 2002 15:50:29 GMT\r\n");
		$socket->setReturnValue("read", "");
		$socket->setReturnValue('getSent', 'HTTP/1.1 ...');

		$response = new SimpleHttpResponse($socket, new SimpleUrl('here'), new SimpleGetEncoding());
		$this->assertTrue($response->isError());
		$this->assertEqual($response->getContent(), '');
		$this->assertEqual($response->getSent(), 'HTTP/1.1 ...');
	}

	function testIncompleteHeader() {
		$socket = new MockSimpleSocket();
		$socket->setReturnValueAt(0, "read", "HTTP/1.1 200 OK\r\n");
		$socket->setReturnValueAt(1, "read", "Date: Mon, 18 Nov 2002 15:50:29 GMT\r\n");
		$socket->setReturnValueAt(2, "read", "Content-Type: text/plain\r\n");
		$socket->setReturnValue("read", "");

		$response = new SimpleHttpResponse($socket, new SimpleUrl('here'), new SimpleGetEncoding());
		$this->assertTrue($response->isError());
		$this->assertEqual($response->getContent(), "");
	}

	function testParseOfResponseHeadersWhenChunked() {
		$socket = new MockSimpleSocket();
		$socket->setReturnValueAt(0, "read", "HTTP/1.1 200 OK\r\nDate: Mon, 18 Nov 2002 15:50:29 GMT\r\n");
		$socket->setReturnValueAt(1, "read", "Content-Type: text/plain\r\n");
		$socket->setReturnValueAt(2, "read", "Server: Apache/1.3.24 (Win32) PHP/4.2.3\r\nConne");
		$socket->setReturnValueAt(3, "read", "ction: close\r\n\r\nthis is a test file\n");
		$socket->setReturnValueAt(4, "read", "with two lines in it\n");
		$socket->setReturnValue("read", "");

		$response = new SimpleHttpResponse($socket, new SimpleUrl('here'), new SimpleGetEncoding());
		$this->assertFalse($response->isError());
		$this->assertEqual(
		$response->getContent(),
                "this is a test file\nwith two lines in it\n");
		$headers = $response->getHeaders();
		$this->assertIdentical($headers->getHttpVersion(), "1.1");
		$this->assertIdentical($headers->getResponseCode(), 200);
		$this->assertEqual($headers->getMimeType(), "text/plain");
		$this->assertFalse($headers->isRedirect());
		$this->assertFalse($headers->getLocation());
	}

	function testRedirect() {
		$socket = new MockSimpleSocket();
		$socket->setReturnValueAt(0, "read", "HTTP/1.1 301 OK\r\n");
		$socket->setReturnValueAt(1, "read", "Content-Type: text/plain\r\n");
		$socket->setReturnValueAt(2, "read", "Location: http://www.somewhere-else.com/\r\n");
		$socket->setReturnValueAt(3, "read", "Connection: close\r\n");
		$socket->setReturnValueAt(4, "read", "\r\n");
		$socket->setReturnValue("read", "");

		$response = new SimpleHttpResponse($socket, new SimpleUrl('here'), new SimpleGetEncoding());
		$headers = $response->getHeaders();
		$this->assertTrue($headers->isRedirect());
		$this->assertEqual($headers->getLocation(), "http://www.somewhere-else.com/");
	}

	function testRedirectWithPort() {
		$socket = new MockSimpleSocket();
		$socket->setReturnValueAt(0, "read", "HTTP/1.1 301 OK\r\n");
		$socket->setReturnValueAt(1, "read", "Content-Type: text/plain\r\n");
		$socket->setReturnValueAt(2, "read", "Location: http://www.somewhere-else.com:80/\r\n");
		$socket->setReturnValueAt(3, "read", "Connection: close\r\n");
		$socket->setReturnValueAt(4, "read", "\r\n");
		$socket->setReturnValue("read", "");

		$response = new SimpleHttpResponse($socket, new SimpleUrl('here'), new SimpleGetEncoding());
		$headers = $response->getHeaders();
		$this->assertTrue($headers->isRedirect());
		$this->assertEqual($headers->getLocation(), "http://www.somewhere-else.com:80/");
	}
}
?>


text:
require(['config'], function () {
  // load expect, mocha and sinon stuff
  require([
    'jquery',
    'expect',
    'mocha',
    'sinon'
  ], function (jquery, _expect, mocha, _sinon) {
    // setup mocha
    mocha.globals([ 'jQuery*' ])
    mocha.checkLeaks();
    mocha.setup('bdd');
    mocha.reporter('html');

    // load then Parsley modules for UT
    require([
      'src/parsley',
      'parsley/validator',
      'parsley/factory',
      'parsley/form',
      'parsley/field',
      'parsley/ui',
      'parsley/utils',
      'parsley/validator_registry',
      'i18n/fr'
    ], function (Parsley, ParsleyValidator, ParsleyFactory, ParsleyForm, ParsleyField, ParsleyUI, ParsleyUtils, ParsleyValidatorRegistry) {

      // Setup console.warn so we insure it is called when we expect it
      beforeEach(function() {
        sinon.spy(console, 'warn');
        console.warn.expectedCallCount = 0;
      });
      afterEach(function() {
        expect(console.warn.callCount).to.be(console.warn.expectedCallCount);
        console.warn.restore();
      });
      window.expectWarning = function(fn) {
        var w = console.warn;
        expect(w.callCount).to.be(w.expectedCallCount);
        var result = fn.call();
        w.expectedCallCount++;
        expect(w.callCount).to.be(w.expectedCallCount);
        return result;
      };

      // load full parsley.js + UT
      require([
        'features/utils',
        'features/validator.js',
        'features/parsley',
        'features/pubsub',
        'features/abstract',
        'features/field',
        'features/multiple',
        'features/form',
        'features/validator_registry',
        'features/ui'
      ], function (utils, validator, parsleyBase, pubsub, abstract, field, multiple, form, validator_registry, ui) {
        describe('ParsleyStandard', function () {
          // Use a pristine ParsleyExtend for the standard suite:
          var previousExtend;
          before(function () {
            previousExtend = window.ParsleyExtend;
            window.ParsleyExtend = {};
          });
          after(function () {
            window.ParsleyExtend = previousExtend;
            ParsleyUtils._resetWarnings();
          });
          utils(ParsleyUtils);
          validator(ParsleyValidator);
          parsleyBase(Parsley.Factory);
          pubsub();
          abstract();
          field(ParsleyField);
          multiple();
          form(ParsleyForm);
          validator_registry(ParsleyValidator, ParsleyValidatorRegistry);
          ui(ParsleyUI);
        });

        require([
          'features/remote',
          'features/abstract',
          'features/field',
          'features/form'
        ], function (remote, abstract, field, form) {
          describe('Parsley+Remote', function () {
            // beforeEach(function () {
            //   window.ParsleyConfig = $.extend(true, {}, window.ParsleyConfig, { excluded: 'input[type=button], input[type=submit], input[type=reset], input[type=hidden], input[disabled]' });
            // });
            remote(ParsleyExtend);
            abstract();
            field(ParsleyField);
            form(ParsleyForm);
          });

          require([
            'features/extra'
          ], function (extra) {
            extra(ParsleyValidator, ParsleyValidatorRegistry);

            // run mocha
            if (window.mochaPhantomJS)
              mochaPhantomJS.run();
            else
              mocha.run();
          });
        });
      });
    });
  });
});