text:
from flask import current_app, g
from flask_login import current_user, login_required
from flask_restful import Resource, abort
from flask_restful import reqparse, marshal_with
from .fields import profile_list_fields, profile_fields
import arrow
from atrium import s3conn
from boto.s3.key import Key
import werkzeug.datastructures
import bleach
from .bleachconfig import ALLOWED_TAGS, ALLOWED_STYLES, ALLOWED_ATTRIBUTES
from hashlib import md5

class ProfileListResource(Resource):
    @marshal_with(profile_list_fields)
    def get(self):
        return list(g.Profile.objects.all())

class ProfileResource(Resource):
    @marshal_with(profile_fields)
    def get(self, profile_id):
        if profile_id == 'me':
            return g.Profile.objects.filter(user=current_user.get_user()).first()
        else:
            if not current_user.is_admin():
                return abort(401)
            return g.Profile.objects.with_id(profile_id)

    @login_required
    @marshal_with(profile_list_fields)
    def put(self, profile_id):
        if profile_id != 'me' and not current_user.is_admin():
            return abort(401)

        if profile_id == 'me':
            profile = g.Profile.objects.filter(user=current_user.get_user()).first()
        else:
            profile = g.Profile.objects.with_id(profile_id)

        parser = reqparse.RequestParser()
        parser.add_argument('facebook_id', type=unicode, store_missing=False)
        parser.add_argument('twitter_id', type=unicode, store_missing=False)
        parser.add_argument('biography', type=unicode, store_missing=False)
        parser.add_argument('birthday', type=unicode, store_missing=False)
        args = parser.parse_args()

        for field in ['facebook_id', 'twitter_id']:
            if field in args.keys():
                setattr(profile, field, args[field])

        if 'biography' in args.keys():
            profile.biography = bleach.clean(args['biography'], tags=ALLOWED_TAGS, styles=ALLOWED_STYLES, attributes=ALLOWED_ATTRIBUTES)

        if 'birthday' in args.keys():
            profile.birthday = arrow.get(args['birthday']).naive

        profile.save()
        return profile

class ProfilePhoto(Resource):
    @login_required
    @marshal_with(profile_list_fields)
    def post(self, profile_id):
        if profile_id != 'me' and not current_user.is_admin():
            return abort(401)

        if profile_id == 'me':
            profile = g.Profile.objects.filter(user=current_user.get_user()).first()
        else:
            profile = g.Profile.objects.with_id(profile_id)

        parser = reqparse.RequestParser()
        parser.add_argument('photo', type=werkzeug.datastructures.FileStorage, location='files')
        args = parser.parse_args()

        bucket = s3conn.get_bucket(current_app.config['AWS_S3_BUCKET'])
        key = Key(bucket)
        key.key = g.tenant + '/profiles/' + str(profile.id)
        key.content_type = args['photo'].mimetype
        key.set_contents_from_file(args['photo'].stream)
        key.make_public()

        profile.photo = 'https://' + current_app.config['AWS_S3_BUCKET'] + '.s3.amazonaws.com/ ' + g.tenant + '/profiles/' + str(profile.id)
        profile.save()

        return profile

    @login_required
    def delete(self, profile_id):
        if profile_id != 'me' and not current_user.is_admin():
            return abort(401)

        if profile_id == 'me':
            profile = g.Profile.objects.filter(user=current_user.get_user()).first()
        else:
            profile = g.Profile.objects.with_id(profile_id)

        photo_url = profile.photo

        profile.photo = 'https://secure.gravatar.com/avatar/' + md5(profile.user.email).hexdigest() + '?d=identicon&s=200'
        profile.save()

        if 'https://' + current_app.config['AWS_S3_BUCKET'] + '.s3.amazonaws.com/profiles/' in photo_url:
            bucket = s3conn.get_bucket(current_app.config['AWS_S3_BUCKET'])
            key = bucket.get_key(g.tenant + '/profiles/' + str(profile.id))
            key.delete()

        return '', 204


text:
<!doctype html>

	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="stylesheet" href="./../../assets/css/combined.css">
	<link rel="shortcut icon" href="./../../favicon.ico" />

	<title>Agent Config - Classes - FuelPHP Documentation</title>

					FuelPHP, a PHP 5.3 Framework
					Documentation

				<form id="google_search">

						<input type="submit" name="search_submit" id="search_submit" value="search" />
						<input type="text" value="" id="search_input" name="search_input" />

				</form>

			table of contents

Agent Class

The agent class allows you to retrieve information about browser type, version, platform or operating system, etc, based on the clients User Agent string.

Configuration

					The agent class uses the PHP function get_browser(),
					which attempts to determine the capabilities of the user's browser, by looking up the browser's information in the browscap.ini file.

The following global configuration values can be defined:

							Param
							Type
							Default
							Description

							browscap
							array

array(
	'enabled' => true,
	'url'     => 'http://browsers.garykeith.com/stream.asp?BrowsCapINI',
	 'method' => 'wrapper',
	 'file'   => '/tmp/php_browscap.ini',
)

								browscap.ini retrieval configuration.

							cache
							array

array(
	'driver'     => '',
	'expiry'     => 604800,
	'identifier' => 'fuel.agent',
)

								browscap.ini caching configuration.

Browscap.ini configuration

						If PHP has not been configured to use the browscap.ini file, the agent class will retrieve the file from the location defined in
						the config/agent.php config file, and cached locally for re-use. This cache will be updated on a regular basis, based
						on the timeout value defined in the configuration.

								Param
								Type
								Default
								Description

								enabled
								boolean

true

								Enable download of the browscap.ini file. If disabled, and PHP has not been configured to the browscap functionality through get_browser(), browser detection is disabled, and the agent class will return 'unknown'.

								method
								string

'wrapper'

									Method used to retrieve the browscap.ini file. Supported methods are:

'wrapper': This method uses file_get_contents(). This is the preferred option, but it might be disabled by your hosting provider.

'curl': This method curl extensions. You can use this in case the 'wrapper' method doesn't work.

'local': Use an external method to download the browscap.ini file (for example a cron job).

'sockets': reserved for future use

								url
								string

'http://browsers.garykeith.com/stream.asp?BrowsCapINI'

								For the methods 'wrapper', 'curl' and 'sockets', the url to download an update of the browscap.ini file.

								file
								string

'/tmp/php_browscap.ini'

								For the method 'local', the name and location of the browscap.ini file on a local storage system.

Cache configuration

						It the agent class is configured to process a browscap.ini file, it will cache the result of both the ini file parser and individual user agent requests
						in order to increase the response time of the class. These configuration settings determine how the data is cached. For more information, see the Cache class documentation.

								Param
								Type
								Default
								Description

								driver
								string

''

								Cache driver to use to cache the agent data. If you leave this empty, the default cache driver, configured in the cache configuration, will be used.

								expiry
								integer

604800

								Number of seconds until the cached data expires. By default, this is 7 days, since the browscap.ini file doesn't change that often. It is recommended not to refresh more frequent than once a day.

The minumum setting is 7200 seconds (two hours), your server will be banned from the browscap website if you download more often!

								identifier
								string

'fuel.agent'

								Prefix to name of the cache.

				© FuelPHP Development Team 2010-2013 - FuelPHP is released under the MIT license.

redpajama_set_name: RedPajamaGithub


text:
package util;

import android.os.Handler;
import android.util.Log;

import com.bocaiweather.app.Activity.MainActivity;
import com.bocaiweather.app.Activity.WeatherTest;
import com.google.gson.Gson;

import java.io.IOException;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

/**
 *Created by oyj
 * 作用:此类主要是用来处理APP网络方面的事项
 */

public class HttpUtil
{

    private OkHttpClient client = new OkHttpClient();
    private String result;
    private Gson gson = new Gson();
    public WeatherTest weather = new WeatherTest();
    Handler m_Handler = new Handler();

    public HttpUtil(String cityID) {getData(cityID);}

    public HttpUtil(){};

    //使用OKHttp + GSON 获取数据
    public  void getData(String cityID)
    {
        final Request request = new Request.Builder()
                .url("https://api.heweather.com/x3/weather?cityid=CN" +cityID+
                        "&key=088b2162b2d44596b9f22a458a8e41e3 ")
                .build();
        client.newCall(request).enqueue(new Callback() {

            @Override
            public void onFailure(Call call, IOException e) {}

            @Override
            public void onResponse(Call call, Response response) throws IOException
            {
                if (!response.isSuccessful()) {
                    throw new IOException("Unexpected code " + response);
                }

                result =response.body().string().replace("HeWeather data service 3.0", "WeatherData");//替换掉数据中有空格的部分,不然不能解析
                weather = gson.fromJson(result,WeatherTest.class);
                Log.d("love",result);

                m_Handler.post(new Runnable()
                {
                    @Override
                    public void run() { MainActivity.recyclerView.getAdapter().notifyDataSetChanged();}

                });

            }

        });

    }
}


text:
<?php

use Helpers\Assets;
use Helpers\Url;
use Helpers\Hooks;
use Helpers\Session;

//initialise hooks
$hooks = Hooks::get();
?>

      <form action="" method="POST" class="form-signinBox no_marg">

Sign in

              Email Address
              <input type="email" placeholder="Ussername" name="email" required="required" class="width-100per">

              Password
              <input type="password" placeholder="Password" name="password" required="required" class="width-100per">

            forgot password? click here
            <button class="btn btn-primary btn-evet-gold" name="login">Sign in </button>

      </form>


text:
package org.wso2.security.tools.scanmanager.common.external.model;

import com.fasterxml.jackson.annotation.JsonBackReference;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Model class to represent a file required for a scanner.
 */
@Entity
@Table(name = "SCAN_FILE", uniqueConstraints = @UniqueConstraint(columnNames = {"JOB_ID", "SCAN_FILE_NAME"}))
public class ScanFile {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID", updatable = false, nullable = false)
    private Integer id;

    @ManyToOne
    @JoinColumn(name = "JOB_ID")
    @JsonBackReference
    private Scan scan;

    @Column(name = "SCAN_FILE_NAME")
    private String name;

    @Column(name = "SCAN_FILE_LOCATION")
    private String location;

    public ScanFile() {
    }

    public ScanFile(Scan scan, String name, String location) {
        this.scan = scan;
        this.name = name;
        this.location = location;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Scan getScan() {
        return scan;
    }

    public void setScan(Scan scan) {
        this.scan = scan;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }
}


text:
package proxy;
/**
 * @author JUANJUAN
 * @version 2017年8月6日下午9:14:42
*/
public interface Image {
	public void display();
}


text:
require "spec_helper"

describe ProjectEulerSolutions::P010 do
  describe "#run" do
    it "works for n = 10" do
      expect(described_class.new.run(10)).to eq(17)
    end

