text:
import { IDispatch } from 'redux';
import { handleActions } from 'redux-actions';
import { spread } from './helpers';
import { Data } from './typings/data';
import { ActionTypes, DataLoadDoneAction, DataLoadErrorAction } from './action-types';
import { Location } from '~react-router~history/history';

export interface State {
    error: Error;
    data: Data;
}

export interface RoutedState extends State {
    location: Location;
    dispatch: IDispatch;
}

const defaultState: State = {
    error: null,
    data: null
};

function dataLoadDone(state: State, action: DataLoadDoneAction): State {
    const result = spread(state);
    result.data = action.payload;
    return result;
}

function dataLoadError(state: State, action: DataLoadErrorAction): State {
    const result = spread(state);
    result.error = action.payload;
    return result;
}

export const reducer = (handleActions as ReduxActionsFixed.HandleActions<State>)({
    [ActionTypes.DATA_LOAD_DONE]: dataLoadDone,
    [ActionTypes.DATA_LOAD_ERROR]: dataLoadError
}, defaultState);


text:
<?php
$filefolder = 'files/'; //Include trailing slash
$statsfolder = 'stats/';

$nixWithExec = true; //Set to true if server is running on a *nix system with PHP exec enabled for faster stats

date_default_timezone_set('America/New_York'); //List of time zones: http://www.php.net/manual/en/timezones.php

$clientInfo = $_SERVER['REMOTE_ADDR'] . " - [" . date('j/M/Y:G:i:s T')  . "] - '" . $_SERVER['HTTP_USER_AGENT'] . "' - " . $_SERVER['HTTP_REFERER'] . "\n";
?>

redpajama_set_name: RedPajamaGithub


text:
package org.drools.guvnor.client.resources;

import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.ImageResource;

public interface ItemImages
    extends
    ClientBundle {

    @Source("images/new_item.gif")
    ImageResource newItem();

    @Source("images/new_item_disabled.gif")
    ImageResource newItemDisabled();

    @Source("images/delete_item_small.gif")
    ImageResource deleteItemSmall();

}


text:
import template from './binary.jade!';

export default ['igniteConfigurationClustersBinary', [() => {
    return {
        scope: true,
        restrict: 'E',
        template,
        replace: true
    };
}]];


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Skeddly.Model
{
	public class ListManagedPoliciesResponse
	{
		public IEnumerable<ManagedPolicy> ManagedPolicies { get; set; }
	}
}


text:
<?php

// Register a new image size.
add_image_size('square', 400, 400, true);

/**
 * Register a new image size options to the list of selectable sizes in the Media Library
 *
 * @param $sizes
 *
 * @return array
 */
function base_camp_custom_image_sizes($sizes)
{
    return array_merge($sizes, [
        'square' => __('Square', 'base-camp'),
    ]);
}

add_filter('image_size_names_choose', 'base_camp_custom_image_sizes');


text:
IF EXISTS(SELECT * FROM [dbo].[sysobjects] WHERE ID=object_id(N'[Data].[Voter_SelectBy_FavoriteOrganizationId]') AND OBJECTPROPERTY(id, N'IsProcedure')=1) DROP PROC [Data].[Voter_SelectBy_FavoriteOrganizationId]
GO--
CREATE PROCEDURE [Data].[Voter_SelectBy_FavoriteOrganizationId]
			@FavoriteOrganizationId int
AS --Generated--
BEGIN
	SET NOCOUNT ON;

	SELECT
			[VoterId],
			[UserId],
			[ContentInspectionId],
			[LocationId],
			[VoterName],
			[PostalCode],
			[FavoriteOrganizationId]
	FROM	[Data].[Voter]
	WHERE	[FavoriteOrganizationId] = @FavoriteOrganizationId

END


text:
using System;
using System.Collections.Generic;
using Orchard.UI.Navigation;
using oforms.Models;

namespace oforms.ViewModels {
    public class FormResultViewModel {

        public List<OFormResultRecord> Results { get; set; }

        public dynamic Pager { get; set; }

        public int FormId { get; set; }

        public string FormName { get; set; }
    }
}


text:
option (USE_PYTHON "Build the Python bindings" ON)
set (PYTHON_VERSION "" CACHE STRING "Target version of python to find")
option (PYLIB_INCLUDE_SONAME "If ON, soname/soversion will be set for Python module library" OFF)
option (PYLIB_LIB_PREFIX "If ON, prefix the Python module with 'lib'" OFF)
set (PYMODULE_SUFFIX "" CACHE STRING "Suffix to add to Python module init namespace")
if (WIN32)
    set (PYLIB_LIB_TYPE SHARED CACHE STRING "Type of library to build for python module (MODULE or SHARED)")
else ()
    set (PYLIB_LIB_TYPE MODULE CACHE STRING "Type of library to build for python module (MODULE or SHARED)")
endif ()

# Find Python. This macro should only be called if python is required. If
# Python cannot be found, it will be a fatal error.
macro (find_python)
    if (NOT VERBOSE)
        set (PythonInterp_FIND_QUIETLY true)
        set (PythonLibs_FIND_QUIETLY true)
    endif ()

    # Attempt to find the desired version, but fall back to other
    # additional versions.
    unset (_req)
    if (USE_PYTHON)
        set (_req REQUIRED)
        if (PYTHON_VERSION)
            list (APPEND _req EXACT)
        endif ()
    endif ()
    checked_find_package (Python ${PYTHON_VERSION}
                          ${_req}
                          COMPONENTS Interpreter Development
                          PRINT Python_VERSION Python_EXECUTABLE
                                Python_LIBRARIES
                                Python_Development_FOUND
                                Python_Interpreter_FOUND )

    # The version that was found may not be the default or user
    # defined one.
    set (PYTHON_VERSION_FOUND ${Python_VERSION_MAJOR}.${Python_VERSION_MINOR})

    # Give hints to subsequent pybind11 searching to ensure that it finds
    # exactly the same version that we found.
    set (PythonInterp_FIND_VERSION PYTHON_VERSION_FOUND)
    set (PythonInterp_FIND_VERSION_MAJOR ${Python_VERSION_MAJOR})

    if (NOT DEFINED PYTHON_SITE_DIR)
        set (PYTHON_SITE_DIR "${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_FOUND}/site-packages/OpenImageIO")
    endif ()
    if (VERBOSE)
        message (STATUS "    Python site packages dir ${PYTHON_SITE_DIR}")
        message (STATUS "    Python to include 'lib' prefix: ${PYLIB_LIB_PREFIX}")
        message (STATUS "    Python to include SO version: ${PYLIB_INCLUDE_SONAME}")
    endif ()
endmacro()

###########################################################################
# pybind11

