text:
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
 * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any styles
 * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
 * file per style scope.
 *
 *= require_tree .
 *= require_self
 */

 html, body, header, nav, h1, a, ul, li,
 strong, main, section, img, div, h2, p,
 form, fieldset, label, input, textarea,
 button, article, footer, small {
     padding: 0;
     margin: 0;
     border: 0;
     text-align: inherit;
     vertical-align: inherit;
     background: transparent;
     box-sizing: border-box;
 }

 html, body {
   height: 100%;
 }

 h1 {
   font-size: 2em;
 }

#root {
  /*width: 940px;*/
  margin: auto;
}

body {
  background-color: #eee;
  color: #2C353C;
  font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
}

button:hover {
  cursor: pointer;
}

header {
  background-color: #1D2439;
}

header .subnav button {
  float: right;
  background: #134FE6;
  height: 50px;
  width: 50px;
  border-radius: 50%;
  color: white;
  padding: 20px;
  font-family: "Lora", Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 20px;
  margin: 0 0 10px 10px;
  padding: 3px 0 0 15px;
}

header .subnav button:hover,
.sidebar .newTerm:hover {
  color: #05ff56;
  cursor: pointer;
}

.header-inner {
  width: 940px;
  margin: auto;
  color: white;
  font-family: 'Special Elite', cursive;
  padding: 15px 0;
}

.header-inner h2 {
  font-size: 20px;
  margin-bottom: 15px;
}

main {
  width: 940px;
  margin: auto;
}

.group:after {
  content: "";
  clear: both;
  display: block;
}

.sidebar {
  width: 300px;
  float: right;
  background-color: #fff;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: 1px 1px 1px #aaa;
  position: relative;
}

.sidebar h2 {
  position: absolute;
  z-index: 2;
}

.sidebar h2 span{
  text-transform: uppercase;
  background-color: #EFFF00;
  font-weight: bold;
  line-height: 1;
}

.sidebar .newTerm {
  margin-top: 120px;
  background: #134FE6;
  width: 240px;
  height: 70px;
  color: white;
  padding: 20px 30px;
  font-family: "Lora", Georgia, Cambria, "Times New Roman", Times, serif;
  text-align: right;
  border-radius: 3px;
  border: 1px solid black;
  box-shadow: 0px 2px 0px #000;
  font-size: 20px;
}

.gif {
  border-radius: 50%;
  height: 130px;
  width: 130px;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
}

.gif.cat {
  background: center center no-repeat url("http://media1.giphy.com/media/uSXTDFYDWpelW/200_s.gif");
}

.gif.cat:hover {
  background: center center no-repeat url("http://media1.giphy.com/media/uSXTDFYDWpelW/200.gif");
}

.gif.bowie {
  background: center center no-repeat url("http://media3.giphy.com/media/yoJC2wQqhXpm97vdeg/200_s.gif");
}

.gif.bowie:hover {
  background: center center no-repeat url("http://media3.giphy.com/media/yoJC2wQqhXpm97vdeg/200.gif");
}

.gif.glider {
  background: center center no-repeat url("http://media1.giphy.com/media/E5OAxWp0bKVj2/200_s.gif");
}

.gif.glider:hover {
  background: center center no-repeat url("http://media1.giphy.com/media/E5OAxWp0bKVj2/200.gif");
}

.gif.kermit {
  background: center center no-repeat url("http://media0.giphy.com/media/DYH297XiCS2Ck/200_s.gif");
}

.gif.kermit:hover {
  background: center center no-repeat url("http://media0.giphy.com/media/DYH297XiCS2Ck/200.gif");
}

.gif.typing {
  background: center center no-repeat url("http://media0.giphy.com/media/JIX9t2j0ZTN9S/200_s.gif");
}

.gif.typing:hover {
  background: center center no-repeat url("http://media0.giphy.com/media/JIX9t2j0ZTN9S/200.gif");
}

.newTerm span {
  float: right;
}

.newTerm .plus {
  float: left;
}

header .subnav button.signIn {
  padding: 1px 0 0 16px;
  font-size: 24px;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(64, 64, 64, 0.9);
  padding-top: 30px;
  z-index: 4;
}

.modal h2 {
  text-transform: uppercase;
  color: white;
  font-weight: bold;
  margin: 0 auto 15px auto;
  text-align: center;
  text-shadow: 2px 2px 2px black;
}

.modal > section {

}

.modal .form-inner {
  padding: 30px;
  font-size: 18px;
  background: white;
  width: 800px;
  margin: 50px auto 0 auto;
  font-family: "Lora", Georgia, Cambria, "Times New Roman", Times, serif;
  border-radius: 3px;
  box-shadow: 0px 2px 2px black;
}

.modal .form-inner input {
  width: 100%;
  background: #aaa;
  height: 50px;
  padding-left: 20px;
  font-size: 18px;
  margin: 10px 0;
}

.modal .form-inner input[type="file"] {
  padding-top: 15px;
}

.modal button {
  color: white;
}

/*.modal form button, .modal form input[type="submit"] {
  background: yellow;
  color: black;
  width: 100%;
  text-align: center;
  font-size: 24px;
  padding: 30px;
  margin-top: 40px;
  border-radius: 3px;
  border: 1px solid black;
  box-shadow: 0px 2px 0px #000;
}*/

.modal form button:hover, .modal form input[type="submit"]:hover {
  background: #1D2439;
  color: white;
}

.modalContent {
  width: 800px;
  margin: auto;
}

.closeModal {
  background: #134FE6;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: white;
  border: 2px solid yellow;
  text-align: center;
  float: right;
}

.subnav .newTerm .fa {
  font-size: 28px;
}

.file-uploads .fa {
  font-size: 14px;
}

.file-uploads button:hover {
  cursor: pointer;
}

.logInStatus {
  float: right;
  font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  font-size: 12px;
}

.logInStatus button {
  background: #134FE6;
  font-weight: bold;
  padding: 5px;
  border-radius: 3px;
  margin-top: 5px;
  color: white;
  float: right
}

.logInStatus button:hover {
  color: #EFFF00;
}

.yt-video {
  margin-top: 10px;
}

.logo {
  margin-bottom: 20px;
  float:left;
}

.logo h1 {
  color: white;
}

.logo h1:hover {
  color: #134FE6;
}

.header-inner a {
  text-decoration: none;
}

.sign-in {
  width: 260px;
  float: left;
}

.sign-in .form-inner, .sign-up .form-inner {
  width: 260px;
  margin-top: 0px;
}

.sign-up{
  width: 260px;
  float: right;
}

.single-click-logins {
  width: 260px;
  float: left;
  margin-right: 10px;
}

.single-click-logins form {
  margin-bottom: 15px;
}

.single-click-logins > form > input[type="submit"] {
  margin: auto;
}

.single-click-logins > form > input[type="submit"]:hover {
  background: #1D2439;
}

.single-click-logins > div {
  margin-bottom: 15px;
}

.third-party-login, .single-click-logins input[type="submit"], .new-term-submit {
  text-align: center;
  font-size: 24px;
  margin:15px auto;
  padding: 10px;
  width: 260px;
  background: #134FE6;
  border-radius: 3px;
  box-shadow: 1px 1px 1px #000;
  color: #1D2439;
}

.third-party-login a button,  i.fa.fa-facebook-official, i.fa.fa-twitter  {
  font-size: 24px;
}

.third-party-login:hover {
  background-color: #1D2439;
  border-radius: 3px;
}

.third-party-login:hover a button,
.third-party-login:hover i.fa.fa-facebook-official,
.third-party-login:hover i.fa.fa-twitter,
.single-click-logins input[type="submit"] {
  color: white;
}

.facebook-like {
  float:right;
}

.opinion button {
  width: 70px;
  height: 45px;
  border: 1px solid black;
  box-shadow: 0px 1px #000;
  text-align: center;
  font-size: 14px;
  font-weight: bold;

}

.opinion button .fa {
  font-size: 14px;
}

.opinion button:hover {
  background: #05ff56;
  cursor: pointer;
}

.opinion button.dislike {
  border-radius: 50% 0 0 50% / 20px 0 0 20px;
}

.opinion button.like {
  border-radius: 0 50% 50% 0 / 0 20px 20px 0;
}

.errors {
  position: absolute;
  background: white;
}

.error {
  color: red;
}

.logo {
  height: 50px;
  width: 145px;
  overflow: hidden;
  background: no-repeat url("https://s3.amazonaws.com/urbane-dictionary-production/terms/logo.png") 0px 0px;
}

.logo:hover {
  background-position: 0px -50px;
}

.search-results-list {
  position: absolute;
  z-index: 1;
  background: white;
  box-shadow: 1px 1px 1px #aaa;
}

.search-results-list ul {
  list-style: none;
  width: 750px;
}

.search-results-list li {
  font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  color: #1769AC;
  padding: 5px 15px;
  font-weight: normal;
  list-style: none;
  width: 750px;

}

.search-results-list li:hover {
  font-weight: bold;
  background: #05ff56;
}

.alphabetMenu {
  display: none;
  position: absolute;
  width: 300px;
  background: white;
  border: solid 1px black;
  box-shadow: 0px 2px black;
  border-radius: 3px;
  top: 40px;
  left: 185px;
}

.alphabetMenu ul {
  list-style: none;
}

.alphabetMenu li {
  float: left;
  z-index: 1;
  border-radius: 50%;
  background: #aaa;
  color: #134FE6;
  width: 40px;
  height: 40px;
  margin: 9px;
  padding: 15px 0 0 16px;
  font-size: 12px;
  text-transform: uppercase;
}

.alphabetMenu li:hover {
  color: white;
  background: #134FE6;
  cursor: pointer;
}

.alphabetMenu::before {
  content: "";
  width: 10px;
  height: 10px;
}

nav.nav {
  font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  position:relative;
}

nav.nav .browse:hover .alphabetMenu {
  display: block;
}

nav.nav ul{
  list-style: none;
}

nav.nav ul li {
  display: inline;
}

nav.nav > ul > a > li {
  display: block;
  float:left;
  font-weight: bold;
  padding:20px 0 0 40px;
  font-size: 12px;
}

nav.nav > ul > a > li:hover {
  color: #EFFF00;
  cursor: pointer;
}

input.sign-in-button, input.sign-up-button {
    color: white;
    font-size: 24px;
    text-align: center;
    margin: 15px auto;
    background: #134FE6;
    width: 260px;
    border-radius: 3px;
    box-shadow: 1px 1px 1px #000;
    padding: 10px;
  }

.delete_button {
  cursor: pointer;
  padding-top: 10px;
  float:left;
}
 input[type="submit"] {
     cursor: pointer;
 }


text:
"""Case for conceptual tests.

ConceptCases are designed to be natural language tests that help
students understand high-level understanding. As such, these test cases
focus mainly on unlocking.
"""

from client import exceptions as ex
from client.sources.common import models as common_models
from client.sources.ok_test import models as ok_models
from client.sources.common import core
import textwrap
import logging

log = logging.getLogger(__name__)

class ConceptSuite(ok_models.Suite):
    scored = core.Boolean(default=False)

    def post_instantiation(self):
        for i, case in enumerate(self.cases):
            if not isinstance(case, dict):
                raise ex.SerializeException('Test cases must be dictionaries')
            self.cases[i] = ConceptCase(**case)

    def run(self, test_name, suite_number, env=None):
        results = {
            'passed': 0,
            'failed': 0,
            'locked': 0,
        }
        for i, case in self.enumerate_cases():
            if case.locked == True or results['locked'] > 0:
                # If a test case is locked, refuse to run any of the subsequent
                # test cases
                log.info('Case {} is locked'.format(i))
                results['locked'] += 1
                continue

            success = self._run_case(test_name, suite_number,
                                     case, i + 1)
            assert success, 'Concept case should never fail while grading'
            results['passed'] += 1
        return results

