text:
package com.intellij.ide.projectView.impl;

import com.intellij.openapi.application.ReadAction;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiManager;
import org.jetbrains.annotations.NonNls;

public class DirectoryUrl extends AbstractUrl {
  @NonNls private static final String ELEMENT_TYPE = "directory";

  public DirectoryUrl(String url, String moduleName) {
    super(url, moduleName, ELEMENT_TYPE);
  }
  public static DirectoryUrl create(PsiDirectory directory) {
    Project project = directory.getProject();
    final VirtualFile virtualFile = directory.getVirtualFile();
    final Module module = ModuleUtil.findModuleForFile(virtualFile, project);
    return new DirectoryUrl(virtualFile.getUrl(), module != null ? module.getName() : null);
  }

  @Override
  public Object[] createPath(final Project project) {
    if (moduleName != null) {
      final Module module =
        ReadAction.compute(() -> ModuleManager.getInstance(project).findModuleByName(moduleName));
      if (module == null) return null;
    }
    final VirtualFileManager virtualFileManager = VirtualFileManager.getInstance();
    final VirtualFile file = virtualFileManager.findFileByUrl(url);
    if (file == null) return null;
    final PsiDirectory directory =
      ReadAction.compute(() -> PsiManager.getInstance(project).findDirectory(file));
    if (directory == null) return null;
    return new Object[]{directory};
  }

  @Override
  protected AbstractUrl createUrl(String moduleName, String url) {
      return new DirectoryUrl(url, moduleName);
  }

  @Override
  public AbstractUrl createUrlByElement(Object element) {
    if (element instanceof PsiDirectory) {
      return create((PsiDirectory)element);
    }
    return null;
  }
}

redpajama_set_name: RedPajamaGithub


text:
//  ----------------------------------------------------------------------------------
//  Copyright Microsoft Corporation
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//  http://www.apache.org/licenses/LICENSE-2.0
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//  ----------------------------------------------------------------------------------

namespace DurableTask.Test.Orchestrations.Performance
{
    using System.Collections.Generic;
    using System.Threading.Tasks;
    using DurableTask.Core;

    public sealed class ExecutionCountingOrchestration : TaskOrchestration<int, int>
    {
        public override async Task<int> RunTask(OrchestrationContext context, int numberOfActivities)
        {
            List<Task<int>> results = new List<Task<int>>();
            for (int i = 0; i < numberOfActivities; i++)
            {
                results.Add(context.ScheduleTask<int>(typeof(ExecutionCountingActivity), i));
            }

            await Task.WhenAll(results);
            return ExecutionCountingActivity.Counter;
        }
    }
}


