text:
package cn.com.jinke.assist.utils;

/**
 * Created by jinke on 16/8/9.
 * 存放一些返回参数的接口
 */
public interface CodeConstants {

    public final static int FAIL = 0;
    public final static int SUCCESS = 200;
    public final static int SUCCESS_AUTO = 2;

    public final static int FINISH_YES = 1;
    public final static int FINISH_NO = 0;

    public final static int PAGE_START = 0;
    public final static int TOTAL = 0;
    public final static int PAGE_SIZE = 10;

    public final static String B_CODE = "code";
    public final static String B_TITLE = "title";
    public final static String B_ENTITY = "entity";
    public final static String B_ID = "id";

    public final static String DATA = "data";
    public final static String MD5 = "md5";
    public final static String COMMAND = "method";
    public final static String LOGIN = "login";
    public final static String USERNAME = "username";
    public final static String PWD = "pwd";
    public final static String GETSRVLIST = "getsrvlist";
    public final static String SAVESRV = "savesrv";
    public final static String KEYWORD = "keyword";
    public final static String INFOTYPEID = "infotypeid";
    public final static String ZCFGLIST = "zcfglist";
    public final static String DATAID = "id";
    public final static String UUID = "uid";
    public final static String PAGESIZE = "pagesize";
    public final static String PAGEINDEX = "pageindex";
    public final static String APPUPDATE = "appupdatecheck";
    public final static String COMMUNITYID = "communityid";
    public final static String ENTITYTYPE = "entitytype";
    public final static String GETPERSIONLIST = "GetPersonalProfileList";

}


text:
package io.katharsis.client.internal;

import java.io.Serializable;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

import io.katharsis.client.KatharsisClient;
import io.katharsis.client.action.ActionStubFactory;
import io.katharsis.core.internal.utils.ClassUtils;
import io.katharsis.repository.ResourceRepositoryV2;
import io.katharsis.resource.list.DefaultResourceList;
import io.katharsis.resource.list.ResourceListBase;
import net.jodah.typetools.TypeResolver;

public class ClientStubInvocationHandler implements InvocationHandler {

	private ResourceRepositoryV2<?, Serializable> repositoryStub;

	private Object actionStub;

	private Map<Method, Method> interfaceStubMethodMap = new HashMap<>();

	public ClientStubInvocationHandler(Class<?> repositoryInterface,
			ResourceRepositoryV2<?, Serializable> repositoryStub, Object actionStub) {
		this.repositoryStub = repositoryStub;
		this.actionStub = actionStub;
		setupRepositoryMethods(repositoryInterface);
	}

	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		try {
			if (method.getDeclaringClass().isAssignableFrom(ResourceRepositoryV2.class)) {
				// execute repository method
				return method.invoke(repositoryStub, args);
			}
			else if (interfaceStubMethodMap.containsKey(method)) {
				return invokeInterfaceMethod(proxy, method, args);
			}
			else if (actionStub != null) {
				// execute action
				return method.invoke(actionStub, args);
			}
			else {
				throw new IllegalStateException("cannot execute actions, no " + ActionStubFactory.class.getSimpleName()
						+ " set with " + KatharsisClient.class.getName());
			}
		}
		catch (InvocationTargetException e) { // NOSONAR ok this way
			throw e.getCause();
		}
	}

	private Object invokeInterfaceMethod(Object proxy, Method method, Object[] args)
			throws IllegalAccessException, InvocationTargetException {
		Method stubMethod = interfaceStubMethodMap.get(method);
		Object result = stubMethod.invoke(repositoryStub, args);

		Class<?> returnType = method.getReturnType();
		if (result == null || returnType.isInstance(result)) {
			return result;
		}
		else if (result instanceof DefaultResourceList) {
			return createTypesafeList(result, returnType);
		}
		else {
			throw new IllegalStateException("cannot cast return type " + result + " to " + returnType.getName());
		}
	}

	@SuppressWarnings({ "unchecked", "rawtypes" })
	private Object createTypesafeList(Object result, Class<?> returnType) {
		DefaultResourceList defaultList = (DefaultResourceList) result;

		Class<?>[] typeArguments = TypeResolver.resolveRawArguments(ResourceListBase.class, returnType);
		Class<?> metaType = typeArguments[1];
		Class<?> linksType = typeArguments[2];

		ResourceListBase typedList = (ResourceListBase) ClassUtils.newInstance(returnType);
		typedList.addAll(defaultList);
		typedList.setMeta(defaultList.getMeta(metaType));
		typedList.setLinks(defaultList.getLinks(linksType));
		return typedList;
	}

	private void setupRepositoryMethods(Class<?> repositoryInterface) {
		Map<String, Method> stubMethods = new HashMap<>();
		for (Method method : ResourceRepositoryV2.class.getMethods()) {
			stubMethods.put(getMethodId(method), method);
		}

		for (Method method : repositoryInterface.getDeclaredMethods()) {
			String id = getMethodId(method);
			Method stubMethod = stubMethods.get(id);
			if (stubMethod != null) {
				interfaceStubMethodMap.put(method, stubMethod);
			}
		}
	}

	private static String getMethodId(Method method) {
		StringBuilder builder = new StringBuilder();
		builder.append(method.getName());
		for (Class<?> paramType : method.getParameterTypes()) {
			builder.append("#");
			builder.append(paramType.getName());
		}
		return builder.toString();
	}
}

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 15.4.4.20-2-14
description: >
    Array.prototype.filter applied to the Array-like object that
    'length property doesn't exist