class ConceptCase(common_models.Case):
    question = core.String()
    answer = core.String()
    choices = core.List(type=str, optional=True)

    def post_instantiation(self):
        self.question = textwrap.dedent(self.question).strip()
        self.answer = textwrap.dedent(self.answer).strip()

        if self.choices != core.NoValue:
            for i, choice in enumerate(self.choices):
                self.choices[i] = textwrap.dedent(choice).strip()

    def run(self):
        """Runs the conceptual test case.

        RETURNS:
        bool; True if the test case passes, False otherwise.
        """
        print('Q: ' + self.question)
        print('A: ' + self.answer)
        return True

    def lock(self, hash_fn):
        self.answer = hash_fn(self.answer)
        self.locked = True

    def unlock(self, unique_id_prefix, case_id, interact):
        """Unlocks the conceptual test case."""
        print('Q: ' + self.question)
        answer = interact(unique_id_prefix + '\n' + self.question,
                          case_id, self.question, [self.answer], self.choices)
        assert len(answer) == 1
        answer = answer[0]
        if answer != self.answer:
            # Answer was presumably unlocked
            self.locked = False
            self.answer = answer

redpajama_set_name: RedPajamaGithub


text:
// Reads the pod configuration from the Kubernetes apiserver.
package config

import (
	"k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/fields"
	"k8s.io/apimachinery/pkg/types"
	"k8s.io/client-go/tools/cache"
	"k8s.io/kubernetes/pkg/api"
	"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
	kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
)

// NewSourceApiserver creates a config source that watches and pulls from the apiserver.
func NewSourceApiserver(c clientset.Interface, nodeName types.NodeName, updates chan<- interface{}) {
	lw := cache.NewListWatchFromClient(c.Core().RESTClient(), "pods", metav1.NamespaceAll, fields.OneTermEqualSelector(api.PodHostField, string(nodeName)))
	newSourceApiserverFromLW(lw, updates)
}

// newSourceApiserverFromLW holds creates a config source that watches and pulls from the apiserver.
func newSourceApiserverFromLW(lw cache.ListerWatcher, updates chan<- interface{}) {
	send := func(objs []interface{}) {
		var pods []*v1.Pod
		for _, o := range objs {
			pods = append(pods, o.(*v1.Pod))
		}
		updates <- kubetypes.PodUpdate{Pods: pods, Op: kubetypes.SET, Source: kubetypes.ApiserverSource}
	}
	cache.NewReflector(lw, &v1.Pod{}, cache.NewUndeltaStore(send, cache.MetaNamespaceKeyFunc), 0).Run()
}


text:
package com.sitexa.android.domain.repository;

import java.util.List;
import rx.Observable;

/**
 * Interface that represents a Repository for getting {@link com.sitexa.android.domain.User} related data.
 */
public interface UserRepository {
  /**
   * Get an {@link rx.Observable} which will emit a List of {@link com.sitexa.android.domain.User}.
   */
  Observable<List<com.sitexa.android.domain.User>> users();

  /**
   * Get an {@link rx.Observable} which will emit a {@link com.sitexa.android.domain.User}.
   *
   * @param userId The user id used to retrieve user data.
   */
  Observable<com.sitexa.android.domain.User> user(final int userId);
}


text:
/**
 *     This code was auto-generated by a Codezu.
 *
 *     Changes to this file may cause incorrect behavior and will be lost if
 *     the code is regenerated.
 */
package com.mozu.api.clients.content;

import org.joda.time.DateTime;
import java.util.List;
import java.util.ArrayList;
import com.mozu.api.MozuClient;
import com.mozu.api.MozuClientFactory;
import com.mozu.api.MozuUrl;
import com.mozu.api.Headers;
import com.mozu.api.AsyncCallback;
import java.util.concurrent.CountDownLatch;

import com.mozu.api.security.AuthTicket;
import org.apache.commons.lang.StringUtils;

/**
 * content/publishsets related resources. DOCUMENT_HERE
 *
 */
public class PublishSetSummaryClient {

	/**
	 * Returns a List of current Publishing sets with counts of drafts in each
	 *

	 * MozuClient<com.mozu.api.contracts.content.PublishSetSummaryPagedCollection> mozuClient=GetPublishSetsClient();
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * PublishSetSummaryPagedCollection publishSetSummaryPagedCollection = client.Result();
	 *

	 * @return Mozu.Api.MozuClient <com.mozu.api.contracts.content.PublishSetSummaryPagedCollection>
	 * @see com.mozu.api.contracts.content.PublishSetSummaryPagedCollection
	 */
	public static MozuClient<com.mozu.api.contracts.content.PublishSetSummaryPagedCollection> getPublishSetsClient() throws Exception
	{
		return getPublishSetsClient( null,  null,  null);
	}

	/**
	 * Returns a List of current Publishing sets with counts of drafts in each
	 *

	 * MozuClient<com.mozu.api.contracts.content.PublishSetSummaryPagedCollection> mozuClient=GetPublishSetsClient( pageSize,  startIndex,  responseFields);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * PublishSetSummaryPagedCollection publishSetSummaryPagedCollection = client.Result();
	 *

	 * @param pageSize The number of results to display on each page when creating paged results from a query. The amount is divided and displayed on the `pageCount `amount of pages. The default is 20 and maximum value is 200 per page.
	 * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. For example, ) returns only the  and  items inside the  array of the specified product.This paramter should only be used to retrieve data. Attempting to update data using this parmater may cause data loss.
	 * @param startIndex When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with a `pageSize `of 25, to get the 51st through the 75th items, use `startIndex=50`.
	 * @return Mozu.Api.MozuClient <com.mozu.api.contracts.content.PublishSetSummaryPagedCollection>
	 * @see com.mozu.api.contracts.content.PublishSetSummaryPagedCollection
	 */
	public static MozuClient<com.mozu.api.contracts.content.PublishSetSummaryPagedCollection> getPublishSetsClient(Integer pageSize, Integer startIndex, String responseFields) throws Exception
	{
		MozuUrl url = com.mozu.api.urls.content.PublishSetSummaryUrl.getPublishSetsUrl(pageSize, responseFields, startIndex);
		String verb = "GET";
		Class<?> clz = com.mozu.api.contracts.content.PublishSetSummaryPagedCollection.class;
		MozuClient<com.mozu.api.contracts.content.PublishSetSummaryPagedCollection> mozuClient = (MozuClient<com.mozu.api.contracts.content.PublishSetSummaryPagedCollection>) MozuClientFactory.getInstance(clz);
		mozuClient.setVerb(verb);
		mozuClient.setResourceUrl(url);
		return mozuClient;

	}

	/**
	 * Retrieve a paged collection of publish set Items.
	 *

	 * MozuClient<com.mozu.api.contracts.content.DocumentDraftSummaryPagedCollection> mozuClient=GetPublishSetItemsClient( code);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * DocumentDraftSummaryPagedCollection documentDraftSummaryPagedCollection = client.Result();
	 *

	 * @param code User-defined code that uniqely identifies the channel group.
	 * @return Mozu.Api.MozuClient <com.mozu.api.contracts.content.DocumentDraftSummaryPagedCollection>
	 * @see com.mozu.api.contracts.content.DocumentDraftSummaryPagedCollection
	 */
	public static MozuClient<com.mozu.api.contracts.content.DocumentDraftSummaryPagedCollection> getPublishSetItemsClient(String code) throws Exception
	{
		return getPublishSetItemsClient( code,  null,  null,  null,  null,  null);
	}

	/**
	 * Retrieve a paged collection of publish set Items.
	 *

	 * MozuClient<com.mozu.api.contracts.content.DocumentDraftSummaryPagedCollection> mozuClient=GetPublishSetItemsClient( code,  pageSize,  startIndex,  sortBy,  filter,  responseFields);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * DocumentDraftSummaryPagedCollection documentDraftSummaryPagedCollection = client.Result();
	 *

	 * @param code User-defined code that uniqely identifies the channel group.
	 * @param filter A set of filter expressions representing the search parameters for a query: eq=equals, ne=not equals, gt=greater than, lt = less than or equals, gt = greater than or equals, lt = less than or equals, sw = starts with, or cont = contains. Optional.
	 * @param pageSize The number of results to display on each page when creating paged results from a query. The amount is divided and displayed on the `pageCount `amount of pages. The default is 20 and maximum value is 200 per page.
	 * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. For example, ) returns only the  and  items inside the  array of the specified product.This paramter should only be used to retrieve data. Attempting to update data using this parmater may cause data loss.
	 * @param sortBy The element to sort the results by and the channel in which the results appear. Either ascending (a-z) or descending (z-a) channel. Optional.
	 * @param startIndex When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with a `pageSize `of 25, to get the 51st through the 75th items, use `startIndex=50`.
	 * @return Mozu.Api.MozuClient <com.mozu.api.contracts.content.DocumentDraftSummaryPagedCollection>
	 * @see com.mozu.api.contracts.content.DocumentDraftSummaryPagedCollection
	 */
	public static MozuClient<com.mozu.api.contracts.content.DocumentDraftSummaryPagedCollection> getPublishSetItemsClient(String code, Integer pageSize, Integer startIndex, String sortBy, String filter, String responseFields) throws Exception
	{
		MozuUrl url = com.mozu.api.urls.content.PublishSetSummaryUrl.getPublishSetItemsUrl(code, filter, pageSize, responseFields, sortBy, startIndex);
		String verb = "GET";
		Class<?> clz = com.mozu.api.contracts.content.DocumentDraftSummaryPagedCollection.class;
		MozuClient<com.mozu.api.contracts.content.DocumentDraftSummaryPagedCollection> mozuClient = (MozuClient<com.mozu.api.contracts.content.DocumentDraftSummaryPagedCollection>) MozuClientFactory.getInstance(clz);
		mozuClient.setVerb(verb);
		mozuClient.setResourceUrl(url);
		return mozuClient;

	}

	/**
	 * Adds a set of documents by id to a publish set
	 *

	 * MozuClient<Object> mozuClient=DeletePublishSetClient( code);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * object object = client.Result();
	 *

	 * @param code User-defined code that uniqely identifies the channel group.
	 * @return Mozu.Api.MozuClient <object>
	 * @see object
	 */
	public static MozuClient<Object> deletePublishSetClient(String code) throws Exception
	{
		return deletePublishSetClient( code,  null,  null);
	}

	/**
	 * Adds a set of documents by id to a publish set
	 *

	 * MozuClient<Object> mozuClient=DeletePublishSetClient( code,  shouldDiscard,  responseFields);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * object object = client.Result();
	 *

	 * @param code User-defined code that uniqely identifies the channel group.
	 * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. For example, ) returns only the  and  items inside the  array of the specified product.This paramter should only be used to retrieve data. Attempting to update data using this parmater may cause data loss.
	 * @param shouldDiscard Specifies whether to discard the pending content changes assigned to the content publish set when the publish set is deleted.
	 * @return Mozu.Api.MozuClient <object>
	 * @see object
	 */
	public static MozuClient<Object> deletePublishSetClient(String code, Boolean shouldDiscard, String responseFields) throws Exception
	{
		MozuUrl url = com.mozu.api.urls.content.PublishSetSummaryUrl.deletePublishSetUrl(code, responseFields, shouldDiscard);
		String verb = "POST";
		Class<?> clz = Object.class;
		MozuClient<Object> mozuClient = (MozuClient<Object>) MozuClientFactory.getInstance(clz);
		mozuClient.setVerb(verb);
		mozuClient.setResourceUrl(url);
		return mozuClient;

	}