text:
Open protocol for receiving measured sensors data.
Russian version of this file [is here.](https://github.com/bzikst/J-SENS/blob/master/README.rus.md)

### Introduction

J-SENS — open application layer communication protocol, using [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) for data transfer. All data is in UTF-8 encoding, structured in [JSON](https://en.wikipedia.org/wiki/JSON) format. This protocol has a client-server architecture, commonly with one master device (acting as a client) sending commands to slave devices (servers), collecting measured sensors data. But there are no any restrictions on how many devices are involved into interaction. Data transfer is based on transactions, consisting of the request and response. Master device initiates a transaction by passing commands as requests, and the slave responds by telling status of the response and returning result of the command.

To identify the device in particular case of using protocol within one broadcast domain broadcast [UDP](https://en.wikipedia.org/wiki/User_Datagram_Protocol)-Packages are used. These packets are sent via port number initially known by all interacting devices. Thus, master devices can recognize ids of slave devices in active mode in the same network without presetting.

J-SENSE was originally developed using common protocols such as TCP, HTTP and JSON unified data format. This simplifies development tools selection procedure and, on the other hand, takes into account all best practices implemented in widely used protocols such as [MODBUS](https://en.wikipedia.org/wiki/Modbus), [PROFINET](https://en.wikipedia.org/wiki/PROFINET), [CANopen](https://es.wikipedia.org/wiki/CANopen), etc.

### Terms and definitions

##### Terms

Device — a controller with sensors, acts as server in a client-server architecture. This protocol does not specify sensor and controller interaction, and treats sensor as a device which transfer measurements in form, suitable to interpretation by a controller.

Client — master device, which requests data from slave devices, acts as client in a client-server architecture.

##### Definitions

[<a>] — an array of elements of single type, can be empty

{} — a set of named comma-separated elements

![Network scheme](https://github.com/bzikst/J-SENS/blob/master/network_scheme_eng.png)

### Description

Device application layer is implemented as web-server, accepting HTTP requests from clients. The device stores sensors metadata (obligatory information is sensor physical address and port) and contains at least one virtual counter sensor. Upon activating, the device broadcasts UDP packet with header in following format: `{CODENAME}_v{VERSION}_p{PORT}`, thus confirms being online.

##### Common device request format
```
{
	cmd: <command: string>,
	params: <parameters>
}
```

##### Common device response format

```
{
	status: {code: <response code (success or fail): строка>, message: <message: string>},
	<data>: <arbitrary data>
}
```

### Requests and responses

Device does support following requests:
- `get-status` — get device status, `params = {}`.
- `get-info` — get device info, `params = {}`.
- `update` — update device firmware, `params = {name, data}`, `data` — base64 encoded data.
- `start` — measurement preparation, `params = {count, delay, sensors: [addr1, addr2, …]}`, where `count` — sample count, `delay` — delay between samples in seconds, `addrN` — sensor address.
- `get-values` — get data from sensors, `params = {addrs: [addr1, addr2]}`, где `addrN` — sensor address.
- `set-ports-setting` — send port information, `params = [{addr: addr1, proccessingMethod: method1}, {addr: addr2, proccessingMethod: method2}, …]`

Device responses have following format:
```
get-status:
{
	status,
	data: {verification}
}

get-info:
{
	status,
	data: {verification, version, protocol}
}
```

`set-ports-setting` и `start` — возвращают только статус:
```
{status: …}
```

```
get-values:
{
	status: {code: "success", message: "OK"},
	data: {sensors: [addr1, addr2, …], values: [row1, row2, row3 …]}
}
```

where `addrN` — sensor address (assuming the data was requested from `k` sensors),
`rowN = [v1, v2, …, vk]` — data array (table row) with `k` elements. Element `vN` corresponds to data, taken from sensor with address `addrN`.

### Work scheme

1. Device is switched on.
2. Device is sending broadcast UDP-packet saying `{CODENAME}_v{VERSION}_p{PORT}` (with some time intervals).
3. Master device receiving packet.
4. In case of unknown device, master is sending `get-info` request.
5. In case of known device, master is sending `get-status` command.
6. Master device is updating slave devices information limited to once in 5 seconds.
8. Device information is removed If slave device is not responding to `get-info` request.
9. User wants to get N measurements with M seconds delay.
10. Particular slave device gets `start` command.
11. If `start` command is accepted, master device is starting to send `get-values` request in M seconds each till it gets N responses or error occurs.

All HTTP responses are required to be sent as fast as possible, not depending on possible measurement delays. Such empty responses are correct:
```
{
	status: {code: "success", message: "OK"},
	data : {sensors: [addr1, addr2], values: [[]]}
},
```

so are responses with data gathered earlier but not sended to master device:

```
{
	status: {code: "success", message: "OK"},
	data : {sensors: [addr1, addr2], values: [[1,61],[80,3]]}
}
```

Requests and responses strictly follow JSON specification. Thus, payload should be like: `{"cmd": "get-sensors"}`. All primitive values, including numbers in `get-values` response, should be sent as strings and be quoted.

### Acknowledgements

Developers of J-SENS protocol appreciate [Фонд содействия МП НТС](http://www.fasie.ru/) for its support .

### References

1. Modbus Organization. April 26, 2012. MODBUS APPLICATION PROTOCOL SPECIFICATION V1.1b3. Retrieved from: http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b3.pdf

2. R. Fielding, UC Irvine, J. Gettys et al. June 1999. Hypertext Transfer Protocol -- HTTP/1.1. Retrieved from: https://tools.ietf.org/html/rfc2616

3. T. Bray, Ed. Google, Inc. March 2014. The JavaScript Object Notation (JSON) Data Interchange Format. Retrieved from: https://tools.ietf.org/html/rfc7159

4. PI Organization. Specifications & Standards. Retrieved from: http://www.profibus.com/download/specifications-standards/

5.  CAN in Automation (CiA). CANopen protocols. Retrieved from: http://www.can-cia.org/index.php?id=systemdesign-canopen-protocol

6. Telecommunications Industry Association (TIA). 12/07/12. TIA-485-A ELECTRICAL CHARACTERISTICS OF GENERATORS AND RECEIVERS FOR USE IN BALANCED DIGITAL MULTIPOINT SYSTEMS. Retrieved from: https://global.ihs.com/search_res.cfm?input_doc_number=TIA-485-A&input_doc_title=&rid=TIA


text:
'use strict';

const common = require('../common');
const assert = require('assert');
const path = require('path');
const fs = require('fs');
const os = require('os');
const URL = require('url').URL;
const Buffer = require('buffer').Buffer;

function pathToFileURL(p) {
  if (!path.isAbsolute(p))
    throw new Error('Path must be absolute');
  if (common.isWindows && p.startsWith('\\\\'))
    p = p.slice(2);
  return new URL(`file://${p}`);
}

const p = path.resolve(common.fixturesDir, 'a.js');
const url = pathToFileURL(p);

assert(url instanceof URL);

// Check that we can pass in a URL object successfully
fs.readFile(url, common.mustCall((err, data) => {
  assert.ifError(err);
  assert(Buffer.isBuffer(data));
}));

// Check that using a non file:// URL reports an error
const httpUrl = new URL('http://example.org');
fs.readFile(httpUrl, common.mustCall((err) => {
  common.expectsError({
    code: 'ERR_INVALID_URL_SCHEME',
    type: TypeError,
    message: 'The URL must be of scheme file'
  })(err);
}));

// pct-encoded characters in the path will be decoded and checked
fs.readFile(new URL('file:///c:/tmp/%00test'), common.mustCall((err) => {
  assert(err);
  assert.strictEqual(err.message,
                     'Path must be a string without null bytes');
}));

if (common.isWindows) {
  // encoded back and forward slashes are not permitted on windows
  ['%2f', '%2F', '%5c', '%5C'].forEach((i) => {
    fs.readFile(new URL(`file:///c:/tmp/${i}`), common.mustCall((err) => {
      common.expectsError({
        code: 'ERR_INVALID_FILE_URL_PATH',
        type: TypeError,
        message: 'File URL path must not include encoded \\ or / characters'
      })(err);
    }));
  });
} else {
  // encoded forward slashes are not permitted on other platforms
  ['%2f', '%2F'].forEach((i) => {
    fs.readFile(new URL(`file:///c:/tmp/${i}`), common.mustCall((err) => {
      common.expectsError({
        code: 'ERR_INVALID_FILE_URL_PATH',
        type: TypeError,
        message: 'File URL path must not include encoded / characters'
      })(err);
    }));
  });

  fs.readFile(new URL('file://hostname/a/b/c'), common.mustCall((err) => {
    common.expectsError({
      code: 'ERR_INVALID_FILE_URL_HOST',
      type: TypeError,
      message: `File URL host must be "localhost" or empty on ${os.platform()}`
    })(err);
  }));
}


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
JacksonXmlRootElement (Jackson-XML-databind 0.6.1 API)
</TITLE>

<META NAME="date" CONTENT="2011-07-19">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: REQUIRED | OPTIONAL

DETAIL: ELEMENT

com.fasterxml.jackson.xml.annotate

Annotation Type JacksonXmlRootElement

@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface JacksonXmlRootElement

Annotation that can be used to define name of root element used
 for the root-level object when serialized, which normally uses
 name of the type (class). It is similar to JAXB XmlRootElement.

Optional Element Summary

 String
localName

 String
namespace

namespace

public abstract String namespace

Default:
""

localName

public abstract String localName

Default:
""

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: REQUIRED | OPTIONAL

DETAIL: ELEMENT

Copyright © 2011 fasterxml.com. All Rights Reserved.


text:
namespace ash {

enum class ShutdownReason;

// Handles actual device shutdown by making requests to powerd over D-Bus.
// Caches the DeviceRebootOnShutdown device policy sent from Chrome.
class ASH_EXPORT ShutdownControllerImpl : public ShutdownController {
 public:
  class Observer {
   public:
    virtual ~Observer() {}

    // Called when shutdown policy changes.
    virtual void OnShutdownPolicyChanged(bool reboot_on_shutdown) = 0;
  };

  ShutdownControllerImpl();

  ShutdownControllerImpl(const ShutdownControllerImpl&) = delete;
  ShutdownControllerImpl& operator=(const ShutdownControllerImpl&) = delete;

  ~ShutdownControllerImpl() override;

  void AddObserver(Observer* observer);
  void RemoveObserver(Observer* observer);

  bool reboot_on_shutdown() const { return reboot_on_shutdown_; }

  // ShutdownController:
  void SetRebootOnShutdown(bool reboot_on_shutdown) override;
  void ShutDownOrReboot(ShutdownReason reason) override;

 private:
  // Cached copy of the DeviceRebootOnShutdown policy from chrome.
  bool reboot_on_shutdown_ = false;

  base::ObserverList<Observer>::Unchecked observers_;
};

}  // namespace ash

#endif  // ASH_SHUTDOWN_CONTROLLER_IMPL_H_


text:
import { Meteor } from 'meteor/meteor';

import { LivechatOfficeHour } from '../../../models';

Meteor.methods({
	'livechat:saveOfficeHours'(day, start, finish, open) {
		LivechatOfficeHour.updateHours(day, start, finish, open);
	},
});


text:
'''
  * Problem005.py
  *
  * Project Euler: Problem 5
  *
  * Problem: Find the smallest positive number that is
  * evenly divisible by all of the numbers from 1 to 20.
  *
'''

import time
start_time = time.time()

def is_divisible_to(number, max):
    for i in xrange(max,1,-1):
        if number % i != 0:
            return False
    return True

def divisible_to(n):
    if n < 1:
        return False
    elif n == 1:
        return 1
    else:
        step = divisible_to(n-1)
        current_attempt = 0
        complete = False
        while not complete:
            current_attempt += step
            complete = is_divisible_to(current_attempt,n)
        return current_attempt

print divisible_to(20)

print("--- %s seconds ---" % (time.time() - start_time))


text:
#include "third_party/blink/renderer/core/execution_context/execution_context.h"

#include "base/metrics/histogram_functions.h"
#include "build/build_config.h"
#include "third_party/blink/public/common/permissions_policy/document_policy_features.h"
#include "third_party/blink/public/mojom/devtools/inspector_issue.mojom-blink-forward.h"
#include "third_party/blink/public/mojom/frame/lifecycle.mojom-blink.h"
#include "third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom-blink.h"
#include "third_party/blink/public/mojom/permissions_policy/policy_disposition.mojom-blink.h"
#include "third_party/blink/public/mojom/permissions_policy/policy_value.mojom-blink.h"
#include "third_party/blink/public/mojom/v8_cache_options.mojom-blink.h"
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/core/dom/events/event_target.h"
#include "third_party/blink/renderer/core/events/error_event.h"
#include "third_party/blink/renderer/core/execution_context/agent.h"
#include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_state_observer.h"
#include "third_party/blink/renderer/core/fileapi/public_url_manager.h"
#include "third_party/blink/renderer/core/frame/csp/execution_context_csp_delegate.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/inspector/inspector_audits_issue.h"
#include "third_party/blink/renderer/core/loader/document_loader.h"
#include "third_party/blink/renderer/core/origin_trials/origin_trial_context.h"
#include "third_party/blink/renderer/core/workers/worker_global_scope.h"
#include "third_party/blink/renderer/core/workers/worklet_global_scope.h"
#include "third_party/blink/renderer/platform/bindings/dom_wrapper_world.h"
#include "third_party/blink/renderer/platform/bindings/source_location.h"
#include "third_party/blink/renderer/platform/context_lifecycle_notifier.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/loader/fetch/code_cache_host.h"
#include "third_party/blink/renderer/platform/loader/fetch/memory_cache.h"
#include "third_party/blink/renderer/platform/scheduler/public/event_loop.h"
#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h"
#include "third_party/blink/renderer/platform/weborigin/security_policy.h"

namespace blink {

ExecutionContext::ExecutionContext(v8::Isolate* isolate, Agent* agent)
    : isolate_(isolate),
      security_context_(this),
      agent_(agent),
      circular_sequential_id_(0),
      in_dispatch_error_event_(false),
      lifecycle_state_(mojom::FrameLifecycleState::kRunning),
      is_context_destroyed_(false),
      csp_delegate_(MakeGarbageCollected<ExecutionContextCSPDelegate>(*this)),
      window_interaction_tokens_(0),
      origin_trial_context_(MakeGarbageCollected<OriginTrialContext>(this)) {
  DCHECK(agent_);
}

ExecutionContext::~ExecutionContext() {
  DCHECK(is_context_destroyed_);
}

// static
ExecutionContext* ExecutionContext::From(const ScriptState* script_state) {
  v8::HandleScope scope(script_state->GetIsolate());
  return ToExecutionContext(script_state->GetContext());
}

// static
ExecutionContext* ExecutionContext::From(v8::Local<v8::Context> context) {
  return ToExecutionContext(context);
}

// static
ExecutionContext* ExecutionContext::ForCurrentRealm(
    const v8::FunctionCallbackInfo<v8::Value>& info) {
  return ToExecutionContext(info.GetIsolate()->GetCurrentContext());
}

// static
ExecutionContext* ExecutionContext::ForCurrentRealm(
    const v8::PropertyCallbackInfo<v8::Value>& info) {
  auto ctx = info.GetIsolate()->GetCurrentContext();
  if (ctx.IsEmpty())
    return nullptr;
  return ToExecutionContext(ctx);
}

// static
ExecutionContext* ExecutionContext::ForRelevantRealm(
    const v8::FunctionCallbackInfo<v8::Value>& info) {
  v8::Local<v8::Context> context;
  if (!info.Holder()->GetCreationContext().ToLocal(&context))
    return nullptr;
  return ToExecutionContext(context);
}

// static
ExecutionContext* ExecutionContext::ForRelevantRealm(
    const v8::PropertyCallbackInfo<v8::Value>& info) {
  v8::Local<v8::Context> context;
  if (!info.Holder()->GetCreationContext().ToLocal(&context))
    return nullptr;
  return ToExecutionContext(context);
}

// static
CodeCacheHost* ExecutionContext::GetCodeCacheHostFromContext(
    ExecutionContext* execution_context) {
  DCHECK_NE(execution_context, nullptr);
  if (execution_context->IsWindow()) {
    auto* window = To<LocalDOMWindow>(execution_context);
    if (!window->GetFrame() ||
        !window->GetFrame()->Loader().GetDocumentLoader()) {
      return nullptr;
    }
    return window->GetFrame()->Loader().GetDocumentLoader()->GetCodeCacheHost();
  }

  if (execution_context->IsWorkerGlobalScope()) {
    auto* global_scope =
        DynamicTo<WorkerOrWorkletGlobalScope>(execution_context);
    return global_scope->GetCodeCacheHost();
  }

  DCHECK(execution_context->IsWorkletGlobalScope());
  return nullptr;
}

void ExecutionContext::SetIsInBackForwardCache(bool value) {
  is_in_back_forward_cache_ = value;
}

void ExecutionContext::SetLifecycleState(mojom::FrameLifecycleState state) {
  if (lifecycle_state_ == state)
    return;
  lifecycle_state_ = state;
  ContextLifecycleNotifier::observers().ForEachObserver(
      [&](ContextLifecycleObserver* observer) {
        if (!observer->IsExecutionContextLifecycleObserver())
          return;
        ExecutionContextLifecycleObserver* execution_context_observer =
            static_cast<ExecutionContextLifecycleObserver*>(observer);
        if (execution_context_observer->ObserverType() !=
            ExecutionContextLifecycleObserver::kStateObjectType)
          return;
        ExecutionContextLifecycleStateObserver* state_observer =
            static_cast<ExecutionContextLifecycleStateObserver*>(
                execution_context_observer);
#if DCHECK_IS_ON()
        DCHECK_EQ(state_observer->GetExecutionContext(), this);
        DCHECK(state_observer->UpdateStateIfNeededCalled());
#endif
        state_observer->ContextLifecycleStateChanged(state);
      });
}

void ExecutionContext::NotifyContextDestroyed() {
  is_context_destroyed_ = true;
  ContextLifecycleNotifier::NotifyContextDestroyed();
}

void ExecutionContext::CountDeprecation(WebFeature feature) {
  Deprecation::CountDeprecation(this, feature);
}

HeapObserverSet<ContextLifecycleObserver>&
ExecutionContext::ContextLifecycleObserverSet() {
  return ContextLifecycleNotifier::observers();
}

unsigned ExecutionContext::ContextLifecycleStateObserverCountForTesting()
    const {
  DCHECK(!ContextLifecycleNotifier::observers().IsIteratingOverObservers());
  unsigned lifecycle_state_observers = 0;
  ContextLifecycleNotifier::observers().ForEachObserver(
      [&](ContextLifecycleObserver* observer) {
        if (!observer->IsExecutionContextLifecycleObserver())
          return;
        if (static_cast<ExecutionContextLifecycleObserver*>(observer)
                ->ObserverType() !=
            ExecutionContextLifecycleObserver::kStateObjectType)
          return;
        lifecycle_state_observers++;
      });
  return lifecycle_state_observers;
}

bool ExecutionContext::SharedArrayBufferTransferAllowed() const {
  // Enable transfer if cross-origin isolated, or if the feature is enabled.
  if (CrossOriginIsolatedCapability() ||
      RuntimeEnabledFeatures::SharedArrayBufferEnabled()) {
    return true;
  }

  // TODO(crbug.com/1184892): Remove once fixed.
  if (SchemeRegistry::ShouldTreatURLSchemeAsAllowingSharedArrayBuffers(
          GetSecurityOrigin()->Protocol())) {
    return true;
  }

  // Check if the SharedArrayBuffer is always allowed for this origin. For
  // worklets use the origin of the main document (consistent with how origin is
  // verified in origin trials).
  const SecurityOrigin* origin;
  if (auto* worklet_scope = DynamicTo<WorkletGlobalScope>(this))
    origin = worklet_scope->DocumentSecurityOrigin();
  else
    origin = GetSecurityOrigin();
  if (SecurityPolicy::IsSharedArrayBufferAlwaysAllowedForOrigin(origin))
    return true;

#if BUILDFLAG(IS_ANDROID)
  return false;
#else
  // On desktop, enable transfer for the reverse Origin Trial, or if the
  // Finch "kill switch" is on, or if enabled by Enterprise Policy.
  return RuntimeEnabledFeatures::UnrestrictedSharedArrayBufferEnabled(this) ||
         RuntimeEnabledFeatures::SharedArrayBufferOnDesktopEnabled() ||
         RuntimeEnabledFeatures::
             SharedArrayBufferUnrestrictedAccessAllowedEnabled();
#endif
}

bool ExecutionContext::CheckSharedArrayBufferTransferAllowedAndReport() {
  const bool allowed = SharedArrayBufferTransferAllowed();
  // File an issue if the transfer is prohibited, or if it will be prohibited
  // in the future, and the problem is encountered for the first time in this
  // execution context. This preserves postMessage performance during the
  // transition period.
  if (!allowed ||
      (!has_filed_shared_array_buffer_transfer_issue_ &&
       !CrossOriginIsolatedCapability() &&
       !SchemeRegistry::ShouldTreatURLSchemeAsAllowingSharedArrayBuffers(
           GetSecurityOrigin()->Protocol()))) {
    has_filed_shared_array_buffer_transfer_issue_ = true;
    AuditsIssue::ReportSharedArrayBufferIssue(
        this, allowed, SharedArrayBufferIssueType::kTransferIssue);
  }
  return allowed;
}

void ExecutionContext::FileSharedArrayBufferCreationIssue() {
  // This is performance critical, only do it once per context.
  if (has_filed_shared_array_buffer_creation_issue_)
    return;
  has_filed_shared_array_buffer_creation_issue_ = true;
  // In enforced mode, the SAB constructor isn't available.
  AuditsIssue::ReportSharedArrayBufferIssue(
      this, true, SharedArrayBufferIssueType::kCreationIssue);
}

void ExecutionContext::ReportNavigatorUserAgentAccess() {
  if (has_filed_navigator_user_agent_issue_)
    return;
  has_filed_navigator_user_agent_issue_ = true;
  AuditsIssue::ReportNavigatorUserAgentAccess(this, Url().GetString());
  base::UmaHistogramBoolean(
      "Blink.Navigator.ReducedUserAgent",
      RuntimeEnabledFeatures::UserAgentReductionEnabled(this));
}

void ExecutionContext::AddConsoleMessageImpl(
    mojom::blink::ConsoleMessageSource source,
    mojom::blink::ConsoleMessageLevel level,
    const String& message,
    bool discard_duplicates,
    absl::optional<mojom::ConsoleMessageCategory> category) {
  auto* console_message =
      MakeGarbageCollected<ConsoleMessage>(source, level, message);
  if (category)
    console_message->SetCategory(*category);
  AddConsoleMessage(console_message, discard_duplicates);
}

void ExecutionContext::DispatchErrorEvent(
    ErrorEvent* error_event,
    SanitizeScriptErrors sanitize_script_errors) {
  if (in_dispatch_error_event_) {
    pending_exceptions_.push_back(error_event);
    return;
  }

  // First report the original exception and only then all the nested ones.
  if (!DispatchErrorEventInternal(error_event, sanitize_script_errors))
    ExceptionThrown(error_event);

  if (pending_exceptions_.IsEmpty())
    return;
  for (ErrorEvent* e : pending_exceptions_)
    ExceptionThrown(e);
  pending_exceptions_.clear();
}

bool ExecutionContext::DispatchErrorEventInternal(
    ErrorEvent* error_event,
    SanitizeScriptErrors sanitize_script_errors) {
  EventTarget* target = ErrorEventTarget();
  if (!target)
    return false;

  if (sanitize_script_errors == SanitizeScriptErrors::kSanitize) {
    error_event = ErrorEvent::CreateSanitizedError(
        ToScriptState(this, *error_event->World()));
  }

  DCHECK(!in_dispatch_error_event_);
  in_dispatch_error_event_ = true;
  target->DispatchEvent(*error_event);
  in_dispatch_error_event_ = false;
  return error_event->defaultPrevented();
}

bool ExecutionContext::IsContextPaused() const {
  return lifecycle_state_ == mojom::blink::FrameLifecycleState::kPaused;
}

LoaderFreezeMode ExecutionContext::GetLoaderFreezeMode() const {
  if (is_in_back_forward_cache_) {
    DCHECK_EQ(lifecycle_state_, mojom::blink::FrameLifecycleState::kFrozen);
    return LoaderFreezeMode::kBufferIncoming;
  } else if (lifecycle_state_ == mojom::blink::FrameLifecycleState::kFrozen ||
             lifecycle_state_ == mojom::blink::FrameLifecycleState::kPaused) {
    return LoaderFreezeMode::kStrict;
  }
  return LoaderFreezeMode::kNone;
}

bool ExecutionContext::IsLoadDeferred() const {
  return lifecycle_state_ == mojom::blink::FrameLifecycleState::kPaused ||
         lifecycle_state_ == mojom::blink::FrameLifecycleState::kFrozen;
}

int ExecutionContext::CircularSequentialID() {
  ++circular_sequential_id_;
  if (circular_sequential_id_ > ((1U << 31) - 1U))
    circular_sequential_id_ = 1;

  return circular_sequential_id_;
}

PublicURLManager& ExecutionContext::GetPublicURLManager() {
  if (!public_url_manager_)
    public_url_manager_ = MakeGarbageCollected<PublicURLManager>(this);
  return *public_url_manager_;
}

ContentSecurityPolicyDelegate&
ExecutionContext::GetContentSecurityPolicyDelegate() {
  return *csp_delegate_;
}

scoped_refptr<const DOMWrapperWorld> ExecutionContext::GetCurrentWorld() const {
  v8::Isolate* isolate = GetIsolate();
  v8::HandleScope handle_scope(isolate);
  v8::Local<v8::Context> v8_context = isolate->GetCurrentContext();

  // This can be called before we enter v8, hence the context might be empty.
  if (v8_context.IsEmpty())
    return nullptr;

  return &DOMWrapperWorld::Current(isolate);
}

ContentSecurityPolicy*
ExecutionContext::GetContentSecurityPolicyForCurrentWorld() {
  return GetContentSecurityPolicyForWorld(GetCurrentWorld().get());
}

ContentSecurityPolicy* ExecutionContext::GetContentSecurityPolicyForWorld(
    const DOMWrapperWorld* world) {
  // Only documents support isolated worlds and only isolated worlds can have
  // their own CSP distinct from the main world CSP. Hence just return the main
  // world's content security policy by default.
  return GetContentSecurityPolicy();
}

const SecurityOrigin* ExecutionContext::GetSecurityOrigin() const {
  return security_context_.GetSecurityOrigin();
}

SecurityOrigin* ExecutionContext::GetMutableSecurityOrigin() {
  return security_context_.GetMutableSecurityOrigin();
}

ContentSecurityPolicy* ExecutionContext::GetContentSecurityPolicy() const {
  return content_security_policy_.Get();
}

void ExecutionContext::SetContentSecurityPolicy(
    ContentSecurityPolicy* content_security_policy) {
  content_security_policy_ = content_security_policy;
}

void ExecutionContext::SetRequireTrustedTypes() {
  DCHECK(require_safe_types_ ||
         content_security_policy_->IsRequireTrustedTypes());
  require_safe_types_ = true;
}

void ExecutionContext::SetRequireTrustedTypesForTesting() {
  require_safe_types_ = true;
}

network::mojom::blink::WebSandboxFlags ExecutionContext::GetSandboxFlags()
    const {
  return security_context_.GetSandboxFlags();
}

bool ExecutionContext::IsSandboxed(
    network::mojom::blink::WebSandboxFlags mask) const {
  return security_context_.IsSandboxed(mask);
}

const base::UnguessableToken& ExecutionContext::GetAgentClusterID() const {
  return GetAgent()->cluster_id();
}

void ExecutionContext::AllowWindowInteraction() {
  ++window_interaction_tokens_;
}

void ExecutionContext::ConsumeWindowInteraction() {
  if (window_interaction_tokens_ == 0)
    return;
  --window_interaction_tokens_;
}

bool ExecutionContext::IsWindowInteractionAllowed() const {
  return window_interaction_tokens_ > 0;
}

bool ExecutionContext::IsSecureContext(String& error_message) const {
  if (!IsSecureContext()) {
    error_message = SecurityOrigin::IsPotentiallyTrustworthyErrorMessage();
    return false;
  }
  return true;
}

// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
String ExecutionContext::OutgoingReferrer() const {
  // Step 3.1: "If environment's global object is a Window object, then"
  // This case is implemented in Document::OutgoingReferrer().

  // Step 3.2: "Otherwise, let referrerSource be environment's creation URL."
  return Url().StrippedForUseAsReferrer();
}

void ExecutionContext::ParseAndSetReferrerPolicy(
    const String& policy,
    const ReferrerPolicySource source) {
  network::mojom::ReferrerPolicy referrer_policy;
  bool policy_is_valid = false;

  if (source == kPolicySourceHttpHeader) {
    policy_is_valid = SecurityPolicy::ReferrerPolicyFromHeaderValue(
        policy, kDoNotSupportReferrerPolicyLegacyKeywords, &referrer_policy);
  } else if (source == kPolicySourceMetaTag) {
    policy_is_valid = (SecurityPolicy::ReferrerPolicyFromString(
        policy, kSupportReferrerPolicyLegacyKeywords, &referrer_policy));
  } else {
    NOTREACHED();
    return;
  }

  if (policy_is_valid) {
    SetReferrerPolicy(referrer_policy);
  } else {
    String error_reason;
    if (source == kPolicySourceMetaTag && policy.Contains(',')) {
      // Only a single token is permitted for Meta-specified policies
      // (https://crbug.com/1093914).
      error_reason =
          "A policy specified by a meta element must contain only one token.";
    } else {
      error_reason =
          "The value '" + policy + "' is not one of " +
          ((source == kPolicySourceMetaTag)
               ? "'always', 'default', 'never', 'origin-when-crossorigin', "
               : "") +
          "'no-referrer', 'no-referrer-when-downgrade', 'origin', "
          "'origin-when-cross-origin', 'same-origin', 'strict-origin', "
          "'strict-origin-when-cross-origin', or 'unsafe-url'.";
    }

    AddConsoleMessage(MakeGarbageCollected<ConsoleMessage>(
        mojom::ConsoleMessageSource::kRendering,
        mojom::ConsoleMessageLevel::kError,
        "Failed to set referrer policy: " + error_reason +
            " The referrer policy has been left unchanged."));
  }
}

network::mojom::ReferrerPolicy ExecutionContext::GetReferrerPolicy() const {
  return policy_container_->GetReferrerPolicy();
}

void ExecutionContext::SetReferrerPolicy(
    network::mojom::ReferrerPolicy referrer_policy) {
  // When a referrer policy has already been set, the latest value takes
  // precedence.
  UseCounter::Count(this, WebFeature::kSetReferrerPolicy);
  if (GetReferrerPolicy() != network::mojom::ReferrerPolicy::kDefault)
    UseCounter::Count(this, WebFeature::kResetReferrerPolicy);

  policy_container_->UpdateReferrerPolicy(referrer_policy);
}

void ExecutionContext::SetPolicyContainer(
    std::unique_ptr<PolicyContainer> container) {
  policy_container_ = std::move(container);
  security_context_.SetSandboxFlags(
      policy_container_->GetPolicies().sandbox_flags);
}

std::unique_ptr<PolicyContainer> ExecutionContext::TakePolicyContainer() {
  return std::move(policy_container_);
}

void ExecutionContext::RemoveURLFromMemoryCache(const KURL& url) {
  GetMemoryCache()->RemoveURLFromCache(url);
}

void ExecutionContext::Trace(Visitor* visitor) const {
  visitor->Trace(security_context_);
  visitor->Trace(agent_);
  visitor->Trace(public_url_manager_);
  visitor->Trace(pending_exceptions_);
  visitor->Trace(csp_delegate_);
  visitor->Trace(timers_);
  visitor->Trace(origin_trial_context_);
  visitor->Trace(content_security_policy_);
  MojoBindingContext::Trace(visitor);
  ConsoleLogger::Trace(visitor);
  Supplementable<ExecutionContext>::Trace(visitor);
}

bool ExecutionContext::IsSameAgentCluster(
    const base::UnguessableToken& other_id) const {
  base::UnguessableToken this_id = GetAgentClusterID();
  // If the AgentClusterID is empty then it should never be the same (e.g.
  // NullExecutionContext).
  if (this_id.is_empty() || other_id.is_empty())
    return false;
  return this_id == other_id;
}

mojom::blink::V8CacheOptions ExecutionContext::GetV8CacheOptions() const {
  return mojom::blink::V8CacheOptions::kDefault;
}

v8::MicrotaskQueue* ExecutionContext::GetMicrotaskQueue() const {
  DCHECK(GetAgent());
  DCHECK(GetAgent()->event_loop());
  return GetAgent()->event_loop()->microtask_queue();
}

bool ExecutionContext::FeatureEnabled(OriginTrialFeature feature) const {
  return origin_trial_context_->IsFeatureEnabled(feature);
}

bool ExecutionContext::IsFeatureEnabled(
    mojom::blink::PermissionsPolicyFeature feature,
    ReportOptions report_option,
    const String& message) {
  bool should_report;
  bool enabled = security_context_.IsFeatureEnabled(feature, &should_report);

  if (should_report && report_option == ReportOptions::kReportOnFailure) {
    mojom::blink::PolicyDisposition disposition =
        enabled ? mojom::blink::PolicyDisposition::kReport
                : mojom::blink::PolicyDisposition::kEnforce;

    ReportPermissionsPolicyViolation(feature, disposition, message);
  }
  return enabled;
}

bool ExecutionContext::IsFeatureEnabled(
    mojom::blink::PermissionsPolicyFeature feature) const {
  bool should_report;
  return security_context_.IsFeatureEnabled(feature, &should_report);
}

bool ExecutionContext::IsFeatureEnabled(
    mojom::blink::DocumentPolicyFeature feature) const {
  DCHECK(GetDocumentPolicyFeatureInfoMap().at(feature).default_value.Type() ==
         mojom::blink::PolicyValueType::kBool);
  return IsFeatureEnabled(feature, PolicyValue::CreateBool(true));
}

bool ExecutionContext::IsFeatureEnabled(
    mojom::blink::DocumentPolicyFeature feature,
    PolicyValue threshold_value) const {
  // The default value for any feature should be true unless restricted by
  // document policy
  if (!RuntimeEnabledFeatures::DocumentPolicyEnabled())
    return true;
  return security_context_.IsFeatureEnabled(feature, threshold_value).enabled;
}

bool ExecutionContext::IsFeatureEnabled(
    mojom::blink::DocumentPolicyFeature feature,
    ReportOptions report_option,
    const String& message,
    const String& source_file) {
  DCHECK(GetDocumentPolicyFeatureInfoMap().at(feature).default_value.Type() ==
         mojom::blink::PolicyValueType::kBool);
  return IsFeatureEnabled(feature, PolicyValue::CreateBool(true), report_option,
                          message, source_file);
}

bool ExecutionContext::IsFeatureEnabled(
    mojom::blink::DocumentPolicyFeature feature,
    PolicyValue threshold_value,
    ReportOptions report_option,
    const String& message,
    const String& source_file) {
  // The default value for any feature should be true unless restricted by
  // document policy
  if (!RuntimeEnabledFeatures::DocumentPolicyEnabled())
    return true;

  SecurityContext::FeatureStatus status =
      security_context_.IsFeatureEnabled(feature, threshold_value);
  if (status.should_report &&
      report_option == ReportOptions::kReportOnFailure) {
    // If both |enabled| and |should_report| are true, the usage must have
    // violated the report-only policy, i.e. |disposition| ==
    // mojom::blink::PolicyDisposition::kReport.
    ReportDocumentPolicyViolation(
        feature,
        status.enabled ? mojom::blink::PolicyDisposition::kReport
                       : mojom::blink::PolicyDisposition::kEnforce,
        message, source_file);
  }
  return status.enabled;
}

bool ExecutionContext::RequireTrustedTypes() const {
  return require_safe_types_;
}

}  // namespace blink


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jdbc="http://www.springframework.org/schema/jdbc"
       xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
">

    <!-- REDEFINE DATA SOURCES FOR TESTS OF ENGINE -->

	<!-- special bean for unit tests to run, since we don't have dispatcher to create tasks in shared db for us -->
	<bean id="taskDaoCore" class="cz.metacentrum.perun.taskslib.dao.jdbc.TaskDaoJdbc">
		<property name="dataSource" ref="dataSource"/>
	</bean>

	<!-- Transaction manager for Spring JDBC -->
	<bean id="transactionManagerPerunEngineLocal" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
		<property name="dataSource" ref="dataSourceLocal"/>
	</bean>

	<beans profile="default">

		<!-- redefine data source of perun-core since we want only empty DB
		<jdbc:embedded-database id="dataSource" type="HSQL">
			<jdbc:script location="classpath:schema.sql"/>
		</jdbc:embedded-database>
		 -->

		<!-- We want local DB also to run in memory, not in a file as engine does normally -->
		<jdbc:embedded-database id="dataSourceLocal" type="HSQL">
			<jdbc:script location="classpath:schema-local.sql"/>
		</jdbc:embedded-database>

	</beans>

	<beans profile="devel,production">

		<!-- We want local DB also to run in memory, not in a file as engine does normally -->
		<jdbc:embedded-database id="dataSourceLocal" type="HSQL">
			<jdbc:script location="classpath:schema-local.sql"/>
		</jdbc:embedded-database>

	</beans>

</beans>


text:
<?php
/**
 * Mail Helper
 *
 * UserApplePie
 * @author David (DaVaR) Sargent <davar@userapplepie.com>
 * @version 4.3.0
 */

namespace Libs\PhpMailer;

/**
 * Custom class for PHPMailer to uniform sending emails.
 */
class Mail extends PhpMailer
{
    /**
     * From
     *
     * @var string $From set sender email
     */
    public $From     = EMAIL_USERNAME;

    /**
     * FromName
     *
     * @var string $FromName set sender name
     */
    public $FromName = EMAIL_FROM_NAME;

    /**
     * Host
     *
     * @var string $Host set sender SMTP Route
     */
    public $Host     = EMAIL_HOST;

    /**
     * Mailer
     *
     * @var string $Mailer set type default is SMTP
     */
    public $Mailer   = 'smtp';

    /**
     * SMTPAuth
     *
     * @var string $SMTPAuth use authenticated
     */
    public $SMTPAuth = true;

    /**
     * Username
     *
     * @var string $Username set username
     */
    public $Username = EMAIL_USERNAME;

    /**
     * Password
     *
     * @var string $Password set password
     */
    public $Password = EMAIL_PASSWORD;

    /**
     * SMTPSecure
     *
     * @var string $SMTPSecure set Secure SMTP
     */
    public $SMTPSecure = EMAIL_STMP_SECURE;

    /**
     * The default SMTP server port.
     * @type int
     */
    public $Port = EMAIL_PORT;

    /**
     * WordWrap
     * @var integer $WordWrap set word wrap
     */
    public $WordWrap = 75;

    /**
     * Subject
     *
     * @param  string $subject The subject of the email
     */
    public function subject($subject)
    {
        $this->Subject = $subject;
    }

    /**
     * Body
     *
     * @param  string $body The content of the email
     */
    public function body($body)
    {
        $this->Body = $body;
    }

    /**
     * Send
     *
     * @return none - sends the email.
     */
    public function send()
    {
        $this->AltBody = strip_tags(stripslashes($this->Body))."\n\n";
        $this->AltBody = str_replace(" ", "\n\n", $this->AltBody);
        return parent::send();
    }

    /**
     * Clean Message.
     * Remove email specific characters from a given string
     *
     * @param string. Email body.
     * @return string.
     */
    public function cleanMessage($string)
    {
        $bad = array("content-type","bcc:","to:","cc:","href");
        return str_replace($bad, "", $string);
    }
}


text:
/*!
 * Author : Matteo Bruni
 * MIT license: https://opensource.org/licenses/MIT
 * Demo / Generator : https://particles.js.org/
 * GitHub : https://www.github.com/matteobruni/tsparticles
 * How to use? : Check the GitHub README
 * v2.5.2
 */
(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("tsparticles-engine"));
	else if(typeof define === 'function' && define.amd)
		define(["tsparticles-engine"], factory);
	else {
		var a = typeof exports === 'object' ? factory(require("tsparticles-engine")) : factory(root["window"]);
		for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
	}
})(this, (__WEBPACK_EXTERNAL_MODULE__961__) => {
return /******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ 961:
/***/ ((module) => {

module.exports = __WEBPACK_EXTERNAL_MODULE__961__;

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/************************************************************************/
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Attract": () => (/* reexport */ Attract),
  "loadExternalAttractInteraction": () => (/* binding */ loadExternalAttractInteraction)
});

// EXTERNAL MODULE: external {"commonjs":"tsparticles-engine","commonjs2":"tsparticles-engine","amd":"tsparticles-engine","root":"window"}
var external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_ = __webpack_require__(961);
;// CONCATENATED MODULE: ./dist/browser/Options/Classes/Attract.js
class Attract {
  constructor() {
    this.distance = 200;
    this.duration = 0.4;
    this.easing = "ease-out-quad";
    this.factor = 1;
    this.maxSpeed = 50;
    this.speed = 1;
  }
  load(data) {
    if (!data) {
      return;
    }
    if (data.distance !== undefined) {
      this.distance = data.distance;
    }
    if (data.duration !== undefined) {
      this.duration = data.duration;
    }
    if (data.easing !== undefined) {
      this.easing = data.easing;
    }
    if (data.factor !== undefined) {
      this.factor = data.factor;
    }
    if (data.maxSpeed !== undefined) {
      this.maxSpeed = data.maxSpeed;
    }
    if (data.speed !== undefined) {
      this.speed = data.speed;
    }
  }
}
;// CONCATENATED MODULE: ./dist/browser/Attractor.js

class Attractor extends external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.ExternalInteractorBase {
  constructor(engine, container) {
    super(container);
    this._engine = engine;
    if (!container.attract) {
      container.attract = {
        particles: []
      };
    }
    this.handleClickMode = mode => {
      const options = this.container.actualOptions,
        attract = options.interactivity.modes.attract;
      if (!attract || mode !== "attract") {
        return;
      }
      if (!container.attract) {
        container.attract = {
          particles: []
        };
      }
      container.attract.clicking = true;
      container.attract.count = 0;
      for (const particle of container.attract.particles) {
        if (!this.isEnabled(particle)) {
          continue;
        }
        particle.velocity.setTo(particle.initialVelocity);
      }
      container.attract.particles = [];
      container.attract.finish = false;
      setTimeout(() => {
        if (!container.destroyed) {
          if (!container.attract) {
            container.attract = {
              particles: []
            };
          }
          container.attract.clicking = false;
        }
      }, attract.duration * 1000);
    };
  }
  clear() {}
  init() {
    const container = this.container,
      attract = container.actualOptions.interactivity.modes.attract;
    if (!attract) {
      return;
    }
    container.retina.attractModeDistance = attract.distance * container.retina.pixelRatio;
  }
  async interact() {
    const container = this.container,
      options = container.actualOptions,
      mouseMoveStatus = container.interactivity.status === external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.mouseMoveEvent,
      events = options.interactivity.events,
      hoverEnabled = events.onHover.enable,
      hoverMode = events.onHover.mode,
      clickEnabled = events.onClick.enable,
      clickMode = events.onClick.mode;
    if (mouseMoveStatus && hoverEnabled && (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.isInArray)("attract", hoverMode)) {
      this.hoverAttract();
    } else if (clickEnabled && (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.isInArray)("attract", clickMode)) {
      this.clickAttract();
    }
  }
  isEnabled(particle) {
    var _a;
    const container = this.container,
      options = container.actualOptions,
      mouse = container.interactivity.mouse,
      events = ((_a = particle === null || particle === void 0 ? void 0 : particle.interactivity) !== null && _a !== void 0 ? _a : options.interactivity).events;
    if ((!mouse.position || !events.onHover.enable) && (!mouse.clickPosition || !events.onClick.enable)) {
      return false;
    }
    const hoverMode = events.onHover.mode,
      clickMode = events.onClick.mode;
    return (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.isInArray)("attract", hoverMode) || (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.isInArray)("attract", clickMode);
  }
  loadModeOptions(options, ...sources) {
    if (!options.attract) {
      options.attract = new Attract();
    }
    for (const source of sources) {
      options.attract.load(source === null || source === void 0 ? void 0 : source.attract);
    }
  }
  reset() {}
  clickAttract() {
    const container = this.container;
    if (!container.attract) {
      container.attract = {
        particles: []
      };
    }
    if (!container.attract.finish) {
      if (!container.attract.count) {
        container.attract.count = 0;
      }
      container.attract.count++;
      if (container.attract.count === container.particles.count) {
        container.attract.finish = true;
      }
    }
    if (container.attract.clicking) {
      const mousePos = container.interactivity.mouse.clickPosition,
        attractRadius = container.retina.attractModeDistance;
      if (!attractRadius || attractRadius < 0 || !mousePos) {
        return;
      }
      this.processAttract(mousePos, attractRadius, new external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.Circle(mousePos.x, mousePos.y, attractRadius));
    } else if (container.attract.clicking === false) {
      container.attract.particles = [];
    }
    return;
  }
  hoverAttract() {
    const container = this.container,
      mousePos = container.interactivity.mouse.position,
      attractRadius = container.retina.attractModeDistance;
    if (!attractRadius || attractRadius < 0 || !mousePos) {
      return;
    }
    this.processAttract(mousePos, attractRadius, new external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.Circle(mousePos.x, mousePos.y, attractRadius));
  }
  processAttract(position, attractRadius, area) {
    const container = this.container,
      attractOptions = container.actualOptions.interactivity.modes.attract;
    if (!attractOptions) {
      return;
    }
    const query = container.particles.quadTree.query(area, p => this.isEnabled(p));
    for (const particle of query) {
      const {
        dx,
        dy,
        distance
      } = (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.getDistances)(particle.position, position);
      const velocity = attractOptions.speed * attractOptions.factor;
      const attractFactor = (0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.clamp)((0,external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.getEasing)(attractOptions.easing)(1 - distance / attractRadius) * velocity, 0, attractOptions.maxSpeed);
      const normVec = external_commonjs_tsparticles_engine_commonjs2_tsparticles_engine_amd_tsparticles_engine_root_window_.Vector.create(distance === 0 ? velocity : dx / distance * attractFactor, distance === 0 ? velocity : dy / distance * attractFactor);
      particle.position.subFrom(normVec);
    }
  }
}
;// CONCATENATED MODULE: ./dist/browser/index.js

async function loadExternalAttractInteraction(engine) {
  await engine.addInteractor("externalAttract", container => new Attractor(engine, container));
}

})();

/******/ 	return __webpack_exports__;
/******/ })()
;
});