macro (setup_python_module)
    cmake_parse_arguments (lib "" "TARGET;MODULE" "SOURCES;LIBS" ${ARGN})
    # Arguments: <prefix> <options> <one_value_keywords> <multi_value_keywords> args...

    set (target_name ${lib_TARGET})

    if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT ${CMAKE_COMPILER_ID} STREQUAL "Intel")
        # Seems to be a problem on some systems, with pybind11 and python headers
        set_property (SOURCE ${lib_SOURCES} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-macro-redefined ")
    endif ()

    pybind11_add_module(${target_name} ${PYLIB_LIB_TYPE} ${lib_SOURCES})

#    # Add the library itself
#    add_library (${target_name} MODULE ${lib_SOURCES})
#
    # Declare the libraries it should link against
    target_link_libraries (${target_name}
                           PRIVATE ${lib_LIBS})

    set (_module_LINK_FLAGS "${VISIBILITY_MAP_COMMAND} ${EXTRA_DSO_LINK_ARGS}")
    if (UNIX AND NOT APPLE)
        # Hide symbols from any static dependent libraries embedded here.
        set (_module_LINK_FLAGS "${_module_LINK_FLAGS} -Wl,--exclude-libs,ALL")
    endif ()
    set_target_properties (${target_name} PROPERTIES LINK_FLAGS ${_module_LINK_FLAGS})

    # Exclude the 'lib' prefix from the name
    if (NOT PYLIB_LIB_PREFIX)
        target_compile_definitions(${target_name}
                                   PRIVATE "PYMODULE_NAME=${lib_MODULE}")
        set_target_properties (${target_name} PROPERTIES
                               OUTPUT_NAME ${lib_MODULE}
                               # PREFIX ""
                               )
    else ()
        target_compile_definitions(${target_name}
                                   PRIVATE "PYMODULE_NAME=Py${lib_MODULE}")
        set_target_properties (${target_name} PROPERTIES
                               OUTPUT_NAME Py${lib_MODULE}
                               PREFIX lib)
    endif ()

    # Even if using a debug postfix, don't use it for the python module, or
    # python won't find it properly.
    set_target_properties(PyOpenImageIO PROPERTIES
                          DEBUG_POSTFIX "")

    # This is only needed for SpComp2
    if (PYLIB_INCLUDE_SONAME)
        if (VERBOSE)
            message(STATUS "Setting Py${lib_MODULE} SOVERSION to: ${SOVERSION}")
        endif ()
        set_target_properties(${target_name} PROPERTIES
            VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
            SOVERSION ${SOVERSION} )
    endif()

#    if (WIN32)
#        set_target_properties (${target_name} PROPERTIES
#                               DEBUG_POSTFIX "_d"
#                               SUFFIX ".pyd")
#    endif()

    # In the build area, put it in lib/python so it doesn't clash with the
    # non-python libraries of the same name (which aren't prefixed by "lib"
    # on Windows).
    set_target_properties (${target_name} PROPERTIES
            LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/python/site-packages
            ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/python/site-packages
            )

    install (TARGETS ${target_name}
             RUNTIME DESTINATION ${PYTHON_SITE_DIR} COMPONENT user
             LIBRARY DESTINATION ${PYTHON_SITE_DIR} COMPONENT user)

    install(FILES __init__.py DESTINATION ${PYTHON_SITE_DIR})

endmacro ()


text:
TEST_CASE("Bar can concatenate strings", "[bar]" ) {
    REQUIRE(concat("foo", "bar")== std::string("foobar"));
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.contactcenterinsights.v1.model;

/**
 * A piece of metadata that applies to a window of a call.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Contact Center AI Insights API. For a detailed
 * explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class GoogleCloudContactcenterinsightsV1CallAnnotation extends com.google.api.client.json.GenericJson {

  /**
   * The boundary in the conversation where the annotation ends, inclusive.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudContactcenterinsightsV1AnnotationBoundary annotationEndBoundary;

  /**
   * The boundary in the conversation where the annotation starts, inclusive.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudContactcenterinsightsV1AnnotationBoundary annotationStartBoundary;

  /**
   * The channel of the audio where the annotation occurs. For single-channel audio, this field is
   * not populated.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer channelTag;

  /**
   * Data specifying an entity mention.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudContactcenterinsightsV1EntityMentionData entityMentionData;

  /**
   * Data specifying a hold.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudContactcenterinsightsV1HoldData holdData;

  /**
   * Data specifying an intent match.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudContactcenterinsightsV1IntentMatchData intentMatchData;

  /**
   * Data specifying an interruption.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudContactcenterinsightsV1InterruptionData interruptionData;

  /**
   * Data specifying a phrase match.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudContactcenterinsightsV1PhraseMatchData phraseMatchData;

  /**
   * Data specifying sentiment.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudContactcenterinsightsV1SentimentData sentimentData;

  /**
   * Data specifying silence.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudContactcenterinsightsV1SilenceData silenceData;

  /**
   * The boundary in the conversation where the annotation ends, inclusive.
   * @return value or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1AnnotationBoundary getAnnotationEndBoundary() {
    return annotationEndBoundary;
  }

  /**
   * The boundary in the conversation where the annotation ends, inclusive.
   * @param annotationEndBoundary annotationEndBoundary or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1CallAnnotation setAnnotationEndBoundary(GoogleCloudContactcenterinsightsV1AnnotationBoundary annotationEndBoundary) {
    this.annotationEndBoundary = annotationEndBoundary;
    return this;
  }

  /**
   * The boundary in the conversation where the annotation starts, inclusive.
   * @return value or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1AnnotationBoundary getAnnotationStartBoundary() {
    return annotationStartBoundary;
  }

  /**
   * The boundary in the conversation where the annotation starts, inclusive.
   * @param annotationStartBoundary annotationStartBoundary or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1CallAnnotation setAnnotationStartBoundary(GoogleCloudContactcenterinsightsV1AnnotationBoundary annotationStartBoundary) {
    this.annotationStartBoundary = annotationStartBoundary;
    return this;
  }

  /**
   * The channel of the audio where the annotation occurs. For single-channel audio, this field is
   * not populated.
   * @return value or {@code null} for none
   */
  public java.lang.Integer getChannelTag() {
    return channelTag;
  }

  /**
   * The channel of the audio where the annotation occurs. For single-channel audio, this field is
   * not populated.
   * @param channelTag channelTag or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1CallAnnotation setChannelTag(java.lang.Integer channelTag) {
    this.channelTag = channelTag;
    return this;
  }

  /**
   * Data specifying an entity mention.
   * @return value or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1EntityMentionData getEntityMentionData() {
    return entityMentionData;
  }

  /**
   * Data specifying an entity mention.
   * @param entityMentionData entityMentionData or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1CallAnnotation setEntityMentionData(GoogleCloudContactcenterinsightsV1EntityMentionData entityMentionData) {
    this.entityMentionData = entityMentionData;
    return this;
  }

  /**
   * Data specifying a hold.
   * @return value or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1HoldData getHoldData() {
    return holdData;
  }

  /**
   * Data specifying a hold.
   * @param holdData holdData or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1CallAnnotation setHoldData(GoogleCloudContactcenterinsightsV1HoldData holdData) {
    this.holdData = holdData;
    return this;
  }

  /**
   * Data specifying an intent match.
   * @return value or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1IntentMatchData getIntentMatchData() {
    return intentMatchData;
  }

  /**
   * Data specifying an intent match.
   * @param intentMatchData intentMatchData or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1CallAnnotation setIntentMatchData(GoogleCloudContactcenterinsightsV1IntentMatchData intentMatchData) {
    this.intentMatchData = intentMatchData;
    return this;
  }

  /**
   * Data specifying an interruption.
   * @return value or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1InterruptionData getInterruptionData() {
    return interruptionData;
  }

  /**
   * Data specifying an interruption.
   * @param interruptionData interruptionData or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1CallAnnotation setInterruptionData(GoogleCloudContactcenterinsightsV1InterruptionData interruptionData) {
    this.interruptionData = interruptionData;
    return this;
  }

  /**
   * Data specifying a phrase match.
   * @return value or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1PhraseMatchData getPhraseMatchData() {
    return phraseMatchData;
  }

  /**
   * Data specifying a phrase match.
   * @param phraseMatchData phraseMatchData or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1CallAnnotation setPhraseMatchData(GoogleCloudContactcenterinsightsV1PhraseMatchData phraseMatchData) {
    this.phraseMatchData = phraseMatchData;
    return this;
  }

  /**
   * Data specifying sentiment.
   * @return value or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1SentimentData getSentimentData() {
    return sentimentData;
  }

  /**
   * Data specifying sentiment.
   * @param sentimentData sentimentData or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1CallAnnotation setSentimentData(GoogleCloudContactcenterinsightsV1SentimentData sentimentData) {
    this.sentimentData = sentimentData;
    return this;
  }

  /**
   * Data specifying silence.
   * @return value or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1SilenceData getSilenceData() {
    return silenceData;
  }

  /**
   * Data specifying silence.
   * @param silenceData silenceData or {@code null} for none
   */
  public GoogleCloudContactcenterinsightsV1CallAnnotation setSilenceData(GoogleCloudContactcenterinsightsV1SilenceData silenceData) {
    this.silenceData = silenceData;
    return this;
  }

  @Override
  public GoogleCloudContactcenterinsightsV1CallAnnotation set(String fieldName, Object value) {
    return (GoogleCloudContactcenterinsightsV1CallAnnotation) super.set(fieldName, value);
  }

  @Override
  public GoogleCloudContactcenterinsightsV1CallAnnotation clone() {
    return (GoogleCloudContactcenterinsightsV1CallAnnotation) super.clone();
  }

}


text:
package types

import (
	"fmt"

	"k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	utilfeature "k8s.io/apiserver/pkg/util/feature"
	kubeapi "k8s.io/kubernetes/pkg/apis/core"
	"k8s.io/kubernetes/pkg/apis/scheduling"
	"k8s.io/kubernetes/pkg/features"
)

const (
	ConfigSourceAnnotationKey    = "kubernetes.io/config.source"
	ConfigMirrorAnnotationKey    = v1.MirrorPodAnnotationKey
	ConfigFirstSeenAnnotationKey = "kubernetes.io/config.seen"
	ConfigHashAnnotationKey      = "kubernetes.io/config.hash"
	CriticalPodAnnotationKey     = "scheduler.alpha.kubernetes.io/critical-pod"
)

// PodOperation defines what changes will be made on a pod configuration.
type PodOperation int

const (
	// This is the current pod configuration
	SET PodOperation = iota
	// Pods with the given ids are new to this source
	ADD
	// Pods with the given ids are gracefully deleted from this source
	DELETE
	// Pods with the given ids have been removed from this source
	REMOVE
	// Pods with the given ids have been updated in this source
	UPDATE
	// Pods with the given ids have unexpected status in this source,
	// kubelet should reconcile status with this source
	RECONCILE
	// Pods with the given ids have been restored from a checkpoint.
	RESTORE

	// These constants identify the sources of pods
	// Updates from a file
	FileSource = "file"
	// Updates from querying a web page
	HTTPSource = "http"
	// Updates from Kubernetes API Server
	ApiserverSource = "api"
	// Updates from all sources
	AllSource = "*"

	NamespaceDefault = metav1.NamespaceDefault
)

// PodUpdate defines an operation sent on the channel. You can add or remove single services by
// sending an array of size one and Op == ADD|REMOVE (with REMOVE, only the ID is required).
// For setting the state of the system to a given state for this source configuration, set
// Pods as desired and Op to SET, which will reset the system state to that specified in this
// operation for this source channel. To remove all pods, set Pods to empty object and Op to SET.
//
// Additionally, Pods should never be nil - it should always point to an empty slice. While
// functionally similar, this helps our unit tests properly check that the correct PodUpdates
// are generated.
type PodUpdate struct {
	Pods   []*v1.Pod
	Op     PodOperation
	Source string
}

// Gets all validated sources from the specified sources.
func GetValidatedSources(sources []string) ([]string, error) {
	validated := make([]string, 0, len(sources))
	for _, source := range sources {
		switch source {
		case AllSource:
			return []string{FileSource, HTTPSource, ApiserverSource}, nil
		case FileSource, HTTPSource, ApiserverSource:
			validated = append(validated, source)
			break
		case "":
			break
		default:
			return []string{}, fmt.Errorf("unknown pod source %q", source)
		}
	}
	return validated, nil
}

// GetPodSource returns the source of the pod based on the annotation.
func GetPodSource(pod *v1.Pod) (string, error) {
	if pod.Annotations != nil {
		if source, ok := pod.Annotations[ConfigSourceAnnotationKey]; ok {
			return source, nil
		}
	}
	return "", fmt.Errorf("cannot get source of pod %q", pod.UID)
}

// SyncPodType classifies pod updates, eg: create, update.
type SyncPodType int

const (
	// SyncPodSync is when the pod is synced to ensure desired state
	SyncPodSync SyncPodType = iota
	// SyncPodUpdate is when the pod is updated from source
	SyncPodUpdate
	// SyncPodCreate is when the pod is created from source
	SyncPodCreate
	// SyncPodKill is when the pod is killed based on a trigger internal to the kubelet for eviction.
	// If a SyncPodKill request is made to pod workers, the request is never dropped, and will always be processed.
	SyncPodKill
)

func (sp SyncPodType) String() string {
	switch sp {
	case SyncPodCreate:
		return "create"
	case SyncPodUpdate:
		return "update"
	case SyncPodSync:
		return "sync"
	case SyncPodKill:
		return "kill"
	default:
		return "unknown"
	}
}

// IsCriticalPod returns true if the pod bears the critical pod annotation key or if pod's priority is greater than
// or equal to SystemCriticalPriority. Both the default scheduler and the kubelet use this function
// to make admission and scheduling decisions.
func IsCriticalPod(pod *v1.Pod) bool {
	if utilfeature.DefaultFeatureGate.Enabled(features.PodPriority) {
		if pod.Spec.Priority != nil && IsCriticalPodBasedOnPriority(*pod.Spec.Priority) {
			return true
		}
	}
	if utilfeature.DefaultFeatureGate.Enabled(features.ExperimentalCriticalPodAnnotation) {
		if IsCritical(pod.Namespace, pod.Annotations) {
			return true
		}
	}
	return false
}

// Preemptable returns true if preemptor pod can preempt preemptee pod
// if preemptee is not critical or if preemptor's priority is greater than preemptee's priority
func Preemptable(preemptor, preemptee *v1.Pod) bool {
	if IsCriticalPod(preemptor) && !IsCriticalPod(preemptee) {
		return true
	}
	if utilfeature.DefaultFeatureGate.Enabled(features.PodPriority) {
		if (preemptor != nil && preemptor.Spec.Priority != nil) &&
			(preemptee != nil && preemptee.Spec.Priority != nil) {
			return *(preemptor.Spec.Priority) > *(preemptee.Spec.Priority)
		}
	}

	return false
}

// IsCritical returns true if parameters bear the critical pod annotation
// key. The DaemonSetController use this key directly to make scheduling decisions.
// TODO: @ravig - Deprecated. Remove this when we move to resolving critical pods based on priorityClassName.
func IsCritical(ns string, annotations map[string]string) bool {
	// Critical pods are restricted to "kube-system" namespace as of now.
	if ns != kubeapi.NamespaceSystem {
		return false
	}
	val, ok := annotations[CriticalPodAnnotationKey]
	if ok && val == "" {
		return true
	}
	return false
}

// IsCriticalPodBasedOnPriority checks if the given pod is a critical pod based on priority resolved from pod Spec.
func IsCriticalPodBasedOnPriority(priority int32) bool {
	if priority >= scheduling.SystemCriticalPriority {
		return true
	}
	return false
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>sk.stuba.fiit.perconik.ivda.util.histogram Class Hierarchy</title>
<meta name="date" content="2015-05-01">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package sk.stuba.fiit.perconik.ivda.util.histogram

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

sk.stuba.fiit.perconik.ivda.util.histogram.Histogram<K>

sk.stuba.fiit.perconik.ivda.util.histogram.HistogramByHashTable<K>

sk.stuba.fiit.perconik.ivda.util.histogram.HistogramBySiblings<K>

sk.stuba.fiit.perconik.ivda.util.histogram.Histogram.KeyComparator<K> (implements java.util.Comparator<T>)

sk.stuba.fiit.perconik.ivda.util.histogram.Histogram.ValueComparator<K> (implements java.util.Comparator<T>)

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:paddingBottom="@dimen/card_vertical_padding"
    android:paddingLeft="@dimen/card_horizontal_padding"
    android:paddingRight="@dimen/card_horizontal_padding"
    android:paddingTop="@dimen/card_vertical_padding" >

    <RelativeLayout
        android:id="@+id/mainContent"
        android:layout_width="@dimen/main_content_width"
        android:layout_height="@dimen/main_content_height"
        android:gravity="center_vertical" >

        <TextView
            android:id="@+id/photographerConnectedBluetoothDeviceNameLabelTextview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:text="@string/photographer_connected_bluetooth_device_label" />

        <TextView
            android:id="@+id/photographerReceivedDataValueTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/photographerReceivedDataLabelTextView"
            android:layout_marginLeft="10dp"
            android:layout_toRightOf="@+id/photographerReceivedDataLabelTextView"
            android:text="@string/photographer_received_data_value_none" />

        <TextView
            android:id="@+id/photographerReceivedDataOnValueTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/photographerReceivedDataValueTextView"
            android:layout_below="@+id/photographerReceivedDataValueTextView"
            android:text="@string/photographer_received_data_on_none" />

        <TextView
            android:id="@+id/photographerConnectedBluetoothDeviceNameTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBaseline="@+id/photographerConnectedBluetoothDeviceNameLabelTextview"
            android:layout_alignBottom="@+id/photographerConnectedBluetoothDeviceNameLabelTextview"
            android:layout_marginLeft="10dp"
            android:layout_toRightOf="@+id/photographerConnectedBluetoothDeviceNameLabelTextview"
            android:text="@string/photographer_connected_bluetooth_device_name_default" />

        <TextView
            android:id="@+id/photographerConnectedBluetoothDeviceAddressTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/photographerConnectedBluetoothDeviceNameTextView"
            android:layout_below="@+id/photographerConnectedBluetoothDeviceNameTextView"
            android:text="@string/photographer_connected_bluetooth_device_address_default" />

        <TextView
            android:id="@+id/photographerReceivedDataLabelTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/photographerConnectedBluetoothDeviceAddressTextView"
            android:layout_marginTop="10dp"
            android:text="@string/photographer_received_data_label" />

    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/footer"
        android:layout_width="@dimen/footer_width"
        android:layout_height="@dimen/footer_height"
        android:layout_below="@id/mainContent" >

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:gravity="center_vertical|center_horizontal" >

            <ImageView
                android:id="@+id/footerIconImageView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_camera_50" />

            <TextView
                android:id="@+id/footerTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/footer"
                android:textAppearance="?android:attr/textAppearanceSmall" />
        </LinearLayout>
    </RelativeLayout>

</RelativeLayout>


text:
package org.cfeclipse.cfml.preferences;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import org.cfeclipse.cfml.editors.CFConfiguration;
import org.cfeclipse.cfml.editors.formatters.FormattingPreferences;
import org.cfeclipse.cfml.editors.formatters.CFMLFormattingStrategy;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.texteditor.AbstractTextEditor;

/**
 * Handles changes for Ant preview viewers.
 *
 * @since 3.0
 */
class CFPreviewerUpdater {

	private Color fForegroundColor= null;
	private Color fBackgroundColor= null;
	private Color fSelectionBackgroundColor= null;
	private Color fSelectionForegroundColor= null;

	/**
	 * Creates a source preview updater for the given viewer, configuration and preference store.
	 *
	 * @param viewer the viewer
	 * @param configuration the configuration
	 * @param preferenceStore the preference store
	 */
	public CFPreviewerUpdater(final SourceViewer viewer, final CFConfiguration configuration, final IPreferenceStore preferenceStore) {

		initializeViewerColors(viewer, preferenceStore);

		final IPropertyChangeListener fontChangeListener= new IPropertyChangeListener() {
			/*
			 * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
			 */
			public void propertyChange(PropertyChangeEvent event) {
				if (event.getProperty().equals(JFaceResources.TEXT_FONT)) {
					Font font= JFaceResources.getFont(JFaceResources.TEXT_FONT);
					viewer.getTextWidget().setFont(font);
				}
			}
		};
		final IPropertyChangeListener propertyChangeListener= new IPropertyChangeListener() {
			/*
			 * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
			 */
			public void propertyChange(PropertyChangeEvent event) {

				String property= event.getProperty();

				if (AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND.equals(property) || AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT.equals(property) ||
						AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND.equals(property) ||	AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT.equals(property) ||
						AbstractTextEditor.PREFERENCE_COLOR_SELECTION_FOREGROUND.equals(property) || AbstractTextEditor.PREFERENCE_COLOR_SELECTION_FOREGROUND_SYSTEM_DEFAULT.equals(property) ||
						AbstractTextEditor.PREFERENCE_COLOR_SELECTION_BACKGROUND.equals(property) ||	AbstractTextEditor.PREFERENCE_COLOR_SELECTION_BACKGROUND_SYSTEM_DEFAULT.equals(property))
					{
						initializeViewerColors(viewer, preferenceStore);
				}

/*
				if (configuration.affectsTextPresentation(event)) {
					configuration.adaptToPreferenceChange(event);
					viewer.invalidateTextPresentation();
				}
 */

				if (FormattingPreferences.affectsFormatting(event)) {
					format(viewer, preferenceStore);
				}
			}

			/**
			 * @param viewer
			 * @param preferenceStore
			 */
			private void format(final SourceViewer sourceViewer, final IPreferenceStore store) {
				String contents= loadPreviewContentFromFile("FormatPreviewCode.txt");
				FormattingPreferences prefs= new FormattingPreferences();
				prefs.setPreferenceStore(store);
				CFMLFormattingStrategy formatter = new CFMLFormattingStrategy();
				contents= formatter.format(contents, prefs, "");
				viewer.getDocument().set(contents);
			}
		};
		viewer.getTextWidget().addDisposeListener(new DisposeListener() {
			/*
			 * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)
			 */
			public void widgetDisposed(DisposeEvent e) {
				preferenceStore.removePropertyChangeListener(propertyChangeListener);
				JFaceResources.getFontRegistry().removeListener(fontChangeListener);
			}
		});
		JFaceResources.getFontRegistry().addListener(fontChangeListener);
		preferenceStore.addPropertyChangeListener(propertyChangeListener);
	}

	/**
	 * Initializes the given viewer's colors.
	 *
	 * @param viewer the viewer to be initialized
	 * @since 2.0
	 */
	protected void initializeViewerColors(ISourceViewer viewer, IPreferenceStore store) {

		StyledText styledText= viewer.getTextWidget();

		// ----------- foreground color --------------------
		Color color= store.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT)
			? null
			: createColor(store, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, styledText.getDisplay());
		styledText.setForeground(color);

		if (fForegroundColor != null) {
			fForegroundColor.dispose();
		}

		fForegroundColor= color;

		// ---------- background color ----------------------
		color= store.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT)
			? null
			: createColor(store, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, styledText.getDisplay());
		styledText.setBackground(color);

		if (fBackgroundColor != null) {
			fBackgroundColor.dispose();
		}

		fBackgroundColor= color;

		// ----------- selection foreground color --------------------
		color= store.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_SELECTION_FOREGROUND_SYSTEM_DEFAULT)
			? null
			: createColor(store, AbstractTextEditor.PREFERENCE_COLOR_SELECTION_FOREGROUND, styledText.getDisplay());
		styledText.setSelectionForeground(color);

		if (fSelectionForegroundColor != null) {
			fSelectionForegroundColor.dispose();
		}

		fSelectionForegroundColor= color;

		// ---------- selection background color ----------------------
		color= store.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_SELECTION_BACKGROUND_SYSTEM_DEFAULT)
			? null
			: createColor(store, AbstractTextEditor.PREFERENCE_COLOR_SELECTION_BACKGROUND, styledText.getDisplay());
		styledText.setSelectionBackground(color);

		if (fSelectionBackgroundColor != null) {
			fSelectionBackgroundColor.dispose();
		}

		fSelectionBackgroundColor= color;
	}

	/**
	 * Creates a color from the information stored in the given preference store.
	 * Returns null if there is no such information available.
	 *
	 * @param store the store to read from
	 * @param key the key used for the lookup in the preference store
	 * @param display the display used create the color
	 * @return the created color according to the specification in the preference store
	 * @since 2.0
	 */
	private Color createColor(IPreferenceStore store, String key, Display display) {

		RGB rgb= null;

		if (store.contains(key)) {

			if (store.isDefault(key))
				rgb= PreferenceConverter.getDefaultColor(store, key);
			else
				rgb= PreferenceConverter.getColor(store, key);

			if (rgb != null)
				return new Color(display, rgb);
		}

		return null;
	}

	protected String loadPreviewContentFromFile(String filename) {
		String line;
		String separator= System.getProperty("line.separator"); //$NON-NLS-1$
		StringBuffer buffer= new StringBuffer(512);
		BufferedReader reader= null;
		try {
			reader= new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(filename)));
			while ((line= reader.readLine()) != null) {
				buffer.append(line);
				buffer.append(separator);
			}
		} catch (IOException io) {
			io.printStackTrace();
			//CFMLPlugin.log(io);
		} finally {
			if (reader != null) {
				try { reader.close(); } catch (IOException e) {}
			}
		}
		return buffer.toString();
	}

	public void dispose() {
		if (fForegroundColor != null) {
			fForegroundColor.dispose();
			fForegroundColor= null;
		}

		if (fBackgroundColor != null) {
			fBackgroundColor.dispose();
			fBackgroundColor= null;
		}

		if (fSelectionForegroundColor != null) {
			fSelectionForegroundColor.dispose();
			fSelectionForegroundColor= null;
		}

		if (fSelectionBackgroundColor != null) {
			fSelectionBackgroundColor.dispose();
			fSelectionBackgroundColor= null;
		}
	}
}