	/**
	 * Adds a set of documents by id to a publish set
	 *

	 * MozuClient<Object> mozuClient=AddPublishSetItemsClient( itemsToPublish,  code);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * object object = client.Result();
	 *

	 * @param code User-defined code that uniqely identifies the channel group.
	 * @param itemsToPublish Mozu.Content.Contracts.AddOrDeletePublishItem ApiType DOCUMENT_HERE
	 * @return Mozu.Api.MozuClient <object>
	 * @see object
	 * @see com.mozu.api.contracts.content.AddOrDeletePublishItem
	 */
	public static MozuClient<Object> addPublishSetItemsClient(List<com.mozu.api.contracts.content.AddOrDeletePublishItem> itemsToPublish, String code) throws Exception
	{
		return addPublishSetItemsClient( itemsToPublish,  code,  null);
	}

	/**
	 * Adds a set of documents by id to a publish set
	 *

	 * MozuClient<Object> mozuClient=AddPublishSetItemsClient( itemsToPublish,  code,  responseFields);
	 * client.setBaseAddress(url);
	 * client.executeRequest();
	 * object object = client.Result();
	 *

	 * @param code User-defined code that uniqely identifies the channel group.
	 * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. For example, ) returns only the  and  items inside the  array of the specified product.This paramter should only be used to retrieve data. Attempting to update data using this parmater may cause data loss.
	 * @param itemsToPublish Mozu.Content.Contracts.AddOrDeletePublishItem ApiType DOCUMENT_HERE
	 * @return Mozu.Api.MozuClient <object>
	 * @see object
	 * @see com.mozu.api.contracts.content.AddOrDeletePublishItem
	 */
	public static MozuClient<Object> addPublishSetItemsClient(List<com.mozu.api.contracts.content.AddOrDeletePublishItem> itemsToPublish, String code, String responseFields) throws Exception
	{
		MozuUrl url = com.mozu.api.urls.content.PublishSetSummaryUrl.addPublishSetItemsUrl(code, responseFields);
		String verb = "PUT";
		Class<?> clz = Object.class;
		MozuClient<Object> mozuClient = (MozuClient<Object>) MozuClientFactory.getInstance(clz);
		mozuClient.setVerb(verb);
		mozuClient.setResourceUrl(url);
		mozuClient.setBody(itemsToPublish);
		return mozuClient;

	}

}


text:
import numpy as np
from numpy.matlib import repmat
from random import shuffle

def svm_loss_naive(W, X, y, reg):
  """
  Structured SVM loss function, naive implementation (with loops).

  Inputs have dimension D, there are C classes, and we operate on minibatches
  of N examples.

  Inputs:
  - W: A numpy array of shape (D, C) containing weights.
  - X: A numpy array of shape (N, D) containing a minibatch of data.
  - y: A numpy array of shape (N,) containing training labels; y[i] = c means
    that X[i] has label c, where 0 <= c < C.
  - reg: (float) regularization strength

  Returns a tuple of:
  - loss as single float
  - gradient with respect to weights W; an array of same shape as W
  """
  dW = np.zeros(W.shape) # initialize the gradient as zero

  # compute the loss and the gradient
  # gradient computing refers to CS231n "Computing the gradient analytically with Calculus"
  # gradient computing formula is in https://zhuanlan.zhihu.com/p/21387326?refer=intelligentunit
  num_classes = W.shape[1]
  num_train = X.shape[0]
  loss = 0.0

  for i in xrange(num_train):
    scores = X[i].dot(W)
    correct_class_score = scores[y[i]]
    current = 0
    for j in xrange(num_classes):
      if j == y[i]:
        continue
      margin = scores[j] - correct_class_score + 1 # note delta = 1
      if margin > 0:
        loss += margin
        dW[:,j] += X[i,:]
        current += 1
    dW[:,y[i]] += -1 * X[i,:] * current

  # Right now the loss is a sum over all training examples, but we want it
  # to be an average instead so we divide by num_train.
  # dW also has to be averaged
  loss /= num_train
  dW /= num_train

  # Add regularization to the loss.
  # dW has regularization??
  loss += 0.5 * reg * np.sum(W * W)
  dW += reg * W

  #############################################################################
  # TODO:                                                                     #
  # Compute the gradient of the loss function and store it dW.                #
  # Rather that first computing the loss and then computing the derivative,   #
  # it may be simpler to compute the derivative at the same time that the     #
  # loss is being computed. As a result you may need to modify some of the    #
  # code above to compute the gradient.                                       #
  #############################################################################

  return loss, dW

def svm_loss_vectorized(W, X, y, reg):
  """
  Structured SVM loss function, vectorized implementation.

  Inputs and outputs are the same as svm_loss_naive.
  """
  loss = 0.0
  dW = np.zeros(W.shape) # initialize the gradient as zero

  #############################################################################
  # TODO:                                                                     #
  # Implement a vectorized version of the structured SVM loss, storing the    #
  # result in loss.                                                           #
  #############################################################################
  #def vectorized_result(j):
    #e = np.ones((10, 1))
    #e[j] = 0
    #return e
  #delta_vectors = np.array([vectorized_result(j) for j in y.reshape(-1).tolist()])

  #num_classes = W.shape[1]
  #num_train = X.shape[0]
  #scores = X.dot(W)
  #margins = scores - scores[range(num_train), y.reshape(-1).tolist()][:, np.newaxis] + delta_vectors.reshape(-1, 10)
  #loss = np.sum(margins[margins > 0]) / num_train + 0.5 * reg * np.sum(W * W)
  num_train = X.shape[0]
  num_classes = W.shape[1]
  scores = X.dot(W)
  correct_class_scores = repmat(scores[np.arange(num_train), y], num_classes, 1)
  margins = scores - correct_class_scores.T
  margins = np.where(margins != 0, margins + 1, 0) # note delta = 1
  margins = np.where(margins < 0, 0, margins)
  loss = np.sum(margins) / num_train
  loss += 0.5 * reg * np.sum(W * W)
  #loss += 0.5 * reg * np.sum(np.square(W))
  #############################################################################
  #                             END OF YOUR CODE                              #
  #############################################################################

  #############################################################################
  # TODO:                                                                     #
  # Implement a vectorized version of the gradient for the structured SVM     #
  # loss, storing the result in dW.                                           #
  #                                                                           #
  # Hint: Instead of computing the gradient from scratch, it may be easier    #
  # to reuse some of the intermediate values that you used to compute the     #
  # loss.                                                                     #
  #############################################################################

  #margins[margins > 0] = 1.0, why this method is wrong?????

  margins = np.where(margins > 0, 1, 0)
  col_sum = np.sum(margins, axis=1)
  margins[range(num_train), y] = -col_sum[range(num_train)]

  #This command leads to overflow
  #dW = (X.T).dot(margins) / num_train + reg * W
  dW += X.T.dot(margins)
  dW /= num_train
  dW += reg * W
  #############################################################################
  #                             END OF YOUR CODE                              #
  #############################################################################

  return loss, dW


