text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Immutable;
using System.Runtime.InteropServices;
using Microsoft.CodeAnalysis.Text;

namespace Microsoft.CodeAnalysis
{
    /// <summary>
    /// Represents a parameter of a method or property.
    /// </summary>
    /// <remarks>
    /// This interface is reserved for implementation by its associated APIs. We reserve the right to
    /// change it in the future.
    /// </remarks>
    public interface IParameterSymbol : ISymbol
    {
        /// <summary>
        /// Whether the parameter passed by value or by reference.
        /// </summary>
        RefKind RefKind { get; }

        /// <summary>
        /// Returns true if the parameter was declared as a parameter array.
        /// </summary>
        bool IsParams { get; }

        /// <summary>
        /// Returns true if the parameter is optional.
        /// </summary>
        bool IsOptional { get; }

        /// <summary>
        /// Returns true if the parameter is the hidden 'this' ('Me' in Visual Basic) parameter.
        /// </summary>
        bool IsThis { get; }

        /// <summary>
        /// Returns true if the parameter is a discard parameter.
        /// </summary>
        bool IsDiscard { get; }

        /// <summary>
        /// Gets the type of the parameter.
        /// </summary>
        ITypeSymbol Type { get; }

        /// <summary>
        /// Gets the top-level nullability of the parameter.
        /// </summary>
        NullableAnnotation NullableAnnotation { get; }

        /// <summary>
        /// Custom modifiers associated with the parameter type, or an empty array if there are none.
        /// </summary>
        ImmutableArray<CustomModifier> CustomModifiers { get; }

        /// <summary>
        /// Custom modifiers associated with the ref modifier, or an empty array if there are none.
        /// </summary>
        ImmutableArray<CustomModifier> RefCustomModifiers { get; }

        /// <summary>
        /// Gets the ordinal position of the parameter. The first parameter has ordinal zero.
        /// The 'this' parameter ('Me' in Visual Basic) has ordinal -1.
        /// </summary>
        int Ordinal { get; }

        /// <summary>
        /// Returns true if the parameter specifies a default value to be passed
        /// when no value is provided as an argument to a call. The default value
        /// can be obtained with the <see cref="ExplicitDefaultValue"/> property.
        /// </summary>
        bool HasExplicitDefaultValue { get; }

        /// <summary>
        /// Returns the default value of the parameter.
        /// </summary>
        /// <remarks>
        /// Returns null if the parameter type is a struct and the default value of the parameter
        /// is the default value of the struct type.
        /// </remarks>
        /// <exception cref="System.InvalidOperationException">The parameter has no default value.</exception>
        object? ExplicitDefaultValue { get; }

        /// <summary>
        /// Get the original definition of this symbol. If this symbol is derived from another
        /// symbol by (say) type substitution, this gets the original symbol, as it was defined in
        /// source or metadata.
        /// </summary>
        new IParameterSymbol OriginalDefinition { get; }
    }
}


text:
import logging
from collections import defaultdict

from dvc.repo import locked
from dvc.repo.scm_context import scm_context
from dvc.scm.base import RevError

from .utils import (
    exp_refs,
    exp_refs_by_baseline,
    remote_exp_refs,
    remote_exp_refs_by_baseline,
)

logger = logging.getLogger(__name__)

@locked
@scm_context
def ls(repo, *args, rev=None, git_remote=None, all_=False, **kwargs):
    from dvc.scm.git import Git

    if rev:
        try:
            rev = repo.scm.resolve_rev(rev)
        except RevError:
            if not (git_remote and Git.is_sha(rev)):
                # This could be a remote rev that has not been fetched yet
                raise
    elif not all_:
        rev = repo.scm.get_rev()

    results = defaultdict(list)

    if rev:
        if git_remote:
            gen = remote_exp_refs_by_baseline(repo.scm, git_remote, rev)
        else:
            gen = exp_refs_by_baseline(repo.scm, rev)
        for info in gen:
            results[rev].append(info.name)
    elif all_:
        if git_remote:
            gen = remote_exp_refs(repo.scm, git_remote)
        else:
            gen = exp_refs(repo.scm)
        for info in gen:
            results[info.baseline_sha].append(info.name)

    return results

redpajama_set_name: RedPajamaGithub


text:
var searchData=
[
  ['baseengmodifiers',['BaseEngModifiers',['../classtracery_1_1_base_eng_modifiers.html#af39dc541e094ff73e1491553efa48d73',1,'tracery::BaseEngModifiers::BaseEngModifiers(ModifierMap modifierMap)'],['../classtracery_1_1_base_eng_modifiers.html#ae07db45d5f56b2e9bf19ecfff2774968',1,'tracery::BaseEngModifiers::BaseEngModifiers()']]]
];


text:
Locksmith is a rails mountable engine that provides api token management. Beeing a mountable engine
it's possible to include it in other rails apps to get API token management functionality.

## Instructions
1. Get the dependencies
    `bundle install`
1. Create the database
    `rake db:migrate`
1. Seed the database
    `rake app:locksmith:populate`
1. Go to the dummy application
    `cd spec/dummy`
1. Start the rails server
    `rails s`
1. Go to the app at
    `http://localhost:3000/locksmith`
1. Login as a normal user with `basic@user.com` or admin as `admin@user.com` with password `password`


text:
import os
import os.path
import tempfile
import mock
import unittest
from shutil import copyfile, rmtree

# 3p
import ntpath

# project
from config import get_config, load_check_directory, _conf_path_to_check_name
from util import is_valid_hostname, windows_friendly_colon_split
from utils.pidfile import PidFile
from utils.platform import Platform

# No more hardcoded default checks
DEFAULT_CHECKS = []

class TestConfig(unittest.TestCase):
    CONFIG_FOLDER = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'fixtures', 'config')

    def get_config(self, name, parse_args=False):
        """
        Small helper function to load fixtures configs
        """
        return get_config(cfg_path=os.path.join(self.CONFIG_FOLDER, name), parse_args=parse_args)

    def testWhiteSpaceConfig(self):
        """Leading whitespace confuse ConfigParser
        """
        agentConfig = self.get_config('bad.conf')

        self.assertEquals(agentConfig["dd_url"], "https://app.datadoghq.com")
        self.assertEquals(agentConfig["api_key"], "1234")
        self.assertEquals(agentConfig["nagios_log"], "/var/log/nagios3/nagios.log")
        self.assertEquals(agentConfig["graphite_listen_port"], 17126)
        self.assertTrue("statsd_metric_namespace" in agentConfig)

    def test_one_endpoint(self):
        agent_config = self.get_config('one_endpoint.conf')
        self.assertEquals(agent_config["dd_url"], "https://app.datadoghq.com")
        self.assertEquals(agent_config["api_key"], "1234")
        endpoints = {'https://app.datadoghq.com': ['1234']}
        self.assertEquals(agent_config['endpoints'], endpoints)

    def test_multiple_endpoints(self):
        agent_config = self.get_config('multiple_endpoints.conf')
        self.assertEquals(agent_config["dd_url"], "https://app.datadoghq.com")
        self.assertEquals(agent_config["api_key"], "1234")
        endpoints = {
            'https://app.datadoghq.com': ['1234'],
            'https://app.example.com': ['5678', '901']
        }
        self.assertEquals(agent_config['endpoints'], endpoints)
        with self.assertRaises(AssertionError):
            self.get_config('multiple_endpoints_bad.conf')

    def test_multiple_apikeys(self):
        agent_config = self.get_config('multiple_apikeys.conf')
        self.assertEquals(agent_config["dd_url"], "https://app.datadoghq.com")
        self.assertEquals(agent_config["api_key"], "1234")
        endpoints = {
            'https://app.datadoghq.com': ['1234', '5678', '901']
        }
        self.assertEquals(agent_config['endpoints'], endpoints)

    def testGoodPidFile(self):
        """Verify that the pid file succeeds and fails appropriately"""

        pid_dir = tempfile.mkdtemp()
        program = 'test'

        expected_path = os.path.join(pid_dir, '%s.pid' % program)
        pid = "666"
        pid_f = open(expected_path, 'w')
        pid_f.write(pid)
        pid_f.close()

        p = PidFile(program, pid_dir)

        self.assertEquals(p.get_pid(), 666)
        # clean up
        self.assertEquals(p.clean(), True)
        self.assertEquals(os.path.exists(expected_path), False)

    def testBadPidFile(self):
        pid_dir = "/does-not-exist"

        p = PidFile('test', pid_dir)
        path = p.get_path()
        self.assertEquals(path, os.path.join(tempfile.gettempdir(), 'test.pid'))

        pid = "666"
        pid_f = open(path, 'w')
        pid_f.write(pid)
        pid_f.close()

        self.assertEquals(p.get_pid(), 666)
        self.assertEquals(p.clean(), True)
        self.assertEquals(os.path.exists(path), False)

    def testHostname(self):
        valid_hostnames = [
            u'i-123445',
            u'5dfsdfsdrrfsv',
            u'432498234234A'
            u'234234235235235235',  # Couldn't find anything in the RFC saying it's not valid
            u'A45fsdff045-dsflk4dfsdc.ret43tjssfd',
            u'4354sfsdkfj4TEfdlv56gdgdfRET.dsf-dg',
            u'r' * 255,
        ]

        not_valid_hostnames = [
            u'abc' * 150,
            u'sdf4..sfsd',
            u'$42sdf',
            u'.sfdsfds'
            u's™£™£¢ª•ªdfésdfs'
        ]

        for hostname in valid_hostnames:
            self.assertTrue(is_valid_hostname(hostname), hostname)

        for hostname in not_valid_hostnames:
            self.assertFalse(is_valid_hostname(hostname), hostname)

    def testWindowsSplit(self):
        # Make the function run as if it was on windows
        func = Platform.is_win32
        try:
            Platform.is_win32 = staticmethod(lambda: True)

            test_cases = [
                ("C:\\Documents\\Users\\script.py:C:\\Documents\\otherscript.py", ["C:\\Documents\\Users\\script.py", "C:\\Documents\\otherscript.py"]),
                ("C:\\Documents\\Users\\script.py:parser.py", ["C:\\Documents\\Users\\script.py", "parser.py"])
            ]

            for test_case, expected_result in test_cases:
                self.assertEqual(windows_friendly_colon_split(test_case), expected_result)
        finally:
            # cleanup
            Platform.is_win32 = staticmethod(func)

    def testDefaultChecks(self):
        checks = load_check_directory({"additional_checksd": "/etc/dd-agent/checks.d/"}, "foo")
        init_checks_names = [c.name for c in checks['initialized_checks']]

        for c in DEFAULT_CHECKS:
            self.assertTrue(c in init_checks_names)

TMP_DIR = tempfile.gettempdir()
DD_AGENT_TEST_DIR = 'dd-agent-tests'
TEMP_SDK_INTEGRATIONS_CHECKS_DIR = os.path.join(TMP_DIR, DD_AGENT_TEST_DIR, 'integrations')
TEMP_ETC_CHECKS_DIR = os.path.join(TMP_DIR, DD_AGENT_TEST_DIR, 'etc', 'checks.d')
TEMP_ETC_CONF_DIR = os.path.join(TMP_DIR, DD_AGENT_TEST_DIR, 'etc', 'conf.d')
TEMP_AGENT_CHECK_DIR = os.path.join(TMP_DIR, DD_AGENT_TEST_DIR)
FIXTURE_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'fixtures', 'checks')