---*/

        var accessed = false;
        function callbackfn(val, idx, obj) {
            accessed = true;
            return true;
        }

        var obj = { 0: 11, 1: 12 };

        var newArr = Array.prototype.filter.call(obj, callbackfn);

assert.sameValue(newArr.length, 0, 'newArr.length');
assert.sameValue(accessed, false, 'accessed');


text:
package com.ivan.dourachok.engine.runtime.clock;

import com.ivan.dourachok.engine.runtime.exception.DourachokRuntimeException;

/**
 * @author Christophe Dame
 */
public class SystemClock implements IClock {

	@Override
	public boolean isManaged() {
		return false;
	}

	@Override
	public long getCurrentTime() {
		return System.currentTimeMillis();
	}

	@Override
	public void setCurrentTime(long time) throws DourachokRuntimeException {
		throw new DourachokRuntimeException("You can't set the time of an unmanaged clock");
	}

	@Override
	public void addTime(long time) throws DourachokRuntimeException {
		throw new DourachokRuntimeException("You can't set the time of an unmanaged clock");
	}

}


text:
<?php

$msg['amount_invalid'] = "Amount is not a valid number";
$msg['amount_decimals'] = "Amount must not have more than 2 decimals."
$msg['encoding_1'] = "Character encoding";
$msg['encoding_2'] = "is not supported."
$msg['name_length'] = "Name has more than 70 characters.";
$msg['bic_length'] = "BIC has more than 11 characters.";
$msg['iban_length'] = "IBAN has more than 34 characters.";
$msg['amount_length'] = "Amount has more than 12 characters.";
$msg['text_length'] = "Reference text has more than 140 characters.";
$msg['payload_bytes_1'] = "Total payload is more than 331 bytes";
$msg['payload_bytes_2'] = "The reference text has";
$msg['bytes'] = "bytes";

?>


text:
"""
Custom Authenticator to use GitHub OAuth with JupyterHub

Most of the code c/o Kyle Kelley (@rgbkrk)

Extended use of GH attributes by Adam Thornton (athornton@lsst.org)
"""

import json
import os
import re
import string

from tornado.auth import OAuth2Mixin
from tornado import gen, web

from tornado.httputil import url_concat
from tornado.httpclient import HTTPRequest, AsyncHTTPClient, HTTPError

from jupyterhub.auth import LocalAuthenticator

from traitlets import List, Set, Unicode

from .common import next_page_from_links
from .oauth2 import OAuthLoginHandler, OAuthenticator

# Support github.com and github enterprise installations
GITHUB_HOST = os.environ.get('GITHUB_HOST') or 'github.com'
if GITHUB_HOST == 'github.com':
    GITHUB_API = 'api.github.com'
else:
    GITHUB_API = '%s/api/v3' % GITHUB_HOST

# Support github enterprise installations with both http and https
GITHUB_HTTP = os.environ.get('GITHUB_HTTP')
if GITHUB_HTTP:
    GITHUB_PROTOCOL = 'http'
else:
    GITHUB_PROTOCOL = 'https'

def _api_headers(access_token):
    return {"Accept": "application/json",
            "User-Agent": "JupyterHub",
            "Authorization": "token {}".format(access_token)
            }

class GitHubMixin(OAuth2Mixin):
    _OAUTH_AUTHORIZE_URL = "%s://%s/login/oauth/authorize" % (GITHUB_PROTOCOL, GITHUB_HOST)
    _OAUTH_ACCESS_TOKEN_URL = "%s://%s/login/oauth/access_token" % (GITHUB_PROTOCOL, GITHUB_HOST)

class GitHubLoginHandler(OAuthLoginHandler, GitHubMixin):
    pass