text:
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.lodsve.test</groupId>
    <artifactId>lodsve-demo</artifactId>
    <version>1.0</version>
    <packaging>pom</packaging>
    <name>Test lodsve</name>
    <url>http://maven.apache.org</url>

    <properties>
        <lodsve.version>2.7.6-SNAPSHOT</lodsve.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.lodsve.test</groupId>
            <artifactId>lodsve-config</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>com.101tec</groupId>
            <artifactId>zkclient</artifactId>
            <version>0.10</version>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.lodsve</groupId>
                <artifactId>lodsve-framework-bom</artifactId>
                <version>${lodsve.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <modules>
        <module>lodsve-config</module>

        <module>test-dubbo-api</module>
        <module>test-dubbo-consumer1</module>
        <module>test-dubbo-consumer2</module>
        <module>test-dubbo-producer</module>

        <module>test-rabbit-consumer</module>
        <module>test-rabbit-producter</module>
        <module>test-mongodb</module>
        <module>test-validate</module>
        <module>test-mybatis</module>
        <module>test-properties</module>

        <module>test-redis</module>
        <module>test-search</module>
        <module>test-webmvc</module>
        <module>test-normal</module>

        <module>test-cache</module>
        <module>test-email</module>
        <module>test-event</module>

        <module>test-rocketmq</module>

        <module>test-rocket-consumer</module>
        <module>test-rocket-producter</module>
    </modules>

    <!-- 仓库 -->
    <repositories>
        <repository>
            <id>default-center</id>
            <name>default center</name>
            <url>http://repo1.maven.org/maven2</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>http://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>http://repo.spring.io/snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>jcenter</id>
            <name>jcenter</name>
            <url>http://jcenter.bintray.com</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <addMavenDescriptor>true</addMavenDescriptor>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>jdk-1.8</id>
            <activation>
                <jdk>1.8</jdk>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <maven.compiler.source>1.8</maven.compiler.source>
                <maven.compiler.target>1.8</maven.compiler.target>
                <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
            </properties>
        </profile>
    </profiles>
</project>


text:
<!DOCTYPE animal [
<!ELEMENT animal ANY>
<?ᆟ an illegal char #x119f
 in PITarget ?>
]>
<animal/>


text: try { throw Error;} catch(e){new.target;}


text:
#ifndef _WX_LONGLONG_H
#define _WX_LONGLONG_H

#include "wx/defs.h"

#if wxUSE_LONGLONG

#include "wx/string.h"

#include <limits.h>     // for LONG_MAX

// define this to compile wxLongLongWx in "test" mode: the results of all
// calculations will be compared with the real results taken from
// wxLongLongNative -- this is extremely useful to find the bugs in
// wxLongLongWx class!

// #define wxLONGLONG_TEST_MODE

#ifdef wxLONGLONG_TEST_MODE
    #define wxUSE_LONGLONG_WX 1
    #define wxUSE_LONGLONG_NATIVE 1
#endif // wxLONGLONG_TEST_MODE

// ----------------------------------------------------------------------------
// decide upon which class we will use
// ----------------------------------------------------------------------------

#ifndef wxLongLong_t
    // both warning and pragma warning are not portable, but at least an
    // unknown pragma should never be an error -- except that, actually, some
    // broken compilers don't like it, so we have to disable it in this case
    // <sigh>
    #ifdef __GNUC__
        #warning "Your compiler does not appear to support 64 bit "\
                 "integers, using emulation class instead.\n" \
                 "Please report your compiler version to " \
                 "wx-dev@lists.wxwidgets.org!"
    #elif !(defined(__WATCOMC__) || defined(__VISAGECPP__))
        #pragma warning "Your compiler does not appear to support 64 bit "\
                        "integers, using emulation class instead.\n" \
                        "Please report your compiler version to " \
                        "wx-dev@lists.wxwidgets.org!"
    #endif

    #define wxUSE_LONGLONG_WX 1
#endif // compiler

// the user may predefine wxUSE_LONGLONG_NATIVE and/or wxUSE_LONGLONG_NATIVE
// to disable automatic testing (useful for the test program which defines
// both classes) but by default we only use one class
#if (defined(wxUSE_LONGLONG_WX) && wxUSE_LONGLONG_WX) || !defined(wxLongLong_t)
    // don't use both classes unless wxUSE_LONGLONG_NATIVE was explicitly set:
    // this is useful in test programs and only there
    #ifndef wxUSE_LONGLONG_NATIVE
        #define wxUSE_LONGLONG_NATIVE 0
    #endif

    class WXDLLIMPEXP_FWD_BASE wxLongLongWx;
    class WXDLLIMPEXP_FWD_BASE wxULongLongWx;
#if defined(__VISUALC__) && !defined(__WIN32__)
    #define wxLongLong wxLongLongWx
    #define wxULongLong wxULongLongWx
#else
    typedef wxLongLongWx wxLongLong;
    typedef wxULongLongWx wxULongLong;
#endif

#else
    // if nothing is defined, use native implementation by default, of course
    #ifndef wxUSE_LONGLONG_NATIVE
        #define wxUSE_LONGLONG_NATIVE 1
    #endif
#endif

#ifndef wxUSE_LONGLONG_WX
    #define wxUSE_LONGLONG_WX 0
    class WXDLLIMPEXP_FWD_BASE wxLongLongNative;
    class WXDLLIMPEXP_FWD_BASE wxULongLongNative;
    typedef wxLongLongNative wxLongLong;
    typedef wxULongLongNative wxULongLong;
#endif

// NB: if both wxUSE_LONGLONG_WX and NATIVE are defined, the user code should
//     typedef wxLongLong as it wants, we don't do it

// ----------------------------------------------------------------------------
// choose the appropriate class
// ----------------------------------------------------------------------------

// we use iostream for wxLongLong output
#include "wx/iosfwrap.h"

#if wxUSE_LONGLONG_NATIVE

class WXDLLIMPEXP_BASE wxLongLongNative
{
public:
    // ctors
        // default ctor initializes to 0
    wxLongLongNative() : m_ll(0) { }
        // from long long
    wxLongLongNative(wxLongLong_t ll) : m_ll(ll) { }
        // from 2 longs
    wxLongLongNative(wxInt32 hi, wxUint32 lo)
    {
        // cast to wxLongLong_t first to avoid precision loss!
        m_ll = ((wxLongLong_t) hi) << 32;
        m_ll |= (wxLongLong_t) lo;
    }
#if wxUSE_LONGLONG_WX
    wxLongLongNative(wxLongLongWx ll);
#endif

    // default copy ctor is ok

    // no dtor

    // assignment operators
        // from native 64 bit integer
#ifndef wxLongLongIsLong
    wxLongLongNative& operator=(wxLongLong_t ll)
        { m_ll = ll; return *this; }
    wxLongLongNative& operator=(wxULongLong_t ll)
        { m_ll = ll; return *this; }
#endif // !wxLongLongNative
    wxLongLongNative& operator=(const wxULongLongNative &ll);
    wxLongLongNative& operator=(int l)
        { m_ll = l; return *this; }
    wxLongLongNative& operator=(long l)
        { m_ll = l; return *this; }
    wxLongLongNative& operator=(unsigned int l)
        { m_ll = l; return *this; }
    wxLongLongNative& operator=(unsigned long l)
        { m_ll = l; return *this; }
#if wxUSE_LONGLONG_WX
    wxLongLongNative& operator=(wxLongLongWx ll);
    wxLongLongNative& operator=(const class wxULongLongWx &ll);
#endif

        // from double: this one has an explicit name because otherwise we
        // would have ambiguity with "ll = int" and also because we don't want
        // to have implicit conversions between doubles and wxLongLongs
    wxLongLongNative& Assign(double d)
        { m_ll = (wxLongLong_t)d; return *this; }

    // assignment operators from wxLongLongNative is ok

    // accessors
        // get high part
    wxInt32 GetHi() const
        { return wx_truncate_cast(wxInt32, m_ll >> 32); }
        // get low part
    wxUint32 GetLo() const
        { return wx_truncate_cast(wxUint32, m_ll); }

        // get absolute value
    wxLongLongNative Abs() const { return wxLongLongNative(*this).Abs(); }
    wxLongLongNative& Abs() { if ( m_ll < 0 ) m_ll = -m_ll; return *this; }

        // convert to native long long
    wxLongLong_t GetValue() const { return m_ll; }

        // convert to long with range checking in debug mode (only!)
    long ToLong() const
    {
        wxASSERT_MSG( (m_ll >= LONG_MIN) && (m_ll <= LONG_MAX),
                      wxT("wxLongLong to long conversion loss of precision") );

        return wx_truncate_cast(long, m_ll);
    }

        // convert to double
    double ToDouble() const { return wx_truncate_cast(double, m_ll); }

    // don't provide implicit conversion to wxLongLong_t or we will have an
    // ambiguity for all arithmetic operations
    //operator wxLongLong_t() const { return m_ll; }

    // operations
        // addition
    wxLongLongNative operator+(const wxLongLongNative& ll) const
        { return wxLongLongNative(m_ll + ll.m_ll); }
    wxLongLongNative& operator+=(const wxLongLongNative& ll)
        { m_ll += ll.m_ll; return *this; }

    wxLongLongNative operator+(const wxLongLong_t ll) const
        { return wxLongLongNative(m_ll + ll); }
    wxLongLongNative& operator+=(const wxLongLong_t ll)
        { m_ll += ll; return *this; }

        // pre increment
    wxLongLongNative& operator++()
        { m_ll++; return *this; }

        // post increment
    wxLongLongNative operator++(int)
        { wxLongLongNative value(*this); m_ll++; return value; }

        // negation operator
    wxLongLongNative operator-() const
        { return wxLongLongNative(-m_ll); }
    wxLongLongNative& Negate() { m_ll = -m_ll; return *this; }

        // subtraction
    wxLongLongNative operator-(const wxLongLongNative& ll) const
        { return wxLongLongNative(m_ll - ll.m_ll); }
    wxLongLongNative& operator-=(const wxLongLongNative& ll)
        { m_ll -= ll.m_ll; return *this; }

    wxLongLongNative operator-(const wxLongLong_t ll) const
        { return wxLongLongNative(m_ll - ll); }
    wxLongLongNative& operator-=(const wxLongLong_t ll)
        { m_ll -= ll; return *this; }

        // pre decrement
    wxLongLongNative& operator--()
        { m_ll--; return *this; }

        // post decrement
    wxLongLongNative operator--(int)
        { wxLongLongNative value(*this); m_ll--; return value; }

    // shifts
        // left shift
    wxLongLongNative operator<<(int shift) const
        { return wxLongLongNative(m_ll << shift); }
    wxLongLongNative& operator<<=(int shift)
        { m_ll <<= shift; return *this; }

        // right shift
    wxLongLongNative operator>>(int shift) const
        { return wxLongLongNative(m_ll >> shift); }
    wxLongLongNative& operator>>=(int shift)
        { m_ll >>= shift; return *this; }

    // bitwise operators
    wxLongLongNative operator&(const wxLongLongNative& ll) const
        { return wxLongLongNative(m_ll & ll.m_ll); }
    wxLongLongNative& operator&=(const wxLongLongNative& ll)
        { m_ll &= ll.m_ll; return *this; }

    wxLongLongNative operator|(const wxLongLongNative& ll) const
        { return wxLongLongNative(m_ll | ll.m_ll); }
    wxLongLongNative& operator|=(const wxLongLongNative& ll)
        { m_ll |= ll.m_ll; return *this; }

    wxLongLongNative operator^(const wxLongLongNative& ll) const
        { return wxLongLongNative(m_ll ^ ll.m_ll); }
    wxLongLongNative& operator^=(const wxLongLongNative& ll)
        { m_ll ^= ll.m_ll; return *this; }

    // multiplication/division
    wxLongLongNative operator*(const wxLongLongNative& ll) const
        { return wxLongLongNative(m_ll * ll.m_ll); }
    wxLongLongNative operator*(long l) const
        { return wxLongLongNative(m_ll * l); }
    wxLongLongNative& operator*=(const wxLongLongNative& ll)
        { m_ll *= ll.m_ll; return *this; }
    wxLongLongNative& operator*=(long l)
        { m_ll *= l; return *this; }

    wxLongLongNative operator/(const wxLongLongNative& ll) const
        { return wxLongLongNative(m_ll / ll.m_ll); }
    wxLongLongNative operator/(long l) const
        { return wxLongLongNative(m_ll / l); }
    wxLongLongNative& operator/=(const wxLongLongNative& ll)
        { m_ll /= ll.m_ll; return *this; }
    wxLongLongNative& operator/=(long l)
        { m_ll /= l; return *this; }

    wxLongLongNative operator%(const wxLongLongNative& ll) const
        { return wxLongLongNative(m_ll % ll.m_ll); }
    wxLongLongNative operator%(long l) const
        { return wxLongLongNative(m_ll % l); }

    // comparison
    bool operator==(const wxLongLongNative& ll) const
        { return m_ll == ll.m_ll; }
    bool operator==(long l) const
        { return m_ll == l; }
    bool operator!=(const wxLongLongNative& ll) const
        { return m_ll != ll.m_ll; }
    bool operator!=(long l) const
        { return m_ll != l; }
    bool operator<(const wxLongLongNative& ll) const
        { return m_ll < ll.m_ll; }
    bool operator<(long l) const
        { return m_ll < l; }
    bool operator>(const wxLongLongNative& ll) const
        { return m_ll > ll.m_ll; }
    bool operator>(long l) const
        { return m_ll > l; }
    bool operator<=(const wxLongLongNative& ll) const
        { return m_ll <= ll.m_ll; }
    bool operator<=(long l) const
        { return m_ll <= l; }
    bool operator>=(const wxLongLongNative& ll) const
        { return m_ll >= ll.m_ll; }
    bool operator>=(long l) const
        { return m_ll >= l; }

    // miscellaneous

        // return the string representation of this number
    wxString ToString() const;

        // conversion to byte array: returns a pointer to static buffer!
    void *asArray() const;

#if wxUSE_STD_IOSTREAM
        // input/output
    friend WXDLLIMPEXP_BASE
    wxSTD ostream& operator<<(wxSTD ostream&, const wxLongLongNative&);
#endif

    friend WXDLLIMPEXP_BASE
    wxString& operator<<(wxString&, const wxLongLongNative&);

#if wxUSE_STREAMS
    friend WXDLLIMPEXP_BASE
    class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxLongLongNative&);
    friend WXDLLIMPEXP_BASE
    class wxTextInputStream& operator>>(class wxTextInputStream&, wxLongLongNative&);
#endif

private:
    wxLongLong_t  m_ll;
};

class WXDLLIMPEXP_BASE wxULongLongNative
{
public:
    // ctors
        // default ctor initializes to 0
    wxULongLongNative() : m_ll(0) { }
        // from long long
    wxULongLongNative(wxULongLong_t ll) : m_ll(ll) { }
        // from 2 longs
    wxULongLongNative(wxUint32 hi, wxUint32 lo) : m_ll(0)
    {
        // cast to wxLongLong_t first to avoid precision loss!
        m_ll = ((wxULongLong_t) hi) << 32;
        m_ll |= (wxULongLong_t) lo;
    }

#if wxUSE_LONGLONG_WX
    wxULongLongNative(const class wxULongLongWx &ll);
#endif

    // default copy ctor is ok

    // no dtor

    // assignment operators
        // from native 64 bit integer
#ifndef wxLongLongIsLong
    wxULongLongNative& operator=(wxULongLong_t ll)
        { m_ll = ll; return *this; }
    wxULongLongNative& operator=(wxLongLong_t ll)
        { m_ll = ll; return *this; }
#endif // !wxLongLongNative
    wxULongLongNative& operator=(int l)
        { m_ll = l; return *this; }
    wxULongLongNative& operator=(long l)
        { m_ll = l; return *this; }
    wxULongLongNative& operator=(unsigned int l)
        { m_ll = l; return *this; }
    wxULongLongNative& operator=(unsigned long l)
        { m_ll = l; return *this; }
    wxULongLongNative& operator=(const wxLongLongNative &ll)
        { m_ll = ll.GetValue(); return *this; }
#if wxUSE_LONGLONG_WX
    wxULongLongNative& operator=(wxLongLongWx ll);
    wxULongLongNative& operator=(const class wxULongLongWx &ll);
#endif