text:
package <%= packageName %>.grpc;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.protobuf.Empty;
import io.grpc.Status;
import org.lognet.springboot.grpc.GRpcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint;
import reactor.core.publisher.Mono;

import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;

@GRpcService(interceptors = {AuthenticationInterceptor.class})
public class ConfigurationPropertiesReportService extends ReactorConfigurationPropertiesReportServiceGrpc.ConfigurationPropertiesReportServiceImplBase {

    private final ConfigurationPropertiesReportEndpoint endpoint;

    private final ObjectMapper mapper;

    public ConfigurationPropertiesReportService(ConfigurationPropertiesReportEndpoint endpoint, ObjectMapper mapper) {
        this.endpoint = endpoint;
        this.mapper = mapper;
    }

    @Override
    public Mono<ApplicationConfigurationProperties> getConfigurationProperties(Mono<Empty> request) {
        return request.map(e -> mapApplicationConfigurationProperties(endpoint.configurationProperties()));
    }

    private ApplicationConfigurationProperties mapApplicationConfigurationProperties(ConfigurationPropertiesReportEndpoint.ApplicationConfigurationProperties props) {
        return ApplicationConfigurationProperties.newBuilder()
            .putAllContexts(props.getContexts().entrySet().stream()
                .collect(Collectors.toMap(
                    Map.Entry::getKey,
                    e -> mapContextConfigurationProperties(e.getValue()))
                )
            )
            .build();
    }