text:
<?php
namespace project\apps\back_end\pages\export;

/**
 * ModelExport class
 *
 * Model Export
 *
 * @author Christopher Beck <chris.beck@jpmh.co.uk> & Alessandro Barzanti <alessandro.barzanti@jpmh.co.uk>
 * @version SVN: $id
 * @package pages
 * @subpackage export
 */
class ModelExport extends \project\apps\back_end\templates\PageTemplate {

	/**
	 * Function - Execute
	 * @param \nano\core\routing\Routing $routing Routing
	 * @return mixed
	 */
	public function execute(\nano\core\routing\Routing $routing){
		$this->headerWidget->setTitle(i18n('admin.pagetitle.model-export','Admin - Export'));

		$menu = new \project\apps\back_end\widgets\menu\Menu();
		$this->menu = $menu->getRenderedWidget();

		$modelExport = new \project\apps\back_end\widgets\export\ModelExport();
		$this->modelExport = $modelExport->getRenderedWidget();

		return 'project/apps/back_end/pages/export/views/model_export.twig';
	}

}


text:
package org.keycloak.protocol.oidc.par.endpoints.request;

import java.io.InputStream;
import java.util.HashSet;
import java.util.List;

import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;

import org.keycloak.common.Profile;
import org.keycloak.common.util.StreamUtil;
import org.keycloak.connections.httpclient.HttpClientProvider;
import org.keycloak.events.Errors;
import org.keycloak.events.EventBuilder;
import org.keycloak.models.ClientModel;
import org.keycloak.models.KeycloakSession;
import org.keycloak.protocol.oidc.OIDCAdvancedConfigWrapper;
import org.keycloak.protocol.oidc.OIDCConfigAttributes;
import org.keycloak.protocol.oidc.OIDCLoginProtocol;
import org.keycloak.protocol.oidc.endpoints.request.AuthorizationEndpointRequest;
import org.keycloak.protocol.oidc.endpoints.request.AuthzEndpointQueryStringParser;
import org.keycloak.protocol.oidc.utils.RedirectUtils;
import org.keycloak.services.ErrorPageException;
import org.keycloak.services.ServicesLogger;
import org.keycloak.services.messages.Messages;
import org.keycloak.services.util.AuthorizationContextUtil;