    // assignment operators from wxULongLongNative is ok

    // accessors
        // get high part
    wxUint32 GetHi() const
        { return wx_truncate_cast(wxUint32, m_ll >> 32); }
        // get low part
    wxUint32 GetLo() const
        { return wx_truncate_cast(wxUint32, m_ll); }

        // convert to native ulong long
    wxULongLong_t GetValue() const { return m_ll; }

        // convert to ulong with range checking in debug mode (only!)
    unsigned long ToULong() const
    {
        wxASSERT_MSG( m_ll <= LONG_MAX,
                      wxT("wxULongLong to long conversion loss of precision") );

        return wx_truncate_cast(unsigned long, m_ll);
    }

        // convert to double
#ifdef _MSC_VER
    double ToDouble() const { return wx_truncate_cast(double, (__int64) m_ll); }
#else
    double ToDouble() const { return wx_truncate_cast(double, m_ll); }
#endif

    // operations
        // addition
    wxULongLongNative operator+(const wxULongLongNative& ll) const
        { return wxULongLongNative(m_ll + ll.m_ll); }
    wxULongLongNative& operator+=(const wxULongLongNative& ll)
        { m_ll += ll.m_ll; return *this; }

    wxULongLongNative operator+(const wxULongLong_t ll) const
        { return wxULongLongNative(m_ll + ll); }
    wxULongLongNative& operator+=(const wxULongLong_t ll)
        { m_ll += ll; return *this; }

        // pre increment
    wxULongLongNative& operator++()
        { m_ll++; return *this; }

        // post increment
    wxULongLongNative operator++(int)
        { wxULongLongNative value(*this); m_ll++; return value; }

        // subtraction
    wxULongLongNative operator-(const wxULongLongNative& ll) const
        { return wxULongLongNative(m_ll - ll.m_ll); }
    wxULongLongNative& operator-=(const wxULongLongNative& ll)
        { m_ll -= ll.m_ll; return *this; }

    wxULongLongNative operator-(const wxULongLong_t ll) const
        { return wxULongLongNative(m_ll - ll); }
    wxULongLongNative& operator-=(const wxULongLong_t ll)
        { m_ll -= ll; return *this; }

        // pre decrement
    wxULongLongNative& operator--()
        { m_ll--; return *this; }

        // post decrement
    wxULongLongNative operator--(int)
        { wxULongLongNative value(*this); m_ll--; return value; }

    // shifts
        // left shift
    wxULongLongNative operator<<(int shift) const
        { return wxULongLongNative(m_ll << shift); }
    wxULongLongNative& operator<<=(int shift)
        { m_ll <<= shift; return *this; }

        // right shift
    wxULongLongNative operator>>(int shift) const
        { return wxULongLongNative(m_ll >> shift); }
    wxULongLongNative& operator>>=(int shift)
        { m_ll >>= shift; return *this; }

    // bitwise operators
    wxULongLongNative operator&(const wxULongLongNative& ll) const
        { return wxULongLongNative(m_ll & ll.m_ll); }
    wxULongLongNative& operator&=(const wxULongLongNative& ll)
        { m_ll &= ll.m_ll; return *this; }

    wxULongLongNative operator|(const wxULongLongNative& ll) const
        { return wxULongLongNative(m_ll | ll.m_ll); }
    wxULongLongNative& operator|=(const wxULongLongNative& ll)
        { m_ll |= ll.m_ll; return *this; }

    wxULongLongNative operator^(const wxULongLongNative& ll) const
        { return wxULongLongNative(m_ll ^ ll.m_ll); }
    wxULongLongNative& operator^=(const wxULongLongNative& ll)
        { m_ll ^= ll.m_ll; return *this; }

    // multiplication/division
    wxULongLongNative operator*(const wxULongLongNative& ll) const
        { return wxULongLongNative(m_ll * ll.m_ll); }
    wxULongLongNative operator*(unsigned long l) const
        { return wxULongLongNative(m_ll * l); }
    wxULongLongNative& operator*=(const wxULongLongNative& ll)
        { m_ll *= ll.m_ll; return *this; }
    wxULongLongNative& operator*=(unsigned long l)
        { m_ll *= l; return *this; }

    wxULongLongNative operator/(const wxULongLongNative& ll) const
        { return wxULongLongNative(m_ll / ll.m_ll); }
    wxULongLongNative operator/(unsigned long l) const
        { return wxULongLongNative(m_ll / l); }
    wxULongLongNative& operator/=(const wxULongLongNative& ll)
        { m_ll /= ll.m_ll; return *this; }
    wxULongLongNative& operator/=(unsigned long l)
        { m_ll /= l; return *this; }

    wxULongLongNative operator%(const wxULongLongNative& ll) const
        { return wxULongLongNative(m_ll % ll.m_ll); }
    wxULongLongNative operator%(unsigned long l) const
        { return wxULongLongNative(m_ll % l); }

    // comparison
    bool operator==(const wxULongLongNative& ll) const
        { return m_ll == ll.m_ll; }
    bool operator==(unsigned long l) const
        { return m_ll == l; }
    bool operator!=(const wxULongLongNative& ll) const
        { return m_ll != ll.m_ll; }
    bool operator!=(unsigned long l) const
        { return m_ll != l; }
    bool operator<(const wxULongLongNative& ll) const
        { return m_ll < ll.m_ll; }
    bool operator<(unsigned long l) const
        { return m_ll < l; }
    bool operator>(const wxULongLongNative& ll) const
        { return m_ll > ll.m_ll; }
    bool operator>(unsigned long l) const
        { return m_ll > l; }
    bool operator<=(const wxULongLongNative& ll) const
        { return m_ll <= ll.m_ll; }
    bool operator<=(unsigned long l) const
        { return m_ll <= l; }
    bool operator>=(const wxULongLongNative& ll) const
        { return m_ll >= ll.m_ll; }
    bool operator>=(unsigned long l) const
        { return m_ll >= l; }

    // miscellaneous

        // return the string representation of this number
    wxString ToString() const;

        // conversion to byte array: returns a pointer to static buffer!
    void *asArray() const;

#if wxUSE_STD_IOSTREAM
        // input/output
    friend WXDLLIMPEXP_BASE
    wxSTD ostream& operator<<(wxSTD ostream&, const wxULongLongNative&);
#endif

    friend WXDLLIMPEXP_BASE
    wxString& operator<<(wxString&, const wxULongLongNative&);

#if wxUSE_STREAMS
    friend WXDLLIMPEXP_BASE
    class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxULongLongNative&);
    friend WXDLLIMPEXP_BASE
    class wxTextInputStream& operator>>(class wxTextInputStream&, wxULongLongNative&);
#endif

private:
    wxULongLong_t  m_ll;
};

inline
wxLongLongNative& wxLongLongNative::operator=(const wxULongLongNative &ll)
{
    m_ll = ll.GetValue();
    return *this;
}

#endif // wxUSE_LONGLONG_NATIVE

#if wxUSE_LONGLONG_WX

class WXDLLIMPEXP_BASE wxLongLongWx
{
public:
    // ctors
        // default ctor initializes to 0
    wxLongLongWx()
    {
        m_lo = m_hi = 0;

#ifdef wxLONGLONG_TEST_MODE
        m_ll = 0;

        Check();
#endif // wxLONGLONG_TEST_MODE
    }
        // from long
    wxLongLongWx(long l) { *this = l; }
        // from 2 longs
    wxLongLongWx(long hi, unsigned long lo)
    {
        m_hi = hi;
        m_lo = lo;

#ifdef wxLONGLONG_TEST_MODE
        m_ll = hi;
        m_ll <<= 32;
        m_ll |= lo;

        Check();
#endif // wxLONGLONG_TEST_MODE
    }

    // default copy ctor is ok in both cases

    // no dtor

    // assignment operators
        // from long
    wxLongLongWx& operator=(long l)
    {
        m_lo = l;
        m_hi = (l < 0 ? -1l : 0l);

#ifdef wxLONGLONG_TEST_MODE
        m_ll = l;

        Check();
#endif // wxLONGLONG_TEST_MODE

        return *this;
    }
        // from int
    wxLongLongWx& operator=(int l)
    {
        return operator=((long)l);
    }

    wxLongLongWx& operator=(unsigned long l)
    {
        m_lo = l;
        m_hi = 0;

#ifdef wxLONGLONG_TEST_MODE
        m_ll = l;

        Check();
#endif // wxLONGLONG_TEST_MODE

        return *this;
    }

    wxLongLongWx& operator=(unsigned int l)
    {
        return operator=((unsigned long)l);
    }

    wxLongLongWx& operator=(const class wxULongLongWx &ll);

    // from double
    wxLongLongWx& Assign(double d);
        // can't have assignment operator from 2 longs

    // accessors
        // get high part
    long GetHi() const { return m_hi; }
        // get low part
    unsigned long GetLo() const { return m_lo; }

        // get absolute value
    wxLongLongWx Abs() const { return wxLongLongWx(*this).Abs(); }
    wxLongLongWx& Abs()
    {
        if ( m_hi < 0 )
            m_hi = -m_hi;

#ifdef wxLONGLONG_TEST_MODE
        if ( m_ll < 0 )
            m_ll = -m_ll;

        Check();
#endif // wxLONGLONG_TEST_MODE

        return *this;
    }

        // convert to long with range checking in debug mode (only!)
    long ToLong() const
    {
        wxASSERT_MSG( (m_hi == 0l) || (m_hi == -1l),
                      wxT("wxLongLong to long conversion loss of precision") );

        return (long)m_lo;
    }

        // convert to double
    double ToDouble() const;

    // operations
        // addition
    wxLongLongWx operator+(const wxLongLongWx& ll) const;
    wxLongLongWx& operator+=(const wxLongLongWx& ll);
    wxLongLongWx operator+(long l) const;
    wxLongLongWx& operator+=(long l);

        // pre increment operator
    wxLongLongWx& operator++();

        // post increment operator
    wxLongLongWx& operator++(int) { return ++(*this); }

        // negation operator
    wxLongLongWx operator-() const;
    wxLongLongWx& Negate();

        // subraction
    wxLongLongWx operator-(const wxLongLongWx& ll) const;
    wxLongLongWx& operator-=(const wxLongLongWx& ll);

        // pre decrement operator
    wxLongLongWx& operator--();

        // post decrement operator
    wxLongLongWx& operator--(int) { return --(*this); }

    // shifts
        // left shift
    wxLongLongWx operator<<(int shift) const;
    wxLongLongWx& operator<<=(int shift);

        // right shift
    wxLongLongWx operator>>(int shift) const;
    wxLongLongWx& operator>>=(int shift);

    // bitwise operators
    wxLongLongWx operator&(const wxLongLongWx& ll) const;
    wxLongLongWx& operator&=(const wxLongLongWx& ll);
    wxLongLongWx operator|(const wxLongLongWx& ll) const;
    wxLongLongWx& operator|=(const wxLongLongWx& ll);
    wxLongLongWx operator^(const wxLongLongWx& ll) const;
    wxLongLongWx& operator^=(const wxLongLongWx& ll);
    wxLongLongWx operator~() const;