@mock.patch('config.get_checksd_path', return_value=TEMP_AGENT_CHECK_DIR)
@mock.patch('config.get_confd_path', return_value=TEMP_ETC_CONF_DIR)
@mock.patch('config.get_sdk_integrations_path', return_value=TEMP_SDK_INTEGRATIONS_CHECKS_DIR)
class TestConfigLoadCheckDirectory(unittest.TestCase):

    TEMP_DIRS = [
        '%s/test_check' % TEMP_SDK_INTEGRATIONS_CHECKS_DIR,
        TEMP_ETC_CHECKS_DIR, TEMP_ETC_CONF_DIR, TEMP_AGENT_CHECK_DIR
    ]

    def setUp(self):
        for _dir in self.TEMP_DIRS:
            if not os.path.exists(_dir):
                os.makedirs(_dir)

    def testConfigInvalid(self, *args):
        copyfile('%s/invalid_conf.yaml' % FIXTURE_PATH,
            '%s/test_check.yaml' % TEMP_ETC_CONF_DIR)
        copyfile('%s/valid_check_1.py' % FIXTURE_PATH,
            '%s/test_check.py' % TEMP_AGENT_CHECK_DIR)
        checks = load_check_directory({"additional_checksd": TEMP_ETC_CHECKS_DIR}, "foo")
        self.assertEquals(1, len(checks['init_failed_checks']))

    def test_conf_path_to_check_name(self, *args):
        """
        Resolve the check name from the full path.

        Note: Support Unix & Windows systems
        """
        # Samples
        check_name = u"haproxy"
        unix_check_path = u"/etc/dd-agent/conf.d/haproxy.yaml"
        win_check_path = u"C:\\ProgramData\\Datadog\\conf.d\\haproxy.yaml"
        with mock.patch('config.os.path.splitext', side_effect=ntpath.splitext):
            with mock.patch('config.os.path.split', side_effect=ntpath.split):
                self.assertEquals(
                    _conf_path_to_check_name(win_check_path), check_name
                )
        self.assertEquals(
            _conf_path_to_check_name(unix_check_path), check_name
        )

    def testConfigNotFound(self, *args):
        copyfile('%s/valid_conf.yaml' % FIXTURE_PATH,
            '%s/test_check.yaml' % TEMP_ETC_CONF_DIR)
        checks = load_check_directory({"additional_checksd": TEMP_ETC_CHECKS_DIR}, "foo")
        self.assertEquals(0, len(checks['init_failed_checks']))
        self.assertEquals(0, len(checks['initialized_checks']))

    def testConfigAgentOnly(self, *args):
        copyfile('%s/valid_conf.yaml' % FIXTURE_PATH,
            '%s/test_check.yaml' % TEMP_ETC_CONF_DIR)
        copyfile('%s/valid_check_1.py' % FIXTURE_PATH,
            '%s/test_check.py' % TEMP_AGENT_CHECK_DIR)
        checks = load_check_directory({"additional_checksd": TEMP_ETC_CHECKS_DIR}, "foo")
        self.assertEquals(1, len(checks['initialized_checks']))

    def testConfigETCOnly(self, *args):
        copyfile('%s/valid_conf.yaml' % FIXTURE_PATH,
            '%s/test_check.yaml' % TEMP_ETC_CONF_DIR)
        copyfile('%s/valid_check_1.py' % FIXTURE_PATH,
            '%s/test_check.py' % TEMP_ETC_CHECKS_DIR)
        checks = load_check_directory({"additional_checksd": TEMP_ETC_CHECKS_DIR}, "foo")
        self.assertEquals(1, len(checks['initialized_checks']))

    def testConfigAgentETC(self, *args):
        copyfile('%s/valid_conf.yaml' % FIXTURE_PATH,
            '%s/test_check.yaml' % TEMP_ETC_CONF_DIR)
        copyfile('%s/valid_check_2.py' % FIXTURE_PATH,
            '%s/test_check.py' % TEMP_AGENT_CHECK_DIR)
        copyfile('%s/valid_check_1.py' % FIXTURE_PATH,
            '%s/test_check.py' % TEMP_ETC_CHECKS_DIR)
        checks = load_check_directory({"additional_checksd": TEMP_ETC_CHECKS_DIR}, "foo")
        self.assertEquals(1, len(checks['initialized_checks']))
        self.assertEquals('valid_check_1', checks['initialized_checks'][0].check(None))

    def testConfigCheckNotAgentCheck(self, *args):
        copyfile('%s/valid_conf.yaml' % FIXTURE_PATH,
            '%s/test_check.yaml' % TEMP_ETC_CONF_DIR)
        copyfile('%s/invalid_check_1.py' % FIXTURE_PATH,
            '%s/test_check.py' % TEMP_AGENT_CHECK_DIR)
        checks = load_check_directory({"additional_checksd": TEMP_ETC_CHECKS_DIR}, "foo")
        self.assertEquals(0, len(checks['init_failed_checks']))
        self.assertEquals(0, len(checks['initialized_checks']))

    def testConfigCheckImportError(self, *args):
        copyfile('%s/valid_conf.yaml' % FIXTURE_PATH,
            '%s/test_check.yaml' % TEMP_ETC_CONF_DIR)
        copyfile('%s/invalid_check_2.py' % FIXTURE_PATH,
            '%s/test_check.py' % TEMP_AGENT_CHECK_DIR)
        checks = load_check_directory({"additional_checksd": TEMP_ETC_CHECKS_DIR}, "foo")
        self.assertEquals(1, len(checks['init_failed_checks']))

    def testConfig3rdPartyAgent(self, *args):
        copyfile('%s/valid_conf.yaml' % FIXTURE_PATH,
            '%s/test_check.yaml' % TEMP_ETC_CONF_DIR)
        copyfile('%s/valid_check_2.py' % FIXTURE_PATH,
            '%s/test_check.py' % TEMP_AGENT_CHECK_DIR)
        copyfile('%s/valid_check_1.py' % FIXTURE_PATH,
            '%s/test_check/check.py' % TEMP_SDK_INTEGRATIONS_CHECKS_DIR)
        checks = load_check_directory({"additional_checksd": TEMP_ETC_CHECKS_DIR}, "foo")
        self.assertEquals(1, len(checks['initialized_checks']))
        self.assertEquals('valid_check_1', checks['initialized_checks'][0].check(None))

    def testConfigETC3rdParty(self, *args):
        copyfile('%s/valid_conf.yaml' % FIXTURE_PATH,
            '%s/test_check.yaml' % TEMP_ETC_CONF_DIR)
        copyfile('%s/valid_check_2.py' % FIXTURE_PATH,
            '%s/test_check/check.py' % TEMP_SDK_INTEGRATIONS_CHECKS_DIR)
        copyfile('%s/valid_check_1.py' % FIXTURE_PATH,
            '%s/test_check.py' % TEMP_ETC_CHECKS_DIR)
        checks = load_check_directory({"additional_checksd": TEMP_ETC_CHECKS_DIR}, "foo")
        self.assertEquals(1, len(checks['initialized_checks']))
        self.assertEquals('valid_check_1', checks['initialized_checks'][0].check(None))

    def testConfigInheritedCheck(self, *args):
        copyfile('%s/valid_conf.yaml' % FIXTURE_PATH,
            '%s/test_check.yaml' % TEMP_ETC_CONF_DIR)
        copyfile('%s/valid_sub_check.py' % FIXTURE_PATH,
            '%s/test_check.py' % TEMP_ETC_CHECKS_DIR)
        checks = load_check_directory({"additional_checksd": TEMP_ETC_CHECKS_DIR}, "foo")
        self.assertEquals(1, len(checks['initialized_checks']))
        self.assertEquals('valid_check_1', checks['initialized_checks'][0].check(None))

    def testConfigDeprecatedNagiosConfig(self, *args):
        copyfile('%s/valid_check_1.py' % FIXTURE_PATH,
            '%s/nagios.py' % TEMP_ETC_CHECKS_DIR)
        checks = load_check_directory({"nagios_perf_cfg": None, "additional_checksd": TEMP_ETC_CHECKS_DIR}, "foo")
        self.assertEquals(1, len(checks['initialized_checks']))
        self.assertEquals('valid_check_1', checks['initialized_checks'][0].check(None))

    def testConfigDefault(self, *args):
        copyfile('%s/valid_conf.yaml' % FIXTURE_PATH,
            '%s/test_check.yaml.default' % TEMP_ETC_CONF_DIR)
        copyfile('%s/valid_check_1.py' % FIXTURE_PATH,
            '%s/test_check.py' % TEMP_ETC_CHECKS_DIR)
        checks = load_check_directory({"additional_checksd": TEMP_ETC_CHECKS_DIR}, "foo")
        self.assertEquals(1, len(checks['initialized_checks']))

    def testConfigCustomOverDefault(self, *args):
        copyfile('%s/valid_conf.yaml' % FIXTURE_PATH,
            '%s/test_check.yaml.default' % TEMP_ETC_CONF_DIR)
        # a 2nd valid conf file, slightly different so that we can test which one has been picked up
        # (with 2 instances for instance)
        copyfile('%s/valid_conf_2.yaml' % FIXTURE_PATH,
            '%s/test_check.yaml' % TEMP_ETC_CONF_DIR)
        copyfile('%s/valid_check_1.py' % FIXTURE_PATH,
            '%s/test_check.py' % TEMP_ETC_CHECKS_DIR)
        checks = load_check_directory({"additional_checksd": TEMP_ETC_CHECKS_DIR}, "foo")
        self.assertEquals(1, len(checks['initialized_checks']))
        self.assertEquals(2, checks['initialized_checks'][0].instance_count())  # check that we picked the right conf

    def tearDown(self):
        for _dir in self.TEMP_DIRS:
            rmtree(_dir)


text:
set -e
input=$1
driver_version=$2
tag=$3
channel=${4:-"default"}
test_failure_ignore=${TEST_FAILURE_IGNORE:-true}

if [ -z "$1" -o -z "$2" -o -z "$3" ]; then
    echo 'Usage: ./automate_chrome.sh <browser_version|package_file> <chromedriver_version|latest> <tag_version> [<channel={beta|dev}>]'
    exit 1
fi
set -x

browser_version=$input
method="chrome/apt"
if [ -f "$input" ]; then
    cp "$input" chrome/local/google-chrome.deb
    filename=$(echo "$input" | awk -F '/' '{print $NF}')
    browser_version=$(echo $filename | awk -F '_' '{print $2}' | awk -F '-' '{print $1}')
    method="chrome/local"
fi