/**
 * @author Takashi Norimatsu
 */
public class ParEndpointRequestParserProcessor {

    public static AuthorizationEndpointRequest parseRequest(EventBuilder event, KeycloakSession session, ClientModel client, MultivaluedMap<String, String> requestParams) {
        try {
            AuthorizationEndpointRequest request = new AuthorizationEndpointRequest();

            AuthzEndpointQueryStringParser parser = new AuthzEndpointQueryStringParser(requestParams, false);
            parser.parseRequest(request);

            if (parser.getInvalidRequestMessage() != null) {
                request.setInvalidRequestMessage(parser.getInvalidRequestMessage());
            }
            if (request.getInvalidRequestMessage() != null) {
                return request;
            }

            String requestParam = requestParams.getFirst(OIDCLoginProtocol.REQUEST_PARAM);
            String requestUriParam = requestParams.getFirst(OIDCLoginProtocol.REQUEST_URI_PARAM);

            if (requestParam != null && requestUriParam != null) {
                throw new RuntimeException("Illegal to use both 'request' and 'request_uri' parameters together");
            }

            String requestObjectRequired = OIDCAdvancedConfigWrapper.fromClientModel(client).getRequestObjectRequired();

            if (OIDCConfigAttributes.REQUEST_OBJECT_REQUIRED_REQUEST_OR_REQUEST_URI.equals(requestObjectRequired)
                    && requestParam == null && requestUriParam == null) {
                throw new RuntimeException("Client is required to use 'request' or 'request_uri' parameter.");
            } else if (OIDCConfigAttributes.REQUEST_OBJECT_REQUIRED_REQUEST.equals(requestObjectRequired)
                    && requestParam == null) {
                throw new RuntimeException("Client is required to use 'request' parameter.");
            } else if (OIDCConfigAttributes.REQUEST_OBJECT_REQUIRED_REQUEST_URI.equals(requestObjectRequired)
                    && requestUriParam == null) {
                throw new RuntimeException("Client is required to use 'request_uri' parameter.");
            }

            if (requestParam != null) {
                new ParEndpointRequestObjectParser(session, requestParam, client).parseRequest(request);
            } else if (requestUriParam != null) {
                // Validate "requestUriParam" with allowed requestUris
                List<String> requestUris = OIDCAdvancedConfigWrapper.fromClientModel(client).getRequestUris();
                String requestUri = RedirectUtils.verifyRedirectUri(session, client.getRootUrl(), requestUriParam, new HashSet<>(requestUris), false);
                if (requestUri == null) {
                    throw new RuntimeException("Specified 'request_uri' not allowed for this client.");
                }
                try (InputStream is = session.getProvider(HttpClientProvider.class).get(requestUri)) {
                    String retrievedRequest = StreamUtil.readString(is);
                    new ParEndpointRequestObjectParser(session, retrievedRequest, client).parseRequest(request);
                }
            }

            if (Profile.isFeatureEnabled(Profile.Feature.DYNAMIC_SCOPES)) {
                request.setAuthorizationRequestContext(AuthorizationContextUtil.getAuthorizationRequestContextFromScopes(session, request.getScope()));
            }

            return request;

        } catch (Exception e) {
            ServicesLogger.LOGGER.invalidRequest(e);
            event.error(Errors.INVALID_REQUEST);
            throw new ErrorPageException(session, Response.Status.BAD_REQUEST, Messages.INVALID_REQUEST);
        }
    }

}


text:
from __future__ import absolute_import

from exam import fixture

from sentry.models import SavedSearch
from sentry.testutils import APITestCase

class DeleteOrganizationSearchTest(APITestCase):
    endpoint = "sentry-api-0-organization-search-details"
    method = "delete"

    def setUp(self):
        self.login_as(user=self.user)

    @fixture
    def member(self):
        user = self.create_user("test@test.com")
        self.create_member(organization=self.organization, user=user)
        return user

    def get_response(self, *args, **params):
        return super(DeleteOrganizationSearchTest, self).get_response(
            *((self.organization.slug,) + args), **params
        )

    def test_owner_can_delete_org_searches(self):
        search = SavedSearch.objects.create(organization=self.organization, name="foo", query="")
        response = self.get_response(search.id)
        assert response.status_code == 204, response.content
        assert not SavedSearch.objects.filter(id=search.id).exists()

    def test_owners_cannot_delete_searches_they_do_not_own(self):
        search = SavedSearch.objects.create(
            organization=self.organization, name="foo", query="", owner=self.create_user()
        )

        response = self.get_response(search.id)
        assert response.status_code == 404, response.content
        assert SavedSearch.objects.filter(id=search.id).exists()

    def test_owners_cannot_delete_global_searches(self):
        search = SavedSearch.objects.create(name="foo", query="", is_global=True)

        response = self.get_response(search.id)
        assert response.status_code == 404, response.content
        assert SavedSearch.objects.filter(id=search.id).exists()

    def test_members_cannot_delete_shared_searches(self):
        search = SavedSearch.objects.create(organization=self.organization, name="foo", query="")

        self.login_as(user=self.member)
        response = self.get_response(search.id)
        assert response.status_code == 403, response.content
        assert SavedSearch.objects.filter(id=search.id).exists()


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
~  Copyright 2017 Seven Bridges Genomics, Inc. All rights reserved.
~
~  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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>com.sevenbridges.apiclient</groupId>
    <artifactId>sevenbridges-java-parent</artifactId>
    <version>0.5.1-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>sevenbridges-java-api</artifactId>

  <packaging>jar</packaging>

  <name>SevenBridges Java :: API</name>
  <description>
    The SevenBridges Java API .jar provides a Java API that your code can use to make calls to the
    SevenBridges API. This .jar is the only compile-time dependency within the SevenBridges Java
    project that your code should depend on. Implementations of this API (implementation .jars)
    should be runtime dependencies only.
  </description>

  <properties>
    <main.basedir>${project.parent.basedir}</main.basedir>
  </properties>

  <dependencies>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

  </dependencies>

</project>


text:
<?xml version='1.0' encoding='UTF-8'?>
<Document>
  <Header>
    <SchemaName>Location</SchemaName>
    <Identifier>location_geonames_2752622</Identifier>
    <DocumentState>public</DocumentState>
    <TimeStamp>1390753462010</TimeStamp>
    <SummaryFields>
      <Title>NL > North Brabant > Kloosterhoek</Title>
    </SummaryFields>
  </Header>
  <Body>
    <Location>
      <GeopoliticalHierarchy>NL,North Brabant,Kloosterhoek</GeopoliticalHierarchy>
      <LocationName>
        <Appelation>Kloosterhoek</Appelation>
        <LocationNameType>populated place</LocationNameType>
        <Comments></Comments>
      </LocationName>
      <Coordinates>
        <Longitude>5.36803</Longitude>
        <Latitude>51.699940000000005</Latitude>
      </Coordinates>
      <GeonamesURI>http://www.geonames.org/2752622</GeonamesURI>
      <WikipediaLink/>
      <DbpediaLink/>
    </Location>
  </Body>
</Document>


text:
package org.apache.oodt.cas.metadata.preconditions;

// Metadata Imports
import org.apache.oodt.cas.metadata.MetadataTestCase;

//JDK imports
import java.io.File;
import java.util.LinkedList;

//Spring imports
import org.junit.Before;
import org.springframework.context.support.FileSystemXmlApplicationContext;

//Junit imports

/**
 *
 * @author bfoster
 * @author mattmann
 * @version $Revision$
 *
 * <p>
 * Test suite for the {@link PreCondEvalUtils} class
 * </p>.
 */