    // comparison
    bool operator==(const wxLongLongWx& ll) const
        { return m_lo == ll.m_lo && m_hi == ll.m_hi; }
#if wxUSE_LONGLONG_NATIVE
    bool operator==(const wxLongLongNative& ll) const
        { return m_lo == ll.GetLo() && m_hi == ll.GetHi(); }
#endif
    bool operator!=(const wxLongLongWx& ll) const
        { return !(*this == ll); }
    bool operator<(const wxLongLongWx& ll) const;
    bool operator>(const wxLongLongWx& ll) const;
    bool operator<=(const wxLongLongWx& ll) const
        { return *this < ll || *this == ll; }
    bool operator>=(const wxLongLongWx& ll) const
        { return *this > ll || *this == ll; }

    bool operator<(long l) const { return *this < wxLongLongWx(l); }
    bool operator>(long l) const { return *this > wxLongLongWx(l); }
    bool operator==(long l) const
    {
        return l >= 0 ? (m_hi == 0 && m_lo == (unsigned long)l)
                      : (m_hi == -1 && m_lo == (unsigned long)l);
    }

    bool operator<=(long l) const { return *this < l || *this == l; }
    bool operator>=(long l) const { return *this > l || *this == l; }

    // multiplication
    wxLongLongWx operator*(const wxLongLongWx& ll) const;
    wxLongLongWx& operator*=(const wxLongLongWx& ll);

    // division
    wxLongLongWx operator/(const wxLongLongWx& ll) const;
    wxLongLongWx& operator/=(const wxLongLongWx& ll);

    wxLongLongWx operator%(const wxLongLongWx& ll) const;

    void Divide(const wxLongLongWx& divisor,
                wxLongLongWx& quotient,
                wxLongLongWx& remainder) const;

    // input/output

    // return the string representation of this number
    wxString ToString() const;

    void *asArray() const;

#if wxUSE_STD_IOSTREAM
    friend WXDLLIMPEXP_BASE
    wxSTD ostream& operator<<(wxSTD ostream&, const wxLongLongWx&);
#endif // wxUSE_STD_IOSTREAM

    friend WXDLLIMPEXP_BASE
    wxString& operator<<(wxString&, const wxLongLongWx&);

#if wxUSE_STREAMS
    friend WXDLLIMPEXP_BASE
    class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxLongLongWx&);
    friend WXDLLIMPEXP_BASE
    class wxTextInputStream& operator>>(class wxTextInputStream&, wxLongLongWx&);
#endif

private:
    // long is at least 32 bits, so represent our 64bit number as 2 longs

    long m_hi;                // signed bit is in the high part
    unsigned long m_lo;

#ifdef wxLONGLONG_TEST_MODE
    void Check()
    {
        wxASSERT( (m_ll >> 32) == m_hi && (unsigned long)m_ll == m_lo );
    }

    wxLongLong_t m_ll;
#endif // wxLONGLONG_TEST_MODE
};

class WXDLLIMPEXP_BASE wxULongLongWx
{
public:
    // ctors
        // default ctor initializes to 0
    wxULongLongWx()
    {
        m_lo = m_hi = 0;

#ifdef wxLONGLONG_TEST_MODE
        m_ll = 0;

        Check();
#endif // wxLONGLONG_TEST_MODE
    }
        // from ulong
    wxULongLongWx(unsigned long l) { *this = l; }
        // from 2 ulongs
    wxULongLongWx(unsigned long hi, unsigned long lo)
    {
        m_hi = hi;
        m_lo = lo;

#ifdef wxLONGLONG_TEST_MODE
        m_ll = hi;
        m_ll <<= 32;
        m_ll |= lo;

        Check();
#endif // wxLONGLONG_TEST_MODE
    }

    // from signed to unsigned
    wxULongLongWx(wxLongLongWx ll)
    {
        wxASSERT(ll.GetHi() >= 0);
        m_hi = (unsigned long)ll.GetHi();
        m_lo = ll.GetLo();
    }

    // default copy ctor is ok in both cases

    // no dtor

    // assignment operators
        // from long
    wxULongLongWx& operator=(unsigned long l)
    {
        m_lo = l;
        m_hi = 0;

#ifdef wxLONGLONG_TEST_MODE
        m_ll = l;

        Check();
#endif // wxLONGLONG_TEST_MODE

        return *this;
    }
    wxULongLongWx& operator=(long l)
    {
        m_lo = l;
        m_hi = (unsigned long) ((l<0) ? -1l : 0);

#ifdef wxLONGLONG_TEST_MODE
        m_ll = (wxULongLong_t) (wxLongLong_t) l;

        Check();
#endif // wxLONGLONG_TEST_MODE

        return *this;
    }
    wxULongLongWx& operator=(const class wxLongLongWx &ll) {
        // Should we use an assert like it was before in the constructor?
        // wxASSERT(ll.GetHi() >= 0);
        m_hi = (unsigned long)ll.GetHi();
        m_lo = ll.GetLo();
        return *this;
    }

    // can't have assignment operator from 2 longs

    // accessors
        // get high part
    unsigned long GetHi() const { return m_hi; }
        // get low part
    unsigned long GetLo() const { return m_lo; }

        // convert to long with range checking in debug mode (only!)
    unsigned long ToULong() const
    {
        wxASSERT_MSG( m_hi == 0ul,
                      wxT("wxULongLong to long conversion loss of precision") );

        return (unsigned long)m_lo;
    }

        // convert to double
    double ToDouble() const;

    // operations
        // addition
    wxULongLongWx operator+(const wxULongLongWx& ll) const;
    wxULongLongWx& operator+=(const wxULongLongWx& ll);
    wxULongLongWx operator+(unsigned long l) const;
    wxULongLongWx& operator+=(unsigned long l);

        // pre increment operator
    wxULongLongWx& operator++();

        // post increment operator
    wxULongLongWx& operator++(int) { return ++(*this); }

        // subtraction
    wxLongLongWx operator-(const wxULongLongWx& ll) const;
    wxULongLongWx& operator-=(const wxULongLongWx& ll);

        // pre decrement operator
    wxULongLongWx& operator--();

        // post decrement operator
    wxULongLongWx& operator--(int) { return --(*this); }

    // shifts
        // left shift
    wxULongLongWx operator<<(int shift) const;
    wxULongLongWx& operator<<=(int shift);

        // right shift
    wxULongLongWx operator>>(int shift) const;
    wxULongLongWx& operator>>=(int shift);

    // bitwise operators
    wxULongLongWx operator&(const wxULongLongWx& ll) const;
    wxULongLongWx& operator&=(const wxULongLongWx& ll);
    wxULongLongWx operator|(const wxULongLongWx& ll) const;
    wxULongLongWx& operator|=(const wxULongLongWx& ll);
    wxULongLongWx operator^(const wxULongLongWx& ll) const;
    wxULongLongWx& operator^=(const wxULongLongWx& ll);
    wxULongLongWx operator~() const;

    // comparison
    bool operator==(const wxULongLongWx& ll) const
        { return m_lo == ll.m_lo && m_hi == ll.m_hi; }
    bool operator!=(const wxULongLongWx& ll) const
        { return !(*this == ll); }
    bool operator<(const wxULongLongWx& ll) const;
    bool operator>(const wxULongLongWx& ll) const;
    bool operator<=(const wxULongLongWx& ll) const
        { return *this < ll || *this == ll; }
    bool operator>=(const wxULongLongWx& ll) const
        { return *this > ll || *this == ll; }

    bool operator<(unsigned long l) const { return *this < wxULongLongWx(l); }
    bool operator>(unsigned long l) const { return *this > wxULongLongWx(l); }
    bool operator==(unsigned long l) const
    {
        return (m_hi == 0 && m_lo == (unsigned long)l);
    }

    bool operator<=(unsigned long l) const { return *this < l || *this == l; }
    bool operator>=(unsigned long l) const { return *this > l || *this == l; }

    // multiplication
    wxULongLongWx operator*(const wxULongLongWx& ll) const;
    wxULongLongWx& operator*=(const wxULongLongWx& ll);

    // division
    wxULongLongWx operator/(const wxULongLongWx& ll) const;
    wxULongLongWx& operator/=(const wxULongLongWx& ll);

    wxULongLongWx operator%(const wxULongLongWx& ll) const;

    void Divide(const wxULongLongWx& divisor,
                wxULongLongWx& quotient,
                wxULongLongWx& remainder) const;

    // input/output

    // return the string representation of this number
    wxString ToString() const;

    void *asArray() const;

#if wxUSE_STD_IOSTREAM
    friend WXDLLIMPEXP_BASE
    wxSTD ostream& operator<<(wxSTD ostream&, const wxULongLongWx&);
#endif // wxUSE_STD_IOSTREAM

    friend WXDLLIMPEXP_BASE
    wxString& operator<<(wxString&, const wxULongLongWx&);

#if wxUSE_STREAMS
    friend WXDLLIMPEXP_BASE
    class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxULongLongWx&);
    friend WXDLLIMPEXP_BASE
    class wxTextInputStream& operator>>(class wxTextInputStream&, wxULongLongWx&);
#endif

private:
    // long is at least 32 bits, so represent our 64bit number as 2 longs

    unsigned long m_hi;
    unsigned long m_lo;

#ifdef wxLONGLONG_TEST_MODE
    void Check()
    {
        wxASSERT( (m_ll >> 32) == m_hi && (unsigned long)m_ll == m_lo );
    }

    wxULongLong_t m_ll;
#endif // wxLONGLONG_TEST_MODE
};

#endif // wxUSE_LONGLONG_WX

// ----------------------------------------------------------------------------
// binary operators
// ----------------------------------------------------------------------------

inline bool operator<(long l, const wxLongLong& ll) { return ll > l; }
inline bool operator>(long l, const wxLongLong& ll) { return ll < l; }
inline bool operator<=(long l, const wxLongLong& ll) { return ll >= l; }
inline bool operator>=(long l, const wxLongLong& ll) { return ll <= l; }
inline bool operator==(long l, const wxLongLong& ll) { return ll == l; }
inline bool operator!=(long l, const wxLongLong& ll) { return ll != l; }

inline wxLongLong operator+(long l, const wxLongLong& ll) { return ll + l; }
inline wxLongLong operator-(long l, const wxLongLong& ll)
{
    return wxLongLong(l) - ll;
}

inline bool operator<(unsigned long l, const wxULongLong& ull) { return ull > l; }
inline bool operator>(unsigned long l, const wxULongLong& ull) { return ull < l; }
inline bool operator<=(unsigned long l, const wxULongLong& ull) { return ull >= l; }
inline bool operator>=(unsigned long l, const wxULongLong& ull) { return ull <= l; }
inline bool operator==(unsigned long l, const wxULongLong& ull) { return ull == l; }
inline bool operator!=(unsigned long l, const wxULongLong& ull) { return ull != l; }

inline wxULongLong operator+(unsigned long l, const wxULongLong& ull) { return ull + l; }

inline wxLongLong operator-(unsigned long l, const wxULongLong& ull)
{
    wxULongLong ret = wxULongLong(l) - ull;
    return wxLongLong((long)ret.GetHi(),ret.GetLo());
}

#if wxUSE_LONGLONG_NATIVE && wxUSE_STREAMS

WXDLLIMPEXP_BASE class wxTextOutputStream &operator<<(class wxTextOutputStream &stream, wxULongLong_t value);
WXDLLIMPEXP_BASE class wxTextOutputStream &operator<<(class wxTextOutputStream &stream, wxLongLong_t value);

WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &stream, wxULongLong_t &value);
WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &stream, wxLongLong_t &value);

#endif

#endif // wxUSE_LONGLONG

#endif // _WX_LONGLONG_H


text:
package org.elasticsearch.action.support;

import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.common.Booleans;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.collect.Tuple;
import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.IndexNotFoundException;