get_latest_chromedriver() {
    chrome_version=$(echo "$1" | awk -F '-' '{print $1}')
    chrome_channel=$2
    base_url="https://chromedriver.storage.googleapis.com"
    if [ "$chrome_channel" == "dev" ]; then
        chrome_major_version=$(echo "$chrome_version" | cut -d. -f1)
        status_code=$(wget --spider -S $base_url/LATEST_RELEASE_$chrome_major_version 2>&1 | awk '/HTTP\// {print $2}')
        if [ "$status_code" == "404" ]; then
            let chrome_major_version--
        fi
        echo "$(wget -qO- $base_url/LATEST_RELEASE_$chrome_major_version)"
    else
        chrome_build_version=$(echo "$chrome_version" | cut -d. -f1-3)
        echo "$(wget -qO- $base_url/LATEST_RELEASE_$chrome_build_version)"
    fi
}

if [ "$driver_version" == "latest" ]; then
    driver_version=$(get_latest_chromedriver $browser_version $channel)
fi

./build-dev.sh $method $browser_version $channel true
if [ "$method" == "chrome/apt" ]; then
    ./build-dev.sh $method $browser_version $channel false
fi
pushd chrome
../build.sh chromedriver $browser_version $driver_version selenoid/chrome:$tag
popd

test_image(){
    docker rm -f selenium || true
    docker run -d --name selenium -p 4445:4444 $1:$2
    tests_dir=../../selenoid-container-tests/
    if [ -d "$tests_dir" ]; then
        pushd "$tests_dir"
        mvn clean test -Dgrid.connection.url="http://localhost:4445/" -Dgrid.browser.name=chrome -Dgrid.browser.version=$2 || $test_failure_ignore
        popd
    else
        echo "Skipping tests as $tests_dir does not exist."
    fi
}

test_image "selenoid/chrome" $tag
docker tag "selenoid/chrome:$tag" "selenoid/vnc_chrome:$tag"
docker tag "selenoid/chrome:$tag" "selenoid/vnc:chrome_$tag"

read -p "Push?" yn
if [ "$yn" == "y" ]; then
	docker push "selenoid/dev_chrome:"$browser_version
	if [ "$method" == "chrome/apt" ]; then
    	docker push "selenoid/dev_chrome_full:"$browser_version
    fi
	docker push "selenoid/chrome:$tag"
    docker tag "selenoid/chrome:$tag" "selenoid/chrome:latest"
    docker push "selenoid/chrome:latest"
    docker push "selenoid/vnc:chrome_"$tag
    docker push "selenoid/vnc_chrome:"$tag
fi


text:
		{{ trans('company.admin_email')}}:
		{!! Form::text('email',null,['class'=>'form-control','required']) !!}

		{{ trans('company.contact_email')}}:
		{!! Form::text('contact_email',null,['class'=>'form-control','required']) !!}

		{{ trans('company.sales_email')}}:
		{!! Form::text('sales_email',null,['class'=>'form-control','required']) !!}

		{{ trans('company.support_email')}}:
		{!! Form::text('support_email',null,['class'=>'form-control','required']) !!}


text:
import commands
counter =0
while counter <=100 :
  (stauts,output) = commands.getstatusoutput("/usr/local/bin/aws ec2 describe-addresses ")
  if len(output) > 5 :
    print output
    break;
  #alocate new Elastic IP, and get the allocation id and allocated ip
  (stauts,output) = commands.getstatusoutput("/usr/local/bin/aws ec2 allocate-address")
  allocation_id = output.split('\t') [0]
  new_gip =  output.split('\t') [2]

  #Sleep for 2 seconds
  (status,output) = commands.getstatusoutput("/bin/sleep 2")

  #associate the allocated ip to indicated ec2 instance
  (status,output) = commands.getstatusoutput("/usr/local/bin/aws ec2 associate-address --instance-id i-9afe2b90 --allocation-id "+allocation_id)
  print status,output
  association_id = output;

  #Sleep for 3 seconds
  (status,output) = commands.getstatusoutput("/bin/sleep 5")

  #click the URL!!
  (status,output) = commands.getstatusoutput("/usr/bin/wget http://star.sznsibi.org/vote.ashx?id=2560")

  print counter, new_gip
  #Sleep for 2 seconds
  (status,output) = commands.getstatusoutput("/bin/sleep 10")

  #Disassociate Elastic IP address
  (status,output) = commands.getstatusoutput("/usr/local/bin/aws ec2 disassociate-address --association-id " + association_id)

  #Sleep for 3 seconds
  (status,output) = commands.getstatusoutput("/bin/sleep 3")

  #release allocated Elastic IP
  (status,output) = commands.getstatusoutput("/usr/local/bin/aws ec2 release-address --allocation-id " + allocation_id)

  #Sleep for 3 seconds
  (status,output) = commands.getstatusoutput("/bin/sleep 3")

  counter +=1


text:
package com.pgmacdesign.pgmactips.adaptersandlisteners;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import androidx.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.daimajia.androidanimations.library.Techniques;
import com.pgmacdesign.pgmactips.R;
import com.pgmacdesign.pgmactips.misc.CustomAnnotationsBase;
import com.pgmacdesign.pgmactips.misc.PGMacTipsConstants;
import com.pgmacdesign.pgmactips.utilities.AnimationUtilities;
import com.pgmacdesign.pgmactips.utilities.DisplayManagerUtilities;
import com.pgmacdesign.pgmactips.utilities.MiscUtilities;
import com.pgmacdesign.pgmactips.utilities.StringUtilities;

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

import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;

/**
 * Multi-purpose Recyclerview adapter that allows for use with different choice options.
 * Currently allows for {@link MultipurposeChoiceType}
 * Created by pmacdowell on 2017-11-13.
 */
@CustomAnnotationsBase.RequiresDependency(requiresDependencies = {CustomAnnotationsBase.Dependencies.AndroidSupport_Design,
    CustomAnnotationsBase.Dependencies.AndroidAnimations, CustomAnnotationsBase.Dependencies.AndroidAnimationsEasing})