public class TestPreCondEvalUtils extends MetadataTestCase {

    LinkedList<String> preconditions;

    private PreCondEvalUtils evalUtils;

    public TestPreCondEvalUtils(String name) {
        super(name);
    }

    @Before
    public void setUp() throws Exception {
        super.setUp();
        this.preconditions = new LinkedList<String>();
        this.preconditions.add("CheckThatDataFileSizeIsGreaterThanZero");
        this.preconditions.add("CheckThatDataFileExists");
        this.preconditions.add("CheckDataFileMimeType");
        File preCondFile = getTestDataFile("/met_extr_preconditions.xml");
        this.evalUtils = new PreCondEvalUtils(new FileSystemXmlApplicationContext("file:" + preCondFile.getAbsolutePath()));
    }

    public void testEval() throws Throwable {
        // Test file is also the config file we used, neat!
        File prodFile = getTestDataFile("/met_extr_preconditions.xml");
        assertTrue(this.evalUtils.eval(this.preconditions, prodFile));
    }
}


text:
/* sangerGeneToWBGeneID.h was originally generated by the autoSql program, which also
 * generated sangerGeneToWBGeneID.c and sangerGeneToWBGeneID.sql.  This header links the database and
 * the RAM representation of objects. */

/* Copyright (C) 2013 The Regents of the University of California
 * See README in this or parent directory for licensing information. */

#ifndef SANGERGENETOWBGENEID_H
#define SANGERGENETOWBGENEID_H

#ifndef JKSQL_H
#include "jksql.h"
#endif

#define SANGERGENETOWBGENEID_NUM_COLS 2

struct sangerGeneToWBGeneID
/* sanger gene names to WormBase Gene IDs translation */
    {
    struct sangerGeneToWBGeneID *next;  /* Next in singly linked list. */
    char *sangerGene;	/* sangerGene name */
    char *WBGeneID;	/* WormBase Gene ID */
    };

void sangerGeneToWBGeneIDStaticLoad(char **row, struct sangerGeneToWBGeneID *ret);
/* Load a row from sangerGeneToWBGeneID table into ret.  The contents of ret will
 * be replaced at the next call to this function. */

struct sangerGeneToWBGeneID *sangerGeneToWBGeneIDLoad(char **row);
/* Load a sangerGeneToWBGeneID from row fetched with select * from sangerGeneToWBGeneID
 * from database.  Dispose of this with sangerGeneToWBGeneIDFree(). */

struct sangerGeneToWBGeneID *sangerGeneToWBGeneIDLoadAll(char *fileName);
/* Load all sangerGeneToWBGeneID from whitespace-separated file.
 * Dispose of this with sangerGeneToWBGeneIDFreeList(). */

struct sangerGeneToWBGeneID *sangerGeneToWBGeneIDLoadAllByChar(char *fileName, char chopper);
/* Load all sangerGeneToWBGeneID from chopper separated file.
 * Dispose of this with sangerGeneToWBGeneIDFreeList(). */

#define sangerGeneToWBGeneIDLoadAllByTab(a) sangerGeneToWBGeneIDLoadAllByChar(a, '\t');
/* Load all sangerGeneToWBGeneID from tab separated file.
 * Dispose of this with sangerGeneToWBGeneIDFreeList(). */

struct sangerGeneToWBGeneID *sangerGeneToWBGeneIDLoadByQuery(struct sqlConnection *conn, char *query);
/* Load all sangerGeneToWBGeneID from table that satisfy the query given.
 * Where query is of the form 'select * from example where something=something'
 * or 'select example.* from example, anotherTable where example.something =
 * anotherTable.something'.
 * Dispose of this with sangerGeneToWBGeneIDFreeList(). */

void sangerGeneToWBGeneIDSaveToDb(struct sqlConnection *conn, struct sangerGeneToWBGeneID *el, char *tableName, int updateSize);
/* Save sangerGeneToWBGeneID as a row to the table specified by tableName.
 * As blob fields may be arbitrary size updateSize specifies the approx size
 * of a string that would contain the entire query. Arrays of native types are
 * converted to comma separated strings and loaded as such, User defined types are
 * inserted as NULL. Strings are automatically escaped to allow insertion into the database. */

struct sangerGeneToWBGeneID *sangerGeneToWBGeneIDCommaIn(char **pS, struct sangerGeneToWBGeneID *ret);
/* Create a sangerGeneToWBGeneID out of a comma separated string.
 * This will fill in ret if non-null, otherwise will
 * return a new sangerGeneToWBGeneID */

void sangerGeneToWBGeneIDFree(struct sangerGeneToWBGeneID **pEl);
/* Free a single dynamically allocated sangerGeneToWBGeneID such as created
 * with sangerGeneToWBGeneIDLoad(). */

void sangerGeneToWBGeneIDFreeList(struct sangerGeneToWBGeneID **pList);
/* Free a list of dynamically allocated sangerGeneToWBGeneID's */

void sangerGeneToWBGeneIDOutput(struct sangerGeneToWBGeneID *el, FILE *f, char sep, char lastSep);
/* Print out sangerGeneToWBGeneID.  Separate fields with sep. Follow last field with lastSep. */

#define sangerGeneToWBGeneIDTabOut(el,f) sangerGeneToWBGeneIDOutput(el,f,'\t','\n');
/* Print out sangerGeneToWBGeneID as a line in a tab-separated file. */

#define sangerGeneToWBGeneIDCommaOut(el,f) sangerGeneToWBGeneIDOutput(el,f,',',',');
/* Print out sangerGeneToWBGeneID as a comma separated list including final comma. */

/* -------------------------------- End autoSql Generated Code -------------------------------- */

#endif /* SANGERGENETOWBGENEID_H */


text:
import React from 'react';
import TimeAgo from 'react-timeago';
import zhStrings from 'react-timeago/lib/language-strings/zh-CN'
import buildFormatter from 'react-timeago/lib/formatters/buildFormatter'

import './build_meta.less';

export default
class BuildMeta extends React.Component {
  render() {
    const { build } = this.props;
    const formatter = buildFormatter(zhStrings);

    var eventDesc;
    var eventDest;

    switch(build.event) {
    case 'push':
      eventDesc = '推送到';
      eventDest = build.branch;
      break;
    case 'pull_request':
      eventDesc = '更新了 Pull Request';
      eventDest = (build.refspec != '') ?
            build.refspec : build.branch;
      break;
    case 'tag':
      eventDesc = '推送了标签';
      eventDest = build.ref;
      break;
    case 'deployment':
      eventDesc = '部署至';
      eventDest = build.deploy_to;
      break;
    }

    return (

        {build.author}
        {eventDesc}
        {eventDest}
        <TimeAgo date={(build.created_at || build.enqueued_at) * 1000} formatter={formatter} />

    );
  }
}


text:
NS_RURU_BEGIN

class LoggedEventService : public EventService
{
	friend ServiceLocator;

	private:
		EventService m_Base;
		std::ostream& m_Output;

	public:
		LoggedEventService(std::ostream& output)
			: m_Base(), m_Output(output) { }

		virtual void processEvents()
		{
			if (m_Events.empty()) return;

			m_Output << "Processing Event Batch Begin" << std::endl;

			while(! m_Events.empty())
			{
				auto eventAndType = m_Events.front();

				EventDelegateList list = m_EventDelegates[eventAndType.first];
				Event* event = eventAndType.second;
				m_Output << event->toString() << std::endl;

				for (auto eventDelegate : list)
				{
					eventDelegate.second(event);
				}

				delete event;
				m_Events.pop_front();
			}

			m_Output << "Processing Event Batch End" << std::endl;
		}
};

NS_RURU_END
#endif


text:
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIButton *iam;
@property (weak, nonatomic) IBOutlet UIButton *school;
@property (weak, nonatomic) IBOutlet UIButton *cv;
@property (weak, nonatomic) IBOutlet UIButton *bulb;
@property (weak, nonatomic) IBOutlet UIButton *heart;
@property (weak, nonatomic) IBOutlet UIButton *award;
@end


text:
namespace Microsoft.AspNet.Razor.Generator.Compiler
{
    public class ExpressionBlockChunk : ChunkBlock
    {
    }
}


text:
/* -*- c-file-style:"stroustrup"; indent-tabs-mode: nil -*- */
#if !defined INC_PUBNUB_PUBSUBAPI
#define INC_PUBNUB_PUBSUBAPI

#include "pubnub_api_types.h"
#include "lib/pb_deprecated.h"

#include <stdbool.h>
#include <stdint.h>

/** @file pubnub_pubsubapi.h
    This is the "Pub/Sub" API of the Pubnub client library.

    It is the minimal, publish & subscribe only API.
*/

/** Initialize a given pubnub context @p p to the @p publish_key and @p
    subscribe_key. You can customize other parameters of the context by
    the configuration function calls below.

    @note The @p publish_key and @p subscribe key are expected to be
    valid (ASCIIZ string) pointers throughout the use of context @p p,
    that is, until either you call pubnub_done(), or the otherwise
    stop using it (like when the whole software/ firmware stops
    working). So, the contents of these keys are not copied to the
    Pubnub context @p p.

    @pre Call this after TCP initialization.
    @pre @p subscribe_key can't be NULL
    @param p The Context to initialize (use pubnub_alloc() to
    obtain it)
    @param publish_key The string of the key to use when publishing
    messages (if you don't want to publish, you can pass NULL)
    @param subscribe_key The string of the key to use when subscribing
    to messages
    @return Returns the @p p context
*/
pubnub_t* pubnub_init(pubnub_t* p, const char* publish_key, const char* subscribe_key);

/** Set the user identification of PubNub client context @p p to @p
    uuid. Pass NULL to unset.

    @deprecated this is provided as a workaround for existing users.
    Please use `pubnub_set_user_id` instead.

    @see pubnub_set_user_id
*/
PUBNUB_DEPRECATED enum pubnub_res pubnub_set_uuid(pubnub_t* p, const char* uuid);

/** Get the user identification of PubNub client context @p p.
    After pubnub_init(), it will return `NULL` until you change it
    to non-`NULL` via pubnub_set_uuid().

    @deprecated this is provided as a workaround for existing users.
    Please use `pubnub_user_id_get` instead.

    @see pubnub_user_id_get
*/
PUBNUB_DEPRECATED char const* pubnub_uuid_get(pubnub_t* p);

/** Set the user identification of PubNub client context @p p to @p
    uuid. Pass NULL to unset.

    @note The @p user_id is expected to be valid (ASCIIZ string) pointers
    throughout the use of context @p p, that is, until either you call
    pubnub_done() on @p p, or the otherwise stop using it (like when
    the whole software/ firmware stops working). So, the contents of
    the @p user_id string is not copied to the Pubnub context @p p.
*/
enum pubnub_res pubnub_set_user_id(pubnub_t* p, const char* user_id);