import java.util.ArrayList;
import java.util.List;

/**
 * Encapsulates the logic of whether a new index should be automatically created when
 * a write operation is about to happen in a non existing index.
 */
public final class AutoCreateIndex {

    public static final Setting<AutoCreate> AUTO_CREATE_INDEX_SETTING =
        new Setting<>("action.auto_create_index", "true", AutoCreate::new, Property.NodeScope, Setting.Property.Dynamic);

    private final IndexNameExpressionResolver resolver;
    private volatile AutoCreate autoCreate;

    public AutoCreateIndex(Settings settings, ClusterSettings clusterSettings, IndexNameExpressionResolver resolver) {
        this.resolver = resolver;
        this.autoCreate = AUTO_CREATE_INDEX_SETTING.get(settings);
        clusterSettings.addSettingsUpdateConsumer(AUTO_CREATE_INDEX_SETTING, this::setAutoCreate);
    }

    /**
     * Do we really need to check if an index should be auto created?
     */
    public boolean needToCheck() {
        return this.autoCreate.autoCreateIndex;
    }

    /**
     * Should the index be auto created?
     * @throws IndexNotFoundException if the index doesn't exist and shouldn't be auto created
     */
    public boolean shouldAutoCreate(String index, ClusterState state) {
        if (resolver.hasIndexAbstraction(index, state)) {
            return false;
        }
        // One volatile read, so that all checks are done against the same instance:
        final AutoCreate autoCreate = this.autoCreate;
        if (autoCreate.autoCreateIndex == false) {
            throw new IndexNotFoundException("[" + AUTO_CREATE_INDEX_SETTING.getKey() + "] is [false]", index);
        }

        // matches not set, default value of "true"
        if (autoCreate.expressions.isEmpty()) {
            return true;
        }
        for (Tuple<String, Boolean> expression : autoCreate.expressions) {
            String indexExpression = expression.v1();
            boolean include = expression.v2();
            if (Regex.simpleMatch(indexExpression, index)) {
                if (include) {
                    return true;
                }
                throw new IndexNotFoundException("[" + AUTO_CREATE_INDEX_SETTING.getKey() + "] contains [-"
                        + indexExpression + "] which forbids automatic creation of the index", index);
            }
        }
        throw new IndexNotFoundException("[" + AUTO_CREATE_INDEX_SETTING.getKey() + "] ([" + autoCreate
                + "]) doesn't match", index);
    }

    AutoCreate getAutoCreate() {
        return autoCreate;
    }

    void setAutoCreate(AutoCreate autoCreate) {
        this.autoCreate = autoCreate;
    }

    static class AutoCreate {
        private final boolean autoCreateIndex;
        private final List<Tuple<String, Boolean>> expressions;
        private final String string;

        private AutoCreate(String value) {
            boolean autoCreateIndex;
            List<Tuple<String, Boolean>> expressions = new ArrayList<>();
            try {
                autoCreateIndex = Booleans.parseBoolean(value);
            } catch (IllegalArgumentException ex) {
                try {
                    String[] patterns = Strings.commaDelimitedListToStringArray(value);
                    for (String pattern : patterns) {
                        if (pattern == null || pattern.trim().length() == 0) {
                            throw new IllegalArgumentException("Can't parse [" + value + "] for setting [action.auto_create_index] must "
                                    + "be either [true, false, or a comma separated list of index patterns]");
                        }
                        pattern = pattern.trim();
                        Tuple<String, Boolean> expression;
                        if (pattern.startsWith("-")) {
                            if (pattern.length() == 1) {
                                throw new IllegalArgumentException("Can't parse [" + value + "] for setting [action.auto_create_index] "
                                        + "must contain an index name after [-]");
                            }
                            expression = new Tuple<>(pattern.substring(1), false);
                        } else if(pattern.startsWith("+")) {
                            if (pattern.length() == 1) {
                                throw new IllegalArgumentException("Can't parse [" + value + "] for setting [action.auto_create_index] "
                                        + "must contain an index name after [+]");
                            }
                            expression = new Tuple<>(pattern.substring(1), true);
                        } else {
                            expression = new Tuple<>(pattern, true);
                        }
                        expressions.add(expression);
                    }
                    autoCreateIndex = true;
                } catch (IllegalArgumentException ex1) {
                    ex1.addSuppressed(ex);
                    throw ex1;
                }
            }
            this.expressions = expressions;
            this.autoCreateIndex = autoCreateIndex;
            this.string = value;
        }

        boolean isAutoCreateIndex() {
            return autoCreateIndex;
        }

        List<Tuple<String, Boolean>> getExpressions() {
            return expressions;
        }

        @Override
        public String toString() {
            return string;
        }
    }
}


text:
<properties>
    <name value="Microsoft Live Account" />
    <description value="A login portal for a user's Microsoft online services." />
    <login_url value="https://login.live.com/ppsecure/post.srf?wa=wsignin1.0&rpsnv=12&rver=6.4.6456.0&wp=MBI_SSL_SHARED&wreply=https:%2F%2Fmail.live.com%2Fdefault.aspx%3Frru%3Dinbox" />
    <invalid_password value="Your account or password is incorrect" />
    <invalid_account value="That Microsoft account doesn\'t exist." />
    <custom_search value="Account blocked because of too many invalid sign in attempts." regex="tried\sto\ssign\sin\stoo\smany\stimes\swith\san\sincorrect\saccount\sor\spassword" />
    <valid_response_header value="PPAuth=" />
    <headers value="Referer=https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=12&ct=&rver=6.4.6456.0&wp=MBI_SSL_SHARED&wreply=https:%2F%2Fmail.live.com%2Fdefault.aspx%3Frru%3Dinbox&lc=&id=&mkt=&cbcxt=" />
    <username_or_email value="both" />
    <login_parameter value="login" />
    <password_parameter value="passwd" />
    <data value="passwd=&login=&type=11&PPFT=&PPSX=Passport&idsbho=1&sso=0&NewUser=1&LoginOptions=3&i1=0&i2=1&i3=45998&i4=0&i7=0&i12=1&i13=0&i14=1789&i15=11286&i17=0&i18=__Login_Strings%7C1%2C__Login_Core%7C1%2C" />
    <multiple_params value="https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=12&ct=&rver=6.4.6456.0&wp=MBI_SSL_SHARED&wreply=https:%2F%2Fmail.live.com%2Fdefault.aspx%3Frru%3Dinbox&lc=&id=&mkt=&cbcxt=">
        <param value="PPFT" />
    </multiple_params>
</properties>


text:
"""
roidb
basic format [image_index]['boxes', 'gt_classes', 'gt_overlaps', 'flipped']
extended ['image', 'max_classes', 'max_overlaps', 'bbox_targets']
"""

import cv2
import numpy as np

from bbox.bbox_regression import compute_bbox_regression_targets

def prepare_roidb(imdb, roidb, cfg):
    """
    add image path, max_classes, max_overlaps to roidb
    :param imdb: image database, provide path
    :param roidb: roidb
    :return: None
    """
    print 'prepare roidb'
    for i in range(len(roidb)):  # image_index
        roidb[i]['image'] = imdb.image_path_from_index(imdb.image_set_index[i])
        if cfg.TRAIN.ASPECT_GROUPING:
            size = cv2.imread(roidb[i]['image']).shape
            roidb[i]['height'] = size[0]
            roidb[i]['width'] = size[1]
        gt_overlaps = roidb[i]['gt_overlaps'].toarray()
        max_overlaps = gt_overlaps.max(axis=1)
        max_classes = gt_overlaps.argmax(axis=1)
        roidb[i]['max_overlaps'] = max_overlaps
        roidb[i]['max_classes'] = max_classes

        # background roi => background class
        zero_indexes = np.where(max_overlaps == 0)[0]
        assert all(max_classes[zero_indexes] == 0)
        # foreground roi => foreground class
        nonzero_indexes = np.where(max_overlaps > 0)[0]
        assert all(max_classes[nonzero_indexes] != 0)


text:
from ledlib import globalconfig

RGB_min = 16        # below this we get flicker.  Disallow or use Fadecandy dither
RGB_max = 255       # as per spec
RGB_range = RGB_max - RGB_min

# values needed for single-strip testing
numLEDs = 512
StripSize = 30

# first pixel on each Fadecandy port - yeah, this is mathable.
Bases = [ 0, 64, 128, 192, 256, 320, 384, 448 ]

def pixel_list (Fadecandy, strand, chunk, chunksize=30, direction=0):
    # given a defined chunk of LEDs, return a list of pixel numbers from
    # basewards to tipwards
    #
    from ledlib.helpers import debugprint, usage
  # sanity check
    if Fadecandy >= 10:
        usage ("Fadecandy value out of range: " + str(Fadecandy))
    if strand >= 8:
        usage ("strand value out of range: " + str(strand))
    if chunk >= 5:
        usage ("chunk value out of range: " + str(chunk))
    if chunksize > 64:
        usage ("chunksize value out of range: " + str(chunksize))
    if direction > 1:
        usage ("direction is 0 for normal, 1 for inverted")

    chunkhead = \
        512 * Fadecandy + \
        Bases [strand] + \
        chunk * chunksize
    chunktail = \
        chunkhead + chunksize

    debugprint ("head = "+str(chunkhead))
    debugprint ("tail = "+str(chunktail))
    # print ("head = "+str(chunkhead))
    # print ("tail = "+str(chunktail))

    pixels = [0] * chunksize
    for i in range (chunksize):
        if direction == 0:
            pixels[i] = chunkhead + i
        if direction == 1:
            pixels[i] = chunktail - i

    return pixels

def wrap():
    # function to put a pattern on a set of LEDs, possibly wrapping around
    # from the start point.
  pass

def check_RGB(value):
    # http://stackoverflow.com/questions/14117415
    cvalue = int(value)
    if (cvalue < 0) or (cvalue > 255):
        raise argparse.ArgumentTypeError("RGB values must be between 0 and 255")
    if (cvalue < RGB_min) and (cvalue > 0):
        raise argparse.ArgumentTypeError("RGB values between 1 and 16 flicker.")
    return cvalue

def check_COLOR(value):
    from ledlib.colordefs import colortable
    if value == "":
        return value
    if value in colortable:
        return value
    else:
        raise argparse.ArgumentTypeError("Unknown color " + value)

def check_RESO(value):
    try:
        ivalue = int(value)
    except:
        raise argparse.ArgumentTypeError("Resonator number must be between 0 and 7")

    if (ivalue < 0) or (ivalue > 7):
        raise argparse.ArgumentTypeError("Resonator number must be between 0 and 7")
    return value

def legal_intensity(value):
    if value < 8:
        return 0
    if value < 16:
        return 16
    if value < 255:
        return int(value)
    else:
        return 255

def dimmer (rgb_triplet, scale=1.00, maxbright=globalconfig.max_brightness):
    # usage:  new_rbg = dimmer(old_rgb)             # flatten down over-brightness
    #                   new_rgb = dimmer(old_rgb, 0.6)  # 60%
    # RGB_min = ledmath.RGB_min
    # RGB_max = ledmath.RGB_max
    red = rgb_triplet[0]
    green = rgb_triplet[1]
    blue = rgb_triplet[2]

    if (scale < 1.00):
        red = red * scale
        green = green * scale
        blue = blue * scale

    average_brightness = (red + green + blue) / 3
    percent_brightness = average_brightness / RGB_max
    if (percent_brightness) > maxbright:
        red = red * maxbright * percent_brightness
        green = green * maxbright * percent_brightness
        blue = blue * maxbright * percent_brightness

    red = legal_intensity(red)
    green = legal_intensity(green)
    blue = legal_intensity(blue)

    return (red, green, blue)