    private ContextConfigurationProperties mapContextConfigurationProperties(ConfigurationPropertiesReportEndpoint.ContextConfigurationProperties props) {
        ContextConfigurationProperties.Builder builder = ContextConfigurationProperties.newBuilder();
        Optional.ofNullable(props.getParentId()).ifPresent(builder::setParentId);
        props.getBeans().forEach((k, v) -> builder.putBeans(k, mapConfigurationPropertiesBean(v)));
        return builder.build();
    }

    private ConfigurationPropertiesBean mapConfigurationPropertiesBean(ConfigurationPropertiesReportEndpoint.ConfigurationPropertiesBeanDescriptor descriptor) {
        ConfigurationPropertiesBean.Builder builder = ConfigurationPropertiesBean.newBuilder();
        Optional.ofNullable(descriptor.getPrefix()).ifPresent(builder::setPrefix);
        descriptor.getProperties().forEach((k, v) -> {
            try {
                builder.putProperties(k, mapper.writeValueAsString(v));
            } catch (JsonProcessingException e) {
                throw Status.INTERNAL.withCause(e).asRuntimeException();
            }
        });
        return builder.build();
    }

}


text:
#ifndef PROPERTY_DELEGATE_QSIZE_H
#define PROPERTY_DELEGATE_QSIZE_H