/** Get the user identification of PubNub client context @p p.
    After pubnub_init(), it will return `NULL` until you change it
    to non-`NULL` via pubnub_set_user_id().
*/
char const* pubnub_user_id_get(pubnub_t* p);

/** Set the authentication information of PubNub client context @p
    p. Pass NULL to unset.

    @note The @p auth is expected to be valid (ASCIIZ string) pointers
    throughout the use of context @p p, that is, until either you call
    pubnub_done() on @p p, or the otherwise stop using it (like when
    the whole software/ firmware stops working). So, the contents of
    the auth string is not copied to the Pubnub context @p p.  */
void pubnub_set_auth(pubnub_t* p, const char* auth);

/** Returns the current authentication information for the
    context @p p.
    After pubnub_init(), it will return `NULL` until you change it
    to non-`NULL` via pubnub_set_auth().
*/
char const* pubnub_auth_get(pubnub_t* p);

/** Cancels an ongoing API transaction. This will, once it is done,
    close the (TCP/IP) connection to Pubnub (if it was open).  The
    outcome of the transaction in progress, if any, will be
    #PNR_CANCELLED.

    In the sync interface, it's possible that this cancellation will
    finish during the execution of a call to this function. But,
    there's no guarantee, so check the result.

    In the callback interface, it's not likely cancellation will be
    done, but, still, it's possible. So, if this matters to you, it's
    always best to check the result.

    @retval #PN_CANCEL_STARTED cancel started, await the outcome
    @retval #PN_CANCEL_FINISHED cancelled, no need to await
*/

/** Set the auth token information of PubNub client context @p
    p. Pass NULL to unset.

    @note The @p token is expected to be valid (ASCIIZ string) pointers
    throughout the use of context @p pb, that is, until either you call
    pubnub_done() on @p pb, or the otherwise stop using it (like when
    the whole software/ firmware stops working). So, the contents of
    the auth string is not copied to the Pubnub context @p pb.  */
void pubnub_set_auth_token(pubnub_t* pb, const char* token);

/** Returns the current auth token information for the
    context @p pb.
    After pubnub_init(), it will return `NULL` until you change it
    to non-`NULL` via pubnub_set_auth_token().
*/
char const* pubnub_auth_token_get(pubnub_t* pb);

enum pubnub_cancel_res pubnub_cancel(pubnub_t* p);

/** Publish the @p message (in JSON format) on @p p channel, using the
    @p p context. This actually means "initiate a publish
    transaction".

    You can't publish if a transaction is in progress on @p p context.

    If transaction is not successful (@c PNR_PUBLISH_FAILED), you can
    get the string describing the reason for failure by calling
    pubnub_last_publish_result().

    Keep in mind that the time token from the publish operation
    response is _not_ parsed by the library, just relayed to the
    user. Only time-tokens from the subscribe operation are parsed
    by the library.

    Also, for all error codes known at the time of this writing, the
    HTTP error will be set also, so the result of the Pubnub operation
    will not be @c PNR_OK (but you will still be able to get the
    result code and the description).

    @param p The pubnub context. Can't be NULL
    @param channel The string with the channel to publish to.
    @param message The message to publish, expected to be in JSON format

    @return #PNR_STARTED or #PNR_OK on success, an error otherwise
 */
enum pubnub_res pubnub_publish(pubnub_t* p, const char* channel, const char* message);

/** Sends a signal @p message (in JSON format) on @p channel, using @p pb context.
    This actually means "initiate a signal transaction".

    It has similar behaviour as publish, but unlike publish
    transaction, signal erases previous signal message on server(, on
    a given channel,) and you can not send any metadata.

    There can be only up to one signal message at the time. If it's
    not renewed by another signal, signal message disappears from
    channel history after certain amount of time.

    You can't (send a) 'signal' if a transaction is in progress on @p
    p context.

    If transaction is not successful (@c PNR_PUBLISH_FAILED), you can
    get the string describing the reason for failure by calling
    pubnub_last_publish_result().

    Keep in mind that the time token from the signal operation
    response is _not_ parsed by the library, just relayed to the
    user. Only time-tokens from the subscribe operation are parsed
    by the library.

    Also, for all error codes known at the time of this writing, the
    HTTP error will be set also, so the result of the Pubnub operation
    will not be @c PNR_OK (but you will still be able to get the
    result code and the description).

    @param pb The pubnub context. Can't be NULL
    @param channel The string with the channel to signal to.
    @param message The signal message to send, expected to be in JSON format

    @return #PNR_STARTED or #PNR_OK on success, an error otherwise
 */
enum pubnub_res pubnub_signal(pubnub_t* pb,
                              const char* channel,
                              const char* message);

/** Returns a pointer to an arrived message or other element of the
    response to an operation/transaction. Message(s) arrive on finish
    of a subscribe operation or history operation, while for some
    other operations this will give access to the whole response,
    or the next element of the response. That is documented in
    the function that starts the operation.

    Subsequent call to this function will return the next message (if
    any). All messages are from the channel(s) the last operation was
    for.

    @note Context doesn't keep track of the channel(s) you subscribed
    to. This is a memory saving design decision, as most users won't
    change the channel(s) they subscribe too.

    @param p The Pubnub context. Can't be NULL.

    @return Pointer to the message, NULL on error
    @see pubnub_subscribe
 */
char const* pubnub_get(pubnub_t* p);

/** Returns a pointer to an fetched subscribe operation/transaction's
    next channel.  Each transaction may hold a list of channels, and
    this functions provides a way to read them.  Subsequent call to
    this function will return the next channel (if any).

    @note You don't have to read all (or any) of the channels before
    you start a new transaction.

    @param pb The Pubnub context. Can't be NULL.

    @return Pointer to the channel, NULL on error
    @see pubnub_subscribe
    @see pubnub_get
 */
char const* pubnub_get_channel(pubnub_t* pb);

/** Subscribe to @p channel and/or @p channel_group. This actually
    means "initiate a subscribe operation/transaction". The outcome
    will be retrieved by the "notification" API, which is different
    for different platforms. There are two APIs that are widely
    available - "sync" and "callback".

    Messages published on @p channel and/or @p channel_group since the
    last subscribe transaction will be fetched, unless this is the
    first subscribe on this context after initialization or a serious
    error. In that "first" case, this will just retrieve the current
    time token, and that event is called "connect" in many pubnub
    SDKs, but in C-core we don't treat it any different. For that
    "first" case, you will receive a notification that subscribe has
    finished OK, but there will be no messages in the reply.

    The @p channel and @p channel_group strings may contain multiple
    comma-separated channel (channel group) names, so only one call is
    needed to fetch messages from multiple channels (channel groups).

    If @p channel is NULL, then @p channel_group cannot be NULL and
    you will subscribe only to the channel group(s). It goes both
    ways: if @p channel_group is NULL, then @p channel cannot be NULL
    and you will subscribe only to the channel(s).

    When auto heartbeat is enabled at compile time both @p channel
    and @p channel_group could be passed as NULL which suggests default
    behaviour(unless it is uuid's very first subscription) in which case
    transaction uses channel and channel groups that are already subscribed.

    You can't subscribe if a transaction is in progress on the context.

    Also, you can't subscribe if there are unread messages in the
    context (you read messages with pubnub_get()).

    @param p The pubnub context. Can't be NULL
    @param channel The string with the channel name (or comma-delimited list
    of channel names) to subscribe to.
    @param channel_group The string with the channel group name (or
    comma-delimited list of channel group names) to subscribe to.

    @return #PNR_STARTED or #PNR_OK on success, an error otherwise

    @see pubnub_get
 */
enum pubnub_res pubnub_subscribe(pubnub_t*   p,
                                 const char* channel,
                                 const char* channel_group);

/** Returns the result of the last transaction in the @p p context.
    This _may_ block if using blocking I/O. It will _not_ block if using
    non-blocking I/O.

    @see pubnub_set_blocking_io
    @see pubnub_set_non_blocking_io
*/
enum pubnub_res pubnub_last_result(pubnub_t* p);

/** Returns the HTTP reply code of the last transaction in the @p p
 * context. */
int pubnub_last_http_code(pubnub_t* p);

/** Returns the string of the result of the last `publish` transaction,
    as returned from Pubnub. If the last transaction is not a publish,
    or there is some other error, it returns NULL. If the Publish
    was successfull, it will return "Sent", otherwise a description
    of the error.
 */
char const* pubnub_last_publish_result(pubnub_t* p);

/** Returns the string of the last received time token on the
    @c p context. After pubnub_init() this should be "0".
    @param p Pubnub context to get the last received time token from
    @return A read only string of the last received time token
 */
char const* pubnub_last_time_token(pubnub_t* p);

/** Gets the origin to be used for the context @p p.
    If setting of the origin is not enabled, this will return
    the default origin.
    @param p Pubnub context to get the origin from
    @return A read only string of origin used for context @p p
 */
char const* pubnub_get_origin(pubnub_t* p);

/** Sets the origin to be used for the context @p p.  If setting of
    the origin is not enabled, this will fail.  It may also fail if it
    detects an invalid origin, but NULL is not an invalid origin - it
    resets the origin to default.

    @param p Pubnub context to set the origin for
    @param origin The origin to use for context @p p. If NULL,
                  the default origin will be set
    @retval 0 origin set,
    @retval +1 origin set will be applied with new connection,
    @retval -1 setting origin not enabled
*/
int pubnub_origin_set(pubnub_t* p, char const* origin);

/** Sets the port to be used for the context @p p.  If setting of
    the port is not enabled, this will fail.  It may also fail if it
    detects an invalid port.

    @param p Pubnub context to set the port for
    @param origin The port to use for context @p p.
    @retval 0 port set,
    @retval +1 port set will be applied with new connection,
    @retval -1 setting port not enabled
*/
int pubnub_port_set(pubnub_t* p, uint16_t port);

/** Enables the use of HTTP Keep-Alive ("persistent connections")
    on the context @p p.

    This is the default, but, you can turn it off with
    pubnub_dont_use_http_keep_alive().

    If HTTP Keep-Alive is active, connection to Pubnub will not be
    closed after the transaction ends. This will avoid connecting
    again on next transaction on the same context, making the
    transaction finish (usually much) quicker.

    But, there's a trade-off here, here are the drawbacks:

    * pubnub_free() is more likely to not complete for contexts that
      are in "keep alive" state.
    * Socket in the keep-alive state will be closed by the
      Pubnub network (server) after some period of inactivity.
      While we should be able to handle that, it's possible
      that some race condition causes a transaction to fail
      in this case.
    * Socket in the keep-alive state is "allocated", consuming
      some resources. If you have a constrained number of
      sockets, relative to Pubnub contexts, this may be an
      issue.
 */