def mix (rgb1, scale1, rgb2, scale2=0, maxbright=globalconfig.max_brightness):
    # mix two colors in the given proportions.
    # more Pythonic to have the inputs be structured.  Feel free to fix.
    # scale1 and scale2 will not necessarily sum to 1
    if scale2==0:
        scale2 = 1.0-scale1
    red     = rgb1[0]*scale1 + rgb2[0]*scale2
    green   = rgb1[1]*scale1 + rgb2[1]*scale2
    blue    = rgb1[2]*scale1 + rgb2[2]*scale2
    return dimmer((int(red), int(green), int(blue)))

    pass


text:
from .MatrixPointer import MatrixPointer

__all__ = ['MatrixPointer']


text:
package function.cohort.statistics;

import function.cohort.base.SampleManager;
import function.cohort.base.CalledVariant;
import function.cohort.base.Sample;
import global.Data;
import global.Index;
import java.util.StringJoiner;
import utils.FormatManager;
import utils.LogManager;
import org.apache.commons.math3.stat.regression.SimpleRegression;

/**
 *
 * @author nick
 */
public class LinearOutput extends StatisticOutput {

    double beta1 = 0;

    public static String getHeader() {
        StringJoiner sj = new StringJoiner(",");

        sj.merge(getVariantDataHeader());
        sj.merge(getAnnotationDataHeader());
        sj.merge(getExternalDataHeader());
        sj.merge(getCohortLevelHeader());
        sj.add("P Value");
        sj.add("Beta1");

        return sj.toString();
    }

    public LinearOutput(CalledVariant c) {
        super(c);
    }

    public boolean isValid(String model) {
        if (model.equals("recessive")) {
            if (!isRecessive()) {
                return false;
            }
        }

        return true;
    }

    public void doRegression(String model) {
        SimpleRegression sr = new SimpleRegression(true);
        for (Sample sample : SampleManager.getList()) {
            byte geno = calledVar.getGT(sample.getIndex());
            if (geno != Data.INTEGER_NA) {
                float y = sample.getQuantitativeTrait();
                switch (model) {
                    case "allelic":
                        if (geno == Index.REF) {
                            sr.addData(0, y);
                            sr.addData(0, y);
                        } else if (geno == Index.HET) {
                            sr.addData(1, y);
                            sr.addData(0, y);
                        } else if (geno == Index.HOM) {
                            sr.addData(1, y);
                            sr.addData(1, y);
                        }
                        break;
                    case "dominant":
                        if (geno == Index.REF) {
                            sr.addData(0, y);
                        } else if (geno == Index.HET) {
                            sr.addData(1, y);
                        } else if (geno == Index.HOM) {
                            sr.addData(1, y);
                        }
                        break;
                    case "recessive":
                        if (geno == Index.REF) {
                            sr.addData(0, y);
                        } else if (geno == Index.HET) {
                            sr.addData(0, y);
                        } else if (geno == Index.HOM) {
                            sr.addData(1, y);
                        }
                        break;
                    case "genotypic":
                        // not complete yet, to be finished a bit later
                        if (geno == Index.REF) {
                            sr.addData(0, y);
                        } else if (geno == Index.HET) {
                            sr.addData(1, y);
                        } else if (geno == Index.HOM) {
                            sr.addData(2, y);
                        }
                        break;
                    case "additive":
                        if (geno == Index.REF) {
                            sr.addData(0, y);
                        } else if (geno == Index.HET) {
                            sr.addData(1, y);
                        } else if (geno == Index.HOM) {
                            sr.addData(2, y);
                        }
                        break;
                    default:
                        LogManager.writeAndPrint("model is not recognized");
                        break;
                }
            }
        }
        pValue = sr.getSignificance();
        if (Double.isNaN(pValue)) {
            pValue = Data.DOUBLE_NA;
        }
        beta1 = sr.getSlope();
        if (Double.isNaN(beta1)) {
            beta1 = Data.DOUBLE_NA;
        }
    }

    @Override
    public String toString() {
        StringJoiner sj = new StringJoiner(",");

        calledVar.getVariantData(sj);
        calledVar.getAnnotationData(sj);
        calledVar.getExternalData(sj);
        getGenoStatData(sj);

        sj.add(FormatManager.getDouble(pValue));
        sj.add(FormatManager.getDouble(beta1));

        return sj.toString();
    }
}


text:
/* jslint node: true */
/* eslint-env mocha */

const chai = require('chai');
const chaiAsPromised = require("chai-as-promised");
chai.use(chaiAsPromised);
const expect = chai.expect;

const FacilityLoaderMock = require('./FacilityLoaderMock.js');
const FacilityService = require('./../../Facility/FacilityService.js');

describe('FacilityService', () => {
  var facilityLoaderMock = new FacilityLoaderMock();
  let facilityServcie = new FacilityService(facilityLoaderMock)

  beforeEach(function() {
    facilityLoaderMock = new FacilityLoaderMock();
    facilityServcie = new FacilityService(facilityLoaderMock);
  });

  it('stationByEvaId should return valid station', () => {
    facilityLoaderMock.result = require('./FacilitiesMockResults');
    let promise = facilityServcie.facilitiesForStationNumber(1).then(facilities => facilities[0]);

    return Promise.all([
        expect(promise).to.eventually.have.property("equipmentNumber", 10355942),
        expect(promise).to.eventually.have.property("type", "ELEVATOR"),
        expect(promise).to.eventually.have.property("description", "zu Gleis 6/7"),
        expect(promise).to.eventually.have.property("state", "ACTIVE"),
        expect(promise).to.eventually.have.deep.property("location", {latitude: 50.767629, longitude: 6.09134})

    ]);
  });

});


text:
<button class="btn btn-danger" ng-click="createKit();">
    Generate Kit (with Fixed Data)
</button>
<p>{{createdKit}}</p>


text:
<?php
require APP_PATH ."libs/Parsedown.php";

class TutorialController extends AppController {
    // Filtro para detectar si se envia un parametro o una acción
    protected function before_filter()
    {
        if (! method_exists($this, $this->action_name)) {
            $this->parameters = [$this->action_name];
            $this->action_name = 'item';
        }
    }

    // Listado de ultimos trabajos
    public function index()
    {
        $this -> ultimosTutoriales = (new Articles) -> listado_de_tutoriales ($page=1);
        $this -> titulo = "Listado de tutoriales";
    }

    public function item($attr)
    {
        View::template('itempublic');
        View::select('item');
        $parseMD = new Parsedown();
        $db = new Articles();
        $this -> articulo = $db -> get_tutorial_by_url($attr);
        $this -> contenido = $parseMD -> text($this -> articulo -> contenido);
        $this -> ultimosTutoriales = (new Articles) -> ver_ultimostutoriales_ind();
        $this -> titulo = $this -> articulo -> titulo;
    }
}

?>


text:
package cli

import (
	"flag"
	"testing"
)

func TestCommandDoNotIgnoreFlags(t *testing.T) {
	app := NewApp()
	set := flag.NewFlagSet("test", 0)
	test := []string{"blah", "blah", "-break"}
	set.Parse(test)

	c := NewContext(app, set, nil)

	command := Command{
		Name:        "test-cmd",
		Aliases:     []string{"tc"},
		Usage:       "this is for testing",
		Description: "testing",
		Action:      func(_ *Context) int { return 0 },
	}
	_, err := command.Run(c)

	expect(t, err.Error(), "flag provided but not defined: -break")
}

func TestCommandIgnoreFlags(t *testing.T) {
	app := NewApp()
	set := flag.NewFlagSet("test", 0)
	test := []string{"blah", "blah"}
	set.Parse(test)

	c := NewContext(app, set, nil)

	command := Command{
		Name:            "test-cmd",
		Aliases:         []string{"tc"},
		Usage:           "this is for testing",
		Description:     "testing",
		Action:          func(_ *Context) int { return 0 },
		SkipFlagParsing: true,
	}
	_, err := command.Run(c)

	expect(t, err, nil)
}


text:
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __IDD_H
#define __IDD_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include <stdint.h>

/** @addtogroup BSP
  * @{
  */

/** @addtogroup Components
  * @{
  */

/** @addtogroup IDD
  * @{
  */

/** @defgroup IDD_Exported_Types IDD Exported Types
  * @{
  */

/** @defgroup IDD_Config_structure  IDD Configuration structure
  * @{
  */
typedef struct
{
  uint16_t AmpliGain;       /*!< Specifies ampli gain value
                                 */
  uint16_t VddMin;          /*!< Specifies minimum MCU VDD can reach to protect MCU from reset
                                  */
  uint16_t Shunt0Value;     /*!< Specifies value of Shunt 0 if existing
                                 */
  uint16_t Shunt1Value;     /*!< Specifies value of Shunt 1 if existing
                                 */
  uint16_t Shunt2Value;     /*!< Specifies value of Shunt 2 if existing
                                 */
  uint16_t Shunt3Value;     /*!< Specifies value of Shunt 3 if existing
                                 */
  uint16_t Shunt4Value;     /*!< Specifies value of Shunt 4 if existing
                                  */
  uint8_t ShuntNumber;      /*!< Specifies number of shunts used
                                 This parameter can be a value of @ref IDD_shunt_number */
  uint8_t VrefMeasurement;  /*!< Specifies if Vref is automatically measured before each Idd measurement
                                 This parameter can be a value of @ref IDD_Vref_Measurement */
  uint8_t Calibration;      /*!< Specifies if calibration is done before each Idd measurement
                                  */
  uint8_t PreDelay;         /*!< Specifies if Pre delay unit
                                 This parameter can be a value of @ref IDD_PreDelay */
  uint8_t PreDelayValue;    /*!< Specifies if Pre delay value in selected unit
                                  */
}IDD_ConfigTypeDef;
/**
  * @}
  */

/** @defgroup IDD_Driver_structure  IDD Driver structure
  * @{
  */
typedef struct
{
  void       (*Init)(uint16_t);
  void       (*DeInit)(uint16_t);
  uint16_t   (*ReadID)(uint16_t);
  void       (*Reset)(uint16_t);
  void       (*LowPower)(uint16_t);
  void       (*WakeUp)(uint16_t);
  void       (*Start)(uint16_t);
  void       (*Config)(uint16_t,IDD_ConfigTypeDef);
  void       (*GetValue)(uint16_t, uint32_t *);
  void       (*EnableIT)(uint16_t);
  void       (*ClearIT)(uint16_t);
  uint8_t    (*GetITStatus)(uint16_t);
  void       (*DisableIT)(uint16_t);
  void       (*ErrorEnableIT)(uint16_t);
  void       (*ErrorClearIT)(uint16_t);
  uint8_t    (*ErrorGetITStatus)(uint16_t);
  void       (*ErrorDisableIT)(uint16_t);
  uint8_t    (*ErrorGetSrc)(uint16_t);
  uint8_t    (*ErrorGetCode)(uint16_t);
}IDD_DrvTypeDef;
/**
  * @}
  */

/**
  * @}
  */

/**
  * @}
  */

/**
  * @}
  */

/**
  * @}
  */

#ifdef __cplusplus
}
#endif

#endif /* __IDD_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


text:
namespace LanguageBasics.Common
{
    // ReSharper disable FieldCanBeMadeReadOnly.Local

    public class StaticConstructorDemoClass
    {
        private static string s_staticField;

        static StaticConstructorDemoClass()
        {
            s_staticField = "You are so cute!";
        }

        public static string StaticField
        {
            get { return s_staticField; }
        }
    }

    // ReSharper restore FieldCanBeMadeReadOnly.Local
}