#include "QtnProperty/Delegates/Utils/PropertyDelegateMisc.h"
#include "QtnProperty/Core/PropertyQSize.h"

class QTN_IMPORT_EXPORT QtnPropertyDelegateQSize
	: public QtnPropertyDelegateTypedEx<QtnPropertyQSizeBase>
{
	Q_DISABLE_COPY(QtnPropertyDelegateQSize)

public:
	QtnPropertyDelegateQSize(QtnPropertyQSizeBase &owner);

	static void Register(QtnPropertyDelegateFactory &factory);

protected:
	virtual void applyAttributesImpl(
		const QtnPropertyDelegateInfo &info) override;

	virtual QWidget *createValueEditorImpl(QWidget *parent, const QRect &rect,
		QtnInplaceInfo *inplaceInfo = nullptr) override;

	virtual bool propertyValueToStrImpl(QString &strValue) const override;
};

#endif // PROPERTY_DELEGATE_QSIZE_H


text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding index on 'Feed', fields ['active_subscribers']
        db.create_index('feeds', ['active_subscribers'])

    def backwards(self, orm):
        # Removing index on 'Feed', fields ['active_subscribers']
        db.delete_index('feeds', ['active_subscribers'])

    models = {
        u'rss_feeds.duplicatefeed': {
            'Meta': {'object_name': 'DuplicateFeed'},
            'duplicate_address': ('django.db.models.fields.CharField', [], {'max_length': '764', 'db_index': 'True'}),
            'duplicate_feed_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_index': 'True'}),
            'duplicate_link': ('django.db.models.fields.CharField', [], {'max_length': '764', 'null': 'True', 'db_index': 'True'}),
            'feed': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'duplicate_addresses'", 'to': u"orm['rss_feeds.Feed']"}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
        },
        u'rss_feeds.feed': {
            'Meta': {'ordering': "['feed_title']", 'object_name': 'Feed', 'db_table': "'feeds'"},
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),
            'active_premium_subscribers': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
            'active_subscribers': ('django.db.models.fields.IntegerField', [], {'default': '-1', 'db_index': 'True'}),
            'average_stories_per_month': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'branch_from_feed': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['rss_feeds.Feed']", 'null': 'True', 'blank': 'True'}),
            'creation': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'days_to_trim': ('django.db.models.fields.IntegerField', [], {'default': '90'}),
            'errors_since_good': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'etag': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'exception_code': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'favicon_color': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}),
            'favicon_not_found': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'feed_address': ('django.db.models.fields.URLField', [], {'max_length': '764', 'db_index': 'True'}),
            'feed_address_locked': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}),
            'feed_link': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '1000', 'null': 'True', 'blank': 'True'}),
            'feed_link_locked': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'feed_title': ('django.db.models.fields.CharField', [], {'default': "'[Untitled]'", 'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'fetched_once': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'has_feed_exception': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
            'has_page': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'has_page_exception': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
            'hash_address_and_link': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_push': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}),
            'known_good': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_load_time': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'last_modified': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'last_update': ('django.db.models.fields.DateTimeField', [], {}),
            'min_to_decay': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'next_scheduled_update': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}),
            'num_subscribers': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
            'premium_subscribers': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
            'queued_date': ('django.db.models.fields.DateTimeField', [], {}),
            's3_icon': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}),
            's3_page': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}),
            'stories_last_month': ('django.db.models.fields.IntegerField', [], {'default': '0'})
        },
        u'rss_feeds.feeddata': {
            'Meta': {'object_name': 'FeedData'},
            'feed': ('utils.fields.AutoOneToOneField', [], {'related_name': "'data'", 'unique': 'True', 'to': u"orm['rss_feeds.Feed']"}),
            'feed_classifier_counts': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'feed_tagline': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'popular_authors': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}),
            'popular_tags': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),
            'story_count_history': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'})
        }
    }

    complete_apps = ['rss_feeds']