void pubnub_use_http_keep_alive(pubnub_t* p);

/** Disables the use of HTTP Keep-Alive ("persistent connections")
    on the context @p p.

    The default is to _use_ the HTTP Keep-Alive, but, you might
    want to turn that off - see pubnub_use_http_keep_alive().
*/
void pubnub_dont_use_http_keep_alive(pubnub_t* p);

#endif /* !defined INC_PUBNUB_PUBSUBAPI */


text:
require 'rails_helper'

RSpec.describe "game/new.html.haml", type: :view do
  pending "add some examples to (or delete) #{__FILE__}"
end


text:
/**
 * Loads all router files that will be used in the application. This way,
 * we only need to require this one file in our app.js
 */
var router = require('express').Router();

// Routes are seperated into modules
router.use('/wells', require('./wells'));

module.exports = router;


text:
package com.b2international.snowowl.datastore.cdo;

import org.eclipse.emf.cdo.common.CDOCommonRepository.State;
import org.eclipse.emf.cdo.common.CDOCommonRepository.Type;
import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent.ChangeKind;
import org.eclipse.emf.cdo.common.CDOCommonSession;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
import org.eclipse.emf.cdo.session.remote.CDORemoteSessionMessage;
import org.eclipse.emf.cdo.spi.common.CDOAuthenticationResult;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranch;
import org.eclipse.emf.cdo.spi.server.ISessionProtocol;
import org.eclipse.emf.cdo.spi.server.InternalSession;

/**
 * An {@link ISessionProtocol} implementation for impersonating users on the server.
 *
 */
public final class ImpersonatingSessionProtocol implements ISessionProtocol {

	private static final byte[] EMPTY_TOKEN = new byte[0];

	private final String userID;

	public ImpersonatingSessionProtocol(final String userID) {
		this.userID = userID;
	}

	@Override
	public CDOCommonSession getSession() {
		throw new UnsupportedOperationException("Not implemented.");
	}

	@Override
	public void sendRepositoryTypeNotification(final Type oldType, final Type newType) throws Exception {
		throw new UnsupportedOperationException("Not implemented.");
	}

	@Override
	public void sendRepositoryStateNotification(final State oldState, final State newState, final CDOID rootResourceID) throws Exception {
		throw new UnsupportedOperationException("Not implemented.");
	}

	@Override
	@Deprecated
	public void sendRepositoryStateNotification(final State oldState, final State newState) throws Exception {
		throw new UnsupportedOperationException("Not implemented.");
	}

	@Override
	public void sendRemoteSessionNotification(final InternalSession sender, final byte opcode) throws Exception {
		throw new UnsupportedOperationException("Not implemented.");
	}

	@Override
	public void sendRemoteMessageNotification(final InternalSession sender, final CDORemoteSessionMessage message) throws Exception {
		throw new UnsupportedOperationException("Not implemented.");
	}

	@Override
	public void sendLockNotification(final CDOLockChangeInfo lockChangeInfo) throws Exception {
		throw new UnsupportedOperationException("Not implemented.");
	}

	@Override
	public void sendCommitNotification(final CDOCommitInfo commitInfo) throws Exception {
		throw new UnsupportedOperationException("Not implemented.");
	}

	@Override
	public void sendBranchNotification(final InternalCDOBranch branch) throws Exception {
		throw new UnsupportedOperationException("Not implemented.");
	}

	@Override
	public void sendBranchNotification(InternalCDOBranch branch, ChangeKind changeKind) throws Exception {
		throw new UnsupportedOperationException("Not implemented.");
	}

	@Override
	public CDOAuthenticationResult sendAuthenticationChallenge(final byte[] randomToken) throws Exception {
		return new CDOAuthenticationResult(userID, EMPTY_TOKEN);
	}

	/**
	 * Returns with the impersonating user's unique ID
	 * @return the user ID.
	 */
	public String getUserID() {
		return userID;
	}
}


text:
<?php
/**
 * Created by PhpStorm.
 * @author Tareq Mahmood <tareqtms@yahoo.com>
 * Created at: 9/10/16 10:46 AM UTC+06:00
 */

namespace PHPShopify;

class CustomerSavedSearchTest extends TestSimpleResource
{
    /**
     * @inheritDoc
     */
    public $postArray = array(
        "name" => "Spent more than $50 and after 2015",
        "query" => "total_spent:>50 order_date:>=2015-01-01",
    );

    /**
     * @inheritDoc
     */
    public $putArray = array(
        "name" => "This Name Has Been Changed",
    );
}


text:
/**
 * 无效链接
 * Created by Captain on 3/16/17.
 */
var notFoundController = module.exports = function () {
    return ['', function () {
    }]
};


text:
using UnityEngine;

namespace BehaviorDesigner.Runtime
{
    // Wrapper for the Behavior class
    [AddComponentMenu("Behavior Designer/Behavior Tree")]
    public class BehaviorTree : Behavior
    {
        // intentionally left blank
    }
}


text:
package dataMapper.diagram.navigator;

import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.IPropertySourceProvider;

/**
 * @generated
 */
public class DataMapperDomainNavigatorItem extends PlatformObject {

	/**
	 * @generated
	 */
	static {
		final Class[] supportedTypes = new Class[]{EObject.class,
				IPropertySource.class};
		Platform.getAdapterManager().registerAdapters(new IAdapterFactory() {

			public Object getAdapter(Object adaptableObject, Class adapterType) {
				if (adaptableObject instanceof dataMapper.diagram.navigator.DataMapperDomainNavigatorItem) {
					dataMapper.diagram.navigator.DataMapperDomainNavigatorItem domainNavigatorItem = (dataMapper.diagram.navigator.DataMapperDomainNavigatorItem) adaptableObject;
					EObject eObject = domainNavigatorItem.getEObject();
					if (adapterType == EObject.class) {
						return eObject;
					}
					if (adapterType == IPropertySource.class) {
						return domainNavigatorItem.getPropertySourceProvider()
								.getPropertySource(eObject);
					}
				}

				return null;
			}

			public Class[] getAdapterList() {
				return supportedTypes;
			}
		}, dataMapper.diagram.navigator.DataMapperDomainNavigatorItem.class);
	}

	/**
	 * @generated
	 */
	private Object myParent;

	/**
	 * @generated
	 */
	private EObject myEObject;

	/**
	 * @generated
	 */
	private IPropertySourceProvider myPropertySourceProvider;

	/**
	 * @generated
	 */
	public DataMapperDomainNavigatorItem(EObject eObject, Object parent,
			IPropertySourceProvider propertySourceProvider) {
		myParent = parent;
		myEObject = eObject;
		myPropertySourceProvider = propertySourceProvider;
	}

	/**
	 * @generated
	 */
	public Object getParent() {
		return myParent;
	}

	/**
	 * @generated
	 */
	public EObject getEObject() {
		return myEObject;
	}

	/**
	 * @generated
	 */
	public IPropertySourceProvider getPropertySourceProvider() {
		return myPropertySourceProvider;
	}

	/**
	 * @generated
	 */
	public boolean equals(Object obj) {
		if (obj instanceof dataMapper.diagram.navigator.DataMapperDomainNavigatorItem) {
			return EcoreUtil
					.getURI(getEObject())
					.equals(EcoreUtil
							.getURI(((dataMapper.diagram.navigator.DataMapperDomainNavigatorItem) obj)
									.getEObject()));
		}
		return super.equals(obj);
	}

	/**
	 * @generated
	 */
	public int hashCode() {
		return EcoreUtil.getURI(getEObject()).hashCode();
	}

}


text:
bash_it_version = version_string_for('bash_it')

git "#{Chef::Config[:file_cache_path]}/bash_it" do
  repository node['bash_it']['repository']
  revision bash_it_version
  destination "#{Chef::Config[:file_cache_path]}/bash_it"
  action :sync
end

directory node['bash_it']['dir'] do
  owner node['current_user']
  mode "0777"
end

execute "Copying bash-it's .git to #{node['bash_it']['dir']}" do
  command "rsync -axSH #{Chef::Config[:file_cache_path]}/bash_it/ #{node['bash_it']['dir']}"
  user node['current_user']
end

template node['bash_it']['bashrc_path'] do
  source "bash_it/bashrc.erb"
  cookbook 'sprout-osx-base'
  owner node['current_user']
  mode "0777"
end

node['bash_it']['enabled_plugins'].each do |feature_type, features|
  features.each do |feature_name|
    sprout_osx_base_bash_it_enable_feature "#{feature_type}/#{feature_name}"
  end
end

node['bash_it']['custom_plugins'].each do |cookbook_name, custom_plugins|
  custom_plugins.each do |custom_plugin|
    sprout_osx_base_bash_it_custom_plugin custom_plugin do
      cookbook cookbook_name
    end
  end
end


text:
package lolstormSDK.models;

import org.parceler.Parcel;

import java.util.ArrayList;

@Parcel
public class Champion {

    ArrayList<ChampionSpell> spells;
    String name;
    String title;
    long id;

    public Champion() {
    }

    public Champion(String name, long id) {
        this.name = name;
        this.id = id;
    }

    public ArrayList<ChampionSpell> getSpells() {
        return spells;
    }

    public String getName() {
        return name;
    }

    public String getTitle() {
        return title;
    }

    public long getId() {
        return id;
    }

}


text:
NS_ASSUME_NONNULL_BEGIN

@interface BNRItem (CoreDataProperties)

@property (nullable, nonatomic, retain) NSDate *dateCreated;
@property (nullable, nonatomic, retain) NSString *itemKey;
@property (nullable, nonatomic, retain) NSString *itemName;
@property (nullable, nonatomic, retain) NSString *serialNumber;

//@property (nullable, nonatomic, retain) NSNumber *orderingValue;
@property (nonatomic) double orderingValue;

//@property (nullable, nonatomic, retain) id thumbnail;
@property (nonatomic,strong)UIImage *thumbnail;

//@property (nullable, nonatomic, retain) NSNumber *valueInDollars;
@property (nonatomic) int valueInDollars;

@property (nullable, nonatomic, retain) NSManagedObject *assetType;

@end

NS_ASSUME_NONNULL_END


text:
#ifndef PATTERN_H
#define PATTERN_H

#include <QtCore/QVector>
#include <QWidget>
#include <QDialog>
#include <QtCore/QThread>
#include <QPixmap>
#include <QStaticText>

#include "Note.h"
#include "Track.h"

class QAction;
class QProgressBar;
class QPushButton;

class InstrumentTrack;
class SampleBuffer;