public class MultipurposeChoiceAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

    //Type of Adapter
    public static enum MultipurposeChoiceType {
        SINGLE_SELECT, MULTI_SELECT
    }

    private Drawable selectedCircle, unselectedCircle;
    private Integer selectedCircleResource, unselectedCircleResource;

    //Vars
    private CustomClickCallbackLink clickLink;
    private CustomLongClickCallbackLink longClickLink;
    private MultipurposeChoiceType type;

    //Dataset List
    private List<MultipurposeChoiceObject> mListObjects;

    //UI
    private LayoutInflater mInflater;

    //Misc
    private Context context;
    private boolean oneSelectedAnimate;
    private DisplayManagerUtilities dmu;
    private int customClickLinkTag, customLongClickLinkTag;

    @CustomAnnotationsBase.RequiresDependency(requiresDependencies = {CustomAnnotationsBase.Dependencies.AndroidSupport_Design,
            CustomAnnotationsBase.Dependencies.AndroidAnimations, CustomAnnotationsBase.Dependencies.AndroidAnimationsEasing})
    public MultipurposeChoiceAdapter(@NonNull Context context,
                                     @NonNull MultipurposeChoiceType type1,
                                     CustomClickCallbackLink clickLink,
                                     CustomLongClickCallbackLink longClickLink,
                                     int selectedImageResource, int unselectedImageResource){
        this.type = type1;
        this.context = context;
        this.clickLink = clickLink;
        this.longClickLink = longClickLink;
        this.mInflater = LayoutInflater.from(context);
        this.customClickLinkTag = this.customLongClickLinkTag = -1;
        this.dmu = new DisplayManagerUtilities(context);
        try {
            this.selectedCircle = ContextCompat.getDrawable(context, selectedImageResource);
            this.unselectedCircle = ContextCompat.getDrawable(context, unselectedImageResource);
            this.selectedCircleResource = null;
            this.unselectedCircleResource = null;
        } catch (Resources.NotFoundException e){
            this.selectedCircle = null;
            this.unselectedCircle = null;
            this.selectedCircleResource = selectedImageResource;
            this.unselectedCircleResource = unselectedImageResource;
        } catch (Exception e){
            e.printStackTrace();
            this.selectedCircle = null;
            this.unselectedCircle = null;
            this.selectedCircle = ContextCompat.getDrawable(context, R.drawable.shutter_black);
            this.unselectedCircle = ContextCompat.getDrawable(context, R.drawable.shutter_white);
        }
    }

    /**
     * Set the custom click listener callback int tag to reference.
     * @param customClickLinkTag Tag to compare against on click results. If -1 is
     *                           passed, will be ignored.
     */
    public void setCustomClickLinkTag(int customClickLinkTag) {
        this.customClickLinkTag = customClickLinkTag;
    }

    /**
     * Set the custom long click listener callback int tag to reference.
     * @param customLongClickLinkTag Tag to compare against on long click results.
     *                               If -1 is passed, will be ignored.
     */
    public void setCustomLongClickLinkTag(int customLongClickLinkTag) {
        this.customLongClickLinkTag = customLongClickLinkTag;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view;
        switch (type){
            case MULTI_SELECT:
                view = mInflater.inflate(R.layout.selection_adapter_multi_layout,
                        parent, false);
                MultipleSelectChoice viewHolder = new MultipleSelectChoice(view);
                return viewHolder;

            case SINGLE_SELECT:
            default:
                this.type = MultipurposeChoiceType.SINGLE_SELECT;
                view = mInflater.inflate(R.layout.selection_adapter_single_layout,
                        parent, false);
                SingleSelectChoice viewHolder1 = new SingleSelectChoice(view);
                return viewHolder1;
        }
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder0, final int position) {

        final MultipurposeChoiceObject currentObj = mListObjects.get(position);

        final CustomClickListener clickListener = new CustomClickListener(
                clickLink, (customClickLinkTag == -1) ?
                        PGMacTipsConstants.TAG_MULTIPURPOSE_CHOICE_CLICK_ADAPTER :
                        customClickLinkTag, currentObj);
        final CustomLongClickListener longClickListener = new CustomLongClickListener(
                longClickLink, (customLongClickLinkTag == -1) ?
                        PGMacTipsConstants.TAG_MULTIPURPOSE_CHOICE_LONG_CLICK_ADAPTER :
                        customLongClickLinkTag, currentObj);

        if(currentObj == null){
            return;
        }

        String imageUrl = currentObj.getImageUrl();
        String desc = currentObj.getDescription();

        if(type == MultipurposeChoiceType.MULTI_SELECT){
            final MultipleSelectChoice holder = (MultipleSelectChoice) holder0;
            holder.selection_adapter_multi_tv.setText(desc);
            // TODO: 2017-06-15 NOTE! This will slow performance in future if not scaled correctly
            if(currentObj.isSelected()){
                if(selectedCircle != null) {
                    holder.selection_adapter_multi_left_iv.setImageDrawable(selectedCircle);
                } else if (selectedCircleResource != null){
                    holder.selection_adapter_multi_left_iv.setImageResource(selectedCircleResource);
                } else {
                    holder.selection_adapter_multi_left_iv.setImageDrawable(null);
                }
            } else {
                holder.selection_adapter_multi_left_iv.setImageDrawable(unselectedCircle);
                if(selectedCircle != null) {
                    holder.selection_adapter_multi_left_iv.setImageDrawable(selectedCircle);
                } else if (unselectedCircleResource != null){
                    holder.selection_adapter_multi_left_iv.setImageResource(unselectedCircleResource);
                } else {
                    holder.selection_adapter_multi_left_iv.setImageDrawable(null);
                }
            }
            if(oneSelectedAnimate){
                AnimationUtilities.animateMyView(
                        holder.selection_adapter_multi_left_iv, 250, Techniques.Pulse);
            }
            holder.selection_adapter_multi_main_layout.setVisibility(View.VISIBLE);
            holder.selection_adapter_multi_main_layout.setOnClickListener(clickListener);
            holder.selection_adapter_multi_main_layout.setOnLongClickListener(longClickListener);

        } else if (type == MultipurposeChoiceType.SINGLE_SELECT){
            final SingleSelectChoice holder = (SingleSelectChoice) holder0;
            holder.selection_adapter_single_tv.setText(desc);
            if(currentObj.isSelected()){
                if(selectedCircle != null) {
                    holder.selection_adapter_single_left_icon.setImageDrawable(selectedCircle);
                } else if (unselectedCircleResource != null){
                    holder.selection_adapter_single_left_icon.setImageResource(selectedCircleResource);
                } else {
                    holder.selection_adapter_single_left_icon.setImageDrawable(null);
                }
            } else {
                if(unselectedCircle != null) {
                    holder.selection_adapter_single_left_icon.setImageDrawable(unselectedCircle);
                } else if (unselectedCircleResource != null){
                    holder.selection_adapter_single_left_icon.setImageResource(unselectedCircleResource);
                } else {
                    holder.selection_adapter_single_left_icon.setImageDrawable(null);
                }
            }
            holder.selection_adapter_single_main_layout.setVisibility(View.VISIBLE);
            holder.selection_adapter_single_main_layout.setOnClickListener(clickListener);
            holder.selection_adapter_single_main_layout.setOnLongClickListener(longClickListener);

        }

        if(oneSelectedAnimate){
            //
        } else {
            //
        }
        this.oneSelectedAnimate = false;
    }

    @Override
    public int getItemCount() {
        if(MiscUtilities.isListNullOrEmpty(mListObjects)){
            return 0;
        } else {
            return mListObjects.size();
        }
    }

    /**
     * Update one object in the list
     * @param position Position to update
     * @param mObject Single object to update. If null, will be ignored (Call remove instead).
     *                {@link MultipurposeChoiceObject}
     */
    public void updateOneObject(int position,  MultipurposeChoiceObject mObject){
        if(mObject == null){
            return;
        }
        if(!MiscUtilities.isListNullOrEmpty(this.mListObjects)){
            try {
                this.oneSelectedAnimate = true;
                this.mListObjects.set(position, mObject);
                notifyItemChanged(position);
            } catch (ArrayIndexOutOfBoundsException aio){
                aio.printStackTrace();
            }
        }
    }

    /**
     * Remove a single object from the list
     * @param position Position to remove
     */
    public void removeOneObject(int position){
        if(!MiscUtilities.isListNullOrEmpty(this.mListObjects)){
            try {
                this.mListObjects.remove(position);
                notifyItemChanged(position);
            } catch (ArrayIndexOutOfBoundsException aio){
                aio.printStackTrace();
            }
        }
    }

    /**
     * Set data list
     * @param mListObjects {@link MultipurposeChoiceObject}
     */
    public void setListObjects(List<MultipurposeChoiceObject> mListObjects){
        this.mListObjects = mListObjects;
        this.notifyDataSetChanged();
    }

    class MultipleSelectChoice extends RecyclerView.ViewHolder {

        private LinearLayout selection_adapter_multi_main_layout;
        private ImageView selection_adapter_multi_left_iv;
        private TextView selection_adapter_multi_tv;

        public MultipleSelectChoice(View itemView) {
            super(itemView);
            this.selection_adapter_multi_main_layout = (LinearLayout) itemView.findViewById(
                    R.id.selection_adapter_multi_main_layout);
            this.selection_adapter_multi_left_iv = (ImageView) itemView.findViewById(
                    R.id.selection_adapter_multi_left_iv);
            this.selection_adapter_multi_tv = (TextView) itemView.findViewById(
                    R.id.selection_adapter_multi_tv);
        }
    }

    class SingleSelectChoice extends RecyclerView.ViewHolder {

        private LinearLayout selection_adapter_single_main_layout;
        private ImageView selection_adapter_single_left_icon;
        private TextView selection_adapter_single_tv;

        public SingleSelectChoice(View itemView) {
            super(itemView);
            this.selection_adapter_single_main_layout = (LinearLayout) itemView.findViewById(
                    R.id.selection_adapter_single_main_layout);
            this.selection_adapter_single_left_icon = (ImageView) itemView.findViewById(
                    R.id.selection_adapter_single_left_icon);
            this.selection_adapter_single_tv = (TextView) itemView.findViewById(
                    R.id.selection_adapter_single_tv);
        }
    }

    public static class MultipurposeChoiceObject {
        private String description;
        private String imageUrl;
        private boolean isSelected;

        public boolean isSelected() {
            return isSelected;
        }

        public void setSelected(boolean selected) {
            isSelected = selected;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public String getImageUrl() {
            return imageUrl;
        }

        public void setImageUrl(String imageUrl) {
            this.imageUrl = imageUrl;
        }
    }

    /**
     * Simple utility for building a list if you do not have image URLs to use, only titles
     * @param objs
     * @return
     */
    public static List<MultipurposeChoiceObject> buildSimpleObjectList(List<String> objs){
        return buildSimpleObjectList(objs, null);
    }

    /**
     * Simple utility for building a list if you do not have image URLs to use, only titles
     * @param objs
     * @return
     */
    public static List<MultipurposeChoiceObject> buildSimpleObjectList(List<String> objs,
                                                                       List<String> selectedStrings){
        if(MiscUtilities.isListNullOrEmpty(objs)){
            return new ArrayList<>();
        }
        List<MultipurposeChoiceObject> aList = new ArrayList<>();
        for(String str : objs){
            MultipurposeChoiceObject o = new MultipurposeChoiceObject();
            o.setDescription(str);
            if(!MiscUtilities.isListNullOrEmpty(selectedStrings)) {
                for (String ss : selectedStrings) {
                    if (!StringUtilities.isNullOrEmpty(ss)) {
                        if (ss.equals(str)) {
                            o.setSelected(true);
                        }
                    }
                }
            }
            aList.add(o);
        }
        return aList;
    }

}


text:
CKEDITOR.plugins.setLang( 'indent', 'mk', {
	indent: 'Increase Indent', // MISSING
	outdent: 'Decrease Indent' // MISSING
});


text:
package com.intellij.debugger.impl;

import com.intellij.openapi.project.Project;

public abstract class HotSwapProgress {
  private final Project myProject;
  private Runnable myCancelWorker;
  private volatile boolean myIsCancelled;

  public HotSwapProgress(Project project) {
    myProject = project;
  }

  public Project getProject() {
    return myProject;
  }

  public abstract void addMessage(DebuggerSession session, final int type, final String text);

  public abstract void setText(String text);

  public abstract void setTitle(String title);

  public abstract void setFraction(double v);

  public void setCancelWorker(Runnable cancel) {
    myCancelWorker = cancel;
  }

  public void cancel() {
    myIsCancelled = true;
    if(myCancelWorker != null) {
      myCancelWorker.run();
    }
  }

  public void finished() {
  }

  public abstract void setDebuggerSession(DebuggerSession debuggerSession);

  public boolean isCancelled() {
    return myIsCancelled;
  }
}


text:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsWebBrowser_h__
#define nsWebBrowser_h__

// Local Includes
#include "nsDocShellTreeOwner.h"

// Core Includes
#include "nsCOMPtr.h"

// Interfaces needed
#include "nsCWebBrowser.h"
#include "nsIBaseWindow.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDocShellTreeNode.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIScrollable.h"
#include "nsISHistory.h"
#include "nsITextScroll.h"
#include "nsIWidget.h"
#include "nsIWebProgress.h"
#include "nsISecureBrowserUI.h"
#include "nsIWebBrowser.h"
#include "nsIWebNavigation.h"
#include "nsIWebBrowserSetup.h"
#include "nsIWebBrowserPersist.h"
#include "nsIWebBrowserFocus.h"
#include "nsIWebBrowserStream.h"
#include "nsIWindowWatcher.h"
#include "nsIPrintSettings.h"
#include "nsEmbedStream.h"
#include "nsIWidgetListener.h"

#include "nsTArray.h"
#include "nsWeakPtr.h"

class nsIContentViewerFile;

class nsWebBrowserInitInfo
{
public:
   //nsIBaseWindow Stuff
   int32_t                 x;
   int32_t                 y;
   int32_t                 cx;
   int32_t                 cy;
   bool                    visible;
   nsCOMPtr<nsISHistory>   sessionHistory;
   nsString                name;
};

class nsWebBrowserListenerState
{
public:
    bool Equals(nsIWeakReference *aListener, const nsIID& aID) {
        if (mWeakPtr.get() == aListener && mID.Equals(aID)) return true;
        return false;
    }

    nsWeakPtr mWeakPtr;
    nsIID mID;
};

//  {F1EAC761-87E9-11d3-AF80-00A024FFC08C} -
#define NS_WEBBROWSER_CID \
{0xf1eac761, 0x87e9, 0x11d3, { 0xaf, 0x80, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c }}