text:
(function () {
    'use strict';

    var express = require('express');
    var router = express.Router();

    var ensureAuthenticated = require('../core/auth.common').ensureAuthenticated;

    /* GET /users listing. */
    router.get('/', ensureAuthenticated, require('../ctrls/controller.users').getUsers);

    /* POST /users create. */
    router.post('/', require('../ctrls/controller.users').postUser);

    /* GET /users/id get */
    router.get('/:id', ensureAuthenticated, require('../ctrls/controller.users').getUser);

    /* PUT /users/id update */
    router.put('/:id', ensureAuthenticated, require('../ctrls/controller.users').putUser);

    /* DELETE /users/:id */
    router.delete('/:id', ensureAuthenticated, require('../ctrls/controller.users').deleteUser);

    module.exports = router;
})();


text:
<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.jeffdempsey.opensesame" >

    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

    <application
        android:allowBackup="true"
        android:label="@string/app_name"
        android:icon="@mipmap/icon_round"
        android:supportsRtl="true" >

        <activity android:name=".MainActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />

            </intent-filter>

        </activity>

    </application>

</manifest>


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.trino.server.security.oauth2;

import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.hash.Hashing;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import io.airlift.units.Duration;

import javax.annotation.PreDestroy;
import javax.inject.Inject;

import java.nio.charset.StandardCharsets;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;

import static com.google.common.util.concurrent.Futures.nonCancellationPropagating;
import static io.airlift.concurrent.Threads.daemonThreadsNamed;
import static java.util.Objects.requireNonNull;
import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.SECONDS;

public class OAuth2TokenExchange
        implements OAuth2TokenHandler
{
    public static final Duration MAX_POLL_TIME = new Duration(10, SECONDS);
    private static final TokenPoll TOKEN_POLL_TIMED_OUT = TokenPoll.error("Authentication has timed out");

    private final LoadingCache<String, SettableFuture<TokenPoll>> cache;
    private final ScheduledExecutorService executor = newSingleThreadScheduledExecutor(daemonThreadsNamed("oauth2-token-exchange"));

    @Inject
    public OAuth2TokenExchange(OAuth2Config config)
    {
        long challengeTimeoutMillis = config.getChallengeTimeout().toMillis();
        this.cache = CacheBuilder.newBuilder()
                .expireAfterWrite(challengeTimeoutMillis + (MAX_POLL_TIME.toMillis() * 10), MILLISECONDS)
                .<String, SettableFuture<TokenPoll>>removalListener(notification -> notification.getValue().set(TOKEN_POLL_TIMED_OUT))
                .build(new CacheLoader<>()
                {
                    @Override
                    public SettableFuture<TokenPoll> load(String authIdHash)
                    {
                        SettableFuture<TokenPoll> future = SettableFuture.create();
                        Future<?> timeout = executor.schedule(() -> future.set(TOKEN_POLL_TIMED_OUT), challengeTimeoutMillis, MILLISECONDS);
                        future.addListener(() -> timeout.cancel(true), executor);
                        return future;
                    }
                });
    }

    @PreDestroy
    public void stop()
    {
        executor.shutdownNow();
    }

    @Override
    public void setAccessToken(String authIdHash, String accessToken)
    {
        cache.getUnchecked(authIdHash).set(TokenPoll.token(accessToken));
    }

    @Override
    public void setTokenExchangeError(String authIdHash, String message)
    {
        cache.getUnchecked(authIdHash).set(TokenPoll.error(message));
    }

    public ListenableFuture<TokenPoll> getTokenPoll(UUID authId)
    {
        return nonCancellationPropagating(cache.getUnchecked(hashAuthId(authId)));
    }

    public void dropToken(UUID authId)
    {
        cache.invalidate(hashAuthId(authId));
    }

    public static String hashAuthId(UUID authId)
    {
        return Hashing.sha256()
                .hashString(authId.toString(), StandardCharsets.UTF_8)
                .toString();
    }

    public static class TokenPoll
    {
        private final Optional<String> token;
        private final Optional<String> error;

        private TokenPoll(String token, String error)
        {
            this.token = Optional.ofNullable(token);
            this.error = Optional.ofNullable(error);
        }

        static TokenPoll token(String token)
        {
            requireNonNull(token, "token is null");

            return new TokenPoll(token, null);
        }

        static TokenPoll error(String error)
        {
            requireNonNull(error, "error is null");

            return new TokenPoll(null, error);
        }

        public Optional<String> getToken()
        {
            return token;
        }

        public Optional<String> getError()
        {
            return error;
        }
    }
}


text:
<?php

declare(strict_types=1);

namespace Centreon\Domain\ActionLog\Interfaces;

use Centreon\Domain\ActionLog\ActionLog;
use Centreon\Domain\ActionLog\ActionLogException;

interface ActionLogServiceInterface
{
    /**
     * Add action log.
     *
     * @param ActionLog $actionLog Action log to be added
     * @param array<string, string|int|bool> $details Details of action
     * @return int Return the id of the last added action
     * @throws ActionLogException
     */
    public function addAction(ActionLog $actionLog, array $details = []): int;
}


text:
@implementation Advertise_Class
@synthesize imageURL,link;

@end


text:
/* apply a natural box layout model to all elements, but allowing components to change */
html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}


text: ./vendor/composer/bin/atoum --ulr -d tests/units


text:
import java.util.HashMap;

public class Solution {
    public int majorityElement(int[] nums) {
        HashMap<Integer, Integer> count = new HashMap<>();
        for (int i : nums) {
            count.merge(i, 1, (c, one) -> c + one);
            if (count.get(i) > nums.length / 2) {
                return i;
            }
        }
        return -1;
    }
}


text:
export declare function i18n(text: string, namespace?: string, ...args: string[]): string;
export declare namespace i18n {
    const _namespaces: {
        [n: string]: {
            [s: string]: string;
        };
    };
    function defineNamespace(namespace: string, translations: {
        [s: string]: string;
    }): void;
    function opt(value: number, opt0: string, opt1: string, optN: string, namespace?: string): string;
}
//# sourceMappingURL=i18n.module.d.ts.map