class EXPORT Pattern : public TrackContentObject
{
	Q_OBJECT
public:
	enum PatternTypes
	{
		BeatPattern,
		MelodyPattern
	} ;

	Pattern( InstrumentTrack* instrumentTrack );
	Pattern( const Pattern& other );
	virtual ~Pattern();

	void init();

	void updateLength();

	// note management
	Note * addNote( const Note & _new_note, const bool _quant_pos = true );

	void removeNote( Note * _note_to_del );

	Note * noteAtStep( int _step );

	void rearrangeAllNotes();
	void clearNotes();

	inline const NoteVector & notes() const
	{
		return m_notes;
	}

	Note * addStepNote( int step );
	void setStep( int step, bool enabled );

	// pattern-type stuff
	inline PatternTypes type() const
	{
		return m_patternType;
	}

	// next/previous track based on position in the containing track
	Pattern * previousPattern() const;
	Pattern * nextPattern() const;

	// settings-management
	virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
	virtual void loadSettings( const QDomElement & _this );
	inline virtual QString nodeName() const
	{
		return "pattern";
	}

	inline InstrumentTrack * instrumentTrack() const
	{
		return m_instrumentTrack;
	}

	bool empty();

	virtual TrackContentObjectView * createView( TrackView * _tv );

	using Model::dataChanged;

protected:
	void updateBBTrack();

protected slots:
	void addSteps();
	void cloneSteps();
	void removeSteps();
	void clear();
	void changeTimeSignature();

private:
	MidiTime beatPatternLength() const;

	void setType( PatternTypes _new_pattern_type );
	void checkType();

	void resizeToFirstTrack();

	InstrumentTrack * m_instrumentTrack;

	PatternTypes m_patternType;

	// data-stuff
	NoteVector m_notes;
	int m_steps;

	Pattern * adjacentPatternByOffset(int offset) const;

	friend class PatternView;
	friend class BBTrackContainerView;

signals:
	void destroyedPattern( Pattern* );

} ;

class PatternView : public TrackContentObjectView
{
	Q_OBJECT

public:
	PatternView( Pattern* pattern, TrackView* parent );
	virtual ~PatternView();

public slots:
	virtual void update();

protected slots:
	void openInPianoRoll();

	void resetName();
	void changeName();

protected:
	virtual void constructContextMenu( QMenu * );
	virtual void mousePressEvent( QMouseEvent * _me );
	virtual void mouseDoubleClickEvent( QMouseEvent * _me );
	virtual void paintEvent( QPaintEvent * pe );
	virtual void wheelEvent( QWheelEvent * _we );

private:
	static QPixmap * s_stepBtnOn0;
	static QPixmap * s_stepBtnOn200;
	static QPixmap * s_stepBtnOff;
	static QPixmap * s_stepBtnOffLight;

	Pattern* m_pat;
	QPixmap m_paintPixmap;

	QStaticText m_staticTextName;
} ;

#endif


text:
<?php
/**
 * Produces a Table instance from a model.
 *
 * @package Garp
 * @author David Spreekmeester <david@grrr.nl>
 */
class Garp_Spawn_MySql_Table_Factory {
    /**
     * @var Garp_Spawn_Model_Abstract
     */
    protected $_model;

    /**
     * @param Garp_Spawn_Model_Abstract $model
     * @return void
     */
    public function __construct(Garp_Spawn_Model_Abstract $model) {
        $this->setModel($model);
    }

    /**
     * Produces a Garp_Spawn_MySql_Table_Abstract instance, based on the spawn configuration.
     *
     * @return void
     */
    public function produceConfigTable() {
        $model = $this->getModel();
        $createStatement = $this->_renderCreateFromConfig();
        return $this->_produceTable($createStatement);
    }

    /**
     * Produces a Garp_Spawn_MySql_Table_Abstract instance, based on the live database.
     *
     * @return void
     */
    public function produceLiveTable() {
        $model = $this->getModel();
        $createStatement = $this->_renderCreateFromLive();
        return $this->_produceTable($createStatement);
    }

    /**
     * @return Garp_Spawn_Model_Abstract
     */
    public function getModel() {
        return $this->_model;
    }

    /**
     * @param Garp_Spawn_Model_Abstract $model
     * @return void
     */
    public function setModel($model) {
        $this->_model = $model;

        return $this;
    }

    protected function _produceTable($createStatement) {
        $model      = $this->getModel();
        $tableClass = $this->_getTableClass($model);
        return new $tableClass($createStatement, $model);
    }

    protected function _renderCreateFromConfig() {
        $model      = $this->getModel();
        $tableName  = $this->_getTableName();
        $fields     = $this->_getUnilingualFields();
        return $this->_renderCreateAbstract(
            $tableName,
            $fields,
            $model->relations->getRelations(),
            $model->unique
        );
    }

    protected function _getUnilingualFields() {
        $model = $this->getModel();

        $fields = $model->isMultilingual()
            ? $fields = $model->fields->getFields('multilingual', false)
            : $model->fields->getFields();

        return $fields;
    }

    protected function _renderCreateFromLive() {
        $model      = $this->getModel();
        $tableName  = $this->_getTableName($model);
        $adapter    = Zend_Db_Table::getDefaultAdapter();
        $liveTable  = $adapter->fetchAll("SHOW CREATE TABLE `{$tableName}`;");
        $statement  = $liveTable[0]['Create Table'] . ';';

        return $statement;
    }

    protected function _getTableName() {
        $model = $this->getModel();

        if ($model->table) {
            return $model->table;
        }

        switch (get_class($model)) {
        case 'Garp_Spawn_Model_Binding':
            return '_' . strtolower($model->id);
        break;
        default:
            return strtolower($model->id);
        }
    }

    /**
     * @return  String  Class of the table type that is to be returned
     */
    protected function _getTableClass() {
        $model = $this->getModel();

        switch (get_class($model)) {
        case 'Garp_Spawn_Model_Binding':
            return 'Garp_Spawn_MySql_Table_Binding';
        break;
        case 'Garp_Spawn_Model_I18n':
            return 'Garp_Spawn_MySql_Table_I18n';
        break;
        case 'Garp_Spawn_Model_Base':
            return 'Garp_Spawn_MySql_Table_Base';
        break;
        default:
            throw new Exception('I do not know which table type should be returned for ' . get_class($model));
        }
    }

    /**
     * Abstract method to render a CREATE TABLE statement.
     *
     * @param string $tableName The table name, usually the Model ID.
     * @param array $fields     Numeric array of Garp_Spawn_Field objects.
     * @param array $relations  Associative array, where the key is the name
     *                          of the relation, and the value a Garp_Spawn_Relation object,
     *                          or at least an object with properties column, model, type.
     * @param array $unique     (optional) List of column names to be combined into a unique id.
     *                          This is model-wide and supersedes the 'unique' property per field.
     * @return string
     */
    protected function _renderCreateAbstract($tableName, array $fields, array $relations, $unique) {
        $lines      = array();

        foreach ($fields as $field) {
            $lines[] = Garp_Spawn_MySql_Column::renderFieldSql($field);
        }

        $primKeys = array();
        $uniqueKeys = array();

        if ($unique) {
            // This checks wether a single one-dimensional array is given: a collection of
            // columns combined into a unique key, or wether an array of arrays is given, meaning
            // multiple collections of columns combining into multiple unique keys per table.
            $isArrayOfArrays = count(array_filter($unique, 'is_array')) === count($unique);
            $unique = !$isArrayOfArrays ? array($unique) : $unique;
            $uniqueKeys = array_merge($uniqueKeys, $unique);
        }

        foreach ($fields as $field) {
            if ($field->primary)
                $primKeys[] = $field->name;
            if ($field->unique)
                $uniqueKeys[] = $field->name;
        }
        if ($primKeys) {
            $lines[] = Garp_Spawn_MySql_PrimaryKey::renderSqlDefinition($primKeys);
        }
        foreach ($uniqueKeys as $fieldName) {
            $lines[] = Garp_Spawn_MySql_UniqueKey::renderSqlDefinition($fieldName);
        }

        foreach ($relations as $rel) {
            if (($rel->type === 'hasOne' || $rel->type === 'belongsTo') && !$rel->multilingual) {
                $lines[] = Garp_Spawn_MySql_IndexKey::renderSqlDefinition($rel->column);
            }
        }

        //  set indices that were configured in the Spawn model config
        foreach ($fields as $field) {
            if ($field->index) {
                $lines[] = Garp_Spawn_MySql_IndexKey::renderSqlDefinition($field->name);
            }
        }

        foreach ($relations as $relName => $rel) {
            if (($rel->type === 'hasOne' || $rel->type === 'belongsTo') && !$rel->multilingual) {
                $fkName = Garp_Spawn_MySql_ForeignKey::generateForeignKeyName($tableName, $relName);
                $lines[] = Garp_Spawn_MySql_ForeignKey::renderSqlDefinition(
                    $fkName, $rel->column, $rel->model, $rel->type
                );
            }
        }

        $out = "CREATE TABLE `{$tableName}` (\n";
        $out.= implode(",\n", $lines);
        $out.= "\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;";

        return $out;
    }

}


text:
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#include "config.h"
#include <stdlib.h>
#include <libcouchstore/couch_db.h>

LIBCOUCHSTORE_API
const char *couchstore_strerror(couchstore_error_t errcode)
{
    switch (errcode) {
    case COUCHSTORE_SUCCESS:
        return "success";
    case COUCHSTORE_ERROR_OPEN_FILE:
        return "error opening file";
    case COUCHSTORE_ERROR_CORRUPT:
        return "malformed data in file";
    case COUCHSTORE_ERROR_ALLOC_FAIL:
        return "failed to allocate buffer";
    case COUCHSTORE_ERROR_READ:
        return "error reading file";
    case COUCHSTORE_ERROR_DOC_NOT_FOUND:
        return "document not found";
    case COUCHSTORE_ERROR_NO_HEADER:
        return "no header in non-empty file";
    case COUCHSTORE_ERROR_WRITE:
        return "error writing to file";
    case COUCHSTORE_ERROR_HEADER_VERSION:
        return "incorrect version in header";
    case COUCHSTORE_ERROR_CHECKSUM_FAIL:
        return "checksum fail";
    case COUCHSTORE_ERROR_INVALID_ARGUMENTS:
        return "invalid arguments";
    case COUCHSTORE_ERROR_NO_SUCH_FILE:
        return "no such file";
    case COUCHSTORE_ERROR_FILE_CLOSED:
        return "cannot do this operation when file is closed";
    case COUCHSTORE_ERROR_DB_NO_LONGER_VALID:
        return "this db handle could have its file reopened and must be closed";
    case COUCHSTORE_ERROR_FILE_CLOSE:
        return "error closing file";
    default:
        return NULL;
    }
}