class nsWebBrowser : public nsIWebBrowser,
                     public nsIWebNavigation,
                     public nsIWebBrowserSetup,
                     public nsIDocShellTreeItem,
                     public nsIBaseWindow,
                     public nsIScrollable,
                     public nsITextScroll,
                     public nsIInterfaceRequestor,
                     public nsIWebBrowserPersist,
                     public nsIWebBrowserFocus,
                     public nsIWebProgressListener,
                     public nsIWebBrowserStream,
                     public nsIWidgetListener,
                     public nsSupportsWeakReference
{
friend class nsDocShellTreeOwner;
public:
    nsWebBrowser();

    NS_DECL_ISUPPORTS

    NS_DECL_NSIBASEWINDOW
    NS_DECL_NSIDOCSHELLTREEITEM
    NS_DECL_NSIDOCSHELLTREENODE
    NS_DECL_NSIINTERFACEREQUESTOR
    NS_DECL_NSISCROLLABLE
    NS_DECL_NSITEXTSCROLL
    NS_DECL_NSIWEBBROWSER
    NS_DECL_NSIWEBNAVIGATION
    NS_DECL_NSIWEBBROWSERSETUP
    NS_DECL_NSIWEBBROWSERPERSIST
    NS_DECL_NSICANCELABLE
    NS_DECL_NSIWEBBROWSERFOCUS
    NS_DECL_NSIWEBBROWSERSTREAM
    NS_DECL_NSIWEBPROGRESSLISTENER

protected:
    virtual ~nsWebBrowser();
    NS_IMETHOD InternalDestroy();

    // XXXbz why are these NS_IMETHOD?  They're not interface methods!
    NS_IMETHOD SetDocShell(nsIDocShell* aDocShell);
    NS_IMETHOD EnsureDocShellTreeOwner();
    NS_IMETHOD GetPrimaryContentWindow(nsIDOMWindow **aDomWindow);
    NS_IMETHOD BindListener(nsISupports *aListener, const nsIID& aIID);
    NS_IMETHOD UnBindListener(nsISupports *aListener, const nsIID& aIID);
    NS_IMETHOD EnableGlobalHistory(bool aEnable);

    // nsIWidgetListener
    virtual void WindowRaised(nsIWidget* aWidget);
    virtual void WindowLowered(nsIWidget* aWidget);
    virtual bool PaintWindow(nsIWidget* aWidget, bool isRequest, nsIntRegion aRegion, bool aWillSendDidPaint);

protected:
   nsDocShellTreeOwner*       mDocShellTreeOwner;
   nsCOMPtr<nsIDocShell>      mDocShell;
   nsCOMPtr<nsIInterfaceRequestor> mDocShellAsReq;
   nsCOMPtr<nsIBaseWindow>    mDocShellAsWin;
   nsCOMPtr<nsIDocShellTreeItem> mDocShellAsItem;
   nsCOMPtr<nsIWebNavigation> mDocShellAsNav;
   nsCOMPtr<nsIScrollable>    mDocShellAsScrollable;
   nsCOMPtr<nsITextScroll>    mDocShellAsTextScroll;
   nsCOMPtr<nsIWidget>        mInternalWidget;
   nsCOMPtr<nsIWindowWatcher> mWWatch;
   nsWebBrowserInitInfo*      mInitInfo;
   uint32_t                   mContentType;
   bool                       mActivating;
   bool                       mShouldEnableHistory;
   bool                       mIsActive;
   nativeWindow               mParentNativeWindow;
   nsIWebProgressListener    *mProgressListener;
   nsCOMPtr<nsIWebProgress>      mWebProgress;

   nsCOMPtr<nsIPrintSettings> mPrintSettings;

   // cached background color
   nscolor                       mBackgroundColor;

   // persistence object
   nsCOMPtr<nsIWebBrowserPersist> mPersist;
   uint32_t                       mPersistCurrentState;
   nsresult                       mPersistResult;
   uint32_t                       mPersistFlags;

   // stream
   nsEmbedStream                 *mStream;
   nsCOMPtr<nsISupports>          mStreamGuard;

   //Weak Reference interfaces...
   nsIWidget*                            mParentWidget;
   nsTArray<nsWebBrowserListenerState*>* mListenerArray;
};

#endif /* nsWebBrowser_h__ */


text:
package com.ubivent.vp8;

public class LoopFilterHeader {
	public final static int BLOCK_CONTEXTS = 4;

	boolean use_simple;
	int level;
	int sharpness;
	boolean delta_enabled;
	int ref_delta[] = new int[BLOCK_CONTEXTS];
	int mode_delta[] = new int[BLOCK_CONTEXTS];
}


text:
<!--
  Copyright 2019 The AMP HTML Authors. All Rights Reserved.

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

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS-IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the license.
-->
<!--
  Test Description:
  Tests for the amp-payments-google-inline tag. See inline comments.
-->
<!doctype html>
<html ⚡ actions>
<head>
  <meta charset="utf-8">
  <link rel="canonical" href="./regular-html-version.html">
  <meta name="viewport" content="width=device-width">
  <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
  <script async src="https://cdn.ampproject.org/v0.js"></script>
  <script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
  <script async custom-element="amp-payment-google-inline" src="https://cdn.ampproject.org/v0/amp-payment-google-inline-0.1.js"></script>
</head>
<body>
  <!-- Valid -->
  <form method="post" action-xhr="https://example.com/checkout">
    <amp-payment-google-inline data-payment-data-input-id="payment-data">
      <script type="application/json">
      {
        "apiVersion": 1,
        "merchantId": "0123456789",
        "allowedPaymentMethods": ["CARD", "TOKENIZED_CARD"],
        "paymentMethodTokenizationParameters": {
          "tokenizationType": "PAYMENT_GATEWAY",
          "parameters": {
            "gateway": "stripe",
            "stripe:publishableKey": "0123456789",
            "stripe:version": "5"
          }
        },
        "cardRequirements": {
          "allowedCardNetworks": ["AMEX", "DISCOVER", "VISA", "MASTERCARD"],
          "billingAddressRequired": true
        },
        "emailRequired": true,
        "transactionInfo": {
          "currencyCode": "USD",
          "totalPriceStatus": "ESTIMATED",
          "totalPrice": "10.00"
        }
      }
      </script>
    </amp-payment-google-inline>
  </form>

  <!-- Invalid: FORM [method=POST] (ACTIONS) not an ancestor -->
  <amp-payment-google-inline data-payment-data-input-id="payment-data">
    <script type="application/json">
    {
      "apiVersion": 1,
      "merchantId": "0123456789",
      "allowedPaymentMethods": ["CARD", "TOKENIZED_CARD"],
      "paymentMethodTokenizationParameters": {
        "tokenizationType": "PAYMENT_GATEWAY",
        "parameters": {
          "gateway": "stripe",
          "stripe:publishableKey": "0123456789",
          "stripe:version": "5"
        }
      },
      "cardRequirements": {
        "allowedCardNetworks": ["AMEX", "DISCOVER", "VISA", "MASTERCARD"],
        "billingAddressRequired": true
      },
      "emailRequired": true,
      "transactionInfo": {
        "currencyCode": "USD",
        "totalPriceStatus": "ESTIMATED",
        "totalPrice": "10.00"
      }
    }
    </script>
  </amp-payment-google-inline>

  <!-- Invalid: missing mandatory data-payment-data-input-id attribute -->
  <form method="post" action-xhr="https://example.com/checkout">
    <amp-payment-google-inline>
      <script type="application/json">
      {
        "apiVersion": 1,
        "merchantId": "0123456789",
        "allowedPaymentMethods": ["CARD", "TOKENIZED_CARD"],
        "paymentMethodTokenizationParameters": {
          "tokenizationType": "PAYMENT_GATEWAY",
          "parameters": {
            "gateway": "stripe",
            "stripe:publishableKey": "0123456789",
            "stripe:version": "5"
          }
        },
        "cardRequirements": {
          "allowedCardNetworks": ["AMEX", "DISCOVER", "VISA", "MASTERCARD"],
          "billingAddressRequired": true
        },
        "emailRequired": true,
        "transactionInfo": {
          "currencyCode": "USD",
          "totalPriceStatus": "ESTIMATED",
          "totalPrice": "10.00"
        }
      }
      </script>
    </amp-payment-google-inline>
  </form>

  <!-- Invalid: missing mandatory child script tag -->
  <form method="post" action-xhr="https://example.com/checkout">
    <amp-payment-google-inline data-payment-data-input-id="payment-data">
    </amp-payment-google-inline>
  </form>
</body>
</html>


text:
package org.ppwcode.util.reflect_I;

public class CloneableStubClassB extends CloneableStubClassA {

  // explicitly no constructor defined, so there is a default default constructor

}


text:
mongoose = require('mongoose');

const { Schema } = mongoose;

// models/User.js
const UserSchema = new Schema({
    firstName: String,
    lastName: String,
  });

module.exports = mongoose.model('user', UserSchema);


text:
var path   = require('path');
var filter = require('../');

var gracefulShutdown = process.argv.indexOf('--graceful-shutdown') > -1;
var noIPCTest        = process.argv.indexOf('--no-ipc-test') > -1;
var ignoreTraceGc    = process.argv.indexOf('--ignore-trace-gc') > -1;

filter(path.join(__dirname, './actual-cli.js'), {
    useShutdownMessage: gracefulShutdown || noIPCTest,
    ignore: ignoreTraceGc && ['--trace-gc']
});


text:
package chittoda;

import java.util.ArrayList;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

/**
 * FSMThreadPool which will maintain the execution order of Task
 * as per their insertion order in ThreadPool.
 * Tasks would be sequentialise based on the Key provided while assigning
 * the Task
 * @author Jitendra Chittoda
 *
 */
public class FSMThreadPool extends AbstractThreadPool {

	//Number of threads to start
	private final int SIZE;

	//For round robin scheduling
	private Integer indexer = -1;

	//index caching enabled, for faster task assignment
	private final boolean isKeyIndexCacheEnabled;

	//Cache to map Key and Index assigned
	private Map<Object, Integer> keyCache;

	//BlockingQueue factory
	private final BlockingQueueFactory queueFactory;

	//Task queue array
	//We could have used Map to store queue, but direct index access would be faster
	private final BlockingQueue<Runnable>[] queueArray;

	private final ReentrantLock lock = new ReentrantLock();

	private final Condition shutdownCondition = lock.newCondition();

	private final List<Worker> workers = new CopyOnWriteArrayList<>();

	/**
	 *
	 * @param size
	 * @param queueFactory
	 * @param isKeyIndexCacheEnabled
	 */
	@SuppressWarnings("unchecked")
	public FSMThreadPool(int size, BlockingQueueFactory queueFactory
			, boolean isKeyIndexCacheEnabled) {

		this.SIZE = size;
		this.queueFactory = queueFactory;
		this.isKeyIndexCacheEnabled = isKeyIndexCacheEnabled;

		queueArray = new BlockingQueue[size];
		init();
	}

	/**
	 * Initialise queue and Threads
	 */
	private void init(){
		for (int i = 0; i <= SIZE-1; i++) {
			queueArray[i] = queueFactory.createBlockingQueue();
			Worker worker = new Worker(queueArray[i]);
			workers.add(worker);
			Thread thr = new Thread(worker);
			worker.setThread(thr);
			thr.start();
		}

		if(isKeyIndexCacheEnabled)
			keyCache = new ConcurrentHashMap<>();
	}

	/**
	 * Assign the Runnable Task to ThreadPool.
	 * @param key Key to maintain the sequence of tasks
	 * @param task Task that is to be executed
	 */
	public Integer assignTask(CacheKeyRunnable<? extends Object> task){

		Integer index = keyCache.get(task.getKey());

		//When index is not assigned to Key
		if(index == null) {
			lock.lock();
			try{
				if( (index = keyCache.get(task.getKey())) == null) {
					//Get round robin index for queue to be used
					index = getRoundRobinIndex();
					keyCache.put(task.getKey(), index);
				}
			} finally {
				lock.unlock();
			}
		}

		try {
			//queue of that index would be used to assign the task
			queueArray[index].put(task);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}

		//Return the index, if uesr directly want to assign the
		//taks to queue
		return index;
	}

	/**
	 * Get Round robin Index of  queue.
	 * @return
	 */
	private int getRoundRobinIndex(){

		int index;

		//When size is 1, directly return 0 index
		if(SIZE == 1)
			return 0;

		lock.lock();

		if(indexer >= SIZE-1)
			indexer = -1;

		indexer++;
		index = indexer;

		lock.unlock();

		return index;
	}