text:
/** @ignore */
export default function createObject(ctor) {
	var factoryFunction = ctor.bind.apply(ctor, arguments);

	return new factoryFunction();
}


text:
Document firstDocument = new Document(collection, "doc1");
firstDocument.setContent("title", "foo");
firstDocument.setContent("content", "bar");

Document secondDocument = new Document(collection, "doc2");
secondDocument.setContent("title", "foo");
secondDocument.setContent("content", "bar");

Document[] documents = new Document[]{firstDocument, secondDocument};

kuzzle
  .collection("collection", "index")
  .mCreateOrReplaceDocument(documents, new ResponseListener<JSONObject>() {
    @Override
    public void onSuccess(JSONObject object) {
      // callback called once the mCreateOrReplace operation has completed
      // => the result is a JSON object containing the raw Kuzzle response
    }

    @Override
    public void onError(JSONObject error) {
      // Handle error
    }
  });


text:
package deezer_test

import (
	"os"
	"testing"

	"github.com/markbates/goth"
	"github.com/markbates/goth/providers/deezer"
	"github.com/stretchr/testify/assert"
)

func Test_New(t *testing.T) {
	t.Parallel()
	a := assert.New(t)

	provider := deezerProvider()
	a.Equal(provider.ClientKey, os.Getenv("DEEZER_KEY"))
	a.Equal(provider.Secret, os.Getenv("DEEZER_SECRET"))
	a.Equal(provider.CallbackURL, "/foo")
}

func Test_Implements_Provider(t *testing.T) {
	t.Parallel()
	a := assert.New(t)
	a.Implements((*goth.Provider)(nil), deezerProvider())
}

func Test_BeginAuth(t *testing.T) {
	t.Parallel()
	a := assert.New(t)
	p := deezerProvider()
	session, err := p.BeginAuth("test_state")
	s := session.(*deezer.Session)
	a.NoError(err)
	a.Contains(s.AuthURL, "https://connect.deezer.com/oauth/auth.php")
}

func Test_SessionFromJSON(t *testing.T) {
	t.Parallel()
	a := assert.New(t)

	p := deezerProvider()
	session, err := p.UnmarshalSession(`{"AuthURL":"https://connect.deezer.com/oauth/auth.php","AccessToken":"1234567890"}`)
	a.NoError(err)

	s := session.(*deezer.Session)
	a.Equal(s.AuthURL, "https://connect.deezer.com/oauth/auth.php")
	a.Equal(s.AccessToken, "1234567890")
}

func deezerProvider() *deezer.Provider {
	return deezer.New(os.Getenv("DEEZER_KEY"), os.Getenv("DEEZER_SECRET"), "/foo", "email")
}


text:
var vertx = require('vertx');
var console = require('vertx/console');
var container = require('vertx/container');

// Deploy mod-shell and additional modules
container.deployModule("org.crashub~vertx.shell~2.0.0", {
    "cmd": "./commands",
    "crash.auth": "simple",
    "crash.auth.simple.username": "admin",
    "crash.auth.simple.password": "admin",
    "crash.ssh.port": 2000
});

vertx.eventBus.registerHandler('shibuya.java', function(message) {
    console.log('I received a message ' + message);
});


text:
{% extends "tethys_apps/app_base.html" %}

{% load static tethys_gizmos %}

{% block styles %}
  {{ block.super }}

{% endblock %}

{% block app_navigation_override %}{% endblock %}

{% block app_actions_override %}

    {% block app_actions %}{% endblock %}

{% endblock %}


text:
        <form>

Edit Beverage Info

                <button type="button" id="closeCross" onclick="closeEditPopup()">×</button>

Beverage name

                    <input type="text" list="beverageList" id="bevName" placeholder="Beverage Name">

                <datalist id="beverageList">
                    <option value="Beer">
                        <option value="Grape Juice">
                            <option value="Water">
                                <option value="Dragons blood">
                                    <option value="Red wine">
                                        <option value="White wine">
                                            <option value="tea">
                                                <option value="ice tea">
                                                    <option value="sprite">
                                                        <option value="coca cola">
                </datalist>

Quantity in stock

                    <input type="number" id="bevQuantity" placeholder="Quantity">

Beverage type

                    <select id="bevType" name="bvt">
                        <option disabled selected value> -- select a row -- </option>
                        <option>1</option>
                        <option>2</option>
                        <option>3</option>
                        <option>4</option>
                        <option>5</option>
                    </select>

                    <select id="bevType" name="bvt">
                        <option disabled selected value> -- select a column -- </option>
                        <option>1</option>
                        <option>2</option>
                        <option>3</option>
                        <option>4</option>
                    </select>

                    <button type="button" id="save" onclick="saveEditBev()">Save</button>
                    <button input type="reset" id="reset">Reset</button>
                    <button type="button" id="cancel" onclick="closeEditPopup()">Cancel</button>

        </form>


text:
namespace chromeos {
namespace local_search_service {

// An implementation that runs LocalSearchService in-process for testing
// purpose.
class LocalSearchServiceProviderForTesting : public LocalSearchServiceProvider {
 public:
  LocalSearchServiceProviderForTesting();
  ~LocalSearchServiceProviderForTesting() override;

  // LocalSearchServiceProvider:
  void BindLocalSearchService(
      mojo::PendingReceiver<mojom::LocalSearchService> receiver) override;

 private:
  std::unique_ptr<LocalSearchService> service_;
};

}  // namespace local_search_service
}  // namespace chromeos

#endif  // CHROMEOS_COMPONENTS_LOCAL_SEARCH_SERVICE_LOCAL_SEARCH_SERVICE_PROVIDER_FOR_TESTING_H_


text:
require 'spec_helper'

describe Dockerspec::Configuration do
  let(:engine) { Dockerspec::Engine::Base }
  let(:runner) { Dockerspec::Runner::Base }
  before do
    @instance_orig = Dockerspec::Configuration.instance_variable_get(:@instance)
    described_class.reset
  end
  after do
    Dockerspec::Configuration.instance_variable_set(:@instance, @instance_orig)
  end

  context '.add_engine & .engines' do
    it 'adds a engine' do
      described_class.add_engine(engine)
      expect(described_class.engines).to eq([engine])
    end

    it 'ignores duplicated engines' do
      described_class.add_engine(engine)
      described_class.add_engine(engine)
      expect(described_class.engines).to eq([engine])
    end
  end

  context '.docker_runner= & .docker_runner' do
    it 'returns Docker Runner by default' do
      described_class.reset
      expect(described_class.docker_runner).to eq(Dockerspec::Runner::Docker)
    end

    it 'sets the runner' do
      described_class.docker_runner = runner
      expect(described_class.docker_runner).to eq(runner)
    end
  end

  context '.compose_runner= & .compose_runner' do
    it 'returns Docker Compose by default' do
      described_class.reset
      expect(described_class.compose_runner).to eq(Dockerspec::Runner::Compose)
    end

    it 'sets the runner' do
      described_class.compose_runner = runner
      expect(described_class.compose_runner).to eq(runner)
    end
  end
end


text:
package kingpin