    it "works for n of a problem" do
      expect(described_class.new.run(2000000)).to eq(142913828922)
    end
  end
end


text:
"""Produces the training and dev data for --problem into --data_dir.

Produces sharded and shuffled TFRecord files of tensorflow.Example protocol
buffers for a variety of registered datasets.

All Problems are registered with @registry.register_problem or are in
_SUPPORTED_PROBLEM_GENERATORS in this file. Each entry maps a string name
(selectable on the command-line with --problem) to a function that takes 2
arguments - input_directory and mode (one of "train" or "dev") - and yields for
each training example a dictionary mapping string feature names to lists of
{string, int, float}. The generator will be run once for each mode.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import multiprocessing
import os
import random
import tempfile

import numpy as np

from tensor2tensor import problems as problems_lib  # pylint: disable=unused-import
from tensor2tensor.data_generators import generator_utils
from tensor2tensor.utils import registry
from tensor2tensor.utils import usr_dir

try:
  # pylint: disable=g-import-not-at-top
  from tensor2tensor.data_generators import algorithmic_math
  from tensor2tensor.data_generators import audio
  from tensor2tensor.data_generators import snli
  from tensor2tensor.data_generators import wsj_parsing
  # pylint: enable=g-import-not-at-top
except ImportError:
  pass

# Improrting here to prevent pylint from ungrouped-imports warning.
import tensorflow as tf  # pylint: disable=g-import-not-at-top

flags = tf.flags
FLAGS = flags.FLAGS

flags.DEFINE_string("data_dir", "", "Data directory.")
flags.DEFINE_string("tmp_dir", "/tmp/t2t_datagen",
                    "Temporary storage directory.")
flags.DEFINE_string("problem", "",
                    "The name of the problem to generate data for.")
flags.DEFINE_string("exclude_problems", "",
                    "Comma-separates list of problems to exclude.")
flags.DEFINE_integer("num_shards", 0, "How many shards to use. Ignored for "
                     "registered Problems.")
flags.DEFINE_integer("max_cases", 0,
                     "Maximum number of cases to generate (unbounded if 0).")
flags.DEFINE_bool("only_list", False,
                  "If true, we only list the problems that will be generated.")
flags.DEFINE_integer("random_seed", 429459, "Random seed to use.")
flags.DEFINE_integer("task_id", -1, "For distributed data generation.")
flags.DEFINE_integer("task_id_start", -1, "For distributed data generation.")
flags.DEFINE_integer("task_id_end", -1, "For distributed data generation.")
flags.DEFINE_integer(
    "num_concurrent_processes", None,
    "Applies only to problems for which multiprocess_generate=True.")
flags.DEFINE_string("t2t_usr_dir", "",
                    "Path to a Python module that will be imported. The "
                    "__init__.py file should include the necessary imports. "
                    "The imported files should contain registrations, "
                    "e.g. @registry.register_problem calls, that will then be "
                    "available to t2t-datagen.")

# Mapping from problems that we can generate data for to their generators.
# pylint: disable=g-long-lambda
_SUPPORTED_PROBLEM_GENERATORS = {
    "algorithmic_algebra_inverse": (
        lambda: algorithmic_math.algebra_inverse(26, 0, 2, 100000),
        lambda: algorithmic_math.algebra_inverse(26, 3, 3, 10000),
        lambda: None),  # test set
    "parsing_english_ptb8k": (
        lambda: wsj_parsing.parsing_token_generator(
            FLAGS.data_dir, FLAGS.tmp_dir, True, 2**13, 2**9),
        lambda: wsj_parsing.parsing_token_generator(
            FLAGS.data_dir, FLAGS.tmp_dir, False, 2**13, 2**9),
        lambda: None),  # test set
    "parsing_english_ptb16k": (
        lambda: wsj_parsing.parsing_token_generator(
            FLAGS.data_dir, FLAGS.tmp_dir, True, 2**14, 2**9),
        lambda: wsj_parsing.parsing_token_generator(
            FLAGS.data_dir, FLAGS.tmp_dir, False, 2**14, 2**9),
        lambda: None),  # test set
    "inference_snli32k": (
        lambda: snli.snli_token_generator(FLAGS.tmp_dir, True, 2**15),
        lambda: snli.snli_token_generator(FLAGS.tmp_dir, False, 2**15),
        lambda: None),  # test set
    "audio_timit_characters_test": (
        lambda: audio.timit_generator(
            FLAGS.data_dir, FLAGS.tmp_dir, True, 1718),
        lambda: audio.timit_generator(
            FLAGS.data_dir, FLAGS.tmp_dir, False, 626),
        lambda: None),  # test set
    "audio_timit_tokens_8k_test": (
        lambda: audio.timit_generator(
            FLAGS.data_dir, FLAGS.tmp_dir, True, 1718,
            vocab_filename="vocab.endefr.%d" % 2**13, vocab_size=2**13),
        lambda: audio.timit_generator(
            FLAGS.data_dir, FLAGS.tmp_dir, False, 626,
            vocab_filename="vocab.endefr.%d" % 2**13, vocab_size=2**13),
        lambda: None),  # test set
    "audio_timit_tokens_32k_test": (
        lambda: audio.timit_generator(
            FLAGS.data_dir, FLAGS.tmp_dir, True, 1718,
            vocab_filename="vocab.endefr.%d" % 2**15, vocab_size=2**15),
        lambda: audio.timit_generator(
            FLAGS.data_dir, FLAGS.tmp_dir, False, 626,
            vocab_filename="vocab.endefr.%d" % 2**15, vocab_size=2**15),
        lambda: None),  # test set
}

# pylint: enable=g-long-lambda

def set_random_seed():
  """Set the random seed from flag everywhere."""
  tf.set_random_seed(FLAGS.random_seed)
  random.seed(FLAGS.random_seed)
  np.random.seed(FLAGS.random_seed)

def main(_):
  usr_dir.import_usr_dir(FLAGS.t2t_usr_dir)

  # Calculate the list of problems to generate.
  problems = sorted(
      list(_SUPPORTED_PROBLEM_GENERATORS) + registry.list_problems())
  for exclude in FLAGS.exclude_problems.split(","):
    if exclude:
      problems = [p for p in problems if exclude not in p]
  if FLAGS.problem and FLAGS.problem[-1] == "*":
    problems = [p for p in problems if p.startswith(FLAGS.problem[:-1])]
  elif FLAGS.problem and "," in FLAGS.problem:
    problems = [p for p in problems if p in FLAGS.problem.split(",")]
  elif FLAGS.problem:
    problems = [p for p in problems if p == FLAGS.problem]
  else:
    problems = []

  # Remove TIMIT if paths are not given.
  if getattr(FLAGS, "timit_paths", None):
    problems = [p for p in problems if "timit" not in p]
  # Remove parsing if paths are not given.
  if getattr(FLAGS, "parsing_path", None):
    problems = [p for p in problems if "parsing_english_ptb" not in p]

  if not problems:
    problems_str = "\n  * ".join(
        sorted(list(_SUPPORTED_PROBLEM_GENERATORS) + registry.list_problems()))
    error_msg = ("You must specify one of the supported problems to "
                 "generate data for:\n  * " + problems_str + "\n")
    error_msg += ("TIMIT and parsing need data_sets specified with "
                  "--timit_paths and --parsing_path.")
    raise ValueError(error_msg)

  if not FLAGS.data_dir:
    FLAGS.data_dir = tempfile.gettempdir()
    tf.logging.warning("It is strongly recommended to specify --data_dir. "
                       "Data will be written to default data_dir=%s.",
                       FLAGS.data_dir)
  FLAGS.data_dir = os.path.expanduser(FLAGS.data_dir)
  tf.gfile.MakeDirs(FLAGS.data_dir)

  tf.logging.info("Generating problems:\n%s"
                  % registry.display_list_by_prefix(problems,
                                                    starting_spaces=4))
  if FLAGS.only_list:
    return
  for problem in problems:
    set_random_seed()

    if problem in _SUPPORTED_PROBLEM_GENERATORS:
      generate_data_for_problem(problem)
    else:
      generate_data_for_registered_problem(problem)

def generate_data_for_problem(problem):
  """Generate data for a problem in _SUPPORTED_PROBLEM_GENERATORS."""
  training_gen, dev_gen, test_gen = _SUPPORTED_PROBLEM_GENERATORS[problem]

  num_train_shards = FLAGS.num_shards or 10
  tf.logging.info("Generating training data for %s.", problem)
  train_output_files = generator_utils.train_data_filenames(
      problem + generator_utils.UNSHUFFLED_SUFFIX, FLAGS.data_dir,
      num_train_shards)
  generator_utils.generate_files(training_gen(), train_output_files,
                                 FLAGS.max_cases)
  num_dev_shards = int(num_train_shards * 0.1)
  tf.logging.info("Generating development data for %s.", problem)
  dev_output_files = generator_utils.dev_data_filenames(
      problem + generator_utils.UNSHUFFLED_SUFFIX, FLAGS.data_dir,
      num_dev_shards)
  generator_utils.generate_files(dev_gen(), dev_output_files)
  num_test_shards = int(num_train_shards * 0.1)
  test_output_files = []
  test_gen_data = test_gen()
  if test_gen_data is not None:
    tf.logging.info("Generating test data for %s.", problem)
    test_output_files = generator_utils.test_data_filenames(
        problem + generator_utils.UNSHUFFLED_SUFFIX, FLAGS.data_dir,
        num_test_shards)
    generator_utils.generate_files(test_gen_data, test_output_files)
  all_output_files = train_output_files + dev_output_files + test_output_files
  generator_utils.shuffle_dataset(all_output_files)

def generate_data_in_process(arg):
  problem_name, data_dir, tmp_dir, task_id = arg
  problem = registry.problem(problem_name)
  problem.generate_data(data_dir, tmp_dir, task_id)

def generate_data_for_registered_problem(problem_name):
  """Generate data for a registered problem."""
  tf.logging.info("Generating data for %s.", problem_name)
  if FLAGS.num_shards:
    raise ValueError("--num_shards should not be set for registered Problem.")
  problem = registry.problem(problem_name)
  task_id = None if FLAGS.task_id < 0 else FLAGS.task_id
  data_dir = os.path.expanduser(FLAGS.data_dir)
  tmp_dir = os.path.expanduser(FLAGS.tmp_dir)
  if task_id is None and problem.multiprocess_generate:
    if FLAGS.task_id_start != -1:
      assert FLAGS.task_id_end != -1
      task_id_start = FLAGS.task_id_start
      task_id_end = FLAGS.task_id_end
    else:
      task_id_start = 0
      task_id_end = problem.num_generate_tasks
    pool = multiprocessing.Pool(processes=FLAGS.num_concurrent_processes)
    problem.prepare_to_generate(data_dir, tmp_dir)
    args = [(problem_name, data_dir, tmp_dir, task_id)
            for task_id in range(task_id_start, task_id_end)]
    pool.map(generate_data_in_process, args)
  else:
    problem.generate_data(data_dir, tmp_dir, task_id)

if __name__ == "__main__":
  tf.logging.set_verbosity(tf.logging.INFO)
  tf.app.run()


text:
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.Marketplace.Models
{
    public partial class QueryApprovedPlansContent : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            writer.WritePropertyName("properties");
            writer.WriteStartObject();
            if (Optional.IsDefined(OfferId))
            {
                writer.WritePropertyName("offerId");
                writer.WriteStringValue(OfferId);
            }
            if (Optional.IsCollectionDefined(PlanIds))
            {
                writer.WritePropertyName("planIds");
                writer.WriteStartArray();
                foreach (var item in PlanIds)
                {
                    writer.WriteStringValue(item);
                }
                writer.WriteEndArray();
            }
            if (Optional.IsCollectionDefined(SubscriptionIds))
            {
                writer.WritePropertyName("subscriptionIds");
                writer.WriteStartArray();
                foreach (var item in SubscriptionIds)
                {
                    writer.WriteStringValue(item);
                }
                writer.WriteEndArray();
            }
            writer.WriteEndObject();
            writer.WriteEndObject();
        }
    }
}


text:
package squirrel.util;

import java.lang.reflect.Method;

import org.tartarus.snowball.SnowballProgram;

public class UTIL_SnowballStemmer {

	protected final static Object[] emptyArgs = new Object[0];

	// Stems the given String's terms and returns the stemmed terms
	@SuppressWarnings("unchecked")
	public static String stem(String str) {

		SnowballProgram stemmer = null;
		Method stemMethod = null;

		String StemLanguage = "english";

		try {
			Class<? extends SnowballProgram> stemClass = (Class<? extends SnowballProgram>) Class
					.forName("org.tartarus.snowball.ext." + StemLanguage + "Stemmer");
			stemmer = (SnowballProgram) stemClass.newInstance();
			stemMethod = stemClass.getMethod("stem", new Class[0]);
		} catch (Exception e) {
			System.out.println("Error, snowball stemmer could not be generated: " + e);
			e.printStackTrace();
		}

		// get the atual terms from the string
		String[] terms = str.split(" ");

		StringBuilder sb = new StringBuilder();

		// loop through, stem and construct result
		for (String term : terms) {
			stemmer.setCurrent(term);
			try {
				stemMethod.invoke(stemmer, emptyArgs); // stemmer.stem();
			} catch (Exception e) {
				System.out.println("Error,snowball stemmer could not stem term: " + term + " " + e);
				e.printStackTrace();
			}

			sb.append(stemmer.getCurrent() + " ");
		}
		return sb.toString();
	}

}


text:
function TestContextAllocation() {
  function* g1(a, b, c) { yield 1; return [a, b, c]; }
  function* g2() { yield 1; return arguments; }
  function* g3() { yield 1; return this; }
  function* g4() { var x = 10; yield 1; return x; }
  // Temporary variable context allocation
  function* g5(l) { "use strict"; yield 1; for (let x in l) { yield x; } }

  g1();
  g2();
  g3();
  g4();
  g5(["foo"]);
}
TestContextAllocation();

// Test the properties and prototype of a generator object.
function TestGeneratorObject() {
  function* g() { yield 1; }

  var iter = g();
  assertSame(g.prototype, Object.getPrototypeOf(iter));
  assertTrue(iter instanceof g);
  assertEquals("Generator", %_ClassOf(iter));
  assertEquals("[object Generator]", String(iter));
  assertEquals([], Object.getOwnPropertyNames(iter));
  assertTrue(iter !== g());
  assertEquals("[object Generator]", Object.prototype.toString.call(iter));
  var gf = iter.__proto__.constructor;
  assertEquals("[object GeneratorFunction]", Object.prototype.toString.call(gf));

  // generators are not constructable.
  assertThrows(()=>new g());
}
TestGeneratorObject();

// Test the methods of generator objects.
function TestGeneratorObjectMethods() {
  function* g() { yield 1; }
  var iter = g();

  function TestNonGenerator(non_generator) {
    assertThrows(function() { iter.next.call(non_generator); }, TypeError);
    assertThrows(function() { iter.next.call(non_generator, 1); }, TypeError);
    assertThrows(function() { iter.throw.call(non_generator, 1); }, TypeError);
  }

  TestNonGenerator(1);
  TestNonGenerator({});
  TestNonGenerator(function(){});
  TestNonGenerator(g);
  TestNonGenerator(g.prototype);
}
TestGeneratorObjectMethods();

function TestPrototype() {
  function* g() { }

  let g_prototype = g.prototype;
  assertEquals([], Reflect.ownKeys(g_prototype));

  let generator_prototype = Object.getPrototypeOf(g_prototype);
  assertSame(generator_prototype, Object.getPrototypeOf(g).prototype);

  // Unchanged .prototype
  assertSame(g_prototype, Object.getPrototypeOf(g()));

  // Custom object as .prototype
  {
    let proto = {};
    g.prototype = proto;
    assertSame(proto, Object.getPrototypeOf(g()));
  }

  // Custom non-object as .prototype
  g.prototype = null;
  assertSame(generator_prototype, Object.getPrototypeOf(g()));
}
TestPrototype();

function TestComputedPropertyNames() {
  function* f1() { return {[yield]: 42} }
  var g1 = f1();
  g1.next();
  assertEquals(42, g1.next('a').value.a);

  function* f2() { return {['a']: yield} }
  var g2 = f2();
  g2.next();
  assertEquals(42, g2.next(42).value.a);
}
TestComputedPropertyNames();


text:
        <showtask ng-if="vm.isinitiator" scenarioid="vm.scenarioid" isagent="vm.isinitiator" class="my-task is-absolut big-div"></showtask>
        <expertmovables ng-if="!vm.isinitiator" class="my-movable right big-div"></expertmovables>
        <experttools ng-if="!vm.isinitiator" class="my-tool right is-absolut big-div"></experttools>
        <fullscreenbutton ng-if="vm.isinitiator" class="my-fullscreen is-absolut right big-div"></fullscreenbutton>
        <display3d isinitiator="vm.isinitiator" class="my-drawing-canvas left is-absolut big-div"></display3d>
        <rtcvideo isinitiator="vm.isinitiator" class="my-video left big-div"></rtcvideo>

    <controltask ng-if="!vm.isinitiator" scenarioid="vm.scenarioid" class="big-div is-relative"></controltask>
    <expertgroups ng-if="!vm.isinitiator" class="big-div is-relative"></expertgroups>
    <agenthandler ng-if="vm.isinitiator"></agenthandler>


text:
package com.minelittlepony.client.model.gear;

import net.minecraft.client.model.Model;
import net.minecraft.client.model.ModelPart;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.util.math.MatrixStack;

import com.minelittlepony.api.model.gear.IGear;

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

public abstract class AbstractGear extends Model implements IGear {

    private final List<ModelPart> parts = new ArrayList<>();

    public AbstractGear() {
        super(RenderLayer::getEntitySolid);
    }

    public void addPart(ModelPart t) {
        parts.add(t);
    }

    @Override
    public void render(MatrixStack stack, VertexConsumer vertices, int overlayUv, int lightUv, float red, float green, float blue, float alpha, UUID interpolatorId) {
        render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha);
    }

    @Override
    public void render(MatrixStack stack, VertexConsumer renderContext, int overlayUv, int lightUv, float red, float green, float blue, float alpha) {
        parts.forEach(part -> {
            part.render(stack, renderContext, overlayUv, lightUv, red, green, blue, alpha);
        });
    }
}


text:
package com.cell.user.ifacade.response.permission;

import com.cell.user.ifacade.response.BaseResponse;
import com.cell.user.page.PageResult;
import com.cell.user.vo.single.SysPermissionVo;

public class ListSysPermissionRsp extends BaseResponse{

	/**
	 *
	 */
	private static final long serialVersionUID = -6574637615516494278L;

	  protected PageResult<SysPermissionVo> result;

	public PageResult<SysPermissionVo> getResult() {
		return result;
	}

	public void setResult(PageResult<SysPermissionVo> result) {
		this.result = result;
	}
}


text:
import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import RepoAbList from '../components/RepoAbList';
import { needAuth } from '../helpers';
import NeedAuth from '../components/NeedAuth';
import { fetchUserRepos, fetchUserStars } from "../actions/fetchAction";
import { checkInArray } from '../helpers';
import { repoFilters, starFilters } from '../constants/filters';

export const routes = ['/repositories', '/stars'];

class SelfRepositories extends React.Component {

  static propTypes = {
    auth: PropTypes.shape({
      user: PropTypes.shape({
        id: PropTypes.number.isRequired
      }),
      token: PropTypes.string,
      expired_at: PropTypes.number
    }).isRequired,
    location: PropTypes.object.isRequired,
    selfReposStatus: PropTypes.string,
    selfStarsStatus: PropTypes.string,
    cache: PropTypes.object
  };

  onFilterChange = (index, filter) => {
    console.log('filter change');
  };

  currentPageLoading(props = this.props) {
    const { location, selfStarsStatus, selfReposStatus } = props;

    const isStar = checkStar(location.pathname);
    // console.log('selfReposStatus', selfReposStatus)
    const loadingStatus = isStar ? selfStarsStatus : selfReposStatus;
    // console.log('loadingStatus', loadingStatus)
    return loadingStatus == 'loading';
  }

  loadInitData(props = this.props) {
    const { auth, dispatch, location, cache } = props;

    if (!needAuth(auth.token, auth.expired_at) && !cache && !this.currentPageLoading(props)) {
      if (checkStar(location.pathname)) {
        dispatch(fetchUserStars(auth.user.id, 0, auth.token));
      } else {
        const i = checkInArray(location.query.filter, repoFilters);
        dispatch(fetchUserRepos(auth.user.id, repoFilters[i], 0, auth.token));
      }
    }
  }

  componentDidMount() {
    // console.log('componentDidMount')
    this.loadInitData(this.props);
  }

  componentWillReceiveProps(newProps) {
    // console.log('componentWillReceiveProps');
    this.loadInitData(newProps);
  }

  renderContent() {
    const { cache, location, dispatch } = this.props;
    const isStar = checkStar(location.pathname);
    const filters = isStar ? starFilters : repoFilters;

    return (
      <RepoAbList
        filters={filters}
        location={location}
        onFilterChange={this.onFilterChange}
        dispatch={dispatch}
        loading={this.currentPageLoading()}
        repoWithRecents={cache && cache.repoList}
        repoNumAll={cache && cache.repoNumAll}
      />
    );
  }

  render() {
    const { auth, dispatch } = this.props;

    return (
      <div>
        {needAuth(auth.token, auth.expired_at) ?
          <NeedAuth
            dispatch={dispatch}
          />
          :
          this.renderContent()
        }
      </div>
    );
  }
}

/**
 * if pathname is /stars
 * @returns {boolean}
 */
function checkStar(pathname) {
  return pathname.toLowerCase() == routes[1];
}

function select(state, ownProps) {
  let newState = {
    auth: state.view.auth,
    location: ownProps.location,
    selfReposStatus: state.view.componentStatus.selfRepos,
    selfStarsStatus: state.view.componentStatus.selfStars
  };

  if (checkStar(ownProps.location.pathname)) {
    newState.cache = state.cache[`/user/${newState.auth.user.id}/stars`];
  } else {
    const filterIndex = checkInArray(ownProps.location.query.filter, repoFilters);
    const filter = repoFilters[filterIndex].toLowerCase();

    newState.cache = state.cache[`/user/${newState.auth.user.id}/repositories?filter=${filter}`]
  }

  // console.log('newState', newState)

  return newState;
}

export default connect(select)(SelfRepositories);


text:
#ifndef __LINUX_PINCTRL_CONSUMER_H
#define __LINUX_PINCTRL_CONSUMER_H

#include <linux/err.h>
#include <linux/list.h>
#include <linux/seq_file.h>
#include <linux/pinctrl/pinctrl-state.h>

/* This struct is private to the core and should be regarded as a cookie */
struct pinctrl;
struct pinctrl_state;
struct device;

#ifdef CONFIG_PINCTRL

/* External interface to pin control */
extern int pinctrl_request_gpio(unsigned gpio);
extern void pinctrl_free_gpio(unsigned gpio);
extern int pinctrl_gpio_direction_input(unsigned gpio);
extern int pinctrl_gpio_direction_output(unsigned gpio);

extern struct pinctrl * __must_check pinctrl_get(struct device *dev);
extern void pinctrl_put(struct pinctrl *p);
extern struct pinctrl_state * __must_check pinctrl_lookup_state(
							struct pinctrl *p,
							const char *name);
extern int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *s);

extern struct pinctrl * __must_check devm_pinctrl_get(struct device *dev);
extern void devm_pinctrl_put(struct pinctrl *p);

#else /* !CONFIG_PINCTRL */

static inline int pinctrl_request_gpio(unsigned gpio)
{
	return 0;
}

static inline void pinctrl_free_gpio(unsigned gpio)
{
}

static inline int pinctrl_gpio_direction_input(unsigned gpio)
{
	return 0;
}

static inline int pinctrl_gpio_direction_output(unsigned gpio)
{
	return 0;
}

static inline struct pinctrl * __must_check pinctrl_get(struct device *dev)
{
	return NULL;
}

static inline void pinctrl_put(struct pinctrl *p)
{
}

static inline struct pinctrl_state * __must_check pinctrl_lookup_state(
							struct pinctrl *p,
							const char *name)
{
	return NULL;
}

static inline int pinctrl_select_state(struct pinctrl *p,
				       struct pinctrl_state *s)
{
	return 0;
}

static inline struct pinctrl * __must_check devm_pinctrl_get(struct device *dev)
{
	return NULL;
}

static inline void devm_pinctrl_put(struct pinctrl *p)
{
}

#endif /* CONFIG_PINCTRL */

static inline struct pinctrl * __must_check pinctrl_get_select(
					struct device *dev, const char *name)
{
	struct pinctrl *p;
	struct pinctrl_state *s;
	int ret;

	p = pinctrl_get(dev);
	if (IS_ERR(p))
		return p;

	s = pinctrl_lookup_state(p, name);
	if (IS_ERR(s)) {
		pinctrl_put(p);
		return ERR_PTR(PTR_ERR(s));
	}

	ret = pinctrl_select_state(p, s);
	if (ret < 0) {
		pinctrl_put(p);
		return ERR_PTR(ret);
	}

	return p;
}

static inline struct pinctrl * __must_check pinctrl_get_select_default(
					struct device *dev)
{
	return pinctrl_get_select(dev, PINCTRL_STATE_DEFAULT);
}

static inline struct pinctrl * __must_check devm_pinctrl_get_select(
					struct device *dev, const char *name)
{
	struct pinctrl *p;
	struct pinctrl_state *s;
	int ret;

	p = devm_pinctrl_get(dev);
	if (IS_ERR(p))
		return p;

	s = pinctrl_lookup_state(p, name);
	if (IS_ERR(s)) {
		devm_pinctrl_put(p);
		return ERR_CAST(s);
	}

	ret = pinctrl_select_state(p, s);
	if (ret < 0) {
		devm_pinctrl_put(p);
		return ERR_PTR(ret);
	}

	return p;
}

static inline struct pinctrl * __must_check devm_pinctrl_get_select_default(
					struct device *dev)
{
	return devm_pinctrl_get_select(dev, PINCTRL_STATE_DEFAULT);
}

#ifdef CONFIG_PINCONF

extern int pin_config_get(const char *dev_name, const char *name,
			  unsigned long *config);
extern int pin_config_set(const char *dev_name, const char *name,
			  unsigned long config);
extern int pin_config_group_get(const char *dev_name,
				const char *pin_group,
				unsigned long *config);
extern int pin_config_group_set(const char *dev_name,
				const char *pin_group,
				unsigned long config);

#else

static inline int pin_config_get(const char *dev_name, const char *name,
				 unsigned long *config)
{
	return 0;
}

static inline int pin_config_set(const char *dev_name, const char *name,
				 unsigned long config)
{
	return 0;
}

static inline int pin_config_group_get(const char *dev_name,
				       const char *pin_group,
				       unsigned long *config)
{
	return 0;
}

static inline int pin_config_group_set(const char *dev_name,
				       const char *pin_group,
				       unsigned long config)
{
	return 0;
}

#endif

#endif /* __LINUX_PINCTRL_CONSUMER_H */


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
              android:background="@android:color/white"
              android:orientation="vertical" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="254dp"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="@string/hello"
        android:textColor="@android:color/black"
        android:id="@+id/textView"
        android:layout_gravity="center_horizontal"/>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="New Button"
            android:id="@+id/button"
            android:onClick="exampleNotif"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"/>

        <Button
            style="?android:attr/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/button2"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true"
            android:onClick="settings"
            android:layout_alignParentEnd="true"/>
    </RelativeLayout>
</LinearLayout>


text:
#include "testing/testing.hpp"

#include "generator/generator_tests_support/test_feature.hpp"
#include "generator/generator_tests_support/test_mwm_builder.hpp"

#include "ugc/api.hpp"
#include "ugc/serdes_json.hpp"
#include "ugc/ugc_tests/utils.hpp"

#include "storage/country_info_getter.hpp"

#include "indexer/classificator.hpp"
#include "indexer/classificator_loader.hpp"
#include "indexer/data_source.hpp"
#include "indexer/feature.hpp"
#include "indexer/feature_decl.hpp"
#include "indexer/ftypes_matcher.hpp"
#include "indexer/mwm_set.hpp"

#include "platform/local_country_file_utils.hpp"
#include "platform/platform.hpp"
#include "platform/platform_tests_support/scoped_file.hpp"

#include "coding/internal/file_data.hpp"
#include "coding/writer.hpp"
#include "coding/zlib.hpp"

#include "base/file_name_utils.hpp"

#include <chrono>
#include <functional>
#include <memory>
#include <string>
#include <vector>

#include "3party/jansson/myjansson.hpp"

using namespace std;
using namespace generator::tests_support;
using namespace ugc;

namespace
{
int64_t constexpr kMinVersionForMigration = 171020;

string const kTestMwmName = "ugc storage test";

bool DeleteIndexFile(ugc::IndexVersion v = ugc::IndexVersion::Latest)
{
  if (v == ugc::IndexVersion::Latest)
    return base::DeleteFileX(base::JoinPath(GetPlatform().SettingsDir(), "index.json"));

  string version;
  switch (v)
  {
  case ugc::IndexVersion::V0:
    version = "v0";
    break;
  case ugc::IndexVersion::V1:
    version = "v1";
    break;
  }

  return base::DeleteFileX(base::JoinPath(GetPlatform().SettingsDir(), "index.json." + version));
}

bool DeleteUGCFile(ugc::IndexVersion v = ugc::IndexVersion::Latest)
{
  if (v == ugc::IndexVersion::Latest)
    return base::DeleteFileX(base::JoinPath(GetPlatform().SettingsDir(), "ugc.update.bin"));

  string version;
  switch (v)
  {
    case ugc::IndexVersion::V0:
      version = "v0";
      break;
    case ugc::IndexVersion::V1:
      version = "v1";
      break;
  }

  return base::DeleteFileX(
      base::JoinPath(GetPlatform().SettingsDir(), "ugc.update.bin." + version));
}
}  // namespace

namespace ugc_tests
{
class TestCafe : public TestPOI
{
public:
  explicit TestCafe(m2::PointD const & center) : TestPOI(center, "Cafe", "en")
  {
    SetTypes({{"amenity", "cafe"}});
  }
};

class TestRailway : public TestPOI
{
public:
  explicit TestRailway(m2::PointD const & center) : TestPOI(center, "Railway", "en")
  {
    SetTypes({{"railway", "station"}});
  }
};

class MwmBuilder
{
public:
  using BuilderFn = function<void(TestMwmBuilder & builder)>;

  static MwmBuilder & Builder()
  {
    static MwmBuilder builder;
    return builder;
  }

  void Build(vector<TestPOI> const & poi)
  {
    BuildMwm([&poi](TestMwmBuilder & builder)
             {
               for (auto const & p : poi)
                 builder.Add(p);
             });
  }

  FeatureID FeatureIdForCafeAtPoint(m2::PointD const & mercator)
  {
    return FeatureIdForPoint(mercator, ftypes::IsEatChecker::Instance());
  }

  FeatureID FeatureIdForRailwayAtPoint(m2::PointD const & mercator)
  {
    return FeatureIdForPoint(mercator, ftypes::IsRailwayStationChecker::Instance());
  }

  DataSource & GetDataSource() { return m_dataSource; }

  ~MwmBuilder()
  {
    platform::CountryIndexes::DeleteFromDisk(m_testMwm);
    m_testMwm.DeleteFromDisk(MapOptions::Map);
  }

private:
  MwmBuilder() { classificator::Load(); }

  MwmSet::MwmId BuildMwm(BuilderFn const & fn)
  {
    if (m_testMwm.OnDisk(MapOptions::Map))
      Cleanup(m_testMwm);

    m_testMwm = platform::LocalCountryFile(GetPlatform().WritableDir(),
                                           platform::CountryFile(kTestMwmName),
                                           kMinVersionForMigration);
    {
      generator::tests_support::TestMwmBuilder builder(m_testMwm,
                                                       feature::DataHeader::MapType::Country);
      fn(builder);
    }

    auto result = m_dataSource.RegisterMap(m_testMwm);
    CHECK_EQUAL(result.second, MwmSet::RegResult::Success, ());

    auto const & id = result.first;

    auto const & info = id.GetInfo();
    if (info)
      m_infoGetter.AddCountry(storage::CountryDef(kTestMwmName, info->m_bordersRect));

    CHECK(id.IsAlive(), ());
    return id;
  }

  template<typename Checker>
  FeatureID FeatureIdForPoint(m2::PointD const & mercator, Checker const & checker)
  {
    m2::RectD const rect = MercatorBounds::RectByCenterXYAndSizeInMeters(mercator, 0.2 /* rect width */);
    FeatureID id;
    auto const fn = [&id, &checker](FeatureType & featureType) {
      if (checker(featureType))
        id = featureType.GetID();
    };
    m_dataSource.ForEachInRect(fn, rect, scales::GetUpperScale());
    CHECK(id.IsValid(), ());
    return id;
  }

  void Cleanup(platform::LocalCountryFile const & map)
  {
    m_dataSource.DeregisterMap(map.GetCountryFile());
    platform::CountryIndexes::DeleteFromDisk(map);
    map.DeleteFromDisk(MapOptions::Map);
  }

  FrozenDataSource m_dataSource;
  storage::CountryInfoGetterForTesting m_infoGetter;
  platform::LocalCountryFile m_testMwm;
};

class StorageTest
{
public:
  ~StorageTest()
  {
    TEST(DeleteUGCFile(), ());
    TEST(DeleteIndexFile(), ());
  }
};
}  // namespace ugc_tests

using namespace ugc_tests;

UNIT_CLASS_TEST(StorageTest, Smoke)
{
  auto & builder = MwmBuilder::Builder();
  m2::PointD const point(1.0, 1.0);
  builder.Build({TestCafe(point)});
  auto const id = builder.FeatureIdForCafeAtPoint(point);
  auto const original = MakeTestUGCUpdate(Time(chrono::hours(24 * 300)));
  Storage storage(builder.GetDataSource());
  storage.Load();
  TEST_EQUAL(storage.SetUGCUpdate(id, original), Storage::SettingResult::Success, ());
  auto const actual = storage.GetUGCUpdate(id);
  TEST_EQUAL(original, actual, ());
  TEST(!storage.GetUGCToSend().empty(), ());
  storage.MarkAllAsSynchronized();
  TEST(storage.GetUGCToSend().empty(), ());
}

UNIT_CLASS_TEST(StorageTest, DuplicatesAndDefragmentationSmoke)
{
  auto & builder = MwmBuilder::Builder();
  m2::PointD const point(1.0, 1.0);
  builder.Build({TestCafe(point), TestRailway(point)});
  auto const cafeId = builder.FeatureIdForCafeAtPoint(point);
  auto const railwayId = builder.FeatureIdForRailwayAtPoint(point);
  auto const first = MakeTestUGCUpdate(Time(chrono::hours(24 * 300)));
  auto const second = MakeTestUGCUpdate(Time(chrono::hours(24 * 100)));
  auto const third = MakeTestUGCUpdate(Time(chrono::hours(24 * 300)));
  auto const last = MakeTestUGCUpdate(Time(chrono::hours(24 * 100)));
  Storage storage(builder.GetDataSource());
  storage.Load();
  TEST_EQUAL(storage.SetUGCUpdate(cafeId, first), Storage::SettingResult::Success, ());
  TEST_EQUAL(storage.SetUGCUpdate(cafeId, second), Storage::SettingResult::Success, ());
  TEST_EQUAL(storage.SetUGCUpdate(cafeId, third), Storage::SettingResult::Success, ());
  TEST_EQUAL(storage.SetUGCUpdate(cafeId, last), Storage::SettingResult::Success, ());
  TEST_EQUAL(storage.SetUGCUpdate(railwayId, first), Storage::SettingResult::Success, ());
  TEST_EQUAL(last, storage.GetUGCUpdate(cafeId), ());
  TEST_EQUAL(storage.GetIndexesForTesting().size(), 5, ());
  TEST_EQUAL(storage.GetNumberOfDeletedForTesting(), 3, ());
  storage.Defragmentation();
  TEST_EQUAL(storage.GetIndexesForTesting().size(), 2, ());
  TEST_EQUAL(storage.GetNumberOfDeletedForTesting(), 0, ());
  TEST_EQUAL(last, storage.GetUGCUpdate(cafeId), ());
  TEST_EQUAL(first, storage.GetUGCUpdate(railwayId), ());
}

UNIT_CLASS_TEST(StorageTest, DifferentTypes)
{
  auto & builder = MwmBuilder::Builder();
  m2::PointD const point(1.0, 1.0);
  builder.Build({TestCafe(point), TestRailway(point)});
  auto const cafeId = builder.FeatureIdForCafeAtPoint(point);
  auto const railwayId = builder.FeatureIdForRailwayAtPoint(point);
  auto const cafeUGC = MakeTestUGCUpdate(Time(chrono::hours(24 * 10)));
  auto const railwayUGC = MakeTestUGCUpdate(Time(chrono::hours(24 * 300)));
  Storage storage(builder.GetDataSource());
  storage.Load();
  TEST_EQUAL(storage.SetUGCUpdate(cafeId, cafeUGC), Storage::SettingResult::Success, ());
  TEST_EQUAL(storage.SetUGCUpdate(railwayId, railwayUGC), Storage::SettingResult::Success, ());
  TEST_EQUAL(railwayUGC, storage.GetUGCUpdate(railwayId), ());
  TEST_EQUAL(cafeUGC, storage.GetUGCUpdate(cafeId), ());
}

UNIT_CLASS_TEST(StorageTest, LoadIndex)
{
  auto & builder = MwmBuilder::Builder();
  m2::PointD const cafePoint(1.0, 1.0);
  m2::PointD const railwayPoint(2.0, 2.0);
  builder.Build({TestCafe(cafePoint), TestRailway(railwayPoint)});
  auto const cafeId = builder.FeatureIdForCafeAtPoint(cafePoint);
  auto const railwayId = builder.FeatureIdForRailwayAtPoint(railwayPoint);
  auto const cafeUGC = MakeTestUGCUpdate(Time(chrono::hours(24 * 10)));
  auto const railwayUGC = MakeTestUGCUpdate(Time(chrono::hours(24 * 300)));

  {
    Storage storage(builder.GetDataSource());
    storage.Load();
    TEST_EQUAL(storage.SetUGCUpdate(cafeId, cafeUGC), Storage::SettingResult::Success, ());
    TEST_EQUAL(storage.SetUGCUpdate(railwayId, railwayUGC), Storage::SettingResult::Success, ());
  }

  Storage storage(builder.GetDataSource());
  storage.Load();
  auto const & indexArray = storage.GetIndexesForTesting();
  TEST_EQUAL(indexArray.size(), 2, ());
  for (auto const & i : indexArray)
  {
    TEST(!i.m_synchronized, ());
    TEST(!i.m_deleted, ());
  }

  TEST_EQUAL(storage.SetUGCUpdate(cafeId, cafeUGC), Storage::SettingResult::Success, ());
  TEST_EQUAL(indexArray.size(), 3, ());
}

UNIT_CLASS_TEST(StorageTest, ContentTest)
{
  auto & builder = MwmBuilder::Builder();
  m2::PointD const cafePoint(1.0, 1.0);
  builder.Build({TestCafe(cafePoint)});
  auto const cafeId = builder.FeatureIdForCafeAtPoint(cafePoint);
  auto const oldUGC = MakeTestUGCUpdate(Time(chrono::hours(24 * 10)));
  auto const newUGC = MakeTestUGCUpdate(Time(chrono::hours(24 * 300)));
  Storage storage(builder.GetDataSource());
  storage.Load();
  TEST_EQUAL(storage.SetUGCUpdate(cafeId, oldUGC), Storage::SettingResult::Success, ());
  TEST_EQUAL(storage.SetUGCUpdate(cafeId, newUGC), Storage::SettingResult::Success, ());
  TEST_EQUAL(storage.GetIndexesForTesting().size(), 2, ());
  auto const toSendActual = storage.GetUGCToSend();

  string data;
  {
    using Sink = MemWriter<string>;
    Sink sink(data);
    SerializerJson<Sink> ser(sink);
    ser(newUGC);
  }

  base::Json ugcNode(data);
  auto const & indexes = storage.GetIndexesForTesting();
  TEST_EQUAL(indexes.size(), 2, ());
  auto const & firstIndex = indexes.front();
  auto const & lastIndex = indexes.back();
  TEST(firstIndex.m_deleted, ());
  TEST(!lastIndex.m_deleted, ());
  TEST(!firstIndex.m_synchronized, ());
  TEST(!lastIndex.m_synchronized, ());

  auto embeddedNode = base::NewJSONObject();
  ToJSONObject(*embeddedNode.get(), "data_version", lastIndex.m_dataVersion);
  ToJSONObject(*embeddedNode.get(), "mwm_name", lastIndex.m_mwmName);
  ToJSONObject(*embeddedNode.get(), "feature_id", lastIndex.m_featureId);
  auto const & c = classif();
  ToJSONObject(*embeddedNode.get(), "feature_type", c.GetReadableObjectName(c.GetTypeForIndex(lastIndex.m_matchingType)));
  ToJSONObject(*ugcNode.get(), "feature", *embeddedNode.release());

  auto array = base::NewJSONArray();
  json_array_append_new(array.get(), ugcNode.get_deep_copy());
  auto reviewsNode = base::NewJSONObject();
  ToJSONObject(*reviewsNode.get(), "reviews", *array.release());
  unique_ptr<char, JSONFreeDeleter> buffer(json_dumps(reviewsNode.get(), JSON_COMPACT | JSON_ENSURE_ASCII));
  string const toSendExpected(buffer.get());
  TEST_EQUAL(toSendActual, toSendExpected, ());
  storage.MarkAllAsSynchronized();
  TEST(firstIndex.m_synchronized, ());
  TEST(lastIndex.m_synchronized, ());
}

UNIT_CLASS_TEST(StorageTest, InvalidUGC)
{
  auto & builder = MwmBuilder::Builder();
  m2::PointD const cafePoint(1.0, 1.0);
  builder.Build({TestCafe(cafePoint)});
  auto const cafeId = builder.FeatureIdForCafeAtPoint(cafePoint);
  Storage storage(builder.GetDataSource());
  storage.Load();

  UGCUpdate first;
  TEST_EQUAL(storage.SetUGCUpdate(cafeId, first), Storage::SettingResult::InvalidUGC, ());
  first.m_time = chrono::system_clock::now();
  TEST_EQUAL(storage.SetUGCUpdate(cafeId, first), Storage::SettingResult::InvalidUGC, ());
  TEST(storage.GetIndexesForTesting().empty(), ());
  TEST(storage.GetUGCToSend().empty(), ());
  first.m_text = KeyboardText("a", 1, {2});
  TEST_EQUAL(storage.SetUGCUpdate(cafeId, first), Storage::SettingResult::Success, ());
  UGCUpdate second;
  second.m_time = chrono::system_clock::now();
  second.m_ratings.emplace_back("a", 0);
  TEST_EQUAL(storage.SetUGCUpdate(cafeId, second), Storage::SettingResult::InvalidUGC, ());
  second.m_ratings.emplace_back("b", 1);
  TEST_EQUAL(storage.SetUGCUpdate(cafeId, second), Storage::SettingResult::Success, ());
}

UNIT_CLASS_TEST(StorageTest, DifferentUGCVersions)
{
  auto & builder = MwmBuilder::Builder();
  m2::PointD const firstPoint(1.0, 1.0);
  m2::PointD const secondPoint(2.0, 2.0);
  builder.Build({TestCafe(firstPoint), TestCafe(secondPoint)});

  Storage storage(builder.GetDataSource());
  storage.Load();

  auto const firstId = builder.FeatureIdForCafeAtPoint(firstPoint);
  auto const oldUGC = MakeTestUGCUpdateV0(Time(chrono::hours(24 * 10)));
  TEST_EQUAL(storage.SetUGCUpdateForTesting(firstId, oldUGC), Storage::SettingResult::Success, ());
  auto const secondId = builder.FeatureIdForCafeAtPoint(secondPoint);
  auto const newUGC = MakeTestUGCUpdate(Time(chrono::hours(24 * 5)));
  TEST_EQUAL(storage.SetUGCUpdate(secondId, newUGC), Storage::SettingResult::Success, ());

  TEST_EQUAL(newUGC, storage.GetUGCUpdate(secondId), ());
  UGCUpdate fromOld;
  fromOld.BuildFrom(oldUGC);
  TEST_EQUAL(fromOld, storage.GetUGCUpdate(firstId), ());
}

UNIT_CLASS_TEST(StorageTest, NumberOfUnsynchronized)
{
  auto & builder = MwmBuilder::Builder();
  m2::PointD const cafePoint(1.0, 1.0);
  builder.Build({TestCafe(cafePoint)});
  auto const cafeId = builder.FeatureIdForCafeAtPoint(cafePoint);
  auto const cafeUGC = MakeTestUGCUpdate(Time(chrono::hours(24 * 10)));

  {
    Storage storage(builder.GetDataSource());
    storage.Load();
    TEST_EQUAL(storage.SetUGCUpdate(cafeId, cafeUGC), Storage::SettingResult::Success, ());
  }

  Storage storage(builder.GetDataSource());
  storage.Load();
  TEST_EQUAL(storage.GetNumberOfUnsynchronized(), 1, ());

  TEST_EQUAL(storage.SetUGCUpdate(cafeId, cafeUGC), Storage::SettingResult::Success, ());
  TEST_EQUAL(storage.GetNumberOfUnsynchronized(), 1, ());
  TEST_EQUAL(storage.GetNumberOfDeletedForTesting(), 1, ());

  storage.MarkAllAsSynchronized();
  TEST_EQUAL(storage.GetNumberOfUnsynchronized(), 0, ());
}

UNIT_CLASS_TEST(StorageTest, GetNumberOfUnsentSeparately)
{
  TEST_EQUAL(lightweight::impl::GetNumberOfUnsentUGC(), 0, ());
  auto & builder = MwmBuilder::Builder();
  m2::PointD const cafePoint(1.0, 1.0);
  builder.Build({TestCafe(cafePoint)});
  auto const cafeId = builder.FeatureIdForCafeAtPoint(cafePoint);
  auto const cafeUGC = MakeTestUGCUpdate(Time(chrono::hours(24 * 10)));

  {
    Storage storage(builder.GetDataSource());
    storage.Load();
    TEST_EQUAL(storage.SetUGCUpdate(cafeId, cafeUGC), Storage::SettingResult::Success, ());
    TEST_EQUAL(storage.GetNumberOfUnsynchronized(), 1, ());
  }

  TEST_EQUAL(lightweight::impl::GetNumberOfUnsentUGC(), 1, ());

  {
    Storage storage(builder.GetDataSource());
    storage.Load();
    storage.MarkAllAsSynchronized();
    TEST_EQUAL(storage.GetNumberOfUnsynchronized(), 0, ());
  }

  TEST_EQUAL(lightweight::impl::GetNumberOfUnsentUGC(), 0, ());
}

UNIT_TEST(UGC_IndexMigrationFromV0ToV1Smoke)
{
  platform::tests_support::ScopedFile dummyUgcUpdate("ugc.update.bin", "some test content");
  LOG(LINFO, ("Created dummy ugc update", dummyUgcUpdate));

  auto & p = GetPlatform();
  auto const version = "v0";
  auto const indexFileName = "index.json";
  auto const folder = base::JoinPath(p.WritableDir(), "ugc_migration_supported_files", "test_index", version);
  auto const indexFilePath = base::JoinPath(folder, indexFileName);
  {
    using Inflate = coding::ZLib::Inflate;
    auto const r = p.GetReader(base::JoinPath(folder, "index.gz"));
    string data;
    r->ReadAsString(data);
    Inflate inflate(Inflate::Format::GZip);
    string index;
    inflate(data.data(), data.size(), back_inserter(index));
    FileWriter w(indexFilePath);
    w.Write(index.data(), index.size());
  }

  auto & builder = MwmBuilder::Builder();
  builder.Build({});
  auto const v0IndexFilePath = indexFilePath + "." + version;

  {
    Storage s(builder.GetDataSource());
    s.LoadForTesting(indexFilePath);
    uint64_t migratedIndexFileSize = 0;
    uint64_t v0IndexFileSize = 0;
    TEST(base::GetFileSize(indexFilePath, migratedIndexFileSize), ());
    TEST(base::GetFileSize(v0IndexFilePath, v0IndexFileSize), ());
    TEST_GREATER(migratedIndexFileSize, 0, ());
    TEST_GREATER(v0IndexFileSize, 0, ());
    auto const & indexes = s.GetIndexesForTesting();
    for (auto const & i : indexes)
    {
      TEST_EQUAL(static_cast<uint8_t>(i.m_version), static_cast<uint8_t>(IndexVersion::Latest), ());
      TEST(!i.m_synchronized, ());
    }
  }

  {
    Storage s(builder.GetDataSource());
    s.LoadForTesting(indexFilePath);
    auto const & indexes = s.GetIndexesForTesting();
    TEST_NOT_EQUAL(indexes.size(), 0, ());
    for (auto const & i : indexes)
    {
      TEST_EQUAL(static_cast<uint8_t>(i.m_version), static_cast<uint8_t>(IndexVersion::Latest), ());
      TEST(!i.m_synchronized, ());
    }
  }

  base::DeleteFileX(indexFilePath);
  base::DeleteFileX(v0IndexFilePath);
}

UNIT_TEST(UGC_NoReviews)
{
  auto & builder = MwmBuilder::Builder();
  Storage s(builder.GetDataSource());
  s.Load();
  s.SaveIndexForTesting();
  // When we didn't write any reviews there should be no index file and no ugc file.
  TEST(!DeleteIndexFile(), ());
  TEST(!DeleteUGCFile(), ());
}

UNIT_TEST(UGC_TooOldDataVersionsForMigration)
{
  auto & builder = MwmBuilder::Builder();
  m2::PointD const cafePoint(1.0, 1.0);
  m2::PointD const railwayPoint(2.0, 2.0);
  builder.Build({TestCafe(cafePoint), TestRailway(railwayPoint)});
  auto const cafeId = builder.FeatureIdForCafeAtPoint(cafePoint);
  auto const cafeUGC = MakeTestUGCUpdate(Time(chrono::hours(24 * 10)));

  auto const railwayId = builder.FeatureIdForRailwayAtPoint(railwayPoint);
  auto const railwayUGC = MakeTestUGCUpdate(Time(chrono::hours(48 * 10)));

  {
    Storage s(builder.GetDataSource());
    s.Load();
    s.SetUGCUpdate(cafeId, cafeUGC);
    s.SetUGCUpdate(railwayId, railwayUGC);
    auto & indexes = s.GetIndexesForTesting();
    TEST_EQUAL(indexes.size(), 2, ());

    auto & cafeIndex = indexes.front();
    cafeIndex.m_dataVersion = kMinVersionForMigration - 1;
    cafeIndex.m_version = IndexVersion::V0;

    auto & railwayIndex = indexes.back();
    railwayIndex.m_dataVersion = kMinVersionForMigration;
    railwayIndex.m_version = IndexVersion::V0;
    railwayIndex.m_synchronized = true;
    s.SaveIndexForTesting();
  }

  {
    Storage s(builder.GetDataSource());
    s.Load();
    // Migration should pass successfully even there are indexes with a data version lower than minimal.
    // Such indexes should be marked as deleted and should be removed after the defragmentation process.
    auto const & indexes = s.GetIndexesForTesting();
    TEST_EQUAL(indexes.size(), 1, ());

    auto const & railwayIndex = indexes.back();
    TEST_EQUAL(static_cast<uint8_t>(railwayIndex.m_version), static_cast<uint8_t>(IndexVersion::Latest), ());
    TEST(!railwayIndex.m_synchronized, ());
    TEST_EQUAL(railwayIndex.m_dataVersion, kMinVersionForMigration, ());
  }

  {
    Storage s(builder.GetDataSource());
    s.Load();
    auto const & indexes = s.GetIndexesForTesting();
    TEST_EQUAL(indexes.size(), 1, ());
    auto const & railwayIndex = indexes.back();
    TEST_EQUAL(static_cast<uint8_t>(railwayIndex.m_version), static_cast<uint8_t>(IndexVersion::Latest), ());
    TEST(!railwayIndex.m_synchronized, ());
    TEST_EQUAL(railwayIndex.m_dataVersion, kMinVersionForMigration, ());
  }

  TEST(DeleteIndexFile(), ());
  TEST(DeleteIndexFile(IndexVersion::V0), ());
  TEST(DeleteUGCFile(), ());
  TEST(DeleteUGCFile(IndexVersion::V0), ());
}

UNIT_CLASS_TEST(StorageTest, UGC_HasUGCForPlace)
{
  auto & builder = MwmBuilder::Builder();
  m2::PointD const point(1.0, 1.0);
  builder.Build({TestCafe(point)});
  auto const id = builder.FeatureIdForCafeAtPoint(point);
  auto const original = MakeTestUGCUpdate(Time(chrono::hours(24 * 300)));
  Storage storage(builder.GetDataSource());
  storage.Load();
  TEST_EQUAL(storage.SetUGCUpdate(id, original), Storage::SettingResult::Success, ());
  auto const actual = storage.GetUGCUpdate(id);
  TEST_EQUAL(original, actual, ());

  auto const & c = classif();
  auto const cafeType = c.GetTypeByReadableObjectName("amenity-cafe");
  TEST(storage.HasUGCForPlace(cafeType, point), ());
}


text:
package org.frozenarc.zeframework.config;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
 *             	List of Action.
 *
 *
 *
Java class for ActionsType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="ActionsType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="Action" type="{http://www.frozenarc.org/zeframework/config}ActionType" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ActionsType", propOrder = {
    "action"
})
public class ActionsType {

    @XmlElement(name = "Action")
    protected List<ActionType> action;

    /**
     * Gets the value of the action property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the action property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getAction().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link ActionType }
     *
     *
     */
    public List<ActionType> getAction() {
        if (action == null) {
            action = new ArrayList<ActionType>();
        }
        return this.action;
    }

}


text:
=head1 NAME

Changes

=head1 Description

Refer to this document to learn what changes were made to the
documents, since you've read these last time.

The most recent changes are listed first.

=head1 Ongoing

* Added "Web Content Compression FAQ" by Slava Bizyayev E<lt>slava
  at) cpan.orgE<gt>

=head1 Wed Jun 5 19:24:05 CET 2002

* Re-arranged content completely to better classify and be able to
  adjust to more tutorials. [Per Einar]

* Merged Lincoln's "Advanced CGI" tutorial into mod_perl_tricks.pod
  from http://modperl.com:9000/perl_conference/advanced/handout.html
  with slight changes to turn it more towards mod_perl [Per Einar]

* browserbugs::browserbugs: Added discussion of length of error
  responses and how it's handled by IE, in relation to this
  discussion:
  http://mathforum.org/epigone/modperl/praibryrghin [Per Einar]

=head1 Wed May 29 12:41:24 SGT 2002

* Added mod_perl_tricks::mod_perl_tricks by Lincoln Stein. Changed it
  to meet our POD style, and some references to the CPAN. [Per Einar]

* Added scale_etoys::etoys tutorial by Perrin Harkins. [Per Einar]

* browserbugs::browserbugs moved here

* started the Tutorials docset [Thomas Klausner]

=head1 Sat Sep 15 19:45:41 SGT 2001

* templates::choosing, the initial version added (Perrin Harkins
  E<lt>perrin@elem.comE<gt>)

=cut


text:
package xyz.zimuju.master.provider;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import me.drakeet.multitype.ItemViewProvider;
import xyz.zimuju.master.R;
import xyz.zimuju.master.entity.content.DailyTitle;

public class DailyViewItemTitleProvider extends ItemViewProvider<DailyTitle, DailyViewItemTitleProvider.ViewHolder> {

    @NonNull
    @Override
    protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        View root = inflater.inflate(R.layout.gank_item_daily_item_title, parent, false);
        return new ViewHolder(root);
    }

    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull DailyTitle recentlyTitle) {
        holder.tv_title.setText(recentlyTitle.getTitle());
    }

    static class ViewHolder extends RecyclerView.ViewHolder {

        TextView tv_title;

        ViewHolder(View itemView) {
            super(itemView);
            tv_title = (TextView) itemView.findViewById(R.id.tv_title);
        }
    }
}


text:
require 'test_helper'
class CalculatingAugmentedRecordsTest < ActiveSupport::TestCase
  include ::Validators

  def setup
    @product_test = FactoryBot.create(:cv_product_test_static_result)
    @validator = ::Validators::CalculatingAugmentedRecords.new(@product_test.measures, [], @product_test.id)
  end

  def test_validation_of_clone
    patient = @product_test.patients.first
    cloned_patient = patient.clone
    assert @validator.validate_calculated_results(cloned_patient, effective_date: @product_test.effective_date, orig_product_patient: patient)
  end

  def test_validation_of_bad_clone
    patient = @product_test.patients.first
    cloned_patient = patient.clone
    cloned_patient.qdmPatient = nil
    assert_equal false, @validator.validate_calculated_results(cloned_patient, effective_date: @product_test.effective_date, orig_product_patient: patient)
  end

  def test_validation_of_clone_with_modified_name
    patient = @product_test.patients.first
    cloned_patient = patient.clone
    cloned_patient.familyName = 'Changed'
    assert @validator.validate_calculated_results(cloned_patient, effective_date: @product_test.effective_date, orig_product_patient: patient)
  end
end


text:
class Account
  include DataMapper::Resource

  property :id,           Integer, :serial => true
  property :type,         Class    # single-table inheritance
  property :address_id,   Integer  # foreign-key

  has n,  :transactions
  belongs_to :address, :class_name => 'Address' #stupid DM, tries to singularize a 'has 1'

  validates_present :address
end


text:
import React from 'react';
import {
  Pressable,
  View,
  Platform,
  StyleSheet,
  StyleProp,
  ViewStyle,
  ColorValue,
} from 'react-native';
import Image, { ImageProps } from '../Image';
import Icon, { IconProps } from '../Icon';
import {
  androidRipple,
  InlinePressableProps,
  RneFunctionComponent,
} from '../helpers';

export type AccessoryProps = Partial<IconProps> &
  Partial<ImageProps> & {
    /** Add underlay color to the accessory of avatar. */
    underlayColor?: ColorValue;

    /** Add custom styling to the accessory of avatar. */
    style?: StyleProp<ViewStyle>;
  } & InlinePressableProps;

/** This is used for adding an accessory to the Avatar.
 * Receives either all [Icon](icon#props) or [Image](image#props) props. */
export const Accessory: RneFunctionComponent<AccessoryProps> = ({
  size = 10,
  style,
  underlayColor = '#000',
  onPress,
  onLongPress,
  onPressIn,
  onPressOut,
  source,
  pressableProps,
  ...rest
}: AccessoryProps) => {
  return (
    <Pressable
      {...{
        android_ripple:
          (onPress || onLongPress) && androidRipple(underlayColor),
        ...pressableProps,
      }}
      style={[
        styles.accessory,
        {
          width: size,
          height: size,
          borderRadius: size / 2,
        },
        style,
      ]}
      {...{ onPressOut, onPressIn, onPress, onLongPress }}
    >
      <View>
        {source ? (
          <Image
            source={source}
            style={{
              width: size,
              height: size,
              borderRadius: size / 2,
            }}
            {...rest}
          />
        ) : (
          <Icon
            name="mode-edit"
            type="material"
            color="#fff"
            size={size * 0.8}
            {...rest}
          />
        )}
      </View>
    </Pressable>
  );
};

const styles = StyleSheet.create({
  accessory: {
    position: 'absolute',
    bottom: 0,
    right: 0,
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: '#aaa',
    ...Platform.select({
      android: {
        elevation: 1,
      },
      default: {
        shadowColor: '#000',
        shadowOffset: { width: 1, height: 1 },
        shadowRadius: 2,
        shadowOpacity: 0.5,
      },
    }),
  },
});

Accessory.displayName = 'Avatar.Accessory';


text:
'use strict';

/**
 * Simple service for storing variables and configuration relevant to the graph.
 */
angular.module('app').factory('graph', function() {
    var service = {};

    var graphConfiguration = null;

    var removedElements = [];
    var graphJson = {};

    var selectedElements = {
        entities: [],
        edges: []
    }

    var searchTerm = null;

    /**
     * Gets the graph configuration
     */
    service.getGraphConfiguration = function() {
        return angular.copy(graphConfiguration);
    }

    /**
     * Sets the graph configuration
     * @param {Object} graphConfig
     */
    service.setGraphConfiguration = function(graphConfig) {
        graphConfiguration = angular.copy(graphConfig);
    }

    /**
     * Gets the selected elements
     */
    service.getSelectedElements = function() {
        return angular.copy(selectedElements);
    }

    /**
     * Sets the selected elements
     * @param {Object} newSelectedElements
     */
    service.setSelectedElements = function(newSelectedElements) {
        selectedElements = angular.copy(newSelectedElements);
    }

    /**
     * Gets the search term
     */
    service.getSearchTerm = function() {
        return angular.copy(searchTerm);
    }

    /**
     * Sets the search term
     * @param {string} search
     */
    service.setSearchTerm = function(search) {
        searchTerm = angular.copy(search);
    }

    /**
     * Gets the removed elements.
     */
    service.getRemovedElements = function() {
        return removedElements;
    }

    /**
     * Sets the removed elements.
     * @param removedElements;
     */
    service.setRemovedElements = function(newRemovedElements) {
        removedElements = newRemovedElements
    }

    /**
     * Checks if the graph json has been set.
     */
    service.hasGraphJson = function() {
        return graphJson && Object.keys(graphJson).length > 0 && Object.keys(graphJson.elements).length > 0;
    }

    /**
     * Gets the graph json.
     */
    service.getGraphJson = function() {
        return graphJson;
    }

    /**
     * Sets the graph json.
     * @param graphJson;
     */
    service.setGraphJson = function(newGraphJson) {
        graphJson = newGraphJson;
    }

    /**
     * Resets the value of the selected elements
     */
    service.deselectAll = function() {
        selectedElements = {
            entities: [],
            edges: []
        }
    }

    return service;
});


text:
package golinters

import (
	"strings"

	"github.com/mbilski/exhaustivestruct/pkg/analyzer"
	"golang.org/x/tools/go/analysis"

	"github.com/golangci/golangci-lint/pkg/config"
	"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
)

func NewExhaustiveStruct(settings *config.ExhaustiveStructSettings) *goanalysis.Linter {
	a := analyzer.Analyzer

	var cfg map[string]map[string]interface{}
	if settings != nil {
		cfg = map[string]map[string]interface{}{
			a.Name: {
				"struct_patterns": strings.Join(settings.StructPatterns, ","),
			},
		}
	}

	return goanalysis.NewLinter(
		a.Name,
		a.Doc,
		[]*analysis.Analyzer{a},
		cfg,
	).WithLoadMode(goanalysis.LoadModeTypesInfo)
}


text:
from contentbase import upgrade_step

@upgrade_step('platform', '', '2')
def platform_0_2(value, system):
    # http://redmine.encodedcc.org/issues/817
    value['dbxrefs'] = []

    if 'encode2_dbxrefs' in value:
        for encode2_dbxref in value['encode2_dbxrefs']:
            new_dbxref = 'UCSC-ENCODE-cv:' + encode2_dbxref
            value['dbxrefs'].append(new_dbxref)
        del value['encode2_dbxrefs']

    if 'geo_dbxrefs' in value:
        for geo_dbxref in value['geo_dbxrefs']:
            new_dbxref = 'GEO:' + geo_dbxref
            value['dbxrefs'].append(new_dbxref)
        del value['geo_dbxrefs']

@upgrade_step('platform', '2', '3')
def platform_2_3(value, system):
    # http://redmine.encodedcc.org/issues/1295
    # http://redmine.encodedcc.org/issues/1307

    if 'status' in value:
        value['status'] = value['status'].lower()


text:
USE [picker]
GO

/****** Object:  Table [dbo].[FellowPlusWebsite]    Script Date: 2016/4/6 19:01:43 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[FellowPlusWebsite](
	[ProjectId] [varchar](50) NOT NULL,
	[Id] [varchar](300) NOT NULL,
	[Uri] [varchar](300) NOT NULL,
	[CreatedAt] [datetime] NULL,
	[UpdatedAt] [datetime] NULL,
	[ProcessedAt] [datetime] NULL,
	[Content] [nvarchar](max) NULL,
 CONSTRAINT [PK_FellowPlusWebsite] PRIMARY KEY CLUSTERED
(
	[ProjectId] ASC,
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


text:
/**
 * @file
 * @brief Board configuration macros for the fsl_frdm_k64f platform
 *
 * This header file is used to specify and describe board-level aspects for the
 * 'fsl_frdm_k64f' platform.
 */

#ifndef _SOC__H_
#define _SOC__H_

#include <sys/util.h>

/* address bases */

#define PERIPH_ADDR_BASE_WDOG 0x40052000 /* Watchdog Timer module */

#ifndef _ASMLANGUAGE

#include <fsl_common.h>

/* Add include for DTS generated information */
#include <devicetree.h>

#endif /* !_ASMLANGUAGE */

#endif /* _SOC__H_ */


text:
#ifndef MITKUSTelemedDevice_H_HEADER_INCLUDED_
#define MITKUSTelemedDevice_H_HEADER_INCLUDED_

#include "mitkUSDevice.h"
#include "mitkUSTelemedImageSource.h"
#include "mitkUSTelemedScanConverterPlugin.h"
#include "mitkUSTelemedProbesControls.h"
#include "mitkUSTelemedBModeControls.h"
#include "mitkUSTelemedDopplerControls.h"

#include "mitkUSTelemedSDKHeader.h"

namespace mitk {
  /**
    * \brief Implementation of mitk::USDevice for Telemed API devices.
    * Connects to a Telemed API device through its COM library interface.
    *
    * This class handles all API communications and creates interfaces for
    * b mode, doppler and probes controls.
    * Images given by the device are put into an object of
    * mitk::USTelemedImageSource.
    *
    * It implements IUsgDeviceChangeSink of the Telemed API to be notified
    * of changes to beamformer device or probes (e.g. probe change).
    */
  class USTelemedDevice : public USDevice, public Usgfw2Lib::IUsgDeviceChangeSink
  {
  public:
    mitkClassMacro(USTelemedDevice, mitk::USDevice);
    mitkNewMacro2Param(Self, std::string, std::string);

    /**
    * \brief Returns the class of the device.
    */
    virtual std::string GetDeviceClass();

    virtual USControlInterfaceBMode::Pointer GetControlInterfaceBMode();
    virtual USControlInterfaceProbes::Pointer GetControlInterfaceProbes();
    virtual USControlInterfaceDoppler::Pointer GetControlInterfaceDoppler();

    /**
      * \brief Is called during the initialization process.
      * There is nothing done on the initialization of a mik::USTelemedDevive object.
      *
      * \return always true
      */
    virtual bool OnInitialization();

    /**
      * \brief Is called during the connection process.
      * Connect to the Telemed API and try to get available probes from the device.
      *
      * \return true if successfull, false if no device is connected to the pc
      * \throws mitk::Exception if something goes wrong at the API calls
      */
    virtual bool OnConnection();

    /**
      * \brief Is called during the disconnection process.
      * Deactivate and remove all Telemed API controls. A disconnect from the
      * Telemed API is not possible for which reason the hardware stays in connected
      * state even after calling this method.
      *
      * \return always true
      * \throws mitk::Exception if something goes wrong at the API calls
      */
    virtual bool OnDisconnection();

    /**
      * \brief Is called during the activation process.
      * After this method is finished, the device is generating images in b mode.
      * Changing scanning mode is possible afterwards by using the appropriate
      * control interfaces.
      *
      * \return always true
      * \throws mitk::Exception if something goes wrong at the API calls
      */
    virtual bool OnActivation();

    /**
      * \brief Is called during the deactivation process.
      * After a call to this method the device is connected, but not producing images anymore.
      *
      * \return always true
      * \throws mitk::Exception if something goes wrong at the API calls
      */
    virtual bool OnDeactivation();

    /**
      * \brief Changes scan state of the device if freeze is toggeled in mitk::USDevice.
      */
    virtual void OnFreeze(bool freeze);

    /**
      * \brief Grabs the next frame from the Video input.
      * This method is called internally, whenever Update() is invoked by an Output.
      */
    void GenerateData();

    /**
      * \brief Getter for main Telemed API object.
      * This method is for being called by Telemed control interfaces.
      */
    Usgfw2Lib::IUsgfw2* GetUsgMainInterface();

    /**
      * \brief Changes active IUsgDataView of the device.
      * This method is for being called by Telemed control interfaces.
      */
    void SetActiveDataView(Usgfw2Lib::IUsgDataView*);

    // Methods implemented for IUsgDeviceChangeSink
    virtual HRESULT __stdcall raw_OnProbeArrive(IUnknown *pUsgProbe, ULONG *reserved);
    virtual HRESULT __stdcall raw_OnBeamformerArrive(IUnknown *pUsgBeamformer, ULONG *reserved);
    virtual HRESULT __stdcall raw_OnProbeRemove(IUnknown *pUsgProbe, ULONG *reserved);
    virtual HRESULT __stdcall raw_OnBeamformerRemove(IUnknown *pUsgBeamformer, ULONG *reserved);
    virtual HRESULT __stdcall raw_OnProbeStateChanged(IUnknown *pUsgProbe, ULONG *reserved) { return S_OK; };
    virtual HRESULT __stdcall raw_OnBeamformerStateChanged(IUnknown *pUsgBeamformer, ULONG *reserved) { return S_OK; };

    // Methods implemented for IUnknown (necessary for IUsgDeviceChangeSink)
    STDMETHODIMP_(ULONG) AddRef();
    STDMETHODIMP_(ULONG) Release();
    STDMETHODIMP QueryInterface(REFIID riid, void** ppv);

    // Methods implemented for IDispatch (necessary for IUsgDeviceChangeSink)
    virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo);
    virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo** pptinfo);
    virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(const IID &riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid);
    virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, const IID &riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);

  protected:
    /**
      * Constructs a mitk::USTelemedDevice object by given manufacturer
      * and model string. These strings are just for labeling the device
      * in the micro service.
      *
      * Control interfaces and image source are available directly after
      * construction. Registration at the micro service happens not before
      * initialization method was called.
      */
    USTelemedDevice(std::string manufacturer, std::string model);
    virtual ~USTelemedDevice();

    USImageSource::Pointer GetUSImageSource( );

    void ReleaseUsgControls( );

    void ConnectDeviceChangeSink( );

    /**
      * \brief Stop ultrasound scanning by Telemed API call.
      *
      * \throw mitk::Exception if API call returned with an error
      */
    void StopScanning( );

    USTelemedProbesControls::Pointer    m_ControlsProbes;
    USTelemedBModeControls::Pointer     m_ControlsBMode;
    USTelemedDopplerControls::Pointer   m_ControlsDoppler;

    USTelemedImageSource::Pointer       m_ImageSource;

    Usgfw2Lib::IUsgfw2*                 m_UsgMainInterface;
    Usgfw2Lib::IProbe*                  m_Probe;
    Usgfw2Lib::IUsgDataView*            m_UsgDataView;
    Usgfw2Lib::IUsgCollection*          m_ProbesCollection;

    ULONG                               m_RefCount;
    IConnectionPoint*                   m_UsgDeviceChangeCpnt;
    DWORD                               m_UsgDeviceChangeCpntCookie;
  };
} // namespace mitk

#endif // MITKUSTelemedDevice_H_HEADER_INCLUDED_


text:
class Ratingvalue < ActiveRecord::Base
  self.table_name="suitability.rating_values"

	def self.factors(sector,interpretation)
		self.select(:factor).where("sector = ? and interpretation = ?",sector,interpretation).group(:factor).map{|x| x.factor }
	end

	def self.values(sector,interpretation,factor)
		self.where("sector = ? and interpretation = ? and factor = ?",sector,interpretation,factor).order(:rating,:lookup_value).each_with_object(Hash.new){|x,hash| hash[x.lookup_value] = x.rating }
	end

	def self.value_factors(sector,interpretation)
		value_factors = Hash.new
		for factor in self.factors(sector,interpretation) do
			value_factors[factor] = Hash.new
			factor_definition = Factordefinition.find_by_factor(factor)
			value_factors[factor][:table] = factor_definition.db_table
			value_factors[factor][:method] = factor_definition.db_method
			value_factors[factor][:ratings] = self.values(sector,interpretation,factor)
		end
		return value_factors
	end

end


text:
/**
 * [IL]
 * Library Import
 */
import React, { PropTypes } from 'react';
import cx from 'classnames';

/**
 * [IS]
 * Style Import
 */
import Styles from './Styles/main.scss';

/**
 * [IA]
 * Assets Import
 */
import Logo from '../../Assets/Logo';
import Palette from 'components/Assets/Palette';
import Hamburger from '../../Assets/Hamburger';
import Instagram from 'components/Assets/Social/Instagram';
import Facebook from 'components/Assets/Social/Fb';
import Twitter from 'components/Assets/Social/Tw';
import YouTube from 'components/Assets/Social/YouTube';
import Ok from 'components/Assets/Social/Ok';
import Vk from 'components/Assets/Social/Vk';
import MenuLive from '../../Assets/MenuLive';

function Header(props) {
    const {
        handleMenu,
        isMenuVisible,
        locale,
        socialLinks,
        getMenuItems
    } = props;

    const ukClass = cx({
        [Styles.active]: locale === 'uk',
        [Styles.language]: true
    });

    const ruClass = cx({
        [Styles.active]: locale === 'ru',
        [Styles.language]: true
    });

    const dynamicStyle = {
        display: isMenuVisible ? 'flex' : 'none'
    };

    const convertToComponent = (el) => {
        const target = el.external ? {
            'target': '_blank',
            'rel': 'noopener noreferrer'
        } : null;

        const liveIcon = el.id === 'live' ? (
            <MenuLive className={ Styles.liveIcon } color={ Palette.mainColor3 }/>
        ) : null;

        return (

                { liveIcon }
                { el.title[locale] }

        );
    };

    const subMenuItems = getMenuItems('sub').map(convertToComponent);
    const mainMenuItems = getMenuItems('main').map(convertToComponent);

    return (

                <Logo className={ Styles.logo } color={ Palette.tempColor26 }/>

                    { mainMenuItems }

                <Hamburger
                    className={ Styles.hamburger }
                    color={ Palette.tempColor26 }
                    isOpened={ isMenuVisible }
                    onClick={ handleMenu }
                />

                        { subMenuItems }

                                <YouTube color={ Palette.tempColor8 }/>

                                <Instagram color={ Palette.tempColor10 }/>

                                <Twitter color={ Palette.tempColor12 }/>

                                <Vk color={ Palette.tempColor9 }/>

                                <Facebook color={ Palette.tempColor6 }/>

                                <Ok color={ Palette.tempColor7 }/>

                            Язык сайта:
                            Русский
                            Украинский

    );
}

/**
 * [CPT]
 * Component prop types
 */
Header.propTypes = {
    handleMenu: PropTypes.func.isRequired,
    isMenuVisible: PropTypes.bool,
    locale: PropTypes.string.isRequired,
    socialLinks: PropTypes.object.isRequired,
    getMenuItems: PropTypes.func.isRequired
};

/**
 * [CDP]
 * Component default props
 */
Header.defaultProps = {
    isMenuVisible: false
};

/**
 * [IE]
 * Export
 */
export default Header;


text:
package org.glowroot.agent.plugin.javahttpserver;

import java.util.List;
import java.util.Locale;
import java.util.Map;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.sun.net.httpserver.HttpExchange;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import org.glowroot.agent.it.harness.AppUnderTest;
import org.glowroot.agent.it.harness.Container;
import org.glowroot.agent.it.harness.impl.JavaagentContainer;
import org.glowroot.wire.api.model.TraceOuterClass.Trace;

import static org.assertj.core.api.Assertions.assertThat;

@SuppressWarnings("restriction")
public class ResponseHeaderIT {

    private static final String PLUGIN_ID = "java-http-server";

    private static Container container;

    @BeforeAll
    public static void setUp() throws Exception {
        // tests only work with javaagent container because they need to weave bootstrap classes
        // that implement com.sun.net.httpserver.HttpExchange
        container = JavaagentContainer.create();
    }

    @AfterAll
    public static void tearDown() throws Exception {
        container.close();
    }

    @AfterEach
    public void afterEachTest() throws Exception {
        container.checkAndReset();
    }

    @Test
    public void testStandardResponseHeadersUsingSetHeader() throws Exception {
        // given
        container.getConfigService().setPluginProperty(PLUGIN_ID, "captureResponseHeaders",
                ImmutableList.of("Content-Type", " Content-Length", " Content-Language"));

        // when
        Trace trace = container.execute(SetStandardResponseHeadersUsingSetHeader.class, "Web");

        // then
        Map<String, Object> responseHeaders = getResponseHeaders(trace);
        assertThat(responseHeaders.get("Content-type")).isEqualTo("text/plain;charset=UTF-8");
        assertThat(responseHeaders.get("Content-length")).isEqualTo("1");
        assertThat(responseHeaders.get("Content-language")).isEqualTo("en");
        assertThat(responseHeaders.get("Extra")).isNull();
    }

    @Test
    public void testStandardResponseHeadersUsingAddHeader() throws Exception {
        // given
        container.getConfigService().setPluginProperty(PLUGIN_ID, "captureResponseHeaders",
                ImmutableList.of("Content-Type", " Content-Length", " Content-Language"));

        // when
        Trace trace = container.execute(SetStandardResponseHeadersUsingAddHeader.class, "Web");

        // then
        Map<String, Object> responseHeaders = getResponseHeaders(trace);
        assertThat(responseHeaders.get("Content-type")).isEqualTo("text/plain;charset=UTF-8");
        assertThat(responseHeaders.get("Content-length")).isEqualTo("1");
        assertThat(responseHeaders.get("Content-language")).isEqualTo("en");
        assertThat(responseHeaders.get("Extra")).isNull();
    }

    @Test
    public void testStandardResponseHeadersLowercase() throws Exception {
        // given
        container.getConfigService().setPluginProperty(PLUGIN_ID, "captureResponseHeaders",
                ImmutableList.of("Content-Type", " Content-Length"));

        // when
        Trace trace = container.execute(SetStandardResponseHeadersLowercase.class, "Web");

        // then
        Map<String, Object> responseHeaders = getResponseHeaders(trace);
        assertThat(responseHeaders.get("Content-type")).isEqualTo("text/plain;charset=UTF-8");
        assertThat(responseHeaders.get("Content-length")).isEqualTo("1");
        assertThat(responseHeaders.get("Extra")).isNull();
    }

    @Test
    public void testWithoutAnyHeaderCaptureUsingSetHeader() throws Exception {
        // given
        container.getConfigService().setPluginProperty(PLUGIN_ID, "captureResponseHeaders",
                ImmutableList.<String>of());
        // when
        Trace trace = container.execute(SetStandardResponseHeadersUsingSetHeader.class, "Web");
        // then
        assertThat(getResponseHeaders(trace)).isNull();
    }

    @Test
    public void testWithoutAnyHeaderCaptureUsingAddHeader() throws Exception {
        // given
        container.getConfigService().setPluginProperty(PLUGIN_ID, "captureResponseHeaders",
                ImmutableList.<String>of());
        // when
        Trace trace = container.execute(SetStandardResponseHeadersUsingAddHeader.class, "Web");
        // then
        assertThat(getResponseHeaders(trace)).isNull();
    }

    @Test
    public void testLotsOfResponseHeaders() throws Exception {
        // given
        container.getConfigService().setPluginProperty(PLUGIN_ID, "captureResponseHeaders",
                ImmutableList.of("One", "Two", "Date-One", "Date-Two", "Int-One", "Int-Two",
                        "X-One"));

        // when
        Trace trace = container.execute(SetLotsOfResponseHeaders.class, "Web");

        // then
        Map<String, Object> responseHeaders = getResponseHeaders(trace);
        @SuppressWarnings("unchecked")
        List<String> one = (List<String>) responseHeaders.get("One");
        @SuppressWarnings("unchecked")
        List<String> iOne = (List<String>) responseHeaders.get("Int-one");
        assertThat(one).containsExactly("ab", "xy");
        assertThat(responseHeaders.get("Two")).isEqualTo("1");
        assertThat(responseHeaders.get("Three")).isNull();
        assertThat(responseHeaders.get("Date-three")).isNull();
        assertThat(iOne).containsExactly("2", "3");
        assertThat(responseHeaders.get("Int-two")).isEqualTo("4");
        assertThat(responseHeaders.get("Int-three")).isNull();
    }

    @Test
    public void testOutsideHttpServer() throws Exception {
        // given
        container.getConfigService().setPluginProperty(PLUGIN_ID, "captureResponseHeaders",
                ImmutableList.of("Content-Type", " Content-Length", " Content-Language"));
        // when
        container.executeNoExpectedTrace(SetStandardResponseHeadersOutsideHttpServer.class);
        // then
        // basically just testing that it should not generate any errors
    }

    @Test
    public void testDontMaskResponseHeaders() throws Exception {
        // given
        container.getConfigService().setPluginProperty(PLUGIN_ID, "captureResponseHeaders",
                ImmutableList.of("content*"));
        container.getConfigService().setPluginProperty(PLUGIN_ID, "maskRequestHeaders",
                ImmutableList.of("content-Len*"));

        // when
        Trace trace = container.execute(SetStandardResponseHeadersLowercase.class, "Web");

        // then
        Map<String, Object> responseHeaders = getResponseHeaders(trace);
        assertThat(responseHeaders.get("Content-type")).isEqualTo("text/plain;charset=UTF-8");
        assertThat(responseHeaders.get("Content-length")).isEqualTo("1");
        assertThat(responseHeaders.get("Extra")).isNull();
    }

    static Map<String, Object> getDetailMap(Trace trace, String name) {
        List<Trace.DetailEntry> details = trace.getHeader().getDetailEntryList();
        Trace.DetailEntry found = null;
        for (Trace.DetailEntry detail : details) {
            if (detail.getName().equals(name)) {
                found = detail;
                break;
            }
        }
        if (found == null) {
            return null;
        }
        Map<String, Object> responseHeaders = Maps.newLinkedHashMap();
        for (Trace.DetailEntry detail : found.getChildEntryList()) {
            List<Trace.DetailValue> values = detail.getValueList();
            if (values.size() == 1) {
                responseHeaders.put(detail.getName(), values.get(0).getString());
            } else {
                List<String> vals = Lists.newArrayList();
                for (Trace.DetailValue value : values) {
                    vals.add(value.getString());
                }
                responseHeaders.put(detail.getName(), vals);
            }
        }
        return responseHeaders;
    }

    private static Map<String, Object> getResponseHeaders(Trace trace) {
        return getDetailMap(trace, "Response headers");
    }

    public static class SetStandardResponseHeadersUsingSetHeader extends TestHandler {
        @Override
        public void handle(HttpExchange exchange) {
            exchange.getResponseHeaders().set("Content-Type", "text/plain;charset=UTF-8");
            exchange.getResponseHeaders().set("Content-Length", "1");
            exchange.getResponseHeaders().set("Extra", "abc");
            exchange.getResponseHeaders().set("Content-Language", Locale.ENGLISH.getLanguage());
        }
    }

    public static class SetStandardResponseHeadersUsingAddHeader extends TestHandler {
        @Override
        public void handle(HttpExchange exchange) {
            exchange.getResponseHeaders().add("Content-Type", "text/plain;charset=UTF-8");
            exchange.getResponseHeaders().add("Content-Length", "1");
            exchange.getResponseHeaders().add("Extra", "abc");
            exchange.getResponseHeaders().add("Content-Language", Locale.ENGLISH.getLanguage());
        }
    }

    public static class SetStandardResponseHeadersLowercase extends TestHandler {
        @Override
        public void handle(HttpExchange exchange) {
            exchange.getResponseHeaders().set("content-type", "text/plain;charset=UTF-8");
            exchange.getResponseHeaders().set("content-length", "1");
            exchange.getResponseHeaders().set("extra", "abc");
        }
    }

    public static class SetLotsOfResponseHeaders extends TestHandler {
        @Override
        public void handle(HttpExchange exchange) {
            exchange.getResponseHeaders().set("One", "abc");
            exchange.getResponseHeaders().set("one", "ab");
            exchange.getResponseHeaders().add("one", "xy");
            exchange.getResponseHeaders().set("Two", "1");
            exchange.getResponseHeaders().set("Three", "xyz");

            exchange.getResponseHeaders().set("Int-One", "1");
            exchange.getResponseHeaders().set("Int-one", "2");
            exchange.getResponseHeaders().add("Int-one", "3");
            exchange.getResponseHeaders().set("Int-Two", "4");
            exchange.getResponseHeaders().set("Int-Thr", "5");
            exchange.getResponseHeaders().add("Int-Four", "6");

            exchange.getResponseHeaders().add("X-One", "xy");
            exchange.getResponseHeaders().add("X-one", "6");
        }
    }

    public static class SetStandardResponseHeadersOutsideHttpServer implements AppUnderTest {
        @Override
        public void executeApp() throws Exception {
            MockHttpExchange exchange = new MockHttpExchange();
            exchange.getResponseHeaders().set("Content-Length", "1");
            exchange.getResponseHeaders().set("Content-Type", "text/plain");
            exchange.getResponseHeaders().set("Character-Encoding", "UTF-8");
            exchange.getResponseHeaders().set("Content-Language", Locale.ENGLISH.getLanguage());
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Classif. Fam. Usneac. 19 (1912)

#### Original name
Cornicularia divergens Ach.

### Remarks
null