	@Override
	public void shutdown() {

		for (Worker worker : workers) {
			worker.shutdown(new Worker.ShutdownListener() {
				@Override
				public void shutdownComplete(Worker worker) {
					workers.remove(worker);
					if(workers.size() == 0){
						lock.lock();
						try{ shutdownCondition.signal(); }
						finally{ lock.unlock(); }
					}
				}
			});

		}

	}

    public boolean awaitTermination(long timeout, TimeUnit unit)
            throws InterruptedException {
        lock.lock();
        try{

	        long waitUntil = System.nanoTime() + unit.toNanos(timeout);
	        long remainingTime;
	        while ((remainingTime = waitUntil - System.nanoTime()) > 0
	                && !workers.isEmpty()) {
	            shutdownCondition.awaitNanos(remainingTime);
	        }
	        if (remainingTime <= 0) return false;
        } finally {
        	lock.unlock();
        }

        return true;
    }

    //TODO
	@Override
	public List<Runnable> shutdownNow() {
		final List<Runnable> unfinishedTasks = new ArrayList<>();

		for (Worker worker : workers) {
			worker.shutdownNow(new Worker.ShutdownListener() {

				@Override
				public void shutdownComplete(Worker worker) {
					assert worker.isWorkerStopped();
					unfinishedTasks.addAll(worker.getUnfinishedTasks());
					workers.remove(worker);
					if(workers.size() == 0){
						lock.lock();
						try{ shutdownCondition.signal(); }
						finally{ lock.unlock(); }
					}
				}
			});
		}

		lock.lock();
		try{
			shutdownCondition.await();
		} catch (InterruptedException e) {
			e.printStackTrace();
		} finally { lock.unlock(); }
		return unfinishedTasks;
	}

}


text:
package org.apache.commons.imaging.formats.rgbe;

import static org.junit.jupiter.api.Assertions.assertNotNull;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.List;

import org.apache.commons.imaging.ImageInfo;
import org.apache.commons.imaging.ImageReadException;
import org.apache.commons.imaging.Imaging;
import org.apache.commons.imaging.common.ImageMetadata;
import org.apache.commons.imaging.common.bytesource.ByteSourceFile;
import org.apache.commons.imaging.internal.Debug;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class RgbeReadTest extends RgbeBaseTest {

    @Test
    public void test() throws IOException, ImageReadException {
        Debug.debug("start");

        final List<File> images = getRgbeImages();

        for (final File imageFile : images) {

            Debug.debug("imageFile", imageFile);

            final ImageMetadata metadata = Imaging.getMetadata(imageFile);
            assertNotNull(metadata);

            final ImageInfo imageInfo = Imaging.getImageInfo(imageFile);
            assertNotNull(imageInfo);

            final BufferedImage image = Imaging.getBufferedImage(imageFile);
            assertNotNull(image);
        }
    }

    /**
     * Test that a bad file does not gets the RgbeImageParser stuck reading it.
     */
    @Test
    public void testErrorDecompressingInvalidFile() {
        // From IMAGING-219
        final File inputFile = new File(
                RgbeReadTest.class.getResource("/IMAGING-219/timeout-9713502c9c371f1654b493650c16ab17c0444369.hdr")
                        .getFile());
        final ByteSourceFile byteSourceFile = new ByteSourceFile(inputFile);
        final RgbeImagingParameters params = new RgbeImagingParameters();
        Assertions.assertThrows(ImageReadException.class, () -> new RgbeImageParser().getBufferedImage(byteSourceFile, params));
    }
}


text:
package manifold.js.rt.parser.tree;

import manifold.js.rt.parser.Token;

/**
 */
public class ParseError
{
  private String _message;
  private Token _token;

  public ParseError( String message, Token token )
  {
    _message = message;
    _token = token;
  }

  public String getMessage()
  {
    return _message;
  }

  public Token getToken()
  {
    return _token;
  }
}


text:
package edu.duke.cabig.c3pr.esb;

/**
 * This class a  local representation of the caXchange Metadata class.
 * Its instantiated by the client and then passed to the broadcast method to build the caxchange metadata object
 *
 * @author Vinay
 */
public class Metadata {

	private String operationName;

	private String externalIdentifier;

	private String serviceType;

	public Metadata() {
	}

	public Metadata(String operationName, String externalId) {
		this.operationName = operationName;
		this.externalIdentifier = externalId;
	}

	public Metadata(String operationName, String externalId, String serviceType) {
		this.operationName = operationName;
		this.externalIdentifier = externalId;
		this.serviceType = serviceType;
	}

	public String getExternalIdentifier() {
		return externalIdentifier;
	}

	public void setExternalIdentifier(String externalIdentifier) {
		this.externalIdentifier = externalIdentifier;
	}

	public String getOperationName() {
		return operationName;
	}

	public void setOperationName(String operationName) {
		this.operationName = operationName;
	}

	public String getServiceType() {
		return serviceType;
	}

	public void setServiceType(String serviceType) {
		this.serviceType = serviceType;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Metadata [operationName=" + operationName
				+ ", externalIdentifier=" + externalIdentifier
				+ ", serviceType=" + serviceType + "]";
	}

}


text:
<?php

declare(strict_types=1);

namespace Bitrix24\SDK\Tests\Integration\Services\CRM\Activity\ReadModel;

use Bitrix24\SDK\Services\CRM\Activity\ReadModel\OpenLineFetcher;
use Bitrix24\SDK\Tests\Integration\Fabric;
use PHPUnit\Framework\TestCase;

class OpenLineFetcherTest extends TestCase
{
    private OpenLineFetcher $openLineFetcher;

    /**
     * @return void
     * @throws \Bitrix24\SDK\Core\Exceptions\BaseException
     * @covers \Bitrix24\SDK\Services\CRM\Activity\ReadModel\WebFormFetcher::getList
     */
    public function testGetListWithAllResults(): void
    {
        // we can't guarantee open lines data on test env
        $itemsCnt = 0;
        foreach ($this->openLineFetcher->getList(['ID' => 'DESC'], [], ['*', 'COMMUNICATIONS',], null, 5) as $item) {
            $itemsCnt++;
//            print(sprintf(
//                    '%s | %s | %s ',
//                    $item->PROVIDER_TYPE_ID,
//                    $item->CREATED,
//                    $item->SUBJECT,
//                ) . PHP_EOL);
        }
        $this->assertTrue(true);
    }

    public function setUp(): void
    {
        $this->openLineFetcher = Fabric::getServiceBuilder()->getCRMScope()->activityFetcher()->openLineFetcher();
    }
}


text:
package io.upit.dal.models.security;

public interface LoginRequest {

    String getUserNameOrEmail();

    void setUserNameOrEmail(String userNameOrEmail);

    String getPassword();

    void setPassword(String password);

    String getRequestType();

    void setRequestType(String requestType);

}


text:
function [Fhull,t,y] = hull(varargin)
% HULL  Construct a model of the convex hull
%
% H = hull(F1,F2,...)
%
% OUTPUT
%   H   : Constraint object describing the convex hull of the input constraints
%
% INPUT
%   Fi  : Constraint objects with constraints
%
% Note that the convex representation of the convex hull requires a lifting
% (introduction of auxially variables). Hence, if you have many set of
% constraints, your problem rapidly grows large.

if nargin==1
    Fhull = varargin{1};
    t = [];
end
% Pre-process to convert convex quadratic constraints to socp constraints.
% This makes the perspective code easier.
% We also wexpand all graph-operators etc to find out all involved
% variables and constraints

for i = 1:nargin
    varargin{i} = convertquadratics(varargin{i});
    varargin{i} = expandmodel(varargin{i},[]);
end

variables = [];
for i = 1:nargin
    % quick fix
    if isa(varargin{i},'constraint')
        varargin{i} = set(varargin{i});
    end
    if ~(isa(varargin{i},'lmi') | isa(varargin{i},'socc'))
        error('Hull can only be applied to linear constraints');
    elseif ~(islinear(varargin{i}))
        error('Hull can only be applied to linear and convex quadratic constraints');
    end
    variables = unique([variables depends(varargin{i})]);
end

if nargin == 1
    Fhull = varargin{1};
    return
end

% Define variables. To allow users to easily plot convex hulls, we mark the
% internally defined variables as auxilliary. YALMIP will then not plot
% w.r.t these variables
nInitial = yalmip('nvars');
y = sdpvar(repmat(length(variables),1,nargin),repmat(1,1,nargin));
t = sdpvar(nargin,1);
nNow = yalmip('nvars');
yalmip('addauxvariables',nInitial+1:nNow);

Fhull = set([]);
for i = 1:nargin
    Fi = varargin{i};
    tvariable = getvariables(t(i));
    for j = 1:length(Fi.clauses)
        local_variables = getvariables(Fi);
        Xi = Fi.clauses{j}.data;
        local_variables = getvariables(Xi);
        local_index = find(ismember(variables,local_variables));
        new_variables = getvariables(y{i}(local_index));
        Fi.clauses{j}.data = brutepersp(Fi.clauses{j}.data,tvariable,new_variables);
    end
    Fhull = Fhull + Fi;
end
Fhull = Fhull + set(sum([y{:}],2) == recover(variables));
Fhull = Fhull + set(sum(t)==1) + set(t>=0);
Fhull = expanded(Fhull,1);
yalmip('setdependence',[reshape([y{:}],[],1);t(:)],recover(variables));
%yalmip('setdependence',recover([10 11]),recover(variables));
yalmip('addauxvariables',getvariables([reshape([y{:}],[],1);t(:)]));
y = [y{:}];


text:
//
//  JMHTopic.m
//  01-不思不得姐
//
//  Created by Minghao on 16/8/15.
//  Copyright © 2016年 Minghao. All rights reserved.
//

#import "JMHTopic.h"
#import "JMHComment.h"
#import "JMHUser.h"

@implementation JMHTopic
{
    CGRect _pictureFrame;
}
+ (NSDictionary *)replacedKeyFromPropertyName
{
    return @{
             @"small_image" : @"image0",
             @"large_image" : @"image1",
             @"middle_image" : @"image2",
             @"ID" : @"id",
             @"top_cmt" : @"top_cmt[0]"
             };
}

+ (NSDictionary *)objectClassInArray
{
    return @{@"top_cmt" : @"JMHComment"};
}
- (NSString *)create_time
{
    // 日期格式化类
    NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
    // 设置日期格式(y:年,M:月,d:日,H:时,m:分,s:秒)
    fmt.dateFormat = @"yyyy-MM-dd HH:mm:ss";
    // 帖子的创建时间
    NSDate *create = [fmt dateFromString:_create_time];

    if (create.isThisYear) { // 今年
        if (create.isToday) { // 今天
            NSDateComponents *cmps = [[NSDate date] deltaFrom:create];

            if (cmps.hour >= 1) { // 时间差距 >= 1小时
                return [NSString stringWithFormat:@"%zd小时前", cmps.hour];
            } else if (cmps.minute >= 1) { // 1小时 > 时间差距 >= 1分钟
                return [NSString stringWithFormat:@"%zd分钟前", cmps.minute];
            } else { // 1分钟 > 时间差距
                return @"刚刚";
            }
        } else if (create.isYesterday) { // 昨天
            fmt.dateFormat = @"昨天 HH:mm:ss";
            return [fmt stringFromDate:create];
        } else { // 其他
            fmt.dateFormat = @"MM-dd HH:mm:ss";
            return [fmt stringFromDate:create];
        }
    } else { // 非今年
        return _create_time;
    }
}

- (CGFloat)cellHeight
{
    if (!_cellHeight) {
        // 文字的最大尺寸
        CGSize maxSize = CGSizeMake([UIScreen mainScreen].bounds.size.width - 4 * 10, MAXFLOAT);

        // 计算文字高度
        CGFloat textH = [self.text boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:14]} context:nil].size.height;
        // cell 的高度
        _cellHeight = textH + 44 + 55 + 2 * JMHTopicCellMargin;
        if (self.type == JMHTopicTypePicture) {

            // 图片宽度
            CGFloat w = maxSize.width;
            // 图片高度
            CGFloat h = self.height * w / self.width;

            if (h > XMGTopicCellPictureMaxH) {
                self.bigPicture = YES;
                h = JMHTopicCellPictureBreakH;

            }
            CGFloat x = JMHTopicCellMargin;
            CGFloat y = 55 + JMHTopicCellMargin + textH;
            _pictureFrame = CGRectMake(x, y, w, h);
            _cellHeight += h + JMHTopicCellMargin;
        }else if (self.type == JMHTopicTypeVoice){

            // 图片宽度
            CGFloat w = maxSize.width;
            // 图片高度
            CGFloat h = self.height * w / self.width;

            CGFloat x = JMHTopicCellMargin;
            CGFloat y = 55 + JMHTopicCellMargin + textH;
            _voiceFrame = CGRectMake(x, y, w, h);
            _cellHeight += h + JMHTopicCellMargin;
        }else if (self.type == JMHTopicTypeVideo){

            // 图片宽度
            CGFloat w = maxSize.width;
            // 图片高度
            CGFloat h = self.height * w / self.width;

            CGFloat x = JMHTopicCellMargin;
            CGFloat y = 55 + JMHTopicCellMargin + textH;
            _videoFrame = CGRectMake(x, y, w, h);
            _cellHeight += h + JMHTopicCellMargin;
        }
        // 处理最热评论