class GitHubOAuthenticator(OAuthenticator):

    # see github_scopes.md for details about scope config
    # set scopes via config, e.g.
    # c.GitHubOAuthenticator.scope = ['read:org']

    login_service = "GitHub"

    # deprecated names
    github_client_id = Unicode(config=True, help="DEPRECATED")

    def _github_client_id_changed(self, name, old, new):
        self.log.warning("github_client_id is deprecated, use client_id")
        self.client_id = new
    github_client_secret = Unicode(config=True, help="DEPRECATED")

    def _github_client_secret_changed(self, name, old, new):
        self.log.warning("github_client_secret is deprecated, use client_secret")
        self.client_secret = new

    client_id_env = 'GITHUB_CLIENT_ID'
    client_secret_env = 'GITHUB_CLIENT_SECRET'
    login_handler = GitHubLoginHandler

    github_organization_whitelist = Set(
        config=True,
        help="Automatically whitelist members of selected organizations",
    )

    @gen.coroutine
    def authenticate(self, handler, data=None):
        """We set up auth_state based on additional GitHub info if we
        receive it.
        """
        code = handler.get_argument("code")
        # TODO: Configure the curl_httpclient for tornado
        http_client = AsyncHTTPClient()

        # Exchange the OAuth code for a GitHub Access Token
        #
        # See: https://developer.github.com/v3/oauth/

        # GitHub specifies a POST request yet requires URL parameters
        params = dict(
            client_id=self.client_id,
            client_secret=self.client_secret,
            code=code
        )

        url = url_concat("%s://%s/login/oauth/access_token" % (GITHUB_PROTOCOL, GITHUB_HOST),
                         params)

        req = HTTPRequest(url,
                          method="POST",
                          headers={"Accept": "application/json"},
                          body=''  # Body is required for a POST...
                          )

        resp = yield http_client.fetch(req)
        resp_json = json.loads(resp.body.decode('utf8', 'replace'))

        if 'access_token' in resp_json:
            access_token = resp_json['access_token']
        elif 'error_description' in resp_json:
            raise HTTPError(403,
                "An access token was not returned: {}".format(
                    resp_json['error_description']))
        else:
            raise HTTPError(500,
                "Bad response: %s".format(resp))

        # Determine who the logged in user is
        req = HTTPRequest("%s://%s/user" % (GITHUB_PROTOCOL, GITHUB_API),
                          method="GET",
                          headers=_api_headers(access_token)
                          )
        resp = yield http_client.fetch(req)
        resp_json = json.loads(resp.body.decode('utf8', 'replace'))

        username = resp_json["login"]
        # username is now the GitHub userid.
        if not username:
            return None
        # Check if user is a member of any whitelisted organizations.
        # This check is performed here, as it requires `access_token`.
        if self.github_organization_whitelist:
            for org in self.github_organization_whitelist:
                user_in_org = yield self._check_organization_whitelist(org, username, access_token)
                if user_in_org:
                    break
            else:  # User not found in member list for any organisation
                self.log.warning("User %s is not in org whitelist", username)
                return None
        userdict = {"name": username}
        # Now we set up auth_state
        userdict["auth_state"] = auth_state = {}
        # Save the access token and full GitHub reply (name, id, email) in auth state
        # These can be used for user provisioning in the Lab/Notebook environment.
        # e.g.
        #  1) stash the access token
        #  2) use the GitHub ID as the id
        #  3) set up name/email for .gitconfig
        auth_state['access_token'] = access_token
        # store the whole user model in auth_state.github_user
        auth_state['github_user'] = resp_json
        # A public email will return in the initial query (assuming default scope).
        # Private will not.

        return userdict

    @gen.coroutine
    def _check_organization_whitelist(self, org, username, access_token):
        http_client = AsyncHTTPClient()
        headers = _api_headers(access_token)
        # Get all the members for organization 'org'
        # With empty scope (even if authenticated by an org member), this
        #  will only yield public org members.  You want 'read:org' in order
        #  to be able to iterate through all members.
        next_page = "%s://%s/orgs/%s/members" % (GITHUB_PROTOCOL, GITHUB_API, org)
        while next_page:
            req = HTTPRequest(next_page, method="GET", headers=headers)
            resp = yield http_client.fetch(req)
            resp_json = json.loads(resp.body.decode('utf8', 'replace'))
            next_page = next_page_from_links(resp)
            for entry in resp_json:
                if username == entry['login']:
                    return True
        return False

class LocalGitHubOAuthenticator(LocalAuthenticator, GitHubOAuthenticator):

    """A version that mixes in local system user creation"""
    pass


text:
import apiClient from './apiClient';

export default {
  load() {
    return apiClient.get('/app/load');
  }
};


text:
require 'zlib'

class ReadFile

  def initialize fn, encoding='utf-8'
    if fn.split('.').last == 'gz'
      @f = Zlib::GzipReader.new(File.new(fn, 'rb'), :external_encoding=>encoding)
    elsif fn == '-'
      @f = STDIN
      STDIN.set_encoding encoding
    else
      @f = File.new fn, 'r'
      @f.set_encoding encoding
    end
  end

  def get
    return @f
  end

  def gets
    @f.gets { |line| yield line }
  end

  def rewind
    @f.rewind
  end

  def readlines
    @f.readlines
  end

  def self.readlines fn, encoding='utf-8'
    f = ReadFile.new fn, encoding
    r = f.readlines
    f.close
    return r
  end

  def readlines_strip
    self.readlines.map{ |i| i.strip }
  end

  def self.readlines_strip fn, encoding='utf-8'
    f = ReadFile.new fn, encoding
    r = f.readlines_strip
    f.close
    return r
  end

  def read
    @f.read
  end

  def self.read fn, encoding='utf-8'
    f = ReadFile.new fn, encoding
    r = f.read
    f.close
    return r
  end

  def close
    @f.close if @f!=STDIN
  end
end

class WriteFile

  def initialize fn, encoding='utf-8'
    if fn.split('.').last == 'gz'
      @f = Zlib::GzipWriter.new(File.new(fn, 'wb+'), :external_encoding=>encoding)
    elsif fn == '-'
      @f = STDOUT
      STDOUT.set_encoding encoding
    else
      @f = File.new fn, 'w+'
      @f.set_encoding encoding
    end
  end

  def write s
    @f.write s
  end

  def self.write s, fn, encoding='utf-8'
    f = WriteFile.new fn, encoding
    f.write s
    f.close
  end

  def close
    @f.close if @f!=STDIN
  end
end


text:
This is a resource cookbook that hosts a LWRP that supports configuration of
Windows shadowcopy with the following (string) attributes:
* drivepath
* MaxSize
* shadowcopy_storagepath
And these (string) actions:
* enable
* schedule

This LWRP leverages Microsoft DSC script to perform tasks, and may not work
properly with older versions of Windows.  Your mileage may vary.

## Warning

This LWRP cookbook requires DSC bits necessary to manage VSS to be installed
prior to using the win_shadowcopy LWRP.  Please refer to DSC documentation for
directions.

## Example Usage

win_shadowcopy 'default' do
  action :enable
  shadowcopy_drivepath 'C:'
  shadowcopy_maxsize '1024MB'
  shadowcopy_storagepath 'C:'
end

win_shadowcopy 'default' do
  action :schedule
  schedule_ensure 'Present'
  schedule_drivepath 'C:'
  schedule_time '5:00PM'
  schedule_taskname 'C_drive_VSS'
end

## Author