import (
	"os"
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestBool(t *testing.T) {
	app := newTestApp()
	b := app.Flag("b", "").Bool()
	_, err := app.Parse([]string{"--b"})
	assert.NoError(t, err)
	assert.True(t, *b)
}

func TestNoBool(t *testing.T) {
	app := newTestApp()
	f := app.Flag("b", "").Default("true")
	b := f.Bool()
	_, err := app.Parse([]string{})
	assert.NoError(t, err)
	assert.True(t, *b)
	_, err = app.Parse([]string{"--no-b"})
	assert.NoError(t, err)
	assert.False(t, *b)
}

func TestNegateNonBool(t *testing.T) {
	app := newTestApp()
	f := app.Flag("b", "")
	f.Int()
	_, err := app.Parse([]string{"--no-b"})
	assert.Error(t, err)
}

func TestNegativePrefixLongFlag(t *testing.T) {
	app := newTestApp()
	f := app.Flag("no-comment", "")
	b := f.Bool()
	_, err := app.Parse([]string{})
	assert.NoError(t, err)
	assert.False(t, *b)
	_, err = app.Parse([]string{"--no-comment"})
	assert.NoError(t, err)
	assert.False(t, *b)
}

func TestInvalidFlagDefaultCanBeOverridden(t *testing.T) {
	app := newTestApp()
	app.Flag("a", "").Default("invalid").Bool()
	_, err := app.Parse([]string{})
	assert.Error(t, err)
}

func TestRequiredFlag(t *testing.T) {
	app := newTestApp().Version("0.0.0")
	exits := 0
	app.Terminate(func(int) { exits++ })
	app.Flag("a", "").Required().Bool()
	_, err := app.Parse([]string{"--a"})
	assert.NoError(t, err)
	_, err = app.Parse([]string{})
	assert.Error(t, err)
	// This will error because the Terminate() function doesn't actually terminate.
	_, _ = app.Parse([]string{"--version"})
	assert.Equal(t, 1, exits)
}

func TestShortFlag(t *testing.T) {
	app := newTestApp()
	f := app.Flag("long", "").Short('s').Bool()
	_, err := app.Parse([]string{"-s"})
	assert.NoError(t, err)
	assert.True(t, *f)
}

func TestCombinedShortFlags(t *testing.T) {
	app := newTestApp()
	a := app.Flag("short0", "").Short('0').Bool()
	b := app.Flag("short1", "").Short('1').Bool()
	c := app.Flag("short2", "").Short('2').Bool()
	_, err := app.Parse([]string{"-01"})
	assert.NoError(t, err)
	assert.True(t, *a)
	assert.True(t, *b)
	assert.False(t, *c)
}

func TestCombinedShortFlagArg(t *testing.T) {
	a := newTestApp()
	n := a.Flag("short", "").Short('s').Int()
	_, err := a.Parse([]string{"-s10"})
	assert.NoError(t, err)
	assert.Equal(t, 10, *n)
}

func TestEmptyShortFlagIsAnError(t *testing.T) {
	_, err := newTestApp().Parse([]string{"-"})
	assert.Error(t, err)
}

func TestRequiredWithEnvarMissingErrors(t *testing.T) {
	app := newTestApp()
	app.Flag("t", "").Envar("TEST_ENVAR").Required().Int()
	_, err := app.Parse([]string{})
	assert.Error(t, err)
}

func TestRequiredWithEnvar(t *testing.T) {
	os.Setenv("TEST_ENVAR", "123")
	app := newTestApp()
	flag := app.Flag("t", "").Envar("TEST_ENVAR").Required().Int()
	_, err := app.Parse([]string{})
	assert.NoError(t, err)
	assert.Equal(t, 123, *flag)
}

func TestSubcommandFlagRequiredWithEnvar(t *testing.T) {
	os.Setenv("TEST_ENVAR", "123")
	app := newTestApp()
	cmd := app.Command("command", "")
	flag := cmd.Flag("t", "").Envar("TEST_ENVAR").Required().Int()
	_, err := app.Parse([]string{"command"})
	assert.NoError(t, err)
	assert.Equal(t, 123, *flag)
}

func TestRegexp(t *testing.T) {
	app := newTestApp()
	flag := app.Flag("reg", "").Regexp()
	_, err := app.Parse([]string{"--reg", "^abc$"})
	assert.NoError(t, err)
	assert.NotNil(t, *flag)
	assert.Equal(t, "^abc$", (*flag).String())
	assert.Regexp(t, *flag, "abc")
	assert.NotRegexp(t, *flag, "abcd")
}

func TestDuplicateShortFlag(t *testing.T) {
	app := newTestApp()
	app.Flag("a", "").Short('a').String()
	app.Flag("b", "").Short('a').String()
	_, err := app.Parse([]string{})
	assert.Error(t, err)
}

func TestDuplicateLongFlag(t *testing.T) {
	app := newTestApp()
	app.Flag("a", "").String()
	app.Flag("a", "").String()
	_, err := app.Parse([]string{})
	assert.Error(t, err)
}

func TestGetFlagAndOverrideDefault(t *testing.T) {
	app := newTestApp()
	a := app.Flag("a", "").Default("default").String()
	_, err := app.Parse([]string{})
	assert.NoError(t, err)
	assert.Equal(t, "default", *a)
	app.GetFlag("a").Default("new")
	_, err = app.Parse([]string{})
	assert.NoError(t, err)
	assert.Equal(t, "new", *a)
}

func TestEnvarOverrideDefault(t *testing.T) {
	os.Setenv("TEST_ENVAR", "123")
	app := newTestApp()
	flag := app.Flag("t", "").Default("default").Envar("TEST_ENVAR").String()
	_, err := app.Parse([]string{})
	assert.NoError(t, err)
	assert.Equal(t, "123", *flag)
}

func TestFlagMultipleValuesDefault(t *testing.T) {
	app := newTestApp()
	a := app.Flag("a", "").Default("default1", "default2").Strings()
	_, err := app.Parse([]string{})
	assert.NoError(t, err)
	assert.Equal(t, []string{"default1", "default2"}, *a)
}

func TestFlagMultipleValuesDefaultNonRepeatable(t *testing.T) {
	c := newTestApp()
	c.Flag("foo", "foo").Default("a", "b").String()
	_, err := c.Parse([]string{})
	assert.Error(t, err)
}

func TestFlagMultipleValuesDefaultEnvarUnix(t *testing.T) {
	app := newTestApp()
	a := app.Flag("a", "").Envar("TEST_MULTIPLE_VALUES").Strings()
	os.Setenv("TEST_MULTIPLE_VALUES", "123\n456\n")
	_, err := app.Parse([]string{})
	assert.NoError(t, err)
	assert.Equal(t, []string{"123", "456"}, *a)
}

func TestFlagMultipleValuesDefaultEnvarWindows(t *testing.T) {
	app := newTestApp()
	a := app.Flag("a", "").Envar("TEST_MULTIPLE_VALUES").Strings()
	os.Setenv("TEST_MULTIPLE_VALUES", "123\r\n456\r\n")
	_, err := app.Parse([]string{})
	assert.NoError(t, err)
	assert.Equal(t, []string{"123", "456"}, *a)
}

func TestFlagMultipleValuesDefaultEnvarNonRepeatable(t *testing.T) {
	c := newTestApp()
	a := c.Flag("foo", "foo").Envar("TEST_MULTIPLE_VALUES_NON_REPEATABLE").String()
	os.Setenv("TEST_MULTIPLE_VALUES_NON_REPEATABLE", "123\n456")
	_, err := c.Parse([]string{})
	assert.NoError(t, err)
	assert.Equal(t, "123\n456", *a)
}

func TestFlagHintAction(t *testing.T) {
	c := newTestApp()

	action := func() []string {
		return []string{"opt1", "opt2"}
	}

	a := c.Flag("foo", "foo").HintAction(action)
	args := a.resolveCompletions()
	assert.Equal(t, []string{"opt1", "opt2"}, args)
}

func TestFlagHintOptions(t *testing.T) {
	c := newTestApp()

	a := c.Flag("foo", "foo").HintOptions("opt1", "opt2")
	args := a.resolveCompletions()
	assert.Equal(t, []string{"opt1", "opt2"}, args)
}

func TestFlagEnumVar(t *testing.T) {
	c := newTestApp()
	var bar string

	a := c.Flag("foo", "foo")
	a.Enum("opt1", "opt2")
	b := c.Flag("bar", "bar")
	b.EnumVar(&bar, "opt3", "opt4")

	args := a.resolveCompletions()
	assert.Equal(t, []string{"opt1", "opt2"}, args)

	args = b.resolveCompletions()
	assert.Equal(t, []string{"opt3", "opt4"}, args)
}

func TestMultiHintOptions(t *testing.T) {
	c := newTestApp()

	a := c.Flag("foo", "foo").HintOptions("opt1").HintOptions("opt2")
	args := a.resolveCompletions()
	assert.Equal(t, []string{"opt1", "opt2"}, args)
}
func TestMultiHintActions(t *testing.T) {
	c := newTestApp()

	a := c.Flag("foo", "foo").
		HintAction(func() []string {
			return []string{"opt1"}
		}).
		HintAction(func() []string {
			return []string{"opt2"}
		})
	args := a.resolveCompletions()
	assert.Equal(t, []string{"opt1", "opt2"}, args)
}

func TestCombinationHintActionsOptions(t *testing.T) {
	c := newTestApp()

	a := c.Flag("foo", "foo").HintAction(func() []string {
		return []string{"opt1"}
	}).HintOptions("opt2")
	args := a.resolveCompletions()
	assert.Equal(t, []string{"opt1", "opt2"}, args)
}

func TestCombinationEnumActions(t *testing.T) {
	c := newTestApp()
	var foo string

	a := c.Flag("foo", "foo").
		HintAction(func() []string {
			return []string{"opt1", "opt2"}
		})
	a.Enum("opt3", "opt4")

	b := c.Flag("bar", "bar").
		HintAction(func() []string {
			return []string{"opt5", "opt6"}
		})
	b.EnumVar(&foo, "opt3", "opt4")

	// Provided HintActions should override automatically generated Enum options.
	args := a.resolveCompletions()
	assert.Equal(t, []string{"opt1", "opt2"}, args)

	args = b.resolveCompletions()
	assert.Equal(t, []string{"opt5", "opt6"}, args)
}

func TestCombinationEnumOptions(t *testing.T) {
	c := newTestApp()
	var foo string

	a := c.Flag("foo", "foo").HintOptions("opt1", "opt2")
	a.Enum("opt3", "opt4")

	b := c.Flag("bar", "bar").HintOptions("opt5", "opt6")
	b.EnumVar(&foo, "opt3", "opt4")

	// Provided HintOptions should override automatically generated Enum options.
	args := a.resolveCompletions()
	assert.Equal(t, []string{"opt1", "opt2"}, args)

	args = b.resolveCompletions()
	assert.Equal(t, []string{"opt5", "opt6"}, args)

}


text:
package org.conqat.lib.commons.collections;

import java.util.Iterator;

/**
 * This is a wrapper for a {@link Iterator} prohibiting all calls which would
 * modify its owning container. All prohibited methods throw an
 * {@link UnsupportedOperationException}.
 *
 * @author Benjamin Hummel
 * @author $Author: kinnen $
 *
 * @version $Revision: 41751 $
 * @ConQAT.Rating GREEN Hash: 754617399E6F78CDAA8A3AE5522028DD
 */
public class UnmodifiableIterator<E> implements Iterator<E> {

	/** The underlying iterator. */
	private final Iterator<E> i;

	/**
	 * Creates a new unmodifiable iterator from another iterator. All
	 * modifications to the underlying iterator will directly be visible in this
	 * wrapper.
	 */
	public UnmodifiableIterator(Iterator<E> i) {
		if (i == null) {
			throw new IllegalArgumentException(
					"Underlying iterator may not be null!");
		}
		this.i = i;
	}

	/** {@inheritDoc} */
	@Override
	public boolean hasNext() {
		return i.hasNext();
	}

	/** {@inheritDoc} */
	@Override
	public E next() {
		return i.next();
	}

	/**
	 * Operation is not supported.
	 *
	 * @throws UnsupportedOperationException
	 */
	@Override
	public void remove() {
		throw new UnsupportedOperationException();
	}
}


text:
You walk away and head back. When you get to camp your stomach is growling
furiously. You need to find food now. You haul yourself back out. Where do you
go now, [West](./west.md) or [East](./east.md)?


text:
import { ObjectNode } from '../../libs/flow.module.js';

export const onNodeValidElement = ( inputElement, outputElement ) => {

	const outputObject = outputElement.getObject();

	if ( ! outputObject || ! outputObject.isNode ) {

		return false;

	}

};

export class BaseNode extends ObjectNode {

	constructor( name, inputLength, value = null, width = 300 ) {

		const getObjectCallback = ( /*output = null*/ ) => {

			return this.value;

		};

		super( name, inputLength, getObjectCallback, width );

		this.setOutputColor( this.getColorValueFromValue( value ) );

		this.editor = null;

		this.value = value;

		this.onValidElement = onNodeValidElement;

	}

	serialize( data ) {

		super.serialize( data );

		delete data.width;

	}

	deserialize( data ) {

		delete data.width;

		super.deserialize( data );

	}

	setEditor( value ) {

		this.editor = value;

		return this;

	}

	getColorValueFromValue( value ) {

		if ( ! value ) return;

		if ( value.isMaterial === true ) {

			return 'forestgreen';

		} else if ( value.isObject3D === true ) {

			return 'orange';

		} else if ( value.isDataFile === true ) {

			return 'aqua';

		}

	}

	add( element ) {

		element.onValid( ( source, target ) => this.onValidElement( source, target ) );

		return super.add( element );

	}

}