        if (self.top_cmt) {
            NSString *content = [NSString stringWithFormat:@"%@ : %@", self.top_cmt.user.username, self.top_cmt.content];
            CGFloat contentH = [content boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:13]} context:nil].size.height;

            _cellHeight += contentH + JMHTopicCellMargin + 20;

        }

    }
    return _cellHeight;
}

/** 图片控件的frame */

@end


text:
- [DOC] Doc edits

## 1.1.3
- [TEST] Added node 5.0 on travis config

## 1.1.1
- [TEST] Added travisCI support for nodeJS 4.0 & 4.2
- [DOC] Added license info

## 1.1.0
- Added ```showOnlyFilenames``` option to show only filenames on the HTML page

## 1.0.0
- First working release


text:
<resources>
    <string name="app_name">Dayvin Ross Soundboard</string>
</resources>


text:
<?php

namespace app\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\models\Landpeat;

/**
 * LandpeatSearch represents the model behind the search form about `app\models\Landpeat`.
 */
class LandpeatSearch extends Landpeat
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'id_user'], 'integer'],
            [['slope_thick', 'slope_ripe', 'thick_ripe', 'bobot_slope', 'bobot_thick', 'bobot_ripe', 'cr'], 'number'],
            [['validation'], 'boolean'],
            [['date'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = Landpeat::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'slope_thick' => $this->slope_thick,
            'slope_ripe' => $this->slope_ripe,
            'thick_ripe' => $this->thick_ripe,
            'bobot_slope' => $this->bobot_slope,
            'bobot_thick' => $this->bobot_thick,
            'bobot_ripe' => $this->bobot_ripe,
            'cr' => $this->cr,
            'validation' => $this->validation,
            'id_user' => $this->id_user,
            'date' => $this->date,
        ]);

        return $dataProvider;
    }
}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/ads/googleads/v12/services/reach_plan_service.proto

package com.google.ads.googleads.v12.services;

public interface ReachCurveOrBuilder extends
    // @@protoc_insertion_point(interface_extends:google.ads.googleads.v12.services.ReachCurve)
    com.google.protobuf.MessageOrBuilder {

  /**
   *

   * All points on the reach curve.
   *

   *
   * repeated .google.ads.googleads.v12.services.ReachForecast reach_forecasts = 1;
   */
  java.util.List<com.google.ads.googleads.v12.services.ReachForecast>
      getReachForecastsList();
  /**
   *

   * All points on the reach curve.
   *

   *
   * repeated .google.ads.googleads.v12.services.ReachForecast reach_forecasts = 1;
   */
  com.google.ads.googleads.v12.services.ReachForecast getReachForecasts(int index);
  /**
   *

   * All points on the reach curve.
   *

   *
   * repeated .google.ads.googleads.v12.services.ReachForecast reach_forecasts = 1;
   */
  int getReachForecastsCount();
  /**
   *

   * All points on the reach curve.
   *

   *
   * repeated .google.ads.googleads.v12.services.ReachForecast reach_forecasts = 1;
   */
  java.util.List<? extends com.google.ads.googleads.v12.services.ReachForecastOrBuilder>
      getReachForecastsOrBuilderList();
  /**
   *

   * All points on the reach curve.
   *

   *
   * repeated .google.ads.googleads.v12.services.ReachForecast reach_forecasts = 1;
   */
  com.google.ads.googleads.v12.services.ReachForecastOrBuilder getReachForecastsOrBuilder(
      int index);
}


text:
package egovframework.com.utl.wed.filter;

import java.io.File;
import java.io.IOException;

import org.apache.commons.fileupload.FileItem;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import egovframework.com.cmm.service.EgovProperties;

/**
 * Created by guava on 1/20/14.
 *  이미지 저장 처리 클래스
 * @author guavatak
 * @since 2014.12.04
 * @version 1.0
 * @see
 *
 * <pre>
 * << 개정이력(Modification Information) >>
 *
 *  수정일              수정자             수정내용
 *  ----------  --------    ---------------------------
 *  2014.12.04	표준프레임워크	최초 적용 (패키지 변경 및 소스 정리)
 *  2018.12.28	신용호             saveFile() 파라미터 수정
 * </pre>
 */
public class DefaultFileSaveManager implements FileSaveManager {

	private static final Logger LOGGER = LoggerFactory.getLogger(EgovProperties.class);

	@Override
	public String saveFile(FileItem fileItem, String imageBaseDir) {
		String originalFileName = FilenameUtils.getName(fileItem.getName());
		String relUrl;
		// filename
		String subDir = File.separator + DirectoryPathManager.getDirectoryPathByDateType(DirectoryPathManager.DIR_DATE_TYPE.DATE_POLICY_YYYY_MM);
		String fileName = RandomStringUtils.randomAlphanumeric(20) + "." + StringUtils.lowerCase(StringUtils.substringAfterLast(originalFileName, "."));

		File newFile = new File(imageBaseDir + subDir + fileName);
		File fileToSave = DirectoryPathManager.getUniqueFile(newFile.getAbsoluteFile());

		try {
			FileUtils.writeByteArrayToFile(fileToSave, fileItem.get());
		} catch (IOException e) {
			//KISA 보안약점 조치 (2018-10-29, 윤창원)
			LOGGER.debug("File IO exception" + e.getMessage());
		}

		String savedFileName = FilenameUtils.getName(fileToSave.getAbsolutePath());
		relUrl = StringUtils.replace(subDir, "\\", "/") + savedFileName;

		return relUrl;
	}
}


text:
'''
Created on 25 Dec 2016

@author: dusted-ipro

Agent movement funcs

'''
import numpy as np
from environment import world

def searchSystem(agent):
    '''
    Move through a system's planets one by one (nothing smart about the order)
    Calculates the next position based on prevPosition, velocity an timeStep toward next planet
    ::Returns coords - coords to move to (Does not move the agent)
    '''
    #Get vector to planet

    #Calculate next coords based on velocity*world timeStep

    #Return Coords
    pass


text:
<?php
/**
 * Class Legislator
 * This control handles pages about legislators specifically searching and viewing profiles
 */
class Legislator extends Controller
{
    /**
     * Construct this object by extending the basic Controller class
     */
    function __construct()
    {
        parent::__construct();

    }

    /**
     * This method controls what happens when you move to /legislator/index in your app.
     */
    function index($state="0")
    {
        $legislator_model = $this->loadModel("Legislator");
        if(isset($state) && $state!="0"){
            $this->view->state = $state;
            $this->view->displayPoliticians=true;
            $this->view->arr_rep_data = $legislator_model->get_reps_by_state($state);
            $this->view->arr_sen_data = $legislator_model->get_senators_by_state($state);
        }else{
            $this->view->displayPoliticians=false;
        }
        $this->view->render('legislator/index');
    }
    function profile($politician_id, $page = 1, $quantity = 20){
        if(!isset($politician_id)){
            $this->view->displayPage = false;
        }else{
            $this->view->displayPage = true;
            $legislator_model = $this->loadModel('Legislator');
            $community_model = $this->loadModel('Community');
            $this->view->threads = $community_model->getThreadsByPolitician($politician_id, $page, $quantity);
            $this->view->page = $page;
            $this->view->quantity = $quantity;
            $this->view->politician_id = $politician_id;
            $this->view->obj_politician_data = $legislator_model->get_politician_data($politician_id);
            $this->view->term_completion_bar = $legislator_model -> get_term_comepletion_bar($this -> view -> obj_politician_data);
            $this->view->arr_recent_voting_history = $legislator_model->get_politician_vote_history($politician_id, 5);
        }
        $this->view->render('legislator/profile');
    }

    public function _findPoliticians($query)
    {
        $legislator_model = $this->loadModel("Legislator");
        $this->view->legislatorList = $legislator_model->findPoliticians($query);
        echo $this->view->legislatorList;
    }

}