Sandeep Bhat and Dave Viebrock, Nordstrom, Inc.

## License

Copyright 2015 Nordstrom, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


text:
package net.automatalib.util.automata;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

import net.automatalib.automata.Automaton;
import net.automatalib.automata.DeterministicAutomaton;
import net.automatalib.automata.MutableDeterministic;
import net.automatalib.automata.UniversalAutomaton;
import net.automatalib.automata.UniversalDeterministicAutomaton;
import net.automatalib.automata.graphs.TransitionEdge;
import net.automatalib.automata.vpda.OneSEVPA;
import net.automatalib.commons.util.collections.CollectionsUtil;
import net.automatalib.graphs.Graph;
import net.automatalib.graphs.UniversalGraph;
import net.automatalib.util.automata.cover.Covers;
import net.automatalib.util.automata.equivalence.CharacterizingSets;
import net.automatalib.util.automata.equivalence.DeterministicEquivalenceTest;
import net.automatalib.util.automata.equivalence.NearLinearEquivalenceTest;
import net.automatalib.util.automata.vpda.OneSEVPAUtil;
import net.automatalib.util.minimizer.Block;
import net.automatalib.util.minimizer.BlockMap;
import net.automatalib.util.minimizer.MinimizationResult;
import net.automatalib.util.minimizer.Minimizer;
import net.automatalib.util.ts.TS;
import net.automatalib.words.VPDAlphabet;
import net.automatalib.words.Word;
import org.checkerframework.checker.nullness.qual.Nullable;

public class Automata extends TS {

    public static <S, I, T> Graph<S, TransitionEdge> asGraph(Automaton<S, I, T> automaton,
                                                                   Collection<? extends I> inputs) {
        return automaton.transitionGraphView(inputs);
    }

    public static <S, I, T, SP, TP, SO, TO, A extends MutableDeterministic<SO, ? super I, TO, ? super SP, ? super TP>> A minimize(
            UniversalDeterministicAutomaton<S, I, T, SP, TP> automaton,
            Collection<? extends I> inputs,
            A output) {

        UniversalGraph<S, TransitionEdge, SP, TransitionEdge.Property> aag =
                asUniversalGraph(automaton, inputs);

        MinimizationResult<S, TransitionEdge.Property> mr =
                Minimizer.minimize(aag, automaton.getInitialStates());
        output.clear();

        S init = automaton.getInitialState();
        Block<S, TransitionEdge.Property> initBlock = init == null ? null : mr.getBlockForState(init);
        BlockMap<SO> bm = new BlockMap<>(mr);

        for (Block<S, TransitionEdge.Property> block : mr.getBlocks()) {
            S rep = mr.getRepresentative(block);
            SO state;
            SP repProp = automaton.getStateProperty(rep);
            if (block == initBlock) {
                state = output.addInitialState(repProp);
            } else {
                state = output.addState(repProp);
            }
            bm.put(block, state);
        }

        for (Block<S, TransitionEdge.Property> block : mr.getBlocks()) {
            S rep = mr.getRepresentative(block);
            SO state = bm.get(block);
            for (I input : inputs) {
                T trans = automaton.getTransition(rep, input);
                if (trans != null) {
                    TP prop = automaton.getTransitionProperty(trans);
                    S oldSucc = automaton.getSuccessor(trans);
                    Block<S, TransitionEdge.Property> succBlock = mr.getBlockForState(oldSucc);
                    SO newSucc = bm.get(succBlock);
                    output.addTransition(state, input, newSucc, prop);
                }
            }
        }
        return output;
    }

    public static <S, I, T, SP, TP> UniversalGraph<S, TransitionEdge, SP, TransitionEdge.Property> asUniversalGraph(
            UniversalAutomaton<S, I, T, SP, TP> automaton,
            Collection<? extends I> inputs) {
        return automaton.transitionGraphView(inputs);
    }

    @SuppressWarnings("unchecked")
    public static <S, I, T, SP, TP, A extends MutableDeterministic<S, I, T, SP, TP>> A invasiveMinimize(A automaton,
                                                                                Collection<? extends I> inputs) {

        final List<? extends I> inputList = CollectionsUtil.randomAccessList(inputs);

        int numInputs = inputs.size();

        UniversalGraph<S, TransitionEdge, SP, TransitionEdge.Property> aag =
                asUniversalGraph(automaton, inputs);

        MinimizationResult<S, TransitionEdge.Property> mr =
                Minimizer.minimize(aag, automaton.getInitialStates());

        S init = automaton.getInitialState();
        int initId = init == null ? -1 : mr.getBlockForState(init).getId();

        ResultStateRecord<SP, TP>[] records = new ResultStateRecord[mr.getNumBlocks()];

        for (Block<S, TransitionEdge.Property> blk : mr.getBlocks()) {
            int id = blk.getId();
            S state = mr.getRepresentative(blk);
            SP prop = automaton.getStateProperty(state);
            ResultStateRecord<SP, TP> rec = new ResultStateRecord<>(numInputs, prop);
            records[id] = rec;
            for (int i = 0; i < numInputs; i++) {
                I input = inputList.get(i);
                T trans = automaton.getTransition(state, input);
                if (trans == null) {
                    continue;
                }

                TP transProp = automaton.getTransitionProperty(trans);
                S succ = automaton.getSuccessor(trans);
                int tgtId = mr.getBlockForState(succ).getId();
                rec.transitions[i] = new ResultTransRecord<>(tgtId, transProp);
            }
        }

        automaton.clear();

        @Nullable Object[] states = new Object[records.length];
        for (int i = 0; i < records.length; i++) {
            ResultStateRecord<SP, TP> rec = records[i];
            SP prop = rec.property;
            S state;
            if (i == initId) {
                state = automaton.addInitialState(prop);
            } else {
                state = automaton.addState(prop);
            }
            states[i] = state;
        }

        for (int i = 0; i < records.length; i++) {
            ResultStateRecord<SP, TP> rec = records[i];
            S state = (S) states[i];

            for (int j = 0; j < numInputs; j++) {
                ResultTransRecord<TP> transRec = rec.transitions[j];
                if (transRec == null) {
                    continue;
                }
                S succ = (S) states[transRec.targetId];
                I input = inputList.get(j);
                automaton.addTransition(state, input, succ, transRec.property);
            }
        }
        return automaton;
    }

    public static  @Nullable Word findShortestSeparatingWord(UniversalDeterministicAutomaton<?, I, ?, ?, ?> reference,
                                                                   UniversalDeterministicAutomaton<?, I, ?, ?, ?> other,
                                                                   Collection<? extends I> inputs) {
        return DeterministicEquivalenceTest.findSeparatingWordLarge(reference, other, inputs);
    }

    public static  boolean testEquivalence(UniversalDeterministicAutomaton<?, I, ?, ?, ?> reference,
                                              UniversalDeterministicAutomaton<?, I, ?, ?, ?> other,
                                              Collection<? extends I> inputs) {
        return (findSeparatingWord(reference, other, inputs) == null);
    }

    public static  boolean testEquivalence(final OneSEVPA<?, I> sevpa1,
                                              final OneSEVPA<?, I> sevpa2,
                                              final VPDAlphabet inputs) {
        return OneSEVPAUtil.testEquivalence(sevpa1, sevpa2, inputs);
    }

    /**
     * Finds a separating word for two automata. A separating word is a word that exposes a difference (differing state
     * or transition properties, or a transition undefined in only one of the automata) between the two automata.
     *
     * @param
     *         input symbol type
     * @param reference
     *         the one automaton to consider
     * @param other
     *         the other automaton to consider
     * @param inputs
     *         the input symbols to consider
     *
     * @return a separating word, or {@code null} if no such word could be found.
     */
    public static  @Nullable Word findSeparatingWord(UniversalDeterministicAutomaton<?, I, ?, ?, ?> reference,
                                                           UniversalDeterministicAutomaton<?, I, ?, ?, ?> other,
                                                           Collection<? extends I> inputs) {
        return NearLinearEquivalenceTest.findSeparatingWord(reference, other, inputs);
    }

    /**
     * Finds a separating word for two states in an automaton. A separating word is a word that exposes a difference
     * (differing state or transition properties, or a transition undefined in only one of the paths) between the two
     * states.
     *
     * @param <S>
     *         state type
     * @param
     *         input symbol type
     * @param automaton
     *         the automaton containing the states
     * @param state1
     *         the one state
     * @param state2
     *         the other state
     * @param inputs
     *         the input symbols to consider
     *
     * @return a separating word, or {@code null} if no such word could be found
     */
    public static <S, I> @Nullable Word findSeparatingWord(UniversalDeterministicAutomaton<S, I, ?, ?, ?> automaton,
                                                              S state1,
                                                              S state2,
                                                              Collection<? extends I> inputs) {
        return NearLinearEquivalenceTest.findSeparatingWord(automaton, state1, state2, inputs);
    }

    public static  @Nullable Word findSeparatingWord(final OneSEVPA<?, I> sevpa1,
                                                           final OneSEVPA<?, I> sevpa2,
                                                           final VPDAlphabet inputs) {
        return OneSEVPAUtil.findSeparatingWord(sevpa1, sevpa2, inputs);
    }

    /**
     * Computes a characterizing set, and returns it as a {@link List}.
     *
     * @param
     *         input symbol type
     * @param automaton
     *         the automaton for which to determine the characterizing set
     * @param inputs
     *         the input symbols to consider
     *
     * @return a list containing the characterizing words
     *
     * @see CharacterizingSets
     */
    public static  List<Word> characterizingSet(UniversalDeterministicAutomaton<?, I, ?, ?, ?> automaton,
                                                      Collection<? extends I> inputs) {
        List<Word> result = new ArrayList<>();
        characterizingSet(automaton, inputs, result);
        return result;
    }

    /**
     * Computes a characterizing set for the given automaton.
     *

     * This is a convenience method acting as a shortcut to {@link CharacterizingSets#findCharacterizingSet(
     * UniversalDeterministicAutomaton, Collection, Collection)}.
     *
     * @param
     *         input symbol type
     * @param automaton
     *         the automaton for which to determine the characterizing set
     * @param inputs
     *         the input symbols to consider
     * @param result
     *         the collection in which to store the characterizing words
     *
     * @see CharacterizingSets
     */
    public static  void characterizingSet(UniversalDeterministicAutomaton<?, I, ?, ?, ?> automaton,
                                             Collection<? extends I> inputs,
                                             Collection<? super Word> result) {
        CharacterizingSets.findCharacterizingSet(automaton, inputs, result);
    }

    public static  boolean incrementalCharacterizingSet(UniversalDeterministicAutomaton<?, I, ?, ?, ?> automaton,
                                                           Collection<? extends I> inputs,
                                                           Collection<? extends Word> oldSuffixes,
                                                           Collection<? super Word> newSuffixes) {
        return CharacterizingSets.findIncrementalCharacterizingSet(automaton, inputs, oldSuffixes, newSuffixes);
    }

    /**
     * Computes a characterizing set for a single state, and returns it as a {@link List}.
     *
     * @param <S>
     *         state type
     * @param
     *         input symbol type
     * @param automaton
     *         the automaton containing the state
     * @param inputs
     *         the input symbols to consider
     * @param state
     *         the state for which to determine a characterizing set
     *
     * @return a list containing the characterizing words
     *
     * @see CharacterizingSets
     */
    public static <S, I> List<Word> stateCharacterizingSet(UniversalDeterministicAutomaton<S, I, ?, ?, ?> automaton,
                                                              Collection<? extends I> inputs,
                                                              S state) {
        List<Word> result = new ArrayList<>();
        stateCharacterizingSet(automaton, inputs, state, result);
        return result;
    }

    /**
     * Computes a characterizing set for a single state.
     *

     * This is a convenience method acting as a shortcut to {@link CharacterizingSets#findCharacterizingSet(
     * UniversalDeterministicAutomaton, Collection, Object, Collection)}.
     *
     * @param <S>
     *         state type
     * @param
     *         input symbol type
     * @param automaton
     *         the automaton containing the state
     * @param inputs
     *         the input symbols to consider
     * @param state
     *         the state for which to determine a characterizing set
     * @param result
     *         the collection in which to store the characterizing words
     *
     * @see CharacterizingSets
     */
    public static <S, I> void stateCharacterizingSet(UniversalDeterministicAutomaton<S, I, ?, ?, ?> automaton,
                                                     Collection<? extends I> inputs,
                                                     S state,
                                                     Collection<? super Word> result) {
        CharacterizingSets.findCharacterizingSet(automaton, inputs, state, result);
    }

    /**
     * Convenient method for computing a state cover.
     *
     * @param automaton
     *         the automaton for which the cover should be computed
     * @param inputs
     *         the set of input symbols allowed in the cover sequences
     * @param
     *         input symbol type
     *
     * @return the state cover for the given automaton
     *
     * @see Covers#stateCover(DeterministicAutomaton, Collection, Collection)
     */
    public static  List<Word> stateCover(DeterministicAutomaton<?, I, ?> automaton,
                                               Collection<? extends I> inputs) {
        final List<Word> result = new ArrayList<>(automaton.size());
        Covers.stateCover(automaton, inputs, result);
        return result;
    }

    /**
     * Convenient method for computing a state cover.
     *
     * @param automaton
     *         the automaton for which the cover should be computed
     * @param inputs
     *         the set of input symbols allowed in the cover sequences
     * @param
     *         input symbol type
     *
     * @return the transition cover for the given automaton
     *
     * @see Covers#transitionCover(DeterministicAutomaton, Collection, Collection)
     */
    public static  List<Word> transitionCover(DeterministicAutomaton<?, I, ?> automaton,
                                                    Collection<? extends I> inputs) {
        final List<Word> result = new ArrayList<>(automaton.size() * inputs.size());
        Covers.transitionCover(automaton, inputs, result);
        return result;
    }

    /**
     * Convenient method for computing a structural cover.
     *
     * @param automaton
     *         the automaton for which the cover should be computed
     * @param inputs
     *         the set of input symbols allowed in the cover sequences
     * @param
     *         input symbol type
     *
     * @return the structural cover for the given automaton
     *
     * @see Covers#structuralCover(DeterministicAutomaton, Collection, Collection)
     */
    public static  List<Word> structuralCover(DeterministicAutomaton<?, I, ?> automaton,
                                                    Collection<? extends I> inputs) {
        final List<Word> result = new ArrayList<>(automaton.size() * (inputs.size() + 1));
        Covers.structuralCover(automaton, inputs, result);
        return result;
    }

    public static <S, I> Iterator<TransRef<S, I, ?>> allDefinedInputsIterator(Automaton<S, I, ?> automaton,
                                                                              Iterable<? extends I> inputs) {
        return allDefinedInputsIterator(automaton, automaton.iterator(), inputs);
    }

    public static <S, I> Iterable<TransRef<S, I, ?>> allDefinedInputs(Automaton<S, I, ?> automaton,
                                                                      Iterable<? extends I> inputs) {
        return allDefinedInputs(automaton, automaton, inputs);
    }

    public static <S, I> Iterable<TransRef<S, I, ?>> allUndefinedInputs(Automaton<S, I, ?> automaton,
                                                                        Iterable<? extends I> inputs) {
        return allUndefinedTransitions(automaton, automaton, inputs);
    }

    public static  boolean hasUndefinedInput(Automaton<?, I, ?> automaton, Iterable<? extends I> inputs) {
        return findUndefinedInput(automaton, inputs) != null;
    }

    public static <S, I> @Nullable TransRef<S, I, ?> findUndefinedInput(Automaton<S, I, ?> automaton,
                                                                        Iterable<? extends I> inputs) {
        Iterator<TransRef<S, I, ?>> it = allUndefinedInputsIterator(automaton, inputs);
        if (!it.hasNext()) {
            return null;
        }
        return it.next();
    }

    public static <S, I> Iterator<TransRef<S, I, ?>> allUndefinedInputsIterator(Automaton<S, I, ?> automaton,
                                                                                Iterable<? extends I> inputs) {
        return allUndefinedTransitionsIterator(automaton, automaton.iterator(), inputs);
    }

    private static final class ResultTransRecord<TP> {

        public final int targetId;
        public final TP property;

        ResultTransRecord(int targetId, TP property) {
            this.targetId = targetId;
            this.property = property;
        }
    }

    private static final class ResultStateRecord<SP, TP> {

        public final SP property;
        public final ResultTransRecord<TP>[] transitions;

        @SuppressWarnings("unchecked")
        ResultStateRecord(int numInputs, SP property) {
            this.property = property;
            this.transitions = new ResultTransRecord[numInputs];
        }
    }
}


text:
"""
Chute Configuration Schema

This module constructs a chute configuration JSON Schema from JSL
specification.
"""

import json

import jsl

class DHCPService(jsl.Document):
    leasetime = jsl.StringField(
        description="Duration of client leases, e.g. 2h.",
        pattern="\d+[dhms]"
    )
    limit = jsl.IntField(
        description="Size of address range beginning at start value.",
        minimum=1
    )
    start = jsl.IntField(
        description="Starting offset for address assignment.",
        minimum=3
    )

class WirelessOptions(jsl.Document):
    ssid = jsl.StringField(
        description="ESSID to broadcast.",
        max_length=32
    )
    key = jsl.StringField(
        description="Wireless network password.",
        min_length=8
    )
    nasid = jsl.StringField(
        description="NAS identifier for RADIUS."
    )
    acct_server = jsl.StringField(
        description="RADIUS accounting server."
    )
    acct_secret = jsl.StringField(
        description="RADIUS accounting secret."
    )
    acct_interval = jsl.IntField(
        description="RADIUS accounting update interval (seconds).",
        minimum=1
    )
    hidden = jsl.BooleanField(
        description="Disable broadcasting the ESSID in beacons."
    )
    isolate = jsl.BooleanField(
        description="Disable forwarding traffic between connected clients."
    )
    maxassoc = jsl.IntField(
        description="Maximum number of associated clients.",
        minimum=0
    )

class InterfaceRequirements(jsl.Document):
    hwmode = jsl.StringField(
        description="Required operating mode (11b for old hardware, 11g for 2.4 GHz, 11a for 5 Ghz).",
        enum=["11b", "11g", "11a"]
    )
    ipv4_network = jsl.StringField(
        description="Required IP network in slash notation.",
        pattern="^\d+\.\d+\.\d+\.\d+/\d+"
    )

class Interface(jsl.Document):
    class Options(object):
        definition_id = "interface"
        title = "Interface Specification"

    type = jsl.StringField(
        description="Network interface type.",
        enum=["monitor", "vlan", "wifi-ap"],
        required=True
    )

    dhcp = jsl.DocumentField(DHCPService)
    dns = jsl.ArrayField(
        description="List of DNS servers to advertise to connected clients.",
        items=jsl.StringField()
    )
    wireless = jsl.DocumentField(WirelessOptions)
    requirements = jsl.DocumentField(InterfaceRequirements)

    l3bridge = jsl.StringField(
        description="Bridge to another network using ARP proxying (experimental)."
    )
    vlan_id = jsl.IntField(
        name="vlan-id",
        description="VLAN tag for traffic to and from the interface.",
        minimum=1,
        maximum=4094
    )


text:
<?php

namespace Magento\User\Block\User\Edit\Tab;

/**
 * Cms page edit form main tab
 *
 * @SuppressWarnings(PHPMD.DepthOfInheritance)
 */
class Main extends \Magento\Backend\Block\Widget\Form\Generic
{
    const CURRENT_USER_PASSWORD_FIELD = 'current_password';

    /**
     * @var \Magento\Backend\Model\Auth\Session
     */
    protected $_authSession;

    /**
     * @var \Magento\Framework\Locale\ListsInterface
     */
    protected $_LocaleLists;

    /**
     * @param \Magento\Backend\Block\Template\Context $context
     * @param \Magento\Framework\Registry $registry
     * @param \Magento\Framework\Data\FormFactory $formFactory
     * @param \Magento\Backend\Model\Auth\Session $authSession
     * @param \Magento\Framework\Locale\ListsInterface $localeLists
     * @param array $data
     */
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Framework\Data\FormFactory $formFactory,
        \Magento\Backend\Model\Auth\Session $authSession,
        \Magento\Framework\Locale\ListsInterface $localeLists,
        array $data = []
    ) {
        $this->_authSession = $authSession;
        $this->_LocaleLists = $localeLists;
        parent::__construct($context, $registry, $formFactory, $data);
    }

    /**
     * Prepare form fields
     *
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     * @return \Magento\Backend\Block\Widget\Form
     */
    protected function _prepareForm()
    {
        /** @var $model \Magento\User\Model\User */
        $model = $this->_coreRegistry->registry('permissions_user');

        /** @var \Magento\Framework\Data\Form $form */
        $form = $this->_formFactory->create();
        $form->setHtmlIdPrefix('user_');

        $baseFieldset = $form->addFieldset('base_fieldset', ['legend' => __('Account Information')]);

        if ($model->getUserId()) {
            $baseFieldset->addField('user_id', 'hidden', ['name' => 'user_id']);
        } else {
            if (!$model->hasData('is_active')) {
                $model->setIsActive(1);
            }
        }

        $baseFieldset->addField(
            'username',
            'text',
            [
                'name' => 'username',
                'label' => __('User Name'),
                'id' => 'username',
                'title' => __('User Name'),
                'required' => true
            ]
        );

        $baseFieldset->addField(
            'firstname',
            'text',
            [
                'name' => 'firstname',
                'label' => __('First Name'),
                'id' => 'firstname',
                'title' => __('First Name'),
                'required' => true
            ]
        );

        $baseFieldset->addField(
            'lastname',
            'text',
            [
                'name' => 'lastname',
                'label' => __('Last Name'),
                'id' => 'lastname',
                'title' => __('Last Name'),
                'required' => true
            ]
        );

        $baseFieldset->addField(
            'email',
            'text',
            [
                'name' => 'email',
                'label' => __('Email'),
                'id' => 'customer_email',
                'title' => __('User Email'),
                'class' => 'required-entry validate-email',
                'required' => true
            ]
        );

        $isNewObject = $model->isObjectNew();
        if ($isNewObject) {
            $passwordLabel = __('Password');
        } else {
            $passwordLabel = __('New Password');
        }
        $confirmationLabel = __('Password Confirmation');
        $this->_addPasswordFields($baseFieldset, $passwordLabel, $confirmationLabel, $isNewObject);

        $baseFieldset->addField(
            'interface_locale',
            'select',
            [
                'name' => 'interface_locale',
                'label' => __('Interface Locale'),
                'title' => __('Interface Locale'),
                'values' => $this->_LocaleLists->getTranslatedOptionLocales(),
                'class' => 'select'
            ]
        );

        if ($this->_authSession->getUser()->getId() != $model->getUserId()) {
            $baseFieldset->addField(
                'is_active',
                'select',
                [
                    'name' => 'is_active',
                    'label' => __('This account is'),
                    'id' => 'is_active',
                    'title' => __('Account Status'),
                    'class' => 'input-select',
                    'style' => 'width: 80px',
                    'options' => ['1' => __('Active'), '0' => __('Inactive')]
                ]
            );
        }

        $baseFieldset->addField('user_roles', 'hidden', ['name' => 'user_roles', 'id' => '_user_roles']);

        $currentUserVerificationFieldset = $form->addFieldset(
            'current_user_verification_fieldset',
            ['legend' => __('Current User Identity Verification')]
        );
        $currentUserVerificationFieldset->addField(
            self::CURRENT_USER_PASSWORD_FIELD,
            'password',
            [
                'name' => self::CURRENT_USER_PASSWORD_FIELD,
                'label' => __('Your Password'),
                'id' => self::CURRENT_USER_PASSWORD_FIELD,
                'title' => __('Your Password'),
                'class' => 'input-text validate-current-password required-entry',
                'required' => true
            ]
        );

        $data = $model->getData();
        unset($data['password']);
        unset($data[self::CURRENT_USER_PASSWORD_FIELD]);
        $form->setValues($data);

        $this->setForm($form);

        return parent::_prepareForm();
    }

    /**
     * Add password input fields
     *
     * @param \Magento\Framework\Data\Form\Element\Fieldset $fieldset
     * @param string $passwordLabel
     * @param string $confirmationLabel
     * @param bool $isRequired
     * @return void
     */
    protected function _addPasswordFields(
        \Magento\Framework\Data\Form\Element\Fieldset $fieldset,
        $passwordLabel,
        $confirmationLabel,
        $isRequired = false
    ) {
        $requiredFieldClass = $isRequired ? ' required-entry' : '';
        $fieldset->addField(
            'password',
            'password',
            [
                'name' => 'password',
                'label' => $passwordLabel,
                'id' => 'customer_pass',
                'title' => $passwordLabel,
                'class' => 'input-text validate-admin-password' . $requiredFieldClass,
                'required' => $isRequired
            ]
        );
        $fieldset->addField(
            'confirmation',
            'password',
            [
                'name' => 'password_confirmation',
                'label' => $confirmationLabel,
                'id' => 'confirmation',
                'title' => $confirmationLabel,
                'class' => 'input-text validate-cpassword' . $requiredFieldClass,
                'required' => $isRequired
            ]
        );
    }
}


text:
#ifndef INC_ISSP_REVISION
#define INC_ISSP_REVISION
// The PROJECT_REV_xyz is used to make sure that the files in the project
// are all from the same revision of the program. Each file starts with an
// ifdef that will prevent the file from being compiled if it is not the
// correct revision
// Set the revision to 3.04
#define PROJECT_REV_304

#endif				//(INC_ISSP_REVISION)
#include <linux/module.h>

#include <linux/init.h>
#include <linux/fs.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/sched.h>
#include <linux/pm.h>
#include <linux/sysctl.h>
#include <linux/proc_fs.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/input.h>
//#include <mach/regs-gpio.h>
//#include <plat/gpio-cfg.h>
#include <asm/gpio.h>
#include <linux/miscdevice.h>
#include <asm/uaccess.h>
#ifdef CONFIG_HAS_EARLYSUSPEND
#include <linux/earlysuspend.h>
#endif
#include <asm/io.h>
//end of file ISSP_Revision.h


text:
import Expression from '../Expression';

export default class CallExpression extends Expression {
    constructor(childNodes) {
        super('CallExpression', childNodes);
    }

    _acceptChildren(children) {
        let args = [];

        let callee = children.passExpressionOrSuper();
        children.skipNonCode();

        children.passToken('Punctuator', '(');
        children.skipNonCode();

        while (!children.isToken('Punctuator', ')')) {
            if (children.isToken('Punctuator', ',')) {
                children.moveNext();
                children.skipNonCode();
                children.assertToken('Punctuator', ')');
            } else {
                args.push(children.passExpressionOrSpreadElement());
                children.skipNonCode();
                if (children.isToken('Punctuator', ',')) {
                    children.moveNext();
                    children.skipNonCode();
                }
            }
        }

        children.passToken('Punctuator', ')');
        children.assertEnd();

        this.callee = callee;
        this.arguments = args;
    }
}


text:
<?php

require_once 'library/core.php';

use library\User\User;
use library\Url\Url;

$user=new User('Kishore');
$url=new Url($_SERVER['PATH_INFO']);

//phpinfo();