text:
{-# LANGUAGE DeriveDataTypeable #-}

module Data.SBV.Examples.Uninterpreted.UISortAllSat where

import Data.Generics
import Data.SBV

-- | A "list-like" data type, but one we plan to uninterpret at the SMT level.
-- The actual shape is really immaterial for us, but could be used as a proxy
-- to generate test cases or explore data-space in some other part of a program.
-- Note that we neither rely on the shape of this data, nor need the actual
-- constructors.
data L = Nil
       | Cons Int L
       deriving (Eq, Ord, Data, Typeable, Read, Show)

-- | Declare instances to make 'L' a usable uninterpreted sort. First we need the
-- 'SymWord' instance, with the default definition sufficing.
instance SymWord L

-- | Similarly, 'HasKind's default implementation is sufficient.
instance HasKind L

-- | An uninterpreted "classify" function. Really, we only care about
-- the fact that such a function exists, not what it does.
classify :: SBV L -> SInteger
classify = uninterpret "classify"

-- | Formulate a query that essentially asserts a cardinality constraint on
-- the uninterpreted sort 'L'. The goal is to say there are precisely 3
-- such things, as it might be the case. We manage this by declaring four
-- elements, and asserting that for a free variable of this sort, the
-- shape of the data matches one of these three instances. That is, we
-- assert that all the instances of the data 'L' can be classified into
-- 3 equivalence classes. Then, allSat returns all the possible instances,
-- which of course are all uninterpreted.
--
-- As expected, we have:
--
-- >>> genLs
-- Solution #1:
--   l = L!val!0 :: L
--   l0 = L!val!0 :: L
--   l1 = L!val!1 :: L
--   l2 = L!val!2 :: L
-- Solution #2:
--   l = L!val!2 :: L
--   l0 = L!val!0 :: L
--   l1 = L!val!1 :: L
--   l2 = L!val!2 :: L
-- Solution #3:
--   l = L!val!1 :: L
--   l0 = L!val!0 :: L
--   l1 = L!val!1 :: L
--   l2 = L!val!2 :: L
-- Found 3 different solutions.
genLs :: IO AllSatResult
genLs = allSatWith z3
               $ do [l, l0, l1, l2] <- symbolics ["l", "l0", "l1", "l2"]
                    constrain $ classify l0 .== 0
                    constrain $ classify l1 .== 1
                    constrain $ classify l2 .== 2
                    return $ l .== l0 ||| l .== l1 ||| l .== l2


text:
package org.owasp.html;

import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.codec.binary.Base64;

import junit.framework.AssertionFailedError;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
 * This class tests AntiSamy functionality and the basic policy file which
 * should be immune to XSS and CSS phishing attacks.
 *
 * @author Arshan Dabirsiaghi
 *
 */
public class AntiSamyTest extends TestCase {

  static final boolean RUN_KNOWN_FAILURES = false;
  static final boolean DISABLE_INTERNETS = false;

  private static HtmlSanitizer.Policy makePolicy(Appendable buffer) {
    final HtmlStreamRenderer renderer = HtmlStreamRenderer.create(
        buffer,
        new Handler<IOException>() {
          public void handle(IOException ex) {
            AssertionFailedError failure = new AssertionFailedError();
            failure.initCause(ex);
            throw failure;
          }
        },
        new Handler<String>() {
          public void handle(String errorMessage) {
            fail(errorMessage);
          }
        });

    return new HtmlPolicyBuilder()
        .allowElements(
            "a", "b", "br", "div", "font", "i", "img", "input", "li",
            "ol", "p", "span", "td", "ul")
        .allowAttributes("checked", "type").onElements("input")
        .allowAttributes("color").onElements("font")
        .allowAttributes("href").onElements("a")
        .allowAttributes("src").onElements("img")
        .allowAttributes("class", "id", "title").globally()
        .allowAttributes("char").matching(
            new AttributePolicy() {
              public String apply(
                  String elementName, String attributeName, String value) {
                return value.length() == 1 ? value : null;
              }
            }).onElements("td")
        .allowStandardUrlProtocols()
        .requireRelNofollowOnLinks()
        .allowStyling()
        .build(renderer);
  }

  private static String sanitize(String html) {
    StringBuilder sb = new StringBuilder();

    HtmlSanitizer.sanitize(html, makePolicy(sb));

    return sb.toString();
  }

  private static final String[] BASE64_BAD_XML_STRINGS = new String[] {
    // first string is
    // "click here"
    "PGEgLSBocmVmPSJodHRwOi8vd3d3Lm93YXNwLm9yZyI+Y2xpY2sgaGVyZTwvYT4=",
    // the rest are randomly generated 300 byte sequences which generate
    // parser errors, turned into Strings
    "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",
  };

  @Override
  protected void setUp() throws Exception {
    super.setUp();
  }

  @Override
  protected void tearDown() throws Exception {
    super.tearDown();
  }

  public static Test suite() {
    TestSuite suite = new TestSuite(AntiSamyTest.class);
    return suite;
  }

  public void testCompareSpeeds() throws Exception {
    if (DISABLE_INTERNETS) { return; }

    long totalTime = 0;
    long averageTime = 0;

    int testReps = 15;

    for (String url : new String[] {
            "http://slashdot.org/", "http://www.fark.com/",
            "http://www.cnn.com/", "http://google.com/",
            "http://www.microsoft.com/en/us/default.aspx",
            "http://deadspin.com/",
        }) {
      URLConnection conn = new URL(url).openConnection();
      String ct = guessCharsetFromContentType(conn.getContentType());
      InputStreamReader in = new InputStreamReader(conn.getInputStream(), ct);
      StringBuilder out = new StringBuilder();
      char[] buffer = new char[5000];
      int read = 0;
      do {
        read = in.read(buffer, 0, buffer.length);
        if (read > 0) {
          out.append(buffer, 0, read);
        }
      } while (read >= 0);

      in.close();

      String html = out.toString();

      System.out.println("About to scan: " + url + " size: " + html.length());
      if (html.length() > 640000) {
        System.out.println("   -Maximum input size 640000 exceeded. SKIPPING.");
        continue;
      }

      long startTime = 0;
      long endTime = 0;

      for (int j = 0; j < testReps; j++) {
        startTime = System.nanoTime();
        sanitize(html);
        endTime = System.nanoTime();

        System.out.println(
            "    Took " + ((endTime - startTime) / 1000000) + " ms");
        totalTime = totalTime + (endTime - startTime);
      }

      averageTime = totalTime / testReps;
    }

    System.out.println("Total time ms: " + totalTime/1000000L);
    System.out.println("Average time per rep ms: " + averageTime/1000000L);
  }

  /*
   * Test basic XSS cases.
   */

  public void testScriptAttacks() throws Exception {
    assertSanitizedDoesNotContain("test", "script");
    assertSanitizedDoesNotContain("test", "script");

    assertSanitizedDoesNotContain("<<<><", "", "", "", "", "", "", "", "", "", "PT SRC=\"http://ha.ckers.org/xss.js\"></SCRIPT>", "script");
    assertSanitizedDoesNotContain("PT SRC=\"http://ha.ckers.org/xss.js\"></SCRIPT>", "script");

    assertSanitizedDoesNotContain("";
      sanitize(s);
      sanitize(s);
    }

    /* issue #37 - OOM */
    {
      String dirty = "
Poor Bill, couldn't make it to the Museum's story time"
      + "today, he was so busy shoveling! Well, we sure missed you Bill! So since" + "ou were busy moving snow we read books about snow. We found a clue in one"
      + "book which revealed a snowplow at the end of the story - we wish it had" + "driven to your driveway Bill. We also read a story which shared fourteen"
      + "Names For Snow. We'll catch up with you next week....wonder which" + "hat Bill will wear?
Jane";

      String s = sanitize(dirty);
      assertNotNull(s);
    }

    /* issue #38 - color problem/color combinations */
    {
      String s = "Test";
      String expected = "Test";
      assertEquals(expected, sanitize(s));
      assertEquals(expected, sanitize(s));

      s = "
Test 3 letter code
";
      expected = "
Test 3 letter code
";
      assertEquals(expected, sanitize(s));
      assertEquals(expected, sanitize(s));

      s = "Test";
      expected = "Test";
      assertEquals(expected, sanitize(s));
      assertEquals(expected, sanitize(s));

      s = "Test";
      expected = s;
      assertEquals(expected, sanitize(s));
      assertEquals(expected, sanitize(s));

      if (RUN_KNOWN_FAILURES) {
        s = "Test";
        expected = "Test";
        assertEquals(expected, sanitize(s));
        assertEquals(expected, sanitize(s));
      }

      if (RUN_KNOWN_FAILURES) {
        s = "
Test
";
        expected = "
Test
";
        assertEquals(expected, sanitize(s));
        assertEquals(expected, sanitize(s));
      }

      s = "Test";
      expected = "Test";
      assertEquals(expected, sanitize(s));
      assertEquals(expected, sanitize(s));

      s = "
Test
";
      expected = "
Test
";
      assertEquals(expected, sanitize(s));
      assertEquals(expected, sanitize(s));

      s = "foo@import 'x';bar";
      sanitize(s);
    }

    /* issue #40 - handling ", "print, projection, screen");
    }

    /* issue #41 - comment handling */

    {
      assertEquals("text ", sanitize("text "));
      assertEquals("text ", sanitize("text "));

      assertEquals("
text
", sanitize("
text
"));
      assertEquals("
text
", sanitize("
text
"));

      assertEquals("
text
", sanitize("
text
"));
      assertEquals("
text
", sanitize("
text
"));

      /*
       * Check to see how nested conditional comments are handled. This is
       * not very clean but the main goal is to avoid any tags. Not sure
       * on encodings allowed in comments.
       */
      String input = "
text <[endif]-->
";
      String expected = "
text <[endif]-->
";
      String output = sanitize(input);
      assertEquals(expected, output);

      input = "
text <[endif]-->
";
      expected = "
text <[endif]-->
";
      output = sanitize(input);
      assertEquals(expected, output);

      /*
       * Regular comment nested inside conditional comment. Test makes
       * sure
       */
      assertEquals("
text  comment <[endif]-->
", sanitize("
text  comment <[endif]-->
"));

      /*
       * These play with whitespace and have invalid comment syntax.
       */
      assertEquals("
text
", sanitize("
text
"));
      assertEquals("
text  comment
", sanitize("
text <![if !IE]> comment <![endif]>
"));
      assertEquals("
text  comment
", sanitize("
text <![ if !IE]> comment <![endif]>
"));

      String attack = "[if lte 8]" + "<link href='/foo.css'>";
      assertEquals(s, "", sanitize(s));
    }

    /* issue #51 - offsite urls with () are found to be invalid */
    assertSanitizedDoesNotContain(
        "test", "(");

    /* issue #56 - unnecessary spaces */
    {
      String s = "Hello World!";
      assertEquals(
          "Hello World!",
          sanitize(s));
    }

    /* issue #58 - input not in list of allowed-to-be-empty tags */
    {
      String s = "tgdan <input/> g  h";
      assertEquals("tgdan  g  h", sanitize(s));
    }

    /* issue #61 - input has newline appended if ends with an accepted tag */
    {
      String dirtyInput = "blah blah.";
      String s = sanitize(dirtyInput);
      assertEquals(dirtyInput, s);
    }

    /* issue #69 - char attribute should allow single char or entity ref */

    {
      String s = "test	";
      assertSanitizedDoesContain(s, "char");
      assertSanitizedDoesContain(s, "char");

      s = "test	";
      assertSanitizedDoesNotContain(s, "char");
      assertSanitizedDoesNotContain(s, "char");

      s = "test	";
      assertSanitizedDoesContain(s, "char");
      assertSanitizedDoesContain(s, "char");

      s = "test	";
      assertSanitizedDoesNotContain(s, "char");
      assertSanitizedDoesNotContain(s, "char");

      s = "test	";
      assertSanitizedDoesNotContain(s, "char");
      assertSanitizedDoesNotContain(s, "char");
    }

    /* privately disclosed issue - cdata bypass */
    {
      String malInput = "<![CDATA[]>]]>";

      assertSanitizedDoesNotContain(